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\first{a} in y=ax2y = \first{ax^2} 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\surf{f(x, y)} = \first{ax^2} + bxy + \second{cy^2} draws.

1

Pure Squares: Bowls, Saddles, and Ridges

To find the 3D shape of f(x,y)=ax2+bxy+cy2\surf{f(x, y)} = \first{ax^2} + bxy + \second{cy^2}, we start with the case where the middle term is missing (b=0b = 0), leaving only pure squares.

Pure Squares: Bowls, Saddles, and Ridges
f(x,y)=ax2+cy2 ⁣: what shape?\surf{f(x, y)} = \first{ax^2} + \second{cy^2}\colon\ \text{what shape?}
xx
yy
f(x,y)\surf{f(x, y)}
f(x,y)=\htmlClass{lc-blue}{f(x, y)} = 2x2+3y2\htmlClass{lc-green}{2x^2} + \htmlClass{lc-pink}{3y^2}
Upward bowl
Positive Definite
f(x,y)=\htmlClass{lc-blue}{f(x, y)} = −2x2−3y2\htmlClass{lc-green}{-2x^2} - \htmlClass{lc-pink}{3y^2}
Dome
Negative Definite
f(x,y)=\htmlClass{lc-blue}{f(x, y)} = 2x2−3y2\htmlClass{lc-green}{2x^2} - \htmlClass{lc-pink}{3y^2}
Saddle
Indefinite
f(x,y)=\htmlClass{lc-blue}{f(x, y)} = 2x2+0y2\htmlClass{lc-green}{2x^2} + \htmlClass{lc-pink}{0y^2}
Valley
Positive Semidefinite
f(x,y)=\htmlClass{lc-blue}{f(x, y)} = −2x2+0y2\htmlClass{lc-green}{-2x^2} + \htmlClass{lc-pink}{0y^2}
Ridge
Negative Semidefinite

When b=0b = 0, setting y=0y = 0 shows the parabola along the xx-axis and setting x=0x = 0 shows the parabola along the yy-axis:

f(x,y)\displaystyle \surf{f(x, y)} =ax2⏟along x-axis+cy2⏟along y-axis\displaystyle = \underbrace{\first{ax^2}}_{\text{along } x\text{-axis}} + \underbrace{\second{cy^2}}_{\text{along } y\text{-axis}}
2

The Cross-Term and the Symmetric Matrix

When we bring back the mixed term bxybxy, as in f(x,y)=x2+4xy+y2\surf{f(x, y)} = \first{x^2} + 4xy + \second{y^2}, checking the xx and yy axes is no longer enough: with the xyxy term, the surface's true uphill and downhill axes no longer line up with the xx and yy axes. To find those axes, we rewrite the equation as a symmetric matrix product x⃗TAx⃗\vec{x}^T \act{A} \vec{x}.

The Cross-Term and the Symmetric Matrix
f(x,y)=x2+4xy+y2\surf{f(x, y)} = \first{x^2} + 4xy + \second{y^2}
xx
yy
x2\first{x^2}
y2\second{y^2}
bowl?\text{bowl?}
Text solution
Check the diagonal y=−xy = -xEven though f(x,0)=x2\surf{f(x, 0)} = \first{x^2} and f(0,y)=y2\surf{f(0, y)} = \second{y^2} both curve upward along the coordinate axes, walking along the diagonal line y=−xy = -x takes the surface downhill as a rotated saddle.
f(x,−x)\displaystyle \surf{f(x, -x)} =x2+4x(−x)+(−x)2\displaystyle = x^2 + 4x(-x) + (-x)^2 =x2−4x2+x2\displaystyle = x^2 - 4x^2 + x^2 =−2x2\displaystyle = \missed{-2x^2}
Split the cross-term into a symmetric matrixPlace the x2\first{x^2} and y2\second{y^2} coefficients on the main diagonal and split the 4xy4xy coefficient evenly into 22 and 22 across the off-diagonal cells so the matrix is symmetric.
f(x,y)=[xy][1221]⏟symmetric A[xy]=x⃗TAx⃗\displaystyle \surf{f(x, y)} = \begin{bmatrix} x & y \end{bmatrix} \underbrace{\begin{bmatrix} \first{1} & 2 \\ 2 & \second{1} \end{bmatrix}}_{\text{symmetric } \act{A}} \begin{bmatrix} x \\ y \end{bmatrix} = \vec{x}^T \act{A} \vec{x}
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⃗\vec{x} measures how much the transformed vector Ax⃗\act{A\vec{x}} points in the same direction as x⃗\vec{x}.
f(x,y)\displaystyle \surf{f(x, y)} =x⃗⋅(Ax⃗)\displaystyle = \vec{x} \cdot (\act{A\vec{x}})

