Modern interactive page · based on uploaded QMD

Quadratic Forms

Quadratic forms turn symmetric matrices into geometry: ellipses, saddles, optimization bowls, Hessians, and covariance shapes.

Opening idea

A symmetric matrix does not only transform vectors. It also defines a geometric landscape. Given a symmetric matrix $A$, the expression assigns a number to each vector $x$. For example, in two variables, we get This is a quadratic form. Quadratic forms describe ellipses, hyperbolas, paraboloids, energy landscapes, curvature, optimization problems, covariance geometry, and least-squares objectives. The central question of this chapter is: How does a symmetric matrix shape a quadratic landscape? The answer comes from eigenvalues and eigenvect...

Central formula

$$q(x)=x^TAx,\qquad A=QDQ^T,\qquad q(x)=\lambda_1y_1^2+\cdots+\lambda_ny_n^2$$

Learning goals

Condensed from the chapter source.

  1. Define a quadratic form.
  2. Write a quadratic form as $x^TAx$ using a symmetric matrix.
  3. Classify quadratic forms using eigenvalues.
  4. Understand positive definite, positive semidefinite, negative definite, and indefinite matrices.
  5. Use orthogonal diagonalization to remove cross terms.
  6. Interpret level curves and level surfaces geometrically.
  7. Connect quadratic forms to optimization.
  8. Understand the Hessian matrix and curvature.
  9. Analyze least-squares objectives as quadratic functions.
  10. Use Python to visualize quadratic forms and optimization geometry.

Chapter map

Key ideas to keep visible while exploring the interactive tools.

Object

Quadratic form

$x^TAx$ measures squared geometry shaped by $A$.

Method

Diagonalize

Orthogonal eigenvectors remove cross terms.

Classification

Eigenvalues

Signs classify bowls, saddles, and flat directions.

Quadratic form explorer

Explore $q(x,y)=ax^2+2bxy+cy^2$ through eigenvalues, contours, and geometry.

Coefficients

Level curve preview

Positive definite checker

Use eigenvalues and Sylvester's criterion for $2\times2$ symmetric matrices.

Sylvester's criterion

$$A=\begin{bmatrix}a&b\\b&c\end{bmatrix}\text{ is positive definite iff }a>0\text{ and }ac-b^2>0.$$

Live result

Gradient descent on a quadratic bowl

For $f(x)=\frac12x^TAx$, the eigenvalues control the contour shape and optimization speed.

Step size and start

Descent path

Quick check

Classification by eigenvalues.

Question. What does it mean if a quadratic form has both positive and negative eigenvalues?

It is indefinite. The graph has saddle behavior: the form is positive in some directions and negative in others.

Chapter summary

The main takeaways in one place.

  • Every real quadratic form can be represented by a symmetric matrix.
  • Orthogonal diagonalization removes cross terms and reveals principal axes.
  • The signs of eigenvalues classify positive definite, negative definite, semidefinite, and indefinite forms.
  • Quadratic forms appear in optimization, least squares, covariance geometry, and Mahalanobis distance.