Algebra

The polynomial whose roots are the stretches

Finding the directions a map leaves alone means finding the numbers at which it crushes something to nothing. Those numbers are the roots of one quadratic, and everything the map does is written in its two coefficients.

Worth reading first: The directions a map leaves alone · A matrix is a picture of what happens to the grid.

A linear map turns almost every arrow it is handed. A few it leaves pointing where they started, longer or shorter but not turned, and those few decide what the map is like at large scale. That essay found them by looking: unit arrows were drawn, their images were drawn beside them, and the directions where the two were parallel were marked.

Looking does not scale, and looking cannot be trusted at the boundary. What is wanted is an equation.

The polynomial whose roots are the stretches. The determinant of A − λI plotted against λ for the map [2, 1, 1, 2], with its roots at 3 and 1 marked.
Fig. 1 The determinant of AλIA - \lambda I, plotted against λ\lambda, for the map that stretches by 3 along one diagonal and leaves the other alone. It crosses the axis twice, at 1 and at 3, and those crossings are the two stretches. The curve is computed by forming the shifted matrix at 241 values of λ\lambda and taking its determinant each time, then checked against the coefficients underneath.

What being left alone actually says

An arrow vv is left alone by AA, up to length, when Av=λvAv = \lambda v for some number λ\lambda. Rewriting that as Avλv=0Av - \lambda v = 0 and pulling out the arrow gives

(AλI)v=0,(A - \lambda I)v = 0,

where II is the map that does nothing and the subtraction is entry by entry. The equation now says something about the map AλIA - \lambda I rather than about vv: there is an arrow, not the zero one, that this map sends to the origin.

A linear map that sends a non-zero arrow to the origin cannot be reversed — two different points now have the same image, so nothing can undo it. And there is already a number that measures exactly that: the determinant, which is the factor by which areas are multiplied. A map with a non-zero arrow in its kernel flattens the plane onto a line, and a line has no area.

So the condition is

det(AλI)=0,\det(A - \lambda I) = 0,

and it is a condition on λ\lambda alone. The arrow has disappeared from it entirely.

The unit square, mapped: area × 0. The unit square and the parallelogram it becomes under a linear map, with the area of that parallelogram computed from its own corners and set against ad − bc.
Fig. 2 The image of the unit square under AλIA - \lambda I at the value of λ\lambda where the determinant vanishes: the square has been flattened onto a segment, and the shoelace formula on its four drawn corners agrees with adbcad - bc to the last decimal place. Two computations that share no line of code, and the whole claim is that they agree.

The equation, written out

For a two-by-two matrix with entries aa, bb, cc, dd the shifted matrix is

AλI=(aλbcdλ),A - \lambda I = \begin{pmatrix} a - \lambda & b \\ c & d - \lambda \end{pmatrix},

whose determinant is (aλ)(dλ)bc(a - \lambda)(d - \lambda) - bc. Multiplying out,

λ2(a+d)λ+(adbc).\lambda^2 - (a + d)\lambda + (ad - bc).

Two numbers appear, and only two. The first, a+da + d, is the trace — the sum down the diagonal. The second is the determinant. Every other detail of the matrix has been thrown away, and what is left is a quadratic in λ\lambda called the characteristic polynomial.

That is the first surprise. A two-by-two matrix has four numbers in it, and the question which directions does this map leave alone depends on only two combinations of them. Whatever else the four entries record, they record it somewhere the eigenvalues cannot see.

The figure above computes both routes at forty-one values of λ\lambda and compares them, because a formula derived on paper and a formula implemented are different objects, and the site’s habit is to make them argue.

What the coefficients already know

A quadratic’s roots and its coefficients are tied together: for λ2pλ+q\lambda^2 - p\lambda + q with roots λ1\lambda_1 and λ2\lambda_2, expanding (λλ1)(λλ2)(\lambda - \lambda_1)(\lambda - \lambda_2) gives p=λ1+λ2p = \lambda_1 + \lambda_2 and q=λ1λ2q = \lambda_1\lambda_2. That is the elementary case of the relation between roots and coefficients that runs all the way up.

Read backwards, it says:

  • the trace is the sum of the eigenvalues;
  • the determinant is their product.

Both are worth pausing on. The determinant is the area factor, so the statement is that the total stretching a map does is the product of the stretches along its own two special directions — which is exactly what it ought to be, since in those directions the map is nothing but two stretches. The trace is harder to feel and easier to compute; it is the one number a matrix hands over without any work at all, and it is half of everything the eigenvalues know.

There is a working consequence. Given a matrix, the two eigenvalues can be read off by finding two numbers with the right sum and the right product, which for small whole-number matrices is faster than any formula. The map (2112)\begin{pmatrix} 2 & 1 \\ 1 & 2\end{pmatrix} has trace 4 and determinant 3, so its eigenvalues are two numbers adding to 4 and multiplying to 3 — that is 1 and 3, with no algebra written down at all.

