Problem Set 9: symmetric and positive definite matrices
Seven problems of our own on Lectures 25 and 27: the spectral theorem and a sum of projections, why the eigenvalues of a symmetric matrix are real and its eigenvectors perpendicular, counting eigenvalues by the signs of pivots, the tests for positive definiteness on a matrix with a parameter, completing the square, the ellipse of a quadratic form, and the second-derivative test for a minimum.
MIT's 18.06 problem sets assign exercises from a textbook that is not openly licensed, so this set is made of our own problems on the same lectures, in MIT's lecture order. No MIT or textbook problem is used: every matrix and every number below is ours, and so are the hints and the solutions. The formulas come from the lessons and from the lecture transcripts they cite.
Work each problem on paper first. Then type or choose your result in the answer box and press Check.
Give a number answer to 3 significant figures and keep 4 in intermediate steps; an answer with only 2 significant figures may or may not be accepted. Where a box needs more digits, its label says so.
A number box wants a decimal number, not a fraction or a root: write 0.25, not 1/4. Every number box accepts any value within 0.01 of the exact one, so give at least two decimal places when the answer is not a whole number. A matrix cannot be typed: a box asks for one of its entries, an eigenvalue, a pivot, a determinant or a count, or you choose from a list. Entries are numbered by row, then column, starting from 1 (so p12 is in the first row, second column).
A formula box takes plain typing, for example (a + 1)/sqrt(2*a), and accepts every correct way of writing the answer. Type sqrt( ) for a square root and ^ for a power.
Some parts ask you to show something. They have no answer box: write your argument, then open the solution and mark yourself. MIT gives no points for these problems: the points here (100 in all) and their split between the parts are ours. If you are stuck, open the hints one at a time. Each part ends with its full solution. Try before you open it: an answer given after its solution was opened earns no points. Your score is kept in this browser only.
(1) λ1>0,λ2>0(2) a>0,ac−b2>0(3) pivots a>0,aac−b2>0(4) xTAx>0 for all x=0
In words
(1) lambda one greater than 0, lambda two greater than 0 (2) a greater than 0, a c minus b squared greater than 0 (3) pivots a greater than 0, the quantity a c minus b squared, all over a greater than 0 (4) x^ capital T capital A x greater than 0 for all x is not equal to 0
So the eigenvalues are 7 and −3, real, as they must be for a symmetric matrix.
Check
7+(−3)=4 is the trace and 7⋅(−3)=−21 is the determinant.
(b)4 points
Let q1 be the unit eigenvector for the larger eigenvalue, with positive components, and P1=q1q1T. Give the entry p12 of P1. Then show that A=λ1P1+λ2P2, with P2=q2q2T for a unit eigenvectorq2 of the other eigenvalue, and that P1+P2=I (these two steps have no box).
Hint
Solve (A−λI)x=0 for each eigenvalue: one row of A−λI is enough for a 2×2 matrix. Then divide by the length.
Hint
Each entry of q1q1T is a product of two components of q1: the entry in row 1, column 2 is the first component times the second. The two unit eigenvectors are perpendicular, so they are the columns of an orthogonal matrix Q, and QQT=I.
Solution
The idea. Unit eigenvectors give the projections; the spectral sum puts them back together.
The eigenvectors
For λ1=7: A−7I=(−244−8), whose first row gives x1=2x2, so the eigenvector is along (2,1). For λ2=−3: A+3I=(8442) gives (1,−2). They are perpendicular, 2−2=0. Both have length 5, so q1=(2,1)/5 and q2=(1,−2)/5.
The projections
The two projection matrices
P1=q1q1T=51(4221),P2=q2q2T=51(1−2−24)
In words
capital P one equals q one q one ^ capital T equals one fifth 4 2; 2 1, capital P two equals q two q two ^ capital T equals one fifth 1 minus 2; minus 2 4
capital A cubed equals 7 cubed capital P one plus (-3) cubed capital P two, ( capital A cubed ) sub 12 equals 343 times two fifths plus (-27) times (- two fifths ) equals 137.2 plus 10.8 equals 148
The idea. Elimination gives the pivots; their signs are the signs of the eigenvalues.
Elimination
Subtract 4/5 of row 1 from row 2: the second pivot is −1−54⋅4=−1−516=−521=−4.2.
The kind of matrix
One pivot is positive and one negative, like the eigenvalues 7 and −3: xTAx takes both signs, so A is indefinite. Along q1 the form is 7 times a square, along q2 it is −3 times a square: a saddle.
Check
5⋅(−4.2)=−21=detA=7⋅(−3). At x=(0,1), xTAx=−1<0, and at x=(1,0) it is 5>0.
For the symmetricmatrix(abbc), the eigenvalues are λ=21(a+c±Δ) with Δ=(trace)2−4det. Write Δ as a formula in a, b and c.
Hint
The trace is a+c and the determinant ac−b2. Multiply out and collect.
Solution
The idea. The trace and the determinant give Δ; then the cross term 2ac combines with −4ac.
Multiplying out
The discriminant
Δ=(a+c)2−4(ac−b2)=a2+2ac+c2−4ac+4b2=(a−c)2+4b2
In words
capital delta equals the quantity a plus c, all squared minus 4 the quantity a c minus b squared, equals a squared plus 2 a c plus c squared minus 4 a c plus 4 b squared equals the quantity a minus c, all squared plus 4 b squared
For a=c and b=0 (a multiple of I) it gives 0: one repeated eigenvalue, as it should.
(b)3 points
Use part (a) to show that the eigenvalues of a real symmetric2×2matrix are always real, and that they are equal only when the matrix is a multiple of the identity.
This part has no answer box. Write your argument, then open the solution and mark yourself.
Hint
A sum of squares of real numbers is never negative. When is it zero?
Solution
The idea. The number under the root is a sum of squares.
Real roots
(a−c)2≥0 and 4b2≥0, so Δ≥0 and Δ is real: both eigenvalues are real.
Equal roots
The eigenvalues are equal exactly when Δ=0, which needs both squares to vanish: a=c and b=0. Then the matrix is aI.
Check
A matrix that is not symmetric can fail: for (0−110) the trace is 0 and the determinant 1, so Δ=−4<0, and the eigenvalues are not real.
(c)3 points
Let A be a real symmetricn×nmatrix with Ax=λ1x and Ay=λ2y, where λ1=λ2. Show that yTx=0.
This part has no answer box. Write your argument, then open the solution and mark yourself.
Hint
Compute the number yTAx in two ways: once using Ax=λ1x, once by moving A onto y.
Solution
The idea. In yTAx the matrix can act on either vector, because AT=A.
Two ways
On one side yTAx=yT(λ1x)=λ1yTx. On the other, yTA=yTAT=(Ay)T=λ2yT, so yTAx=λ2yTx:
Comparing the two
λ1yTx=λ2yTx⇒(λ1−λ2)yTx=0
In words
lambda one y^ capital T x equals lambda two y^ capital T x which gives the quantity lambda one minus lambda two, y^ capital T x equals 0
Since λ1=λ2, yTx=0. This is the same device as Lecture 25's proof that the eigenvalues are real, which compares xˉTAx computed two ways (transcript, pp. 6–7).
Check
In Problem 1 the eigenvectors (2,1) and (1,−2) for 7 and −3 have dot product 2−2=0.
(d)3 points
The matrixB=(1141) is not symmetric. Its eigenvalues are real (check it). Find an eigenvector for each, and give the absolute value of the cosine of the angle between them.
Hint
cosθ=∥u∥∥v∥uTv. The sign depends on which way each eigenvector points, so the box asks for the absolute value.
Solution
The idea. Without symmetry the argument of part (c) breaks down, and the eigenvectors need not be perpendicular.
Eigenvalues and eigenvectors
The trace is 2 and the determinant 1−4=−3: λ2−2λ−3=(λ−3)(λ+1), real eigenvalues 3 and −1. B−3I=(−214−2) gives u=(2,1); B+I=(2142) gives v=(2,−1).
The angle
Angle between the eigenvectors
cosθ=∥u∥∥v∥uTv=554−1=53=0.6
In words
cos theta equals u^ capital T v over the quantity the norm of u the norm of v, equals the quantity 4 minus 1, all over the quantity the square root of 5 the square root of 5, equals three fifths equals 0.6
By cofactors along the first row: 2(15−1)−4(12+2)+(−2)(4+10)=28−56−28=−56. A negative determinant fits an odd number of negative eigenvalues.
(c)4 points
How many eigenvalues of S are greater than 3? Answer with the pivots of S−3I.
Hint
The eigenvalues of S−3I are those of S minus 3. So positive eigenvalues of S−3I are eigenvalues of S above 3.
Solution
The idea. Shift, then count positive pivots, as Lecture 25 suggests with A−7I (transcript, p. 14).
Elimination on S − 3I
S−3I=−14−2421−210. The first pivot is −1. Row 2 plus 4× row 1 gives (0,18,−7); row 3 minus 2× row 1 gives (0,−7,4). The second pivot is 18, and the third is 4−1849=1823.
The count
Pivots −1, 18, 1823: two positive. So S−3I has two positive eigenvalues, and S has two eigenvalues greater than 3.
Check
The product of the pivots, −1⋅18⋅1823=−23, must be det(S−3I). Cofactors along the first row: −1(0−1)−4(0+2)+(−2)(4+4)=1−8−16=−23.
(d)4 points
Elimination on S+2I gives the pivots4, 3 and 1. What does this say about S+2I? Then compute the eigenvalues of S to check parts (b) to (d) (this check has no box).
Hint
All pivots of a symmetric matrix positive: which test is that?
Hint
For the check, use the characteristic polynomial λ3−(traceS)λ2+Eλ−detS, where E is the sum of the three 2×2 determinants on the diagonal of S. One of its roots is a whole number.
Solution
The idea. Positive pivots of a symmetric matrix mean positive definite; for S+2I it says every eigenvalue of S is above −2.
The test
S+2I is symmetric with all three pivots positive, so it is positive definite (Lecture 25 transcript, pp. 15–16). Its eigenvalues, those of S plus 2, are all positive: every eigenvalue of S is greater than −2.
The eigenvalues of S
The trace is 10, the three 2×2 determinants on the diagonal add to E=(10−16)+(6−4)+(15−1)=10, and detS=−56:
Characteristic polynomial of S
λ3−10λ2+10λ+56=(λ−4)(λ2−6λ−14)=0,λ=4,3±23
In words
lambda cubed minus 10 lambda squared plus 10 lambda plus 56 equals the quantity lambda minus 4, the quantity lambda squared minus 6 lambda minus 14, equals 0, lambda equals 4, 3 plus or minus the square root of 23
Numerically λ≈−1.80, 4 and 7.80. The root 4 has the eigenvector (−1,1,3): S(−1,1,3)=(−4,4,12).
Check
Two eigenvalues are positive (part b); their product is 4⋅(9−23)=−56 (part b); two of them, 4 and 7.80, are above 3 (part c); all three are above −2 (part d).
The smallest, for b>0, is 3−2b, with eigenvector (1,−2,1).
Check
The sum is 9, the trace. The product is 3(9−2b2)=27−6b2, the determinant of part (a). And 3−2b>0 exactly when b<3/2: the eigenvalue test agrees with part (b).
Each pivot is the ratio of two neighbouring upper-left determinants.
Solution
The idea. The product of the first pivots is the upper-left determinant of the same size, so each pivot after the first is an upper-left determinant divided by the one before it.
The pivots
For b=2 the determinants are 3, 5 and 3, so the pivots are 3, 35 and 53=0.6. All positive, as part (b) requires for b=2<2.12.
Check
Elimination: row 2 minus 32 row 1 leaves (0,3−34,2)=(0,35,2); row 3 minus 56 of that leaves 3−56⋅2=53.
The determinant 4⋅5−36=−16 is negative, so one eigenvalue is positive and one negative: f is a saddle, and the cut at height 1 is a hyperbola (Lecture 27 transcript, p. 12). Completing the square gives 4(x+23y)2−4y2=1, a difference of squares.
Check
f(1,0)=4>0 and f(3,−2)<0: both signs occur.
(d)3 points
For the borderline value of c from part (a), where is f(x,y)=0?
Hint
Complete the square again with this c: what is left over after 4(x+my)2?
Solution
The idea. At the borderline the matrix is singular: positive semidefinite, with a whole line where the form is zero.
The square
With c=9 nothing is left over: 4x2+12xy+9y2=4(x+23y)2=(2x+3y)2. It is zero exactly on the line 2x+3y=0.
Check
(3,−2) is on that line, and f(3,−2)=36−72+36=0. The vector (3,−2) is in the nullspace of (4669): 12−12=0 and 18−18=0, so its eigenvalue is 0.
In the eigenvector coordinates the ellipse is 4X2+16Y2=16, or 4X2+Y2=1: half-lengths 2 and 1.
(c)3 points
In which direction does the longer axis point?
Hint
Find the eigenvector of the eigenvalue that belongs to the longer axis.
Solution
The idea. The longer axis belongs to the smaller eigenvalue, 4.
The eigenvector
A−4I=(6666) sends (1,−1) to (6−6,6−6)=0. So the longer axis lies along (1,−1), and the shorter along the perpendicular direction (1,1), the eigenvector for 16.
Check
The point 2(1,−1)/2=(2,−2) should lie on the curve. With x2=2, xy=−2 and y2=2: 10⋅2+12⋅(−2)+10⋅2=20−24+20=16.
(d)3 points
The area of an ellipse is π times the product of its two half-lengths. Find the area enclosed by the curve.
Hint
The half-lengths come from part (b).
Solution
The idea. Multiply the two half-lengths and π.
The area
π⋅2⋅1=2π≈6.28.
Check
In general the half-lengths are 4/λ1 and 4/λ2, so the area is 16π/λ1λ2=16π/detA=16π/8=2π.
The second gives y=x; then 3x2−6x=3x(x−2)=0, so x=0 or x=2. The points are (0,0) and (2,2).
Check
At (2,2): fx=12−12=0 and fy=−12+12=0.
(b)6 points
At the point found in (a), with x>0, find the matrix of second derivatives. Give fxx and the determinant of that matrix, say what kind of point it is, and give the value of f there.
Hint
fxx=6x; the other two second derivatives are constants.
Hint
Use the 2×2 test: first entry and determinant.
Solution
The idea. Zero first derivatives plus a positive definite matrix of second derivatives give a minimum (Lecture 27 transcript, pp. 14–15).
The second derivatives
fxx=6x, fxy=fyx=−6 and fyy=6. At (2,2):
The matrix at (2, 2)
(12−6−66),12>0,12⋅6−36=36>0
In words
12 minus 6; minus 6 6, 12 greater than 0, 12 times 6 minus 36 equals 36 greater than 0
The matrix is positive definite, so (2,2) is a local minimum. It is not the lowest point overall: x3 goes to −∞ as x→−∞.
The value
f(2,2)=8−24+12=−4.
Check
Nearby, f(2.1,2)=9.261−25.2+12=−3.939 and f(2,2.1)=8−25.2+13.23=−3.97, both above −4.
(c)4 points
What kind of point is the origin?
Hint
Here fxx=0, so look at the determinant of the matrix of second derivatives.
Solution
The idea. A negative determinant means one positive and one negative eigenvalue: the matrix is indefinite.
The test
At (0,0) the matrix is (0−6−66) with determinant 0−36=−36<0. Its eigenvalues have product −36, so they have opposite signs: the origin is a saddle point.
Check
Along the line y=x near the origin, f(t,t)=t3−3t2<0 for small t=0; along the y axis, f(0,t)=3t2>0. So f goes down in one direction and up in another.
A number measuring distance along a unit eigenvector, x = tq; in the check of Problem 7(c), a small number giving points (t, t) and (0, t) near the origin. Say it: “t”.
A function of x and y: in the reminders a general one, in Problem 5 the quadratic form 4x² + 12xy + cy², in Problem 7 the function x³ − 6xy + 3y². Say it: “f”.
Unchanged by some swap, reflection or turn; for an expression in two quantities, unchanged when they are exchanged. Explained in Introduction to Fourier series.
A rectangular table of numbers, which acts on vectors to give new ones and so describes a linear change of coordinates. Explained in Planes through three points, and matrices.
Of a symmetric matrix or quadratic form: always giving a positive value for any nonzero input; equivalently, all its eigenvalues are positive. Explained in Symmetric matrices and positive definiteness.
A fast method for multiplying by the Fourier matrix, splitting the work in halves again and again, so n log n steps replace n². Explained in Complex matrices and the fast Fourier transform.
A single number worked out from a square array of numbers (a matrix), which measures how the matrix stretches areas or volumes. Explained in Determinants and the cross product.
An expression in which every term has degree two, such as ax² + 2bxy + cy², written xᵀAx with a symmetric matrix A. Explained in Positive definite matrices and minima.
An open curve with two separate branches: the set of points whose distances from two fixed points differ by the same amount. Explained in Quadratics and power laws.
A closed surface like a ball stretched or squashed along three perpendicular directions; every flat slice through it is an ellipse. Explained in Positive definite matrices and minima.
A square matrix whose columns are perpendicular unit vectors; it rotates or reflects without changing lengths, and its inverse is its transpose. Explained in Orthogonal matrices and Gram–Schmidt.
A way of multiplying two vectors that gives a third vector, at right angles to both, as long as the area of their parallelogram. Explained in Torque and the cross product.
A list of numbers written as a column, or more generally anything that can be added and multiplied by numbers. Explained in Orthogonal vectors and subspaces.
A way of multiplying two vectors that gives a number: multiply matching components and add, or lengths times the cosine of the angle between them. Explained in Vectors and the dot product.
A minor of a matrix with a plus or minus sign attached, following a checkerboard of signs that starts with plus in the top-left corner. Explained in Planes through three points, and matrices.
The polynomial whose roots are the eigenvalues of a matrix, found as the determinant of the matrix minus λ times the identity. Explained in Diagonalisation and powers of A.
In a square matrix, the entries running from the top left corner to the bottom right; a diagonal matrix has zeros everywhere else. Explained in The four fundamental subspaces.
Of a square matrix: having no inverse, because its determinant is zero and some nonzero vector is sent to zero. Explained in The geometry of linear equations.
To take a value directly from a graph, table or formula, without further calculation.
Tap or click a word, here or in the text, for its meaning in this lesson. All words: the glossary. How many words are marked in the text: Reading options (the “Aa” button).