For f(x,y)=x2+4xy+y2\surf{f(x, y)} = x^2 + 4xy + y^2, Ax⃗\act{A\vec{x}} rotates away from x⃗\vec{x} along the xx and yy axes, but along the 45∘45^\circ diagonals [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}} it stays right on the line of x⃗\vec{x}, stretching by 3\first{3} uphill on y=x\first{y = x} and flipping by −1\second{-1} downhill on y=−x\second{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\surf{f(x, y)} = x^2 + 4xy + y^2 as pure squares without a cross-term, we switch from (x,y)(x, y) to tilted coordinates (u,w)(\first{u}, \second{w}) lined up with the perpendicular unit eigenvectors of A\act{A}.

Un-Rotating a Surface with Eigenvectors
A=[1221]\displaystyle \act{A} = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix}
f(x,y)=x2+4xy+y2=? u2+? w2\displaystyle \begin{aligned} \surf{f(x, y)} &= x^2 + 4xy + y^2 \\ &= {?}\,\first{u^2} + {?}\,\second{w^2} \end{aligned}
Text solution
Find the eigenvalues and eigenvectors of A\act{A}Multiplying A=[1221]\act{A} = \begin{bmatrix} 1 & 2 \\ 2 & 1 \end{bmatrix} by the 45∘45^\circ diagonal vectors gives the uphill eigenvalue λ1=3\first{\lambda_1 = 3} and the downhill eigenvalue λ2=−1\second{\lambda_2 = -1}.
A[11]=[33]=3[11],A[1−1]=[−11]=−1[1−1]\displaystyle \begin{aligned} \act{A}\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} &= \begin{bmatrix} 3 \\ 3 \end{bmatrix} = \first{3}\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}}, \\ \act{A}\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}} &= \begin{bmatrix} -1 \\ 1 \end{bmatrix} = \second{-1}\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}} \end{aligned}
Divide by length to build the orthogonal matrix QQWe divide each eigenvector by its length 12+12=2\sqrt{1^2 + 1^2} = \sqrt{2} so that 11 unit along the tilted u\first{u} and w\second{w} axes matches 11 unit of distance in the xyxy-plane.
Q=[q⃗1q⃗2]=[121212−12]\displaystyle Q = \begin{bmatrix} \first{\vec{q}_1} & \second{\vec{q}_2} \end{bmatrix} = \begin{bmatrix} \first{\tfrac{1}{\sqrt{2}}} & \second{\tfrac{1}{\sqrt{2}}} \\ \first{\tfrac{1}{\sqrt{2}}} & \second{-\tfrac{1}{\sqrt{2}}} \end{bmatrix}
Substitute x⃗=Qu⃗\vec{x} = Q\vec{u} to remove the cross-termReplacing x⃗\vec{x} with Qu⃗Q\vec{u} turns QTAQQ^T \act{A} Q into the diagonal eigenvalue matrix Λ\Lambda, leaving pure squares weighted by λ1=3\first{\lambda_1 = 3} and λ2=−1\second{\lambda_2 = -1}.
x⃗TAx⃗=(Qu⃗)TA(Qu⃗)=u⃗T(QTAQ)⏟Λu⃗=[uw][300−1][uw]=3u2−1w2\displaystyle \begin{aligned} \vec{x}^T \act{A} \vec{x} &= (Q\vec{u})^T \act{A} (Q\vec{u}) \\ &= \vec{u}^T \underbrace{(Q^T \act{A} Q)}_{\Lambda} \vec{u} \\ &= \begin{bmatrix} \first{u} & \second{w} \end{bmatrix} \begin{bmatrix} \first{3} & 0 \\ 0 & \second{-1} \end{bmatrix} \begin{bmatrix} \first{u} \\ \second{w} \end{bmatrix} \\ &= \first{3u^2} - \second{1w^2} \end{aligned}
Convert back to xx and yy using u⃗=QTx⃗\vec{u} = Q^T\vec{x}Because QQ is orthogonal (Q−1=QTQ^{-1} = Q^T), each tilted coordinate is the dot product of x⃗\vec{x} with that unit eigenvector, rewriting f(x,y)\surf{f(x, y)} as pure squares in xx and yy.
[uw]=QTx⃗=[x+y2x−y2]  ⟹  f(x,y)=3(x+y2)2−1(x−y2)2=32(x+y)2−12(x−y)2\displaystyle \begin{aligned} \begin{bmatrix} \first{u} \\ \second{w} \end{bmatrix} &= Q^T\vec{x} = \begin{bmatrix} \first{\tfrac{x + y}{\sqrt{2}}} \\ \second{\tfrac{x - y}{\sqrt{2}}} \end{bmatrix} \\ \implies \surf{f(x, y)} &= \first{3\left(\frac{x + y}{\sqrt{2}}\right)^2} \\ &\quad - \second{1\left(\frac{x - y}{\sqrt{2}}\right)^2} \\ &= \first{\frac{3}{2}(x + y)^2} \\ &\quad - \second{\frac{1}{2}(x - y)^2} \end{aligned}
Once the cross-term is gone, the signs of the eigenvalues λ\lambda classify the surface in the exact same way the pure-square coefficients did:
All λ>0\lambda > 0Upward bowl (positive definite)
All λ<0\lambda < 0Upside-down bowl or dome (negative definite)
Mixed positive and negative λ\lambdaSaddle (indefinite)
At least one λ=0\lambda = 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×22 \times 2 matrix A\act{A}.

The 2×2 Determinant Shortcut
f=3x2−2xy+3y2f=x2+6xy+9y2f=4xy\displaystyle \begin{aligned} \surf{f} &= \first{3x^2} - 2xy + \second{3y^2} \\ \surf{f} &= \first{x^2} + 6xy + \second{9y^2} \\ \surf{f} &= 4xy \end{aligned}
shape\displaystyle \text{shape} =  ?\displaystyle = \;?

Because the determinant is the product of the two eigenvalues and the trace is their sum, a quick check classifies the symmetric matrix A=[ab2b2c]\act{A} = \begin{bmatrix} a & \tfrac{b}{2} \\ \tfrac{b}{2} & c \end{bmatrix} of ax2+bxy+cy2ax^2 + bxy + cy^2:

det⁡(A)=ac−b24=λ1⋅λ2,trace(A)=a+c=λ1+λ2\displaystyle \begin{aligned} \det(\act{A}) &= ac - \frac{b^2}{4} = \first{\lambda_1} \cdot \second{\lambda_2}, \\ \text{trace}(\act{A}) &= a + c = \first{\lambda_1} + \second{\lambda_2} \end{aligned}
Text solution
Classify f(x,y)=3x2−2xy+3y2\surf{f(x, y)} = \first{3x^2} - 2xy + \second{3y^2}Splitting −2xy-2xy into −1-1 and −1-1 gives a positive determinant and positive diagonal entries (+3+3), so both eigenvalues are positive and the surface is a tilted upward bowl (positive definite).
A=[3−1−13],det⁡(A)=(3)(3)−(−1)(−1)=9−1=+8>0\displaystyle \begin{aligned} \act{A} &= \begin{bmatrix} \first{3} & -1 \\ -1 & \second{3} \end{bmatrix}, \\ \det(\act{A}) &= (3)(3) - (-1)(-1) \\ &= 9 - 1 = +8 > 0 \end{aligned}
Classify f(x,y)=x2+6xy+9y2\surf{f(x, y)} = \first{x^2} + 6xy + \second{9y^2}Splitting 6xy6xy into 33 and 33 gives a determinant of 00 with positive diagonal entries, meaning one eigenvalue is zero and the surface is a tilted valley (positive semidefinite) that stays flat at height 00 along the line x+3y=0\missed{x + 3y = 0}.
A=[1339],det⁡(A)=(1)(9)−(3)(3)=0,x2+6xy+9y2=(x+3y)2\displaystyle \begin{aligned} \act{A} &= \begin{bmatrix} \first{1} & 3 \\ 3 & \second{9} \end{bmatrix}, \\ \det(\act{A}) &= (1)(9) - (3)(3) \\ &= 0, \\ \first{x^2} + 6xy + \second{9y^2} &= (\missed{x + 3y})^2 \end{aligned}
Classify f(x,y)=4xy\surf{f(x, y)} = 4xyWith no x2\first{x^2} or y2\second{y^2} terms, the diagonal entries are 00 and splitting 4xy4xy into 22 and 22 gives a negative determinant, so the eigenvalues have opposite signs and the surface is a saddle (indefinite) rotated by 45∘45^\circ.
A=[0220],det⁡(A)=(0)(0)−(2)(2)=−4<0\displaystyle \begin{aligned} \act{A} &= \begin{bmatrix} \first{0} & 2 \\ 2 & \second{0} \end{bmatrix}, \\ \det(\act{A}) &= (0)(0) - (2)(2) \\ &= -4 < 0 \end{aligned}
5

Slicing the Surface: Tilted Ellipses and Hyperbolas

Now suppose we slice a surface horizontally at height 11 by setting f(x,y)=1\surf{f(x, y)} = 1. We want to identify the level curve in the xyxy-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
3x2−2xy+3y2=1 ⁣: what curve?\surf{3x^2 - 2xy + 3y^2 = 1}\colon\ \text{what curve?}
xx
height 1\text{height } 1
Text solution
Rewrite the bowl slice 3x2−2xy+3y2=13x^2 - 2xy + 3y^2 = 1 in eigenvector coordinatesThe matrix A=[3−1−13]\act{A} = \begin{bmatrix} 3 & -1 \\ -1 & 3 \end{bmatrix} has eigenvalues λ1=2\first{\lambda_1 = 2} along q⃗1=[1212]\first{\vec{q}_1} = \first{\begin{bmatrix} \tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} \end{bmatrix}} and λ2=4\second{\lambda_2 = 4} along q⃗2=[12−12]\second{\vec{q}_2} = \second{\begin{bmatrix} \tfrac{1}{\sqrt{2}} \\ -\tfrac{1}{\sqrt{2}} \end{bmatrix}}, turning the slice into a tilted ellipse along the u\first{u} and w\second{w} axes.
3x2−2xy+3y2\displaystyle 3x^2 - 2xy + 3y^2 =1  ⟹  2u2+4w2\displaystyle = 1 \implies \first{2u^2} + \second{4w^2} =1\displaystyle = 1
Find the half-lengths of the ellipse axes from the eigenvaluesAlong the steeper w\second{w}-axis (λ2=4\second{\lambda_2 = 4}), the bowl climbs to height 11 in a shorter distance w=12\second{w} = \tfrac{1}{2}; along the gentler u\first{u}-axis (λ1=2\first{\lambda_1 = 2}), you have to walk further out to u=12\first{u} = \tfrac{1}{\sqrt{2}}, so the major (longer) axis points along [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and the minor (shorter) axis points along [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}}.
w=14=12 along [1−1],u=12 along [11]\displaystyle \begin{aligned} \second{w} &= \frac{1}{\sqrt{\second{4}}} = \frac{1}{2} \text{ along } \second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}}, \\ \first{u} &= \frac{1}{\sqrt{\first{2}}} \text{ along } \first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} \end{aligned}
Slice the saddle x2+4xy+y2=1x^2 + 4xy + y^2 = 1 at height 11Because the eigenvalues λ1=3\first{\lambda_1 = 3} and λ2=−1\second{\lambda_2 = -1} have opposite signs, the level curve is a tilted hyperbola that opens along the uphill eigenvector direction [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and never crosses the downhill axis [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}}.
x2+4xy+y2\displaystyle x^2 + 4xy + y^2 =1  ⟹  3u2−1w2\displaystyle = 1 \implies \first{3u^2} - \second{1w^2} =1\displaystyle = 1
2u2+4w2=1\htmlClass{lc-green}{2u^2} + \htmlClass{lc-pink}{4w^2} = 1
u\htmlClass{lc-green}{u}
w\htmlClass{lc-pink}{w}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
12\htmlClass{lc-green}{\frac{1}{\sqrt{2}}}
12\htmlClass{lc-pink}{\frac{1}{2}}
3u2−1w2=1\htmlClass{lc-green}{3u^2} - \htmlClass{lc-pink}{1w^2} = 1
u\htmlClass{lc-green}{u}
w\htmlClass{lc-pink}{w}
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}