It also settles a question that would otherwise need the eigenvalues themselves. A map with a negative determinant has eigenvalues of opposite sign, because their product is negative, so it stretches along one invariant direction and reflects along the other. A map with determinant 1 and trace larger than 2 has two positive eigenvalues, one above 1 and one below, since they multiply to 1 and add to more than 2. Nothing has been computed; a pair of readings off the matrix has decided the qualitative behaviour, which is what a good invariant is for.

Three shapes, and only three

A quadratic with real coefficients meets the axis twice, once, or not at all, and the discriminant p24qp^2 - 4q decides which. In the language of the map, (a+d)24(adbc)(a+d)^2 - 4(ad - bc) decides whether there are two invariant directions, one, or none.

A polynomial with no real root, and a map with no invariant direction. The determinant of A − λI plotted against λ for the map [0, −1, 1, 0], with no crossing of the axis anywhere, so no real eigenvalue.
Fig. 3 A quarter turn. Its trace is 0 and its determinant is 1, so the polynomial is λ2+1\lambda^2 + 1, which never touches the axis. No real number is a stretch here, and no direction survives the turn — which the picture says by never crossing, and which is a good deal more convincing than failing to find one by looking.

The case with no real root is the honest one to draw first, because it is the case where searching for an invariant direction by eye can only ever produce a failure to find. The curve above is a proof that none exists: a parabola opening upwards whose lowest point is above the axis has no real root, and that is checkable arithmetic rather than an exhausted search.

The rotation is not an exotic example. Any map that turns everything by an angle other than a half turn has this shape of polynomial, and complex multiplication is exactly such a map — which is a hint about where the missing roots have gone, taken up in the essays on the complex plane rather than here.

The case that is not a case

The middle possibility, one root twice over, looks like an edge case that will not matter. It matters more than either of the others, because it hides a distinction the polynomial cannot see.

The polynomial whose roots are the stretches. The determinant of A − λI plotted against λ for the map [1, 1, 0, 1], with its repeated root at 1 marked.
Fig. 4 A shear: everything slides parallel to one axis by an amount proportional to its height. Trace 2, determinant 1, so the polynomial is λ22λ+1=(λ1)2\lambda^2 - 2\lambda + 1 = (\lambda - 1)^2, which touches the axis at 1 and does not cross. One root, counted twice.

A root of multiplicity two might mean two independent invariant directions that happen to be stretched by the same amount — which is what the map 2I2I, a plain doubling, does, since every direction is invariant there. Or it might mean one direction and no more.

The shear is the second kind, and the way to tell is to go back to (AλI)v=0(A - \lambda I)v = 0 and count solutions.

The directions the map leaves alone. Unit vectors and their images under the map. On the two marked lines the image points the same way as the original, stretched by 1.00 and 1.00.
Fig. 5 The same shear, with unit arrows and their images. Exactly one line is left alone — the horizontal one, along which the sliding happens — and every other arrow is tipped. A doubling would have marked every direction; the polynomial cannot distinguish the two, and this picture can.

For the shear, AIA - I is the matrix with a single 1 in the top right and zeros elsewhere, which sends (x,y)(x, y) to (y,0)(y, 0). That is zero exactly when y=0y = 0: one line of solutions, not two. The map has a repeated eigenvalue and a single invariant direction, and matrices like it are called defective.

This is why the figure counts the solutions by row-reducing the shifted matrix rather than by reading the multiplicity of the root. Reading the count off the polynomial is precisely the mistake the shear is there to catch — a formula that says two where the geometry says one, in the only case where anyone would be tempted to trust it.

The easy case, drawn to show it is easy

When the matrix is triangular the polynomial factors before it is written down, because the determinant of a triangular matrix is the product of its diagonal.

The polynomial whose roots are the stretches. The determinant of A − λI plotted against λ for the map [3, 1, 0, 2], with its roots at 3 and 2 marked.
Fig. 6 An upper triangular map. Its polynomial is (3λ)(2λ)(3 - \lambda)(2 - \lambda), so the roots are visible in the matrix without any computation — and the curve crosses at exactly 3 and 2, as it must.

That observation is small and it is the seed of a large programme. If every matrix could be rewritten as a triangular or diagonal one without changing what the map does, the eigenvalues would always be readable at a glance. Whether that rewriting is possible, and what it costs, is the next rung of this ladder.

The directions the map leaves alone. Unit vectors and their images under the map. On the two marked lines the image points the same way as the original, stretched by 3.00 and 2.00.
Fig. 7 The triangular map’s two invariant directions. One is the horizontal axis, which is forced: a zero in the lower left says that nothing horizontal acquires a vertical part. The other is slanted, and the two are not perpendicular — which they need not be, and which turns out to depend on whether the matrix is symmetric.

The matrix satisfies its own equation

Here is the fact that makes the characteristic polynomial feel less like an accounting device and more like a description.

