Linear-Algebra-Done-Right ยท Unit 27 ยท Video 5 ยท Interactive Practice

Quadratic Forms: Polarization and Sums of Squares

IKey Formulas

FormulaNameHypotheses
qฮฒ(v)=ฮฒ(v,v)q_\beta(v) = \beta(v, v); on Fn\mathbf{F}^n: q(x1,โ€ฆ,xn)=โˆ‘j,kAj,kโ€‰xjxkq(x_1, \dots, x_n) = \sum_{j,k} A_{j,k}\, x_j x_kQuadratic formฮฒ\beta bilinear on VV; Aj,kA_{j,k} the entries of M(ฮฒ)\mathcal{M}(\beta) in the standard basis
ฯ(u,w)=12(q(u+w)โˆ’q(u)โˆ’q(w))\rho(u, w) = \tfrac{1}{2}\big(q(u + w) - q(u) - q(w)\big)Polarization formula: the unique symmetric ฯ\rho with q=qฯq = q_\rhoqq a quadratic form on VV
q(2v)=4q(v)q(2v) = 4q(v) and (u,w)โ†ฆq(u+w)โˆ’q(u)โˆ’q(w)(u, w) \mapsto q(u + w) - q(u) - q(w) symmetric bilinearTest for a quadratic formany function qโ€‰โฃ:Vโ†’Fq \colon V \to \mathbf{F}
q(x1e1+โ‹ฏ+xnen)=ฮป1x12+โ‹ฏ+ฮปnxn2q(x_1e_1 + \cdots + x_ne_n) = \lambda_1x_1^2 + \cdots + \lambda_nx_n^2Diagonalization: a weighted sum of squaresVV finite-dimensional; some basis e1,โ€ฆ,ene_1, \dots, e_n; orthonormal if F=R\mathbf{F} = \mathbf{R} and VV is an inner product space

Key Insight: Only the sums Aj,k+Ak,jA_{j,k} + A_{k,j} reach qq, so the symmetric form behind qq has matrix 12(A+At)\tfrac{1}{2}\big(A + A^{\mathsf{t}}\big); the alternating part of ฮฒ\beta is invisible to qq.

IIOne Symmetric Matrix per Quadratic Form

Matrices with the same A1,2+A2,1A_{1,2} + A_{2,1} give the same qq; their common symmetric part is M(ฯ)\mathcal{M}(\rho).

IIIBoth Halves of the Test

A quadratic form needs q(2v)=4q(v)q(2v) = 4q(v) and a polarization q(u+w)โˆ’q(u)โˆ’q(w)q(u + w) - q(u) - q(w) linear in ww.

๐Ÿ’ก Neither half suffices alone: โˆฃxyโˆฃ\lvert xy\rvert passes the scaling test, while x2+yx^2 + y has the bilinear polarization 2u1w12u_1w_1 but fails q(2v)=4q(v)q(2v) = 4q(v).

IVA Basis with No Cross Term

For q(x,y)=x2โˆ’4xyq(x, y) = x^2 - 4xy the c1c2c_1c_2 coefficient is 2ฯ(e1,e2)2\rho(e_1, e_2), so it vanishes exactly when ฯ(e1,e2)=0\rho(e_1, e_2) = 0.

๐Ÿ’ก Challenge: find two diagonalizing bases whose weights differ; only the existence of some basis without cross terms is guaranteed, not the weights.

VQuiz Questions

Problem 1 ยท The Symmetric Matrix of a Quadratic Form

Given: the quadratic form q(x,y,z)=3x2+2xyโˆ’6yz+5z2q(x, y, z) = 3x^2 + 2xy - 6yz + 5z^2 on R3\mathbf{R}^3 โ€” find M(ฯ)\mathcal{M}(\rho) in the standard basis, where ฯ\rho is the unique symmetric bilinear form with q=qฯq = q_\rho.

โœ… Correct! The squares go on the diagonal, and each cross coefficient is split evenly between its two mirror entries.
โŒ This matrix gives 4xy4xy and โˆ’12yz-12yz. The entries A1,2A_{1,2} and A2,1A_{2,1} both contribute to the xyxy term, so each must be half of 22.
โŒ This ฮฒ\beta does give qฮฒ=qq_\beta = q, but it is not symmetric. Its (1,2)(1,2) entry is 22 while its (2,1)(2,1) entry is 00; symmetrize with 12(A+At)\tfrac12\big(A + A^{\mathsf{t}}\big).
โŒ The โˆ’6-6 belongs to yzyz, not xzxz. Entry (j,k)(j, k) multiplies xjxkx_j x_k; the yzyz term lives in positions (2,3)(2,3) and (3,2)(3,2).
Show solution