Now see how changing an eigenvalue bends the parabola along its eigenvector axis, stretching a tilted ellipse into parallel lines when λ=0\lambda = 0 and opening it into a hyperbola when λ<0\lambda < 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⃗\vec{x} of length 11 on the unit circle x2+y2=1x^2 + y^2 = 1, we want to find the largest and smallest values that x⃗TAx⃗\vec{x}^T \act{A} \vec{x} can reach and which unit vectors achieve them.

Maximum and Minimum on the Unit Circle
x⃗TAx⃗=2u2+4w2\vec{x}^T \act{A} \vec{x} = \first{2u^2} + \second{4w^2}
on x2+y2=1 ⁣: largest? smallest?\text{on } x^2 + y^2 = 1\colon\ \text{largest? smallest?}
xx
yy
u\first{u}
w\second{w}
x⃗\vec{x}
Text solution
Rewrite the unit-circle constraint in tilted coordinatesBecause the orthogonal matrix QQ preserves vector lengths, x2+y2=1x^2 + y^2 = 1 becomes u2+w2=1\first{u^2} + \second{w^2} = 1, turning the quadratic form into a weighted average of λ1=2\first{\lambda_1 = 2} and λ2=4\second{\lambda_2 = 4}.
x⃗TAx⃗\displaystyle \vec{x}^T \act{A} \vec{x} =λ1u2+λ2w2\displaystyle = \first{\lambda_1 u^2} + \second{\lambda_2 w^2} =2u2+4w2,u2+w2=1⏟weights adding to 100%\displaystyle = \first{2u^2} + \second{4w^2}, \qquad \underbrace{\first{u^2} + \second{w^2} = 1}_{\text{weights adding to } 100\%}
Put 100%100\% of the weight on one eigenvalue at a timeSetting w=±1,u=0\second{w} = \pm 1, \first{u} = 0 gives the maximum λmax⁡=4\second{\lambda_{\max} = 4} along the steeper unit eigenvector ±q⃗2\pm\second{\vec{q}_2}, and setting u=±1,w=0\first{u} = \pm 1, \second{w} = 0 gives the minimum λmin⁡=2\first{\lambda_{\min} = 2} along the gentler unit eigenvector ±q⃗1\pm\first{\vec{q}_1}.
max⁡∥x⃗∥=1x⃗TAx⃗=λmax⁡=4 at x⃗=±[12−12],min⁡∥x⃗∥=1x⃗TAx⃗=λmin⁡=2 at x⃗=±[1212]\displaystyle \begin{aligned} \max_{\|\vec{x}\|=1} \vec{x}^T \act{A} \vec{x} &= \second{\lambda_{\max} = 4} \\ &\text{ at } \vec{x} = \pm\second{\begin{bmatrix} \tfrac{1}{\sqrt{2}} \\ -\tfrac{1}{\sqrt{2}} \end{bmatrix}}, \\ \min_{\|\vec{x}\|=1} \vec{x}^T \act{A} \vec{x} &= \first{\lambda_{\min} = 2} \\ &\text{ at } \vec{x} = \pm\first{\begin{bmatrix} \tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} \end{bmatrix}} \end{aligned}