Take the polynomial λ2pλ+q\lambda^2 - p\lambda + q that the matrix produced, and substitute the matrix itself for λ\lambda, reading the constant term as qq times the identity. The result is the zero matrix, every time. For (2112)\begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, with p=4p = 4 and q=3q = 3:

A24A+3I=(5445)(8448)+(3003)=(0000).A^2 - 4A + 3I = \begin{pmatrix} 5 & 4 \\ 4 & 5 \end{pmatrix} - \begin{pmatrix} 8 & 4 \\ 4 & 8 \end{pmatrix} + \begin{pmatrix} 3 & 0 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.

This is the Cayley–Hamilton theorem, and its two-by-two case can be verified by multiplying out the general matrix, which takes four lines and no ideas. Every entry cancels.

The temptation is to prove it by substituting AA into det(AλI)\det(A - \lambda I) directly and getting det(AA)=det(0)=0\det(A - A) = \det(0) = 0. That argument is worthless: det(AλI)\det(A - \lambda I) is a number for each number λ\lambda, and putting a matrix where a number was is not a substitution into anything. The conclusion is right and the reasoning is a coincidence of notation, which is a good example of the kind of proof worth being suspicious of — it has the shape of an argument without any of the content.

What the theorem buys is arithmetic. It says A2=4A3IA^2 = 4A - 3I, so every power of AA from the second upwards is a combination of AA and II — the whole infinite sequence of powers lives in a two-dimensional space. Computing A100A^{100} becomes a matter of reducing λ100\lambda^{100} modulo the characteristic polynomial, and the inverse comes out for free: dividing A24A+3I=0A^2 - 4A + 3I = 0 by AA gives A1=(4IA)/3A^{-1} = (4I - A)/3, an inverse obtained without a single division of entries.

What it costs in larger dimensions

For an n×nn \times n matrix the same argument gives a polynomial of degree nn, whose coefficients are the trace, the determinant and n2n - 2 intermediate quantities. The fundamental theorem of algebra then guarantees nn roots in the complex numbers, counted with multiplicity, so the eigenvalues always exist somewhere even when they are not real.

The trouble is that the polynomial is a terrible way to find them. Its coefficients are enormous alternating sums of products of matrix entries, so tiny changes in the matrix move them a great deal, and finding roots of a high-degree polynomial is numerically delicate in its own right. Every practical method for computing eigenvalues avoids forming the characteristic polynomial altogether, and one of them does nothing but apply the map repeatedly.

There is also a limit of principle. A general polynomial of degree five or more has no formula in radicals for its roots, and every polynomial is the characteristic polynomial of some matrix — the companion matrix, whose entries are the coefficients. So there is no formula for the eigenvalues of a general 5×55 \times 5 matrix either. Eigenvalues are found by iteration because they cannot be found any other way.

What the picture cannot show

The curve on the page is a real function of a real variable, and it stops at the axis. When the roots are complex the picture goes quiet exactly where the interesting thing is: it shows a parabola floating above the axis and says nothing here, when what is true is that the two roots have moved off the line into the plane. A drawing that showed them would be a drawing of a complex function of a complex variable, which needs four dimensions and is why that subject gets its own pictures.

Nor can the curve show the difference between a doubling and a shear. Both give (λk)2(\lambda - k)^2, and the polynomial is the same object in the two cases. Everything that distinguishes them lives in the shifted matrix, which the curve has already summarised into a single number.

And a curve drawn from 241 samples is a curve drawn from 241 samples. A root that two nearby samples straddle is visible; a pair of roots closer together than the sample spacing is a curve that dips towards the axis and appears not to reach it, which is indistinguishable on the page from no root at all. Every root marked here is placed from the closed-form solution and then checked against the sampled curve, rather than found by watching for a sign change — because near a repeated root the sign never changes, and a search that looks for one finds nothing precisely where the answer is most delicate.

The ladder from here

Rungs above: rewriting the map in the basis of its own eigenvectors, which turns it into two independent stretches. What symmetry does to the eigen-directions, and why a symmetric matrix always has real eigenvalues and perpendicular ones. The frames a map has when it has no invariant direction at all. The power method, which finds the largest eigenvalue by doing nothing but applying the map. Jordan form, which is the nearest thing to a diagonal that a defective matrix admits. And the Markov chains whose long-run behaviour is the eigenvector of the eigenvalue 1.

The move worth keeping

The step that does all the work here is worth naming, because it recurs everywhere.

A question about a vector — is there an arrow this map leaves alone? — was turned into a question about a number, by noticing that the existence of such an arrow is equivalent to a map being non-invertible, and that non-invertibility is measured by a single quantity. The unknown arrow was eliminated rather than solved for.

The same move underlies finding a shared root of two polynomials without finding it, where a determinant again reports the existence of a solution nobody has computed. Both are instances of one habit: when an object is hard to produce, look for a number that vanishes exactly when it exists.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Characteristic polynomialDefective matrixDeterminantEigenvalueEigenvectorInvariant directionMatrixPolynomialShearTrace