Write q=โˆ‘j,kAj,kโ€‰xjxkq = \sum_{j,k} A_{j,k}\, x_jx_k with AA symmetric. A square cโ€‰xj2c\,x_j^2 gives Aj,j=cA_{j,j} = c; a cross term cโ€‰xjxkc\,x_jx_k (jโ‰ kj \ne k) equals Aj,kxjxk+Ak,jxkxjA_{j,k}x_jx_k + A_{k,j}x_kx_j, so Aj,k=Ak,j=c/2A_{j,k} = A_{k,j} = c/2.

3x2โ†’A1,1=3,2xyโ†’A1,2=A2,1=1,โˆ’6yzโ†’A2,3=A3,2=โˆ’3,5z2โ†’A3,3=5.3x^2 \to A_{1,1} = 3, \qquad 2xy \to A_{1,2} = A_{2,1} = 1, \qquad -6yz \to A_{2,3} = A_{3,2} = -3, \qquad 5z^2 \to A_{3,3} = 5. M(ฯ)=(31010โˆ’30โˆ’35).\mathcal{M}(\rho) = \begin{pmatrix} 3 & 1 & 0 \\ 1 & 0 & -3 \\ 0 & -3 & 5 \end{pmatrix}.

The missing y2y^2 and xzxz terms give zeros in positions (2,2)(2,2), (1,3)(1,3) and (3,1)(3,1).

Problem 2 ยท Which One Is a Quadratic Form?

Given: four functions R2โ†’R\mathbf{R}^2 \to \mathbf{R} โ€” find the one that is a quadratic form.

โœ… Correct! (2xโˆ’y)(x+3y)=2x2+5xyโˆ’3y2(2x - y)(x + 3y) = 2x^2 + 5xy - 3y^2, a sum of degree-two terms.
โŒ The scaling test fails. q(0,1)=3q(0, 1) = 3 but q(0,2)=6โ‰ 4โ‹…3q(0, 2) = 6 \ne 4 \cdot 3.
โŒ It passes q(2v)=4q(v)q(2v) = 4q(v), but the polarization is not linear. With u=(1,0)u = (1, 0): w=(0,1)w = (0, 1) gives q(1,1)โˆ’1โˆ’1=โˆ’1q(1, 1) - 1 - 1 = -1, and โˆ’w-w gives q(1,โˆ’1)โˆ’1โˆ’1=โˆ’1q(1, -1) - 1 - 1 = -1 again, not +1+1.
โŒ It passes q(2v)=4q(v)q(2v) = 4q(v), but a quadratic form also has q(โˆ’v)=q(v)q(-v) = q(v). Here q(1,1)=2q(1, 1) = 2 while q(โˆ’1,โˆ’1)=โˆ’1+1=0q(-1, -1) = -1 + 1 = 0.
Show solution

(b) Expanding, q(x,y)=2x2+6xyโˆ’xyโˆ’3y2=2x2+5xyโˆ’3y2q(x, y) = 2x^2 + 6xy - xy - 3y^2 = 2x^2 + 5xy - 3y^2, which has the form โˆ‘j,kAj,kxjxk\sum_{j,k} A_{j,k}x_jx_k (for instance A1,1=2A_{1,1} = 2, A1,2=A2,1=52A_{1,2} = A_{2,1} = \tfrac52, A2,2=โˆ’3A_{2,2} = -3). So it is a quadratic form.

(a) q(2v)=4x2+6yq(2v) = 4x^2 + 6y differs from 4q(v)=4x2+12y4q(v) = 4x^2 + 12y whenever yโ‰ 0y \ne 0.

(c) maxโก{4x2,4y2}=4maxโก{x2,y2}\max\{4x^2, 4y^2\} = 4\max\{x^2, y^2\}, so the scaling test holds. But for u=(1,0)u = (1, 0) the polarization P(u,w)=q(u+w)โˆ’q(u)โˆ’q(w)P(u, w) = q(u + w) - q(u) - q(w) takes the value โˆ’1-1 at both w=(0,1)w = (0, 1) and w=(0,โˆ’1)w = (0, -1); a function linear in ww would change sign.