Drag x⃗\vec{x} around the unit circle to see the weights u2\first{u^2} and w2\second{w^2} trade off between λmin⁡=2\first{\lambda_{\min} = 2} and λmax⁡=4\second{\lambda_{\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,zx, y, z, we build its 3×33 \times 3 symmetric matrix the same way, by putting the squared coefficients on the diagonal and splitting each cross-term in half, but the 2×22 \times 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\displaystyle \begin{aligned} &\surf{f(x, y, z)} = \first{2x^2} + \second{5y^2} + \third{3z^2} \\ &\qquad + 4xy - 6xz + 8yz \end{aligned}
A\displaystyle A =  ?\displaystyle = \;?

For example, f(x,y,z)=2x2+5y2+3z2+4xy\surf{f(x, y, z)} = \first{2x^2} + \second{5y^2} + \third{3z^2} + 4xy −6xz+8yz{}- 6xz + 8yz becomes:

f(x,y,z)=[xyz][22−3254−343][xyz]\displaystyle \surf{f(x, y, z)} = \begin{bmatrix} x & y & z \end{bmatrix} \begin{bmatrix} \first{2} & 2 & -3 \\ 2 & \second{5} & 4 \\ -3 & 4 & \third{3} \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix}

Now let's classify f(x,y,z)\surf{f(x, y, z)} =x2+y2+z2+4xy+4xz+4yz{}= \first{x^2} + \second{y^2} + \third{z^2} + 4xy + 4xz + 4yz and see why a single determinant can mislead us in 3D.

Text solution
Build the 3×33 \times 3 symmetric matrix AAPlace 1,1,1\first{1}, \second{1}, \third{1} on the main diagonal and split each +4+4 cross-term into 22 and 22.
A=[122212221]\displaystyle A = \begin{bmatrix} \first{1} & 2 & 2 \\ 2 & \second{1} & 2 \\ 2 & 2 & \third{1} \end{bmatrix}
Find all three eigenvalues from det⁡(A−λI)=0\det(A - \lambda I) = 0Subtracting λ=−1\lambda = -1 from the diagonal makes every row equal to [222]\begin{bmatrix} 2 & 2 & 2 \end{bmatrix}, giving a double eigenvalue λ2=−1,λ3=−1\second{\lambda_2 = -1}, \third{\lambda_3 = -1} along with λ1=5\first{\lambda_1 = 5}.
det⁡(A−λI)=−(λ−5)(λ+1)2=0  ⟹  λ1=5,λ2=−1,λ3=−1\displaystyle \begin{aligned} \det(A - \lambda I) &= -(\lambda - 5)(\lambda + 1)^2 \\ &= 0 \\ &\implies \first{\lambda_1 = 5}, \\ &\quad \second{\lambda_2 = -1}, \quad \third{\lambda_3 = -1} \end{aligned}
Classify the form and bound it on the unit sphere x2+y2+z2=1x^2 + y^2 + z^2 = 1Because the eigenvalues 5,−1,−1\first{5}, \second{-1}, \third{-1} have mixed signs, the form is an indefinite 3D saddle with maximum 55 and minimum −1-1 on the unit sphere, even though the diagonal entries are +1+1 and det⁡(A)=(5)(−1)(−1)=+5>0\det(A) = (\first{5})(\second{-1})(\third{-1}) = +5 > 0, where the two negative eigenvalues multiply to a positive number and hide the two downhill directions.
x⃗TAx⃗=5u12−u22−u32,max⁡∥x⃗∥=1x⃗TAx⃗=5,min⁡∥x⃗∥=1x⃗TAx⃗=−1\displaystyle \begin{aligned} \vec{x}^T A \vec{x} &= \first{5u_1^2} - \second{u_2^2} - \third{u_3^2}, \\ \max_{\|\vec{x}\|=1} \vec{x}^T A \vec{x} &= 5, \\ \min_{\|\vec{x}\|=1} \vec{x}^T A \vec{x} &= -1 \end{aligned}

Key concepts

When you look at a quadratic form, your first check is whether there are any cross-terms at all. If there is no xyxy term, don't build a matrix; read the shape straight from the signs of the pure squares, such as 2x2+3y2\first{2x^2} + \second{3y^2} (both positive →\to upward bowl, positive definite), 2x2−3y2\first{2x^2} - \second{3y^2} (opposite signs →\to saddle, indefinite), or 2x2+0y2\first{2x^2} + \second{0y^2} (one zero →\to 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\act{A} is symmetric (x2+4xy+y2\first{x^2} + 4xy + \second{y^2} becomes A=[1221]\act{A} = \begin{bmatrix} \first{1} & 2 \\ 2 & \second{1} \end{bmatrix} with x⃗TAx⃗=x⃗⋅Ax⃗\vec{x}^T \act{A} \vec{x} = \vec{x} \cdot \act{A\vec{x}}). What you do next depends on what the question asks:

Only classifying a 2×22 \times 2 form

Don't solve for the eigenvalues; check det⁡(A)=λ1λ2\det(\act{A}) = \first{\lambda_1}\second{\lambda_2}. A negative determinant (det⁡[0220]=−4<0\det\begin{bmatrix} 0 & 2 \\ 2 & 0 \end{bmatrix} = -4 < 0) means opposite eigenvalue signs and is immediately an indefinite saddle. A positive determinant (det⁡[3−1−13]=8>0\det\begin{bmatrix} 3 & -1 \\ -1 & 3 \end{bmatrix} = 8 > 0) means both eigenvalues share the sign of the diagonal entries (+3→+3 \to upward bowl, positive definite; negative diagonal →\to dome, negative definite). A zero determinant (det⁡[1339]=0\det\begin{bmatrix} 1 & 3 \\ 3 & 9 \end{bmatrix} = 0) means one eigenvalue is zero, and the form is a number times a single square, like (x+3y)2(\missed{x + 3y})^2, with a flat line at height 00.

Classifying a 3×33 \times 3 form

Do not use the single determinant det⁡(A)=λ1λ2λ3\det(A) = \first{\lambda_1}\second{\lambda_2}\third{\lambda_3}, because two negative eigenvalues multiply to a positive number (5(−1)(−1)=+5\first{5}(\second{-1})(\third{-1}) = +5) and make a saddle look like a bowl. Find all three eigenvalues and check their signs directly.

Un-rotating, slicing at height 11, 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=[q⃗1q⃗2]Q = \begin{bmatrix} \first{\vec{q}_1} & \second{\vec{q}_2} \end{bmatrix}. In tilted coordinates u⃗=QTx⃗\vec{u} = Q^T\vec{x}, the cross-term disappears to leave λ1u2+λ2w2\first{\lambda_1 u^2} + \second{\lambda_2 w^2}. Slicing a bowl at height 11 (λ1u2+λ2w2=1\first{\lambda_1 u^2} + \second{\lambda_2 w^2} = 1, such as 2u2+4w2=1\first{2u^2} + \second{4w^2} = 1) draws a tilted ellipse that reaches distance 1λ\tfrac{1}{\sqrt{\lambda}} along each eigenvector axis, so the steeper direction (larger λ=4\second{\lambda = 4}) gives the shorter half-length 12\tfrac{1}{2}, while the gentler direction (smaller λ=2\first{\lambda = 2}) gives the longer half-length 12\tfrac{1}{\sqrt{2}}. On the unit circle x2+y2=1x^2 + y^2 = 1, the weights u2+w2=1\first{u^2} + \second{w^2} = 1 average the eigenvalues, keeping x⃗TAx⃗\vec{x}^T \act{A} \vec{x} between λmin⁡\lambda_{\min} and λmax⁡\lambda_{\max}, which it reaches along the corresponding unit eigenvectors.

8

Practice

1

Write f(x,y)=−2x2+2xy−5y2\surf{f(x, y)} = \first{-2x^2} + 2xy \second{- 5y^2} in the form x⃗TAx⃗\vec{x}^T \act{A} \vec{x} with a symmetric matrix A\act{A}, and use the 2×22 \times 2 determinant shortcut to classify its 3D shape and definiteness.

Split the 2xy2xy coefficient evenly across the off-diagonal, then check the sign of det⁡(A)\det(\act{A}) first and the sign of the diagonal entries second.

Place −2\first{-2} and −5\second{-5} on the diagonal and split +2xy+2xy into 11 and 11:
x⃗TAx⃗=[xy][−211−5][xy]\displaystyle \vec{x}^T \act{A} \vec{x} = \begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} \first{-2} & 1 \\ 1 & \second{-5} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}
(Warning: Putting the unsplit 22 in both off-diagonal spots gives [−222−5]\begin{bmatrix} -2 & 2 \\ 2 & -5 \end{bmatrix} with det⁡=6\det = 6, and stopping after det⁡(A)>0\det(\act{A}) > 0 without checking the negative diagonal sign misclassifies the dome as a positive definite upward bowl.)
det⁡(A)\displaystyle \det(\act{A}) =(−2)(−5)−(1)(1)\displaystyle = (-2)(-5) - (1)(1) =10−1\displaystyle = 10 - 1 =9>0\displaystyle = 9 > 0
Since det⁡(A)=9>0\det(\act{A}) = 9 > 0, both eigenvalues have the same sign; because the top-left diagonal entry −2\first{-2} (and trace −7-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\surf{f(x, y)} = \first{-4x^2} + 12xy \second{- 9y^2} to classify its shape and definiteness, and find the line in the xyxy-plane along which the surface stays flat at height 00.

After finding det⁡(A)=0\det(\act{A}) = 0, factor out a minus sign to write f(x,y)\surf{f(x, y)} as the negative of a single squared expression −()2-( \quad )^2.

Place −4\first{-4} and −9\second{-9} on the diagonal and split +12xy+12xy into 66 and 66:
A=[−466−9],det⁡(A)=(−4)(−9)−(6)(6)=36−36=0\displaystyle \begin{aligned} \act{A} &= \begin{bmatrix} \first{-4} & 6 \\ 6 & \second{-9} \end{bmatrix}, \\ \det(\act{A}) &= (-4)(-9) - (6)(6) \\ &= 36 - 36= 0 \end{aligned}
Because det⁡(A)=0\det(\act{A}) = 0 and the diagonal entries are negative, the surface is a ridge, negative semidefinite. Factoring out the minus sign gives:
f(x,y)\displaystyle \surf{f(x, y)} =−(4x2−12xy+9y2)\displaystyle = -(\first{4x^2} - 12xy + \second{9y^2}) =−(2x−3y)2\displaystyle = -(\missed{2x - 3y})^2
(Warning: Keeping +12xy+12xy unchanged inside the parentheses after factoring out the minus sign gives −(2x+3y)2-(2x + 3y)^2 and the wrong line 2x+3y=02x + 3y = 0.)
The height stays at 00 along the line 2x−3y=0\missed{2x - 3y = 0} (or y=23x\missed{y = \frac{2}{3}x}).
3

For f(x,y)=5x2+4xy+2y2\surf{f(x, y)} = 5x^2 + 4xy + 2y^2, find the eigenvalues and unit eigenvectors of its symmetric matrix A\act{A}, write the quadratic form in tilted coordinates u⃗=QTx⃗\vec{u} = Q^T\vec{x}, and use u\first{u} and w\second{w} to rewrite f(x,y)\surf{f(x, y)} in terms of xx and yy as pure squares.

Once you find the eigenvectors of A=[5222]\act{A} = \begin{bmatrix} 5 & 2 \\ 2 & 2 \end{bmatrix}, remember to divide each eigenvector by its length 5\sqrt{5} before computing u⃗=QTx⃗\vec{u} = Q^T\vec{x}.

Build A\act{A} and solve det⁡(A−λI)=0\det(\act{A} - \lambda I) = 0:
A=[5222],det⁡(A−λI)=(5−λ)(2−λ)−4=λ2−7λ+6=(λ−6)(λ−1)=0\displaystyle \begin{aligned} \act{A} &= \begin{bmatrix} 5 & 2 \\ 2 & 2 \end{bmatrix}, \\ \det(\act{A} - \lambda I) &= (5 - \lambda)(2 - \lambda) - 4 \\ &= \lambda^2 - 7\lambda + 6 \\ &= (\first{\lambda - 6})(\second{\lambda - 1}) = 0 \end{aligned}
The eigenvalues are λ1=6\first{\lambda_1 = 6} (with eigenvector [21]\first{\begin{bmatrix} 2 \\ 1 \end{bmatrix}}) and λ2=1\second{\lambda_2 = 1} (with eigenvector [1−2]\second{\begin{bmatrix} 1 \\ -2 \end{bmatrix}}). Dividing by their length 22+12=5\sqrt{2^2 + 1^2} = \sqrt{5} gives the unit eigenvectors:
q⃗1=[2515],q⃗2=[15−25]\displaystyle \begin{aligned} \first{\vec{q}_1} &= \first{\begin{bmatrix} \tfrac{2}{\sqrt{5}} \\ \tfrac{1}{\sqrt{5}} \end{bmatrix}}, \\ \second{\vec{q}_2} &= \second{\begin{bmatrix} \tfrac{1}{\sqrt{5}} \\ -\tfrac{2}{\sqrt{5}} \end{bmatrix}} \end{aligned}
In tilted coordinates u⃗=QTx⃗\vec{u} = Q^T\vec{x}, we have u=2x+y5\first{u} = \first{\frac{2x + y}{\sqrt{5}}} and w=x−2y5\second{w} = \second{\frac{x - 2y}{\sqrt{5}}}.
(Warning: Skipping the 15\frac{1}{\sqrt{5}} length division and plugging u=2x+y\first{u} = 2x + y and w=x−2y\second{w} = x - 2y into 6u2+w2\first{6u^2} + \second{w^2} gives 6(2x+y)2+(x−2y)26(2x + y)^2 + (x - 2y)^2 =25x2+20xy+10y2{}= 25x^2 + 20xy + 10y^2, which is 55 times too large.)
f(x,y)=6u2+w2=6(2x+y5)2+(x−2y5)2=65(2x+y)2+15(x−2y)2\displaystyle \begin{aligned} \surf{f(x, y)} &= \first{6u^2} + \second{w^2} \\ &= \first{6\left(\frac{2x + y}{\sqrt{5}}\right)^2} + \second{\left(\frac{x - 2y}{\sqrt{5}}\right)^2} \\ &= \first{\frac{6}{5}(2x + y)^2} + \second{\frac{1}{5}(x - 2y)^2} \end{aligned}
4

Slice the surfaces f(x,y)=5x2+8xy+5y2\surf{f(x, y)} = 5x^2 + 8xy + 5y^2 and g(x,y)=2x2−6xy+2y2\surf{g(x, y)} = 2x^2 - 6xy + 2y^2 at height 11. (a) For 5x2+8xy+5y2=15x^2 + 8xy + 5y^2 = 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)\surf{g(x, y)} is a saddle despite having +2x2+2x^2 and +2y2+2y^2, and state what curve 2x2−6xy+2y2=12x^2 - 6xy + 2y^2 = 1 draws and which direction it opens along.

