Chapter 15A quick trick for computing eigenvalues
This is a video for anyone who already knows what eigenvalues and eigenvectors are, and who might enjoy a quick way to compute them in the case of 2x2 matrices. If you're unfamiliar with eigenvalues, take a look at the previous chapter which introduces them.
You can skip ahead if you just want to see the trick, but if possible we'd like you to rediscover it for yourself, so let's lay down a little background.
As a quick reminder, if the effect of a linear transformation on a given vector is to scale it by some constant, we call that vector an eigenvector of the transformation, and we call the relevant scaling factor the corresponding eigenvalue, often denoted with the letter lambda, .
When you write this as an equation and rearrange a little, what you see is that if a number is an eigenvalue of a matrix , then the matrix must send some nonzero vector, namely the corresponding eigenvector, to the zero vector, which in turn means the determinant of this modified matrix must be .
That's a bit of a mouthful, but again, we're assuming this is review for anyone reading.
The usual way to compute eigenvalues and how most students are taught to carry it out, is to subtract a variable lambda off the diagonals of a matrix and solve for when the determinant equals . For example, when finding the eigenvalues of the matrix this looks like:
This always involves a few steps to expand this and simplify it to get a clean quadratic polynomial, known as the “characteristic polynomial” of the matrix. The eigenvalues are the roots of this polynomial, so to find them you apply the quadratic formula, which typically requires one or two more steps of simplification.
This process isn't terrible, but at least for 2x2 matrices, there's a much more direct way to get at this answer. If you want to rediscover this trick, there are three relevant facts you'll need to know, each of which is worth knowing in its own right and can help with other problem-solving.
The trace of a matrix, which is the sum of these two diagonal entries, is equal to the sum of the eigenvalues.
Or another way to phrase it, more useful for our purposes, is that the mean of the two eigenvalues is the same as the mean of these two diagonal entries.
The determinant of a matrix, our usual formula, equals the product of the two eigenvalues.
This should make sense if you understand that an eigenvalue describes how much an operator stretches space in a particular direction and that the determinant describes how much an operator scales areas (or volumes).
- (We'll get to this...)
Before getting to the third fact, notice how you can essentially read these first two values out of the matrix. Take this matrix as an example. Straight away you can know that the mean of the eigenvalues is the same as the mean of and , which is .
Likewise, most linear algebra students are well-practiced at finding the determinant, which in this case is , so you know the product of our two eigenvalues is .
Take a moment to see how you can derive what will be our third relevant fact, which is how to recover two numbers when you know their mean and product.
Focus on this example. You know the two values are evenly spaced around , so they look like plus or minus something; let's call it for distance.
You also know that the product of these two numbers is .
To find , notice how this product expands nicely as a difference of squares. This lets you cleanly solve for :
In other words, the two values for this very specific example work out to be and .
But our goal is a quick trick and you wouldn't want to think through this each time, so let's wrap up what we just did in a general formula.
For any mean, , and product, , the distance squared is always going to be . This gives the third key fact, which is that when two numbers have a mean and a product, you can write those two numbers as .
This is decently fast to rederive on the fly if you ever forget it and it's essentially just a rephrasing of the difference of squares formula, but even still it's a fact worth memorizing. In fact, Tim from Acapella Science wrote us a quick jingle to make it a little more memorable.
Examples
Let me show you how this works, say for the matrix . You start by thinking of the formula, stating it all in your head.
But as you write it down, you fill in the appropriate values of and as you go. Here, the mean of the eigenvalues is the same as the mean of and , which is , so you start by writing:
The product of the eigenvalues is the determinant, which in this example is , so that's the final thing you fill in.
So the eigenvalues are . You may noticed this is the same matrix we were using at the start, but notice how much more directly we can get at the answer compared to the characteristic polynomial route.
Here, let's try another one using the matrix . This time the mean of the eigenvalues is the same as the mean of and , which is . So again, start writing out the formula, but writing in place of :
The determinant is . So in this example, the eigenvalues look like , which gives us and .
You see what we mean about how you can basically just write down the eigenvalues while staring at the matrix? It's typically just the tiniest bit of simplifying at the end.
What are the eigenvalue(s) of the matrix ?
This trick is especially useful when you need to read off the eigenvalues from small examples without losing the main line of thought by getting bogged down in calculations.
For more practice, let's try this out on a common set of matrices which pop up in quantum mechanics, known as the Pauli spin matrices.
If you know quantum mechanics, you'll know the eigenvalues of these are highly relevant to the physics they describe, and if you don't then let this just be a little glimpse of how these computations are actually relevant to real applications.
The mean of the diagonal in all three cases is , so the mean of the eigenvalues in all cases is , making our formula look especially simple.
What about the products of the eigenvalues, the determinants? For the first one, it's or . The second also looks like , though it takes a moment more to see because of the complex numbers. And the final one looks like . So in all three cases, the eigenvalues are .
Although in this case you don't even really need the formula to find two values evenly spaced around zero whose product is .
If you're curious, in the context of quantum mechanics, these matrices correspond with observations you might make about the spin of a particle in the , or -direction, and the fact that these eigenvalues are corresponds with the idea that the values for the spin you would observe would be entirely in one direction or entirely in another, as opposed to something continuously ranging in between.
Maybe you'd wonder how exactly this works, and why you'd use 2x2 matrices with complex numbers to describe spin in three dimensions. Those would be valid questions, just beyond the scope of what we're talking about here.
You know it's funny, this section is supposed to be about a case where 2x2 matrices are not just toy examples or homework problems, but actually come up in practice, and quantum mechanics is great for that. However, the example kind of undercuts the whole ponit we're trying to make. For these specific matrices, if you use the traditional method with characteristic polynomials, it's essentially just as fast, and might actually faster.
For the first matrix, the relevant determinant directly gives you a characteristic polynomial of , which clearly has roots of plus and minus . Same answer for the second matrix. And for the last, forget about doing any computations, traditional or otherwise, it's already a diagonal matrix, so those diagonal entries are the eigenvalues!
However, the example is not totally lost on our cause, where you would actually feel the speed up is the more general case where you take a linear combination of these matrices and then try to compute the eigenvalues.
We might write this as times the first one, plus times the second, plus times the third. In physics, this would describe spin observations in the direction of a vector .
More specifically, you should assume this vector is normalized, meaning . When you look at this new matrix, it's immediate to see that the mean of the eigenvalues here is still zero, and you may enjoy pausing for a brief moment to confirm that the product of those eigenvalues is still , and from there concluding what the eigenvalues must be.
The characteristic polynomial approach, on the other hand, is now actually more cumbersome to do in your head.
Relation to the quadratic formula
To be clear, using the mean-product formula is the same thing as finding roots of the characteristic polynomial; it has to be. In fact, this formula is a nice way to think about solving quadratics in general and some viewers of the channel may recognize this.
If you're trying to find the roots of a quadratic given its coefficients, you can think of that as a puzzle where you know the sum of two values, and you know their product, and you're trying to recover the original two values.
Specifically, if the polynomial is normalized so that the leading coefficient is , then the mean of the roots is times the linear coefficient, for the example on screen that would be , and the product of the roots is even easier, it's just the constant term. From there, you'd apply the mean product formula to find the roots.
Now, you could think of the mean product formula as being a lighter-weight reframing of the traditional quadratic formula. But the real advantage is that the terms have more meaning to them.
The whole point of this eigenvalue trick is that because you can read out the mean and product directly from the matrix, you can jump straight to writing down the roots without thinking about what the characteristic polynomial looks like. But to do that, we need a version of the quadratic formula where the terms carry some kind of meaning.
What are the eigenvalue(s) of the matrix ?
What are the eigenvalue(s) of the matrix ?
Last thoughts
The hope is that it's not just one more thing to memorize, but that the framing reinforces other nice facts worth knowing, like how the trace and determinant relate to eigenvalues. If you want to prove these facts, by the way, take a moment to expand out the characteristic polynomial for a general matrix, and think hard about the meaning of each coefficient.
Many thanks to Tim, for ensuring that the mean-product formula will stay stuck in all of our heads for at least a few months.
If you don't know about his channel, do check it out. The Molecular Shape of You, in particular, is one of the greatest things on the internet.
Thanks
Special thanks to those below for supporting the original video behind this post, and to current patrons for funding ongoing projects. If you find these lessons valuable, consider joining.