96. Quadratic Form

A quadratic form is a polynomial expression in 𝑛 variables where every term has total degree exactly 2:

𝑄(𝑥)=𝑖,𝑗𝑎𝑖𝑗𝑥𝑖𝑥𝑗

It can always be written compactly using a symmetric matrix 𝐴:

𝑄(𝑥)=𝑥𝑇𝐴𝑥

The matrix 𝐴 is assumed symmetric without loss of generality — if 𝐵 isn’t symmetric, replacing it with 𝐵+𝐵𝑇2 gives the same quadratic form.

Example
𝑄(𝑥,𝑦)=3𝑥2+5𝑥𝑦+2𝑦2

As a matrix product (split the 5𝑥𝑦 symmetrically as 52𝑥𝑦+52𝑦𝑥):

𝐴=[352522],𝑄(𝑥)=𝑥𝑇𝐴𝑥

96.1. Definiteness

Quadratic forms are classified by the sign of 𝑄(𝑥) over all non-zero 𝑥:

TypeSign of 𝑄All eigenvalues of 𝐴
Positive definite>0always>0
Positive semi-definite0always0
Negative definite<0always<0
Negative semi-definite0always0
Indefinitetakes both signsmixed

The eigenvalue characterization comes from the Spectral Theorem: diagonalizing 𝐴=𝑄𝐷𝑄𝑇 and changing variables 𝑦=𝑄𝑇𝑥 gives

𝑄(𝑥)=𝑖=1𝑛𝜆𝑖𝑦𝑖2

— a sum of squares weighted by eigenvalues. The signs of the eigenvalues determine the signs of 𝑄.

96.2. Tests for positive definiteness

For a symmetric 𝐴, equivalent conditions:

  1. All eigenvalues >0
  2. All leading principal minors >0 (Sylvester’s criterion)
  3. 𝐴=𝐿𝐿𝑇 admits a Cholesky decomposition
  4. 𝑥𝑇𝐴𝑥>0 for all 𝑥𝟎

96.3. Geometric pictures (2D)

For 𝑄(𝑥,𝑦)=𝑥𝑇𝐴𝑥, the level sets 𝑄(𝑥)=𝑐 are conic sections aligned with the eigenvectors of 𝐴:

96.4. Where they show up

96.5. Diagonalization (principal axis theorem)

Every quadratic form can be brought to diagonal form by an orthogonal change of variables — equivalently, by rotating the coordinate axes to align with the eigenvectors of 𝐴:

𝑦=𝑄𝑇𝑥𝑄(𝑥)=𝜆1𝑦12+𝜆2𝑦22++𝜆𝑛𝑦𝑛2

This is the “principal axes” of the conic / quadric.

96.6. See also