Both symmetric matrices have equal numbers on the diagonal, so their eigenvectors point along [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}}; think about whether the steeper or gentler eigenvalue reaches height 11 first.

(a)For A=[5445]\act{A} = \begin{bmatrix} 5 & 4 \\ 4 & 5 \end{bmatrix}, testing [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}} gives eigenvalues λ1=9\first{\lambda_1 = 9} along [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and λ2=1\second{\lambda_2 = 1} along [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}}:
5x2+8xy+5y2\displaystyle 5x^2 + 8xy + 5y^2 =1  ⟹  9u2+w2\displaystyle = 1 \implies \first{9u^2} + \second{w^2} =1\displaystyle = 1
(Warning: Matching the larger eigenvalue λ1=9\first{\lambda_1 = 9} to the major axis swaps the major and minor directions, and forgetting the square root in 1λ\tfrac{1}{\sqrt{\lambda}} gives half-length 19\tfrac{1}{9} instead of 13\tfrac{1}{3}.)
The curve is a tilted ellipse whose major (longer) axis points along the gentler direction [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}} with half-length 11=1\tfrac{1}{\sqrt{\second{1}}} = 1, and whose minor (shorter) axis points along the steeper direction [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} with half-length 19=13\tfrac{1}{\sqrt{\first{9}}} = \tfrac{1}{3}.
(b)For B=[2−3−32]\act{B} = \begin{bmatrix} 2 & -3 \\ -3 & 2 \end{bmatrix}, the determinant is negative:
det⁡(B)\displaystyle \det(\act{B}) =(2)(2)−(−3)(−3)\displaystyle = (2)(2) - (-3)(-3) =4−9\displaystyle = 4 - 9 =−5<0\displaystyle = -5 < 0
Even though g(x,y)\surf{g(x, y)} curves up along the xx and yy axes, walking along the diagonal y=xy = x gives g(x,x)=2x2−6x2+2x2=−2x2\surf{g(x, x)} = 2x^2 - 6x^2 + 2x^2 = \missed{-2x^2}, which drops downhill. Its eigenvalues are λ1=−1\first{\lambda_1 = -1} along [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}} and λ2=5\second{\lambda_2 = 5} along [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}}, giving −u2+5w2=1\first{-u^2} + \second{5w^2} = 1: a tilted hyperbola opening along [1−1]\second{\begin{bmatrix} 1 \\ -1 \end{bmatrix}} and never crossing [11]\first{\begin{bmatrix} 1 \\ 1 \end{bmatrix}}.
5

