ConceptComplete

Quadratic Form

A quadratic form is a homogeneous polynomial of degree 22 in the coordinates of a vector. Quadratic forms are intimately connected to symmetric bilinear forms: each determines the other (in characteristic 2\neq 2). They arise throughout mathematics -- in optimization, number theory, differential geometry, and physics.


Definition

Definition8.7Quadratic form

A quadratic form on a vector space VV over FF is a function Q:VFQ: V \to F such that:

  1. Q(αv)=α2Q(v)Q(\alpha v) = \alpha^2 Q(v) for all αF\alpha \in F, vVv \in V.
  2. The function BQ(u,v)=Q(u+v)Q(u)Q(v)B_Q(u, v) = Q(u + v) - Q(u) - Q(v) is bilinear.

In characteristic 2\neq 2, QQ and its associated symmetric bilinear form B(u,v)=12BQ(u,v)=12(Q(u+v)Q(u)Q(v))B(u, v) = \frac{1}{2}B_Q(u,v) = \frac{1}{2}(Q(u+v) - Q(u) - Q(v)) determine each other via:

Q(v)=B(v,v),B(u,v)=12(Q(u+v)Q(u)Q(v)).Q(v) = B(v, v), \quad B(u, v) = \frac{1}{2}(Q(u + v) - Q(u) - Q(v)).

ExampleQuadratic forms on R^2

Q(x,y)=ax2+2bxy+cy2Q(x, y) = ax^2 + 2bxy + cy^2 (the most general quadratic form on R2\mathbb{R}^2).

Associated bilinear form: B((x1,y1),(x2,y2))=ax1x2+b(x1y2+x2y1)+cy1y2B((x_1, y_1), (x_2, y_2)) = ax_1 x_2 + b(x_1 y_2 + x_2 y_1) + cy_1 y_2.

Gram matrix: M=(abbc)M = \begin{pmatrix} a & b \\ b & c \end{pmatrix}.

  • Q=x2+y2Q = x^2 + y^2: M=IM = I (positive definite).
  • Q=x2y2Q = x^2 - y^2: M=diag(1,1)M = \operatorname{diag}(1, -1) (indefinite).
  • Q=2xyQ = 2xy: M=(0110)M = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} (indefinite, det=1\det = -1).
  • Q=x2Q = x^2: M=(1000)M = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} (degenerate, rank 11).
ExampleQuadratic forms on R^3

Q(x,y,z)=x2+2y2+3z2+2xy4xzQ(x, y, z) = x^2 + 2y^2 + 3z^2 + 2xy - 4xz. The matrix is:

M=(112120203)M = \begin{pmatrix} 1 & 1 & -2 \\ 1 & 2 & 0 \\ -2 & 0 & 3 \end{pmatrix}.

The coefficient of xixjx_i x_j (with iji \neq j) is 2mij2m_{ij}, so m12=1m_{12} = 1 (half of the coefficient 22 of xyxy) and m13=2m_{13} = -2 (half of 4-4).


Classification: positive definite, negative definite, indefinite

Definition8.8Definiteness of a quadratic form

A real quadratic form QQ (or its matrix MM) is:

  • Positive definite if Q(v)>0Q(v) > 0 for all v0v \neq 0.
  • Positive semi-definite if Q(v)0Q(v) \geq 0 for all vv.
  • Negative definite if Q(v)<0Q(v) < 0 for all v0v \neq 0.
  • Negative semi-definite if Q(v)0Q(v) \leq 0 for all vv.
  • Indefinite if QQ takes both positive and negative values.
ExampleClassifying 2x2 quadratic forms

Q=ax2+2bxy+cy2Q = ax^2 + 2bxy + cy^2 with M=(abbc)M = \begin{pmatrix} a & b \\ b & c \end{pmatrix}.

  • Positive definite iff a>0a > 0 and detM=acb2>0\det M = ac - b^2 > 0.
  • Negative definite iff a<0a < 0 and acb2>0ac - b^2 > 0.
  • Indefinite iff acb2<0ac - b^2 < 0.
  • Semi-definite (degenerate) iff acb2=0ac - b^2 = 0.

Examples:

  • Q=x2+y2Q = x^2 + y^2: a=1,b=0,c=1a = 1, b = 0, c = 1. det=1>0\det = 1 > 0, a>0a > 0. Positive definite.
  • Q=x2y2Q = x^2 - y^2: det=1<0\det = -1 < 0. Indefinite.
  • Q=x2+2xy+y2=(x+y)2Q = x^2 + 2xy + y^2 = (x + y)^2: det=0\det = 0. Positive semi-definite (but not positive definite).
