Linear AlgebraSymmetric Matrices and Quadratic Forms2 of 4
Symmetric Matrices and Quadratic Forms · 2
Quadratic Forms: Bowls, Saddles, and Ridges
In one variable, the sign of a in y=ax2 tells us right away whether the parabola opens upward, downward, or flattens out; in two variables, we want to tell just as quickly what 3D surface a degree-two equation f(x,y)=ax2+bxy+cy2 draws.
1
Pure Squares: Bowls, Saddles, and Ridges
To find the 3D shape of f(x,y)=ax2+bxy+cy2, we start with the case where the middle term is missing (b=0), leaving only pure squares.
Pure Squares: Bowls, Saddles, and Ridges
f(x,y)=2x2+3y2
Upward bowl Positive Definite
f(x,y)=−2x2−3y2
Dome Negative Definite
f(x,y)=2x2−3y2
Saddle Indefinite
f(x,y)=2x2+0y2
Valley Positive Semidefinite
f(x,y)=−2x2+0y2
Ridge Negative Semidefinite
When b=0, setting y=0 shows the parabola along the x-axis and setting x=0 shows the parabola along the y-axis:
f(x,y)=along x-axisax2+along y-axiscy2
Same signs (a,c>0 or a,c<0): Both axes curve the same way, forming an upward bowl (positive definite) when both are positive and an upside-down bowl or dome (negative definite) when both are negative.
Opposite signs (a and c have opposite signs): One axis curves up while the other curves down, forming a saddle (indefinite).
One coefficient is zero: One axis stays flat at height 0, stretching the other parabola along that flat axis into a valley (positive semidefinite) or a ridge (negative semidefinite).
2
The Cross-Term and the Symmetric Matrix
When we bring back the mixed term bxy, as in f(x,y)=x2+4xy+y2, checking the x and y axes is no longer enough: with the xy term, the surface's true uphill and downhill axes no longer line up with the x and y axes. To find those axes, we rewrite the equation as a symmetric matrix product xTAx.
The Cross-Term and the Symmetric Matrix
Text solution
Check the diagonal y=−xEven though f(x,0)=x2 and f(0,y)=y2 both curve upward along the coordinate axes, walking along the diagonal line y=−x takes the surface downhill as a rotated saddle.
f(x,−x)=x2+4x(−x)+(−x)2=x2−4x2+x2=−2x2
Split the cross-term into a symmetric matrixPlace the x2 and y2 coefficients on the main diagonal and split the 4xy coefficient evenly into 2 and 2 across the off-diagonal cells so the matrix is symmetric.
f(x,y)=[xy]symmetric A[1221][xy]=xTAx
Write the surface height as a dot productBecause a row vector times a column vector is a dot product, the height above any vector x measures how much the transformed vector Ax points in the same direction as x.
f(x,y)=x⋅(Ax)
For f(x,y)=x2+4xy+y2,Ax rotates away from x along the x and y axes, but along the 45∘ diagonals [11] and [1−1] it stays right on the line of x, stretching by 3 uphill on y=x and flipping by −1 downhill on y=−x.
The surface climbs wherever the transformed vector points partly with your step and drops where it points against it, with the saddle's true axes showing up where both vectors stay on the same line.
3
Un-Rotating a Surface with Eigenvectors
To rewrite f(x,y)=x2+4xy+y2 as pure squares without a cross-term, we switch from (x,y) to tilted coordinates (u,w) lined up with the perpendicular unit eigenvectors of A.
Un-Rotating a Surface with Eigenvectors
A=[1221]
f(x,y)=x2+4xy+y2=?u2+?w2
Text solution
Find the eigenvalues and eigenvectors of AMultiplying A=[1221] by the 45∘ diagonal vectors gives the uphill eigenvalue λ1=3 and the downhill eigenvalue λ2=−1.
A[11]A[1−1]=[33]=3[11],=[−11]=−1[1−1]
Divide by length to build the orthogonal matrix QWe divide each eigenvector by its length 12+12=2 so that 1 unit along the tilted u and w axes matches 1 unit of distance in the xy-plane.
Q=[q1q2]=[212121−21]
Substitute x=Qu to remove the cross-termReplacing x with Qu turns QTAQ into the diagonal eigenvalue matrix Λ, leaving pure squares weighted by λ1=3 and λ2=−1.
Convert back to x and y using u=QTxBecause Q is orthogonal (Q−1=QT), each tilted coordinate is the dot product of x with that unit eigenvector, rewriting f(x,y) as pure squares in x and y.
Once the cross-term is gone, the signs of the eigenvalues λ classify the surface in the exact same way the pure-square coefficients did:
All λ>0Upward bowl (positive definite)
All λ<0Upside-down bowl or dome (negative definite)
Mixed positive and negative λSaddle (indefinite)
At least one λ=0 (with the rest sharing a sign)Valley or ridge (semidefinite)
4
The 2×2 Determinant Shortcut
When we only want to know whether a two-variable quadratic form is a bowl, a saddle, or a ridge, we don't need to solve for the eigenvalues: we can tell their signs from the determinant and the diagonal entries of the 2×2 matrix A.
The 2×2 Determinant Shortcut
fff=3x2−2xy+3y2=x2+6xy+9y2=4xy
shape=?
Because the determinant is the product of the two eigenvalues and the trace is their sum, a quick check classifies the symmetric matrix A=[a2b2bc] of ax2+bxy+cy2:
det(A)trace(A)=ac−4b2=λ1⋅λ2,=a+c=λ1+λ2
Text solution
Classify f(x,y)=3x2−2xy+3y2Splitting −2xy into −1 and −1 gives a positive determinant and positive diagonal entries (+3), so both eigenvalues are positive and the surface is a tilted upward bowl (positive definite).
Adet(A)=[3−1−13],=(3)(3)−(−1)(−1)=9−1=+8>0
Classify f(x,y)=x2+6xy+9y2Splitting 6xy into 3 and 3 gives a determinant of 0 with positive diagonal entries, meaning one eigenvalue is zero and the surface is a tilted valley (positive semidefinite) that stays flat at height 0 along the line x+3y=0.
Classify f(x,y)=4xyWith no x2 or y2 terms, the diagonal entries are 0 and splitting 4xy into 2 and 2 gives a negative determinant, so the eigenvalues have opposite signs and the surface is a saddle (indefinite) rotated by 45∘.
Adet(A)=[0220],=(0)(0)−(2)(2)=−4<0
5
Slicing the Surface: Tilted Ellipses and Hyperbolas
Now suppose we slice a surface horizontally at height 1 by setting f(x,y)=1. We want to identify the level curve in the xy-plane, find which directions its axes point along, and see which axis of a tilted ellipse is longer.
Slicing the Surface: Tilted Ellipses and Hyperbolas
Text solution
Rewrite the bowl slice 3x2−2xy+3y2=1 in eigenvector coordinatesThe matrix A=[3−1−13] has eigenvalues λ1=2 along q1=[2121] and λ2=4 along q2=[21−21], turning the slice into a tilted ellipse along the u and w axes.
3x2−2xy+3y2=1⟹2u2+4w2=1
Find the half-lengths of the ellipse axes from the eigenvaluesAlong the steeper w-axis (λ2=4), the bowl climbs to height 1 in a shorter distance w=21; along the gentler u-axis (λ1=2), you have to walk further out to u=21, so the major (longer) axis points along [11] and the minor (shorter) axis points along [1−1].
wu=41=21 along [1−1],=21 along [11]
Slice the saddle x2+4xy+y2=1 at height 1Because the eigenvalues λ1=3 and λ2=−1 have opposite signs, the level curve is a tilted hyperbola that opens along the uphill eigenvector direction [11] and never crosses the downhill axis [1−1].
x2+4xy+y2=1⟹3u2−1w2=1
2u2+4w2=1
3u2−1w2=1
u
w
x
y
Now see how changing an eigenvalue bends the parabola along its eigenvector axis, stretching a tilted ellipse into parallel lines when λ=0 and opening it into a hyperbola when λ<0.
How the surface curves along an axis sets where, and whether, the height 1 slice crosses that axis.
6
Maximum and Minimum on the Unit Circle
If we only allow unit vectors x of length 1 on the unit circle x2+y2=1, we want to find the largest and smallest values that xTAx can reach and which unit vectors achieve them.
Maximum and Minimum on the Unit Circle
xTAx=2u2+4w2
on x2+y2=1:largest? smallest?
x
y
u
w
x
Text solution
Rewrite the unit-circle constraint in tilted coordinatesBecause the orthogonal matrix Q preserves vector lengths, x2+y2=1 becomes u2+w2=1, turning the quadratic form into a weighted average of λ1=2 and λ2=4.
xTAx=λ1u2+λ2w2=2u2+4w2,weights adding to 100%u2+w2=1
Put 100% of the weight on one eigenvalue at a timeSetting w=±1,u=0 gives the maximum λmax=4 along the steeper unit eigenvector ±q2, and setting u=±1,w=0 gives the minimum λmin=2 along the gentler unit eigenvector ±q1.
∥x∥=1maxxTAx∥x∥=1minxTAx=λmax=4 at x=±[21−21],=λmin=2 at x=±[2121]
Drag x around the unit circle to see the weights u2 and w2 trade off between λmin=2 and λmax=4.
Around the unit circle, the two squared projections always add up to 1, so the bowl's height stays between the eigenvalues 2 and 4.
7
Three Variables and Higher Dimensions
When a quadratic form has three variables x,y,z, we build its 3×3 symmetric matrix the same way, by putting the squared coefficients on the diagonal and splitting each cross-term in half, but the 2×2 single-determinant shortcut no longer works to classify it.
Three Variables and Higher Dimensions
f(x,y,z)=2x2+5y2+3z2+4xy−6xz+8yz
A=?
For example, f(x,y,z)=2x2+5y2+3z2+4xy−6xz+8yz becomes:
f(x,y,z)=[xyz]22−3254−343xyz
Now let's classify f(x,y,z)=x2+y2+z2+4xy+4xz+4yz and see why a single determinant can mislead us in 3D.
Text solution
Build the 3×3 symmetric matrix APlace 1,1,1 on the main diagonal and split each +4 cross-term into 2 and 2.
A=122212221
Find all three eigenvalues from det(A−λI)=0Subtracting λ=−1 from the diagonal makes every row equal to [222], giving a double eigenvalue λ2=−1,λ3=−1 along with λ1=5.
det(A−λI)=−(λ−5)(λ+1)2=0⟹λ1=5,λ2=−1,λ3=−1
Classify the form and bound it on the unit sphere x2+y2+z2=1Because the eigenvalues 5,−1,−1 have mixed signs, the form is an indefinite 3D saddle with maximum 5 and minimum −1 on the unit sphere, even though the diagonal entries are +1 and det(A)=(5)(−1)(−1)=+5>0, where the two negative eigenvalues multiply to a positive number and hide the two downhill directions.
When you look at a quadratic form, your first check is whether there are any cross-terms at all. If there is no xy term, don't build a matrix; read the shape straight from the signs of the pure squares, such as 2x2+3y2 (both positive → upward bowl, positive definite), 2x2−3y2 (opposite signs → saddle, indefinite), or 2x2+0y2 (one zero → valley, positive semidefinite).
When a cross-term is present, put the squared coefficients on the main diagonal and split each cross-term in half so the matrix A is symmetric (x2+4xy+y2 becomes A=[1221] with xTAx=x⋅Ax). What you do next depends on what the question asks:
Only classifying a 2×2 form
Don't solve for the eigenvalues; check det(A)=λ1λ2. A negative determinant (det[0220]=−4<0) means opposite eigenvalue signs and is immediately an indefinite saddle. A positive determinant (det[3−1−13]=8>0) means both eigenvalues share the sign of the diagonal entries (+3→ upward bowl, positive definite; negative diagonal → dome, negative definite). A zero determinant (det[1339]=0) means one eigenvalue is zero, and the form is a number times a single square, like (x+3y)2, with a flat line at height 0.
Classifying a 3×3 form
Do not use the single determinant det(A)=λ1λ2λ3, because two negative eigenvalues multiply to a positive number (5(−1)(−1)=+5) and make a saddle look like a bowl. Find all three eigenvalues and check their signs directly.
Un-rotating, slicing at height 1, or finding the maximum and minimum on the unit circle
Find the eigenvalues and divide the perpendicular eigenvectors by their lengths to form the orthogonal matrix Q=[q1q2]. In tilted coordinates u=QTx, the cross-term disappears to leave λ1u2+λ2w2. Slicing a bowl at height 1 (λ1u2+λ2w2=1, such as 2u2+4w2=1) draws a tilted ellipse that reaches distance λ1 along each eigenvector axis, so the steeper direction (larger λ=4) gives the shorter half-length 21, while the gentler direction (smaller λ=2) gives the longer half-length 21. On the unit circle x2+y2=1, the weights u2+w2=1 average the eigenvalues, keeping xTAx between λmin and λmax, which it reaches along the corresponding unit eigenvectors.
8
Practice
1
Write f(x,y)=−2x2+2xy−5y2 in the form xTAx with a symmetric matrix A, and use the 2×2 determinant shortcut to classify its 3D shape and definiteness.
Split the 2xy coefficient evenly across the off-diagonal, then check the sign of det(A) first and the sign of the diagonal entries second.
Place −2 and −5 on the diagonal and split +2xy into 1 and 1:
xTAx=[xy][−211−5][xy]
(Warning: Putting the unsplit 2 in both off-diagonal spots gives [−222−5] with det=6, and stopping after det(A)>0 without checking the negative diagonal sign misclassifies the dome as a positive definite upward bowl.)
det(A)=(−2)(−5)−(1)(1)=10−1=9>0
Since det(A)=9>0, both eigenvalues have the same sign; because the top-left diagonal entry −2 (and trace −7) is negative, both eigenvalues are negative, so the surface is an upside-down bowl (dome), negative definite.
2
Build the symmetric matrix for f(x,y)=−4x2+12xy−9y2 to classify its shape and definiteness, and find the line in the xy-plane along which the surface stays flat at height 0.
After finding det(A)=0, factor out a minus sign to write f(x,y) as the negative of a single squared expression −()2.
Place −4 and −9 on the diagonal and split +12xy into 6 and 6:
Adet(A)=[−466−9],=(−4)(−9)−(6)(6)=36−36=0
Because det(A)=0 and the diagonal entries are negative, the surface is a ridge, negative semidefinite. Factoring out the minus sign gives:
f(x,y)=−(4x2−12xy+9y2)=−(2x−3y)2
(Warning: Keeping +12xy unchanged inside the parentheses after factoring out the minus sign gives −(2x+3y)2 and the wrong line 2x+3y=0.)
The height stays at 0 along the line 2x−3y=0 (or y=32x).
3
For f(x,y)=5x2+4xy+2y2, find the eigenvalues and unit eigenvectors of its symmetric matrix A, write the quadratic form in tilted coordinates u=QTx, and use u and w to rewrite f(x,y) in terms of x and y as pure squares.
Once you find the eigenvectors of A=[5222], remember to divide each eigenvector by its length 5 before computing u=QTx.
The eigenvalues are λ1=6 (with eigenvector [21]) and λ2=1 (with eigenvector [1−2]). Dividing by their length 22+12=5 gives the unit eigenvectors:
q1q2=[5251],=[51−52]
In tilted coordinates u=QTx, we have u=52x+y and w=5x−2y.
(Warning: Skipping the 51 length division and plugging u=2x+y and w=x−2y into 6u2+w2 gives 6(2x+y)2+(x−2y)2=25x2+20xy+10y2, which is 5 times too large.)
Slice the surfaces f(x,y)=5x2+8xy+5y2 and g(x,y)=2x2−6xy+2y2 at height 1. (a) For 5x2+8xy+5y2=1, identify the curve, the directions of its major and minor axes, and the distance from the origin to the curve along each axis. (b) Explain why g(x,y) is a saddle despite having +2x2 and +2y2, and state what curve 2x2−6xy+2y2=1 draws and which direction it opens along.
Both symmetric matrices have equal numbers on the diagonal, so their eigenvectors point along [11] and [1−1]; think about whether the steeper or gentler eigenvalue reaches height 1 first.
(a)For A=[5445], testing [11] and [1−1] gives eigenvalues λ1=9 along [11] and λ2=1 along [1−1]:
5x2+8xy+5y2=1⟹9u2+w2=1
(Warning: Matching the larger eigenvalue λ1=9 to the major axis swaps the major and minor directions, and forgetting the square root in λ1 gives half-length 91 instead of 31.)
The curve is a tilted ellipse whose major (longer) axis points along the gentler direction [1−1] with half-length 11=1, and whose minor (shorter) axis points along the steeper direction [11] with half-length 91=31.
(b)For B=[2−3−32], the determinant is negative:
det(B)=(2)(2)−(−3)(−3)=4−9=−5<0
Even though g(x,y) curves up along the x and y axes, walking along the diagonal y=x gives g(x,x)=2x2−6x2+2x2=−2x2, which drops downhill. Its eigenvalues are λ1=−1 along [11] and λ2=5 along [1−1], giving −u2+5w2=1: a tilted hyperbola opening along [1−1] and never crossing [11].
5
Find the maximum and minimum values of f(x,y)=3x2+8xy−3y2 for unit vectors on the circle x2+y2=1, together with the unit vectors x that achieve them. What value does f(x,y) take at a unit vector whose tilted coordinates put 25% of the weight on the positive eigenvalue's axis (u2=0.25) and 75% on the negative eigenvalue's axis (w2=0.75)?
Find the eigenvalues and unit eigenvectors of A=[344−3], then compute the weighted average λ1u2+λ2w2.
Set up the symmetric matrix A and find its eigenvalues:
On the unit circle, the maximum value is 5, achieved at the unit eigenvectors x=±[5251], and the minimum value is −5, achieved at x=±[51−52].
(Warning: Squaring the weights u2=0.25 and w2=0.75 a second time in λ1u2+λ2w2 gives 5(0.25)2+(−5)(0.75)2=−2.5 only by coincidence here; the weights u2 and w2 are already squared.)
f(x,y)=5(0.25)+(−5)(0.75)=1.25−3.75=−2.5
6
At a point where a surface is flat, the second derivatives give the quadratic form f(x,y)=4x2+kxy+9y2 for the shape of the surface nearby. For which values of k is this point at the bottom of a bowl (a local minimum), when does it flatten into a valley, and when does it become a saddle?
Putting k instead of 2k in the off-diagonal cells gives det=36−k2, which misses the cutoffs by a factor of 2 and gives ±6 instead of ±12.
Split kxy into 2k and 2k in the symmetric matrix A, then check when det(A) is positive, zero, or negative.
Build the symmetric matrix A and compute its determinant:
Adet(A)=[42k2k9],=(4)(9)−(2k)2=36−4k2
(Warning: Putting k instead of 2k in the off-diagonal cells gives det=36−k2, which misses the cutoffs by a factor of 2 and gives ±6 instead of ±12.)
Because the diagonal entries 4 and 9 are positive:
Bottom of a bowl (positive definite, local minimum)det(A)=36−4k2>0⟹−12<k<12
Valley (positive semidefinite)det(A)=36−4k2=0⟹k=±12
Saddle (indefinite)det(A)=36−4k2<0⟹k<−12 or k>12
7
Write f(x,y,z)=x2+y2+z2+6xy−6xz−6yz as xTAx with a 3×3 symmetric matrix A. Find all three eigenvalues of A (hint: check what happens to the rows of A−λI when λ=−2), classify the 3D form, give its maximum and minimum on the unit sphere x2+y2+z2=1, and explain why det(A)>0 with positive diagonal entries does not make f positive definite.
Put 1,1,1 on the diagonal and split +6,−6,−6 in half; once λ=−2 makes all three rows of A−λI multiples of the same row, multiply A by 11−1 to find the third eigenvalue.
Place 1,1,1 on the main diagonal and split the cross-terms +6xy,−6xz,−6yz into +3,−3,−3:
A=13−331−3−3−31
Subtracting λ=−2 from the diagonal makes every row a multiple of [11−1]:
A−(−2)I=33−333−3−3−33⟹λ2=−2,λ3=−2
Multiplying A by 11−1 gives 77−7=711−1, so the third eigenvalue is λ1=7.
(Warning: Applying the 2×2 determinant rule to det(A)=(7)(−2)(−2)=+28>0 with +1 diagonal entries falsely classifies the 3D saddle as positive definite.)
Because the eigenvalues 7,−2,−2 have mixed signs, the form is indefinite (a 3D saddle), with maximum 7 and minimum −2 on the unit sphere x2+y2+z2=1; even though the diagonal entries are +1 and det(A)=+28>0, the two negative eigenvalues multiply to a positive number and hide the two downhill directions.