Find the maximum and minimum values of f(x,y)=3x2+8xy−3y2\surf{f(x, y)} = 3x^2 + 8xy - 3y^2 for unit vectors on the circle x2+y2=1x^2 + y^2 = 1, together with the unit vectors x⃗\vec{x} that achieve them. What value does f(x,y)\surf{f(x, y)} take at a unit vector whose tilted coordinates put 25%25\% of the weight on the positive eigenvalue's axis (u2=0.25\first{u^2} = 0.25) and 75%75\% on the negative eigenvalue's axis (w2=0.75\second{w^2} = 0.75)?

Find the eigenvalues and unit eigenvectors of A=[344−3]\act{A} = \begin{bmatrix} 3 & 4 \\ 4 & -3 \end{bmatrix}, then compute the weighted average λ1u2+λ2w2\first{\lambda_1 u^2} + \second{\lambda_2 w^2}.

Set up the symmetric matrix A\act{A} and find its eigenvalues:
A=[344−3],det⁡(A−λI)=(3−λ)(−3−λ)−16=λ2−25=0  ⟹  λmax⁡=5,λmin⁡=−5\displaystyle \begin{aligned} & \act{A} = \begin{bmatrix} 3 & 4 \\ 4 & -3 \end{bmatrix}, \\ & \det(\act{A} - \lambda I) \\ &\quad = (3 - \lambda)(-3 - \lambda) - 16 \\ &\quad = \lambda^2 - 25 = 0 \\ &\quad \implies \first{\lambda_{\max} = 5}, \quad \second{\lambda_{\min} = -5} \end{aligned}
On the unit circle, the maximum value is 55, achieved at the unit eigenvectors x⃗=±[2515]\vec{x} = \pm\first{\begin{bmatrix} \tfrac{2}{\sqrt{5}} \\ \tfrac{1}{\sqrt{5}} \end{bmatrix}}, and the minimum value is −5-5, achieved at x⃗=±[15−25]\vec{x} = \pm\second{\begin{bmatrix} \tfrac{1}{\sqrt{5}} \\ -\tfrac{2}{\sqrt{5}} \end{bmatrix}}.
(Warning: Squaring the weights u2=0.25\first{u^2} = 0.25 and w2=0.75\second{w^2} = 0.75 a second time in λ1u2+λ2w2\first{\lambda_1 u^2} + \second{\lambda_2 w^2} gives 5(0.25)2+(−5)(0.75)2=−2.55(0.25)^2 + (-5)(0.75)^2 = -2.5 only by coincidence here; the weights u2\first{u^2} and w2\second{w^2} are already squared.)
f(x,y)\displaystyle \surf{f(x, y)} =5(0.25)+(−5)(0.75)\displaystyle = \first{5(0.25)} + \second{(-5)(0.75)} =1.25−3.75\displaystyle = 1.25 - 3.75 =−2.5\displaystyle = -2.5
6