ExampleSylvester's criterion for 3x3

M=(210131014)M = \begin{pmatrix} 2 & 1 & 0 \\ 1 & 3 & 1 \\ 0 & 1 & 4 \end{pmatrix}.

Leading principal minors: Δ1=2>0\Delta_1 = 2 > 0, Δ2=61=5>0\Delta_2 = 6 - 1 = 5 > 0, Δ3=detM=2(121)1(4)=18>0\Delta_3 = \det M = 2(12 - 1) - 1(4) = 18 > 0.

All positive, so MM is positive definite.


Completing the square

TheoremDiagonalization by completing the square

Every real quadratic form can be reduced to a sum of squares (with signs) by a change of variables:

Q(x1,,xn)=d1y12+d2y22++dnyn2Q(x_1, \ldots, x_n) = d_1 y_1^2 + d_2 y_2^2 + \cdots + d_n y_n^2

where yiy_i are linear combinations of xjx_j and di{+1,1,0}d_i \in \{+1, -1, 0\} (after further scaling).

ExampleCompleting the square in 2 variables

Q(x,y)=2x2+4xy+5y2Q(x, y) = 2x^2 + 4xy + 5y^2.

=2(x2+2xy)+5y2=2(x+y)22y2+5y2=2(x+y)2+3y2= 2(x^2 + 2xy) + 5y^2 = 2(x + y)^2 - 2y^2 + 5y^2 = 2(x + y)^2 + 3y^2.

Set u=x+yu = x + y, v=yv = y: Q=2u2+3v2Q = 2u^2 + 3v^2 (sum of two positive squares, so positive definite).

Matrix check: M=(2225)M = \begin{pmatrix} 2 & 2 \\ 2 & 5 \end{pmatrix}, det=6>0\det = 6 > 0, a=2>0a = 2 > 0. Positive definite ✓.

ExampleCompleting the square in 3 variables

Q(x,y,z)=x2+2xy+2y2+2yz+z2Q(x, y, z) = x^2 + 2xy + 2y^2 + 2yz + z^2.

=(x+y)2+y2+2yz+z2=(x+y)2+(y+z)2= (x + y)^2 + y^2 + 2yz + z^2 = (x + y)^2 + (y + z)^2.

Set u=x+yu = x + y, v=y+zv = y + z, w=zw = z: Q=u2+v2Q = u^2 + v^2.

The form has rank 22 (only 22 squares). Signature (2,0)(2, 0) with rank 22 out of 33 variables, so it is positive semi-definite but degenerate.

ExampleCompleting the square: indefinite case

Q(x,y)=x24xy+y2Q(x, y) = x^2 - 4xy + y^2.

=(x2y)24y2+y2=(x2y)23y2= (x - 2y)^2 - 4y^2 + y^2 = (x - 2y)^2 - 3y^2.

Set u=x2yu = x - 2y, v=yv = y: Q=u23v2Q = u^2 - 3v^2 (indefinite, signature (1,1)(1, 1)).


The signature

Definition8.9Signature of a quadratic form

After diagonalization, Q=d1y12++dryr2Q = d_1 y_1^2 + \cdots + d_r y_r^2 where di0d_i \neq 0 and r=rank(Q)r = \operatorname{rank}(Q). Let pp be the number of positive did_i and qq the number of negative did_i. The signature of QQ is the pair (p,q)(p, q), with p+q=rp + q = r.

By Sylvester's Law of Inertia, the signature is independent of the choice of diagonalization.

ExampleSignatures of common forms
  • Q=x2+y2+z2Q = x^2 + y^2 + z^2: signature (3,0)(3, 0) (positive definite).
  • Q=x2+y2z2Q = x^2 + y^2 - z^2: signature (2,1)(2, 1) (indefinite, the "light cone" form).
  • Q=x2y2z2Q = -x^2 - y^2 - z^2: signature (0,3)(0, 3) (negative definite).
  • Q=x2y2Q = x^2 - y^2: signature (1,1)(1, 1) (hyperbolic form).
  • Q=x2+y2Q = x^2 + y^2: on R3\mathbb{R}^3, this has signature (2,0)(2, 0) and rank 22 (degenerate).

Quadratic forms in applications

ExampleQuadratic forms in optimization

The second-order Taylor expansion of f(x)f(x) at a critical point x0x_0 is:

f(x0+h)f(x0)+12hTHh,f(x_0 + h) \approx f(x_0) + \frac{1}{2} h^T H h,