(d) q(2v)=2xโ‹…2โˆฃyโˆฃ+4y2=4q(v)q(2v) = 2x \cdot 2\lvert y\rvert + 4y^2 = 4q(v), so the test with ฮป=2\lambda = 2 alone cannot rule it out. A quadratic form satisfies q(ฮปv)=ฮป2q(v)q(\lambda v) = \lambda^2 q(v) for every ฮป\lambda, in particular q(โˆ’v)=q(v)q(-v) = q(v); here q(โˆ’1,โˆ’1)=0โ‰ 2=q(1,1)q(-1, -1) = 0 \ne 2 = q(1, 1). (So its polarization cannot be bilinear either, since q(2v)=4q(v)q(2v) = 4q(v) plus a symmetric bilinear polarization would make qq a quadratic form.)

Problem 3 ยท Polarization on R3\mathbf{R}^3

Given: q(x,y,z)=x2+3y2โˆ’2z2+4xyโˆ’6yzq(x, y, z) = x^2 + 3y^2 - 2z^2 + 4xy - 6yz on R3\mathbf{R}^3, u=(1,0,2)u = (1, 0, 2) and w=(0,1,1)w = (0, 1, 1) โ€” find q(u+w)q(u + w) and ฯ(u,w)\rho(u, w), where ฯ\rho is the symmetric bilinear form with q=qฯq = q_\rho.

q(u+w)q(u + w)

ฯ(u,w)\rho(u, w)

โœ… Correct! ฯ(u,w)=12(โˆ’28โˆ’(โˆ’7)โˆ’(โˆ’5))=โˆ’8\rho(u, w) = \tfrac12\big(-28 - (-7) - (-5)\big) = -8.
โŒ That is q(u)+q(w)=โˆ’7+(โˆ’5)q(u) + q(w) = -7 + (-5). A quadratic form is not additive; the difference q(u+w)โˆ’q(u)โˆ’q(w)q(u + w) - q(u) - q(w) is exactly the polarization.
โŒ The cross terms are missing. At u+w=(1,1,3)u + w = (1, 1, 3), 4xy=44xy = 4 and โˆ’6yz=โˆ’18-6yz = -18 also count.
โŒ Check the signs. u+w=(1,1,3)u + w = (1, 1, 3), and q(1,1,3)=1+3โˆ’18+4โˆ’18q(1, 1, 3) = 1 + 3 - 18 + 4 - 18.
โŒ That is the polarization, 2ฯ(u,w)2\rho(u, w). The symmetric form is half of it.
โŒ 00 is ฮฒ(u,w)\beta(u, w) for the upper triangular ฮฒ\beta with qฮฒ=qq_\beta = q. That ฮฒ\beta is not symmetric: ฮฒ(w,u)=โˆ’16\beta(w, u) = -16. The symmetric ฯ\rho averages the two.
โŒ Subtract the negative values with care. โˆ’28โˆ’(โˆ’7)โˆ’(โˆ’5)=โˆ’28+7+5=โˆ’16-28 - (-7) - (-5) = -28 + 7 + 5 = -16, and ฯ(u,w)\rho(u, w) is half of that.
โŒ Not quite. Use ฯ(u,w)=12(q(u+w)โˆ’q(u)โˆ’q(w))\rho(u, w) = \tfrac12\big(q(u + w) - q(u) - q(w)\big).
Show solution
q(u)=q(1,0,2)=1+0โˆ’8+0โˆ’0=โˆ’7,q(w)=q(0,1,1)=0+3โˆ’2+0โˆ’6=โˆ’5,q(u) = q(1, 0, 2) = 1 + 0 - 8 + 0 - 0 = -7, \qquad q(w) = q(0, 1, 1) = 0 + 3 - 2 + 0 - 6 = -5, q(u+w)=q(1,1,3)=1+3โˆ’18+4โˆ’18=โˆ’28.q(u + w) = q(1, 1, 3) = 1 + 3 - 18 + 4 - 18 = -28.

By the polarization formula,

ฯ(u,w)=12(q(u+w)โˆ’q(u)โˆ’q(w))=12(โˆ’28+7+5)=โˆ’8.\rho(u, w) = \tfrac12\big(q(u + w) - q(u) - q(w)\big) = \tfrac12(-28 + 7 + 5) = -8.

Check with the matrix: M(ฯ)=(12023โˆ’30โˆ’3โˆ’2)\mathcal{M}(\rho) = \begin{pmatrix} 1 & 2 & 0 \\ 2 & 3 & -3 \\ 0 & -3 & -2 \end{pmatrix} and M(ฯ)โ€‰w=(2,0,โˆ’5)\mathcal{M}(\rho)\,w = (2, 0, -5), so ฯ(u,w)=1โ‹…2+0โ‹…0+2โ‹…(โˆ’5)=โˆ’8\rho(u, w) = 1 \cdot 2 + 0 \cdot 0 + 2 \cdot (-5) = -8.

Problem 4 ยท A Weighted Sum of Squares on R3\mathbf{R}^3