At a point where a surface is flat, the second derivatives give the quadratic form f(x,y)=4x2+kxy+9y2\surf{f(x, y)} = \first{4x^2} + kxy + \second{9y^2} for the shape of the surface nearby. For which values of kk 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?

Split kxykxy into k2\tfrac{k}{2} and k2\tfrac{k}{2} in the symmetric matrix A\act{A}, then check when det⁡(A)\det(\act{A}) is positive, zero, or negative.

Build the symmetric matrix A\act{A} and compute its determinant:
A=[4k2k29],det⁡(A)=(4)(9)−(k2)2=36−k24\displaystyle \begin{aligned} \act{A} &= \begin{bmatrix} \first{4} & \tfrac{k}{2} \\ \tfrac{k}{2} & \second{9} \end{bmatrix}, \\ \det(\act{A}) &= (4)(9) - \left(\frac{k}{2}\right)^2 = 36 - \frac{k^2}{4} \end{aligned}
(Warning: Putting kk instead of k2\tfrac{k}{2} in the off-diagonal cells gives det⁡=36−k2\det = 36 - k^2, which misses the cutoffs by a factor of 22 and gives ±6\pm 6 instead of ±12\pm 12.)
Because the diagonal entries 4\first{4} and 9\second{9} are positive:
Bottom of a bowl (positive definite, local minimum)det⁡(A)=36−k24>0\det(\act{A}) = 36 - \frac{k^2}{4} > 0   ⟹  −12<k<12{}\implies -12 < k < 12
Valley (positive semidefinite)det⁡(A)=36−k24=0  ⟹  k=±12\det(\act{A}) = 36 - \frac{k^2}{4} = 0 \implies k = \pm 12
Saddle (indefinite)det⁡(A)=36−k24<0  ⟹  k\det(\act{A}) = 36 - \frac{k^2}{4} < 0 \implies k <−12 or k>12{}< -12 \text{ or } k > 12
7

Write f(x,y,z)=x2+y2+z2+6xy−6xz−6yz\surf{f(x, y, z)} = \first{x^2} + \second{y^2} + \third{z^2} + 6xy - 6xz - 6yz as x⃗TAx⃗\vec{x}^T A \vec{x} with a 3×33 \times 3 symmetric matrix AA. Find all three eigenvalues of AA (hint: check what happens to the rows of A−λIA - \lambda I when λ=−2\lambda = -2), classify the 3D form, give its maximum and minimum on the unit sphere x2+y2+z2=1x^2 + y^2 + z^2 = 1, and explain why det⁡(A)>0\det(A) > 0 with positive diagonal entries does not make f\surf{f} positive definite.

Put 1,1,1\first{1}, \second{1}, \third{1} on the diagonal and split +6,−6,−6+6, -6, -6 in half; once λ=−2\lambda = -2 makes all three rows of A−λIA - \lambda I multiples of the same row, multiply AA by [11−1]\begin{bmatrix} 1 \\ 1 \\ -1 \end{bmatrix} to find the third eigenvalue.

Place 1,1,1\first{1}, \second{1}, \third{1} on the main diagonal and split the cross-terms +6xy,−6xz,−6yz+6xy, -6xz, -6yz into +3,−3,−3+3, -3, -3:
A=[13−331−3−3−31]\displaystyle A = \begin{bmatrix} \first{1} & 3 & -3 \\ 3 & \second{1} & -3 \\ -3 & -3 & \third{1} \end{bmatrix}
Subtracting λ=−2\lambda = -2 from the diagonal makes every row a multiple of [11−1]\begin{bmatrix} 1 & 1 & -1 \end{bmatrix}:
A−(−2)I=[33−333−3−3−33]  ⟹  λ2=−2,λ3=−2\displaystyle A - (-2)I = \begin{bmatrix} 3 & 3 & -3 \\ 3 & 3 & -3 \\ -3 & -3 & 3 \end{bmatrix} \implies \second{\lambda_2 = -2}, \quad \third{\lambda_3 = -2}
Multiplying AA by [11−1]\first{\begin{bmatrix} 1 \\ 1 \\ -1 \end{bmatrix}} gives [77−7]=7[11−1]\begin{bmatrix} 7 \\ 7 \\ -7 \end{bmatrix} = \first{7}\first{\begin{bmatrix} 1 \\ 1 \\ -1 \end{bmatrix}}, so the third eigenvalue is λ1=7\first{\lambda_1 = 7}.
(Warning: Applying the 2×22 \times 2 determinant rule to det⁡(A)=(7)(−2)(−2)=+28>0\det(A) = (\first{7})(\second{-2})(\third{-2}) = +28 > 0 with +1+1 diagonal entries falsely classifies the 3D saddle as positive definite.)
Because the eigenvalues 7,−2,−2\first{7}, \second{-2}, \third{-2} have mixed signs, the form is indefinite (a 3D saddle), with maximum 77 and minimum −2-2 on the unit sphere x2+y2+z2=1x^2 + y^2 + z^2 = 1; even though the diagonal entries are +1+1 and det⁡(A)=+28>0\det(A) = +28 > 0, the two negative eigenvalues multiply to a positive number and hide the two downhill directions.