where HH is the Hessian matrix. The nature of the critical point depends on the quadratic form Q(h)=hTHhQ(h) = h^T H h:

  • QQ positive definite: local minimum.
  • QQ negative definite: local maximum.
  • QQ indefinite: saddle point.

For f(x,y)=x2+xy+y2f(x, y) = x^2 + xy + y^2 at (0,0)(0, 0): H=(2112)H = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, eigenvalues 3,1>03, 1 > 0. Local minimum ✓.

ExampleClassifying conics

The conic ax2+2bxy+cy2+dx+ey+f=0ax^2 + 2bxy + cy^2 + dx + ey + f = 0 is classified by the quadratic part Q=ax2+2bxy+cy2Q = ax^2 + 2bxy + cy^2:

  • acb2>0ac - b^2 > 0: ellipse (or circle if a=ca = c and b=0b = 0).
  • acb2<0ac - b^2 < 0: hyperbola.
  • acb2=0ac - b^2 = 0: parabola.

x2+y2=1x^2 + y^2 = 1 (circle): a=c=1,b=0a = c = 1, b = 0, acb2=1>0ac - b^2 = 1 > 0. x2y2=1x^2 - y^2 = 1 (hyperbola): acb2=1<0ac - b^2 = -1 < 0. x2=yx^2 = y (parabola): a=1,b=c=0a = 1, b = c = 0, acb2=0ac - b^2 = 0.

ExampleQuadratic forms in number theory

The question "which integers are sums of two squares?" is equivalent to asking for which nn the equation Q(x,y)=x2+y2=nQ(x, y) = x^2 + y^2 = n has integer solutions.

Fermat's theorem: a prime pp is a sum of two squares iff p=2p = 2 or p1(mod4)p \equiv 1 \pmod{4}.

The form Q(x,y)=x2+y2Q(x, y) = x^2 + y^2 has discriminant 4-4. Forms of different discriminants represent different sets of integers. This is the beginning of the theory of binary quadratic forms (Gauss).

ExampleMoment of inertia tensor

The moment of inertia of a rigid body about an axis n^\hat{n} is I=n^TIn^I = \hat{n}^T \mathcal{I} \hat{n}, a quadratic form in the direction n^\hat{n}. The inertia tensor I\mathcal{I} is a 3×33 \times 3 positive semi-definite symmetric matrix.

The principal axes are the eigenvectors of I\mathcal{I}, and the principal moments of inertia are the eigenvalues.

For a uniform cube of side aa and mass mm: I=ma26I3\mathcal{I} = \frac{ma^2}{6}I_3 (isotropic), so I=ma26I = \frac{ma^2}{6} regardless of the axis direction.


Equivalence of quadratic forms

Definition8.10Equivalence of quadratic forms

Two quadratic forms QQ and QQ' on Rn\mathbb{R}^n are equivalent (over R\mathbb{R}) if there is an invertible linear change of variables taking one to the other, equivalently if their Gram matrices are congruent: M=PTMPM' = P^T M P for some invertible PP.

By Sylvester's Law, real quadratic forms are equivalent iff they have the same rank and signature.

ExampleEquivalent quadratic forms

Q1=x2+y2Q_1 = x^2 + y^2 and Q2=2x2+3y2Q_2 = 2x^2 + 3y^2: both have signature (2,0)(2, 0) and rank 22. They are equivalent over R\mathbb{R} (set u=2xu = \sqrt{2}x, v=3yv = \sqrt{3}y: Q2=u2+v2=Q1Q_2 = u^2 + v^2 = Q_1).

Q1=x2y2Q_1 = x^2 - y^2 and Q2=2xyQ_2 = 2xy: both have signature (1,1)(1, 1). They are equivalent (set u=x+yu = x + y, v=xyv = x - y: 2xy=u2/2v2/22xy = u^2/2 - v^2/2... after scaling, same signature).

Q1=x2+y2Q_1 = x^2 + y^2 and Q2=x2y2Q_2 = x^2 - y^2: signatures (2,0)(2, 0) and (1,1)(1, 1). Not equivalent.


Summary

RemarkQuadratic forms as geometry

Quadratic forms bridge algebra and geometry:

  • Their definiteness classifies critical points in optimization.
  • Their signature classifies real quadratic forms up to equivalence (Sylvester).
  • In number theory, they determine which integers can be represented.
  • In physics, they appear as energy forms, inertia tensors, and metrics.
  • The passage from QQ to its associated bilinear form BB (and back) is the bridge between "self-pairing" and "cross-pairing" data.