Given: q(x,y,z)=x2+6xy+2xz+7y2+10yz+2z2q(x, y, z) = x^2 + 6xy + 2xz + 7y^2 + 10yz + 2z^2 โ€” complete the square in xx first, then in yy, and call the bracketed quantities c1,c2,c3c_1, c_2, c_3 (with c3=zc_3 = z). Find qq in these coordinates and the basis vector e2e_2 for which (x,y,z)=c1e1+c2e2+c3e3(x, y, z) = c_1e_1 + c_2e_2 + c_3e_3.

q(c1e1+c2e2+c3e3)q(c_1e_1 + c_2e_2 + c_3e_3)

e2e_2

โœ… Correct! In the basis (1,0,0)(1, 0, 0), (โˆ’3,1,0)(-3, 1, 0), (โˆ’4,1,1)(-4, 1, 1) the weights are 11, โˆ’2-2, 33.
โŒ Those are the diagonal entries of M(ฯ)\mathcal{M}(\rho). The standard basis leaves the cross terms 6xy6xy, 2xz2xz, 10yz10yz; the weights come from completing the square.
โŒ The second square brings its own z2z^2. โˆ’2(yโˆ’z)2=โˆ’2y2+4yzโˆ’2z2-2(y - z)^2 = -2y^2 + 4yz - 2z^2, so โˆ’2y2+4yz+z2=โˆ’2(yโˆ’z)2+3z2-2y^2 + 4yz + z^2 = -2(y - z)^2 + 3z^2.
โŒ Check the y2y^2 remainder. (x+3y+z)2(x + 3y + z)^2 already contains 9y29y^2, so 7y2โˆ’9y2=โˆ’2y27y^2 - 9y^2 = -2y^2.
โŒ Not quite. Start from (x+3y+z)2=x2+6xy+2xz+9y2+6yz+z2(x + 3y + z)^2 = x^2 + 6xy + 2xz + 9y^2 + 6yz + z^2 and subtract it from qq.
โŒ That lists the coefficients of c2=yโˆ’zc_2 = y - z. The basis vectors come from solving back for (x,y,z)(x, y, z) in terms of the cjc_j.
โŒ Watch the sign in the solve-back. x=c1โˆ’3yโˆ’zx = c_1 - 3y - z, so the coefficient of c2c_2 in xx is โˆ’3-3.
โŒ That is e3e_3. It is the coefficient vector of c3c_3; e2e_2 is the coefficient vector of c2c_2.
โŒ Not quite. Express xx, yy, zz in terms of c1,c2,c3c_1, c_2, c_3 and read off the coefficient of c2c_2.
Show solution

Square in xx. The xx-terms x2+6xy+2xzx^2 + 6xy + 2xz start (x+3y+z)2=x2+6xy+2xz+9y2+6yz+z2(x + 3y + z)^2 = x^2 + 6xy + 2xz + 9y^2 + 6yz + z^2, so

q=(x+3y+z)2โˆ’2y2+4yz+z2.q = (x + 3y + z)^2 - 2y^2 + 4yz + z^2.

Square in yy. โˆ’2y2+4yz=โˆ’2(yโˆ’z)2+2z2-2y^2 + 4yz = -2(y - z)^2 + 2z^2, hence

q=(x+3y+z)2โˆ’2(yโˆ’z)2+3z2.q = (x + 3y + z)^2 - 2(y - z)^2 + 3z^2.

With c1=x+3y+zc_1 = x + 3y + z, c2=yโˆ’zc_2 = y - z, c3=zc_3 = z this is c12โˆ’2c22+3c32c_1^2 - 2c_2^2 + 3c_3^2.

Solve back. z=c3z = c_3, y=c2+c3y = c_2 + c_3, x=c1โˆ’3yโˆ’z=c1โˆ’3c2โˆ’4c3x = c_1 - 3y - z = c_1 - 3c_2 - 4c_3, so

(x,y,z)=c1(1,0,0)+c2(โˆ’3,1,0)+c3(โˆ’4,1,1).(x, y, z) = c_1(1, 0, 0) + c_2(-3, 1, 0) + c_3(-4, 1, 1).

Thus e2=(โˆ’3,1,0)e_2 = (-3, 1, 0). Check: q(e1)=1q(e_1) = 1, q(e2)=9โˆ’18+7=โˆ’2q(e_2) = 9 - 18 + 7 = -2, q(e3)=16โˆ’24โˆ’8+7+10+2=3q(e_3) = 16 - 24 - 8 + 7 + 10 + 2 = 3.

Solved: 0 / 4