1. Home
  2. Explore
  3. Mathematics
  4. Visualizing Matrix Trace

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Visualizing Matrix Trace

Speaker 1Speaker 2

Visualizing Matrix Trace

11:05
0:00-11:05
  1. Corey

    When we compute the trace of a matrix, we usually add its diagonal entries. But that is a very algebraic way to think about it. Today, we want to visualize what that addition really means, and that picture will help explain several important properties of trace.

  2. Michael

    Including the especially famous identity tr(AB) = tr(BA), although we will save one particular discussion of that property for later. In many cases where one of the matrices is invertible, we can already derive it from another property. So let’s begin with the geometric picture.

  3. Corey

    We can view a matrix A as a vector field. At every point with position vector x, attach the vector Ax. Strictly speaking, drawing the vectors with their actual lengths can become messy, because some vectors may be very long. Illustrations often standardize the lengths to emphasize direction, and colors can be used to indicate the actual magnitude.

  4. Michael

    The vectors attached to the points (1,0) and (0,1) are especially useful. The vector A(1,0) is the first column of A, and A(0,1) is the second column. So the columns of the matrix are directly visible in the vector field.

  5. Corey

    The central visual statement is this: the trace of A is the divergence of the vector field generated by A. Divergence measures how quickly a tiny region expands or contracts under the flow of the vector field, per unit area.

  6. Michael

    Let’s make that quantitative. Choose a very small region around a point, record its area, and let every point in that region move according to the vector field. The region’s area may change, and divergence is the initial rate of that area change divided by the original area as the region shrinks toward a point.

  7. Corey

    So if the area initially decreases, the divergence is negative. For example, a particular region might undergo an area change of -0.148. If we start with a region four times as large and run the same evolution, the area change is approximately -0.595, which is four times as large, apart from rounding.

  8. Michael

    That example emphasizes the phrase 'per area.' The total area change depends on the size of the starting region, but the change divided by the initial area does not. Divergence is therefore a local rate, normalized by area.

  9. Corey

    At first, there seems to be a puzzle. Divergence is generally a local property, so it can vary from point to point. Why should the trace of one matrix represent the divergence everywhere? The answer is that for a vector field generated by a fixed matrix A, the divergence really is the same at every point.

  10. Michael

    Take a point with position vector x, and another nearby point x + d, where d is a small displacement. Their attached vectors are Ax and A(x+d). After a very short time epsilon, the displacement between the two moving points becomes d plus epsilon times A d.

  11. Corey

    The important observation is that x has disappeared from that expression. The way nearby points separate depends on d and A, but not on the location x itself. Therefore, a small region with a particular shape changes in exactly the same way no matter where we place it in the plane.

  12. Michael

    That means the area change is the same everywhere for equal-shaped regions. Since divergence is area change per area, the divergence is constant across the whole vector field generated by A.

  13. Corey

    And because the same scaling applies to every tiny piece of a larger region, we do not actually need to use an infinitesimal region to calculate it. If each small piece has area A_i, then after time epsilon it has area approximately A_i times 1 plus epsilon times the divergence. Adding all the pieces gives the same factor for the entire region.

  14. Michael

    So we can choose a convenient region: the unit square. Its area starts at one, and it contains the points (1,0) and (0,1), whose attached vectors reveal the columns of the matrix.

  15. Corey

    Write the matrix as A = [[a,b],[c,d]]. The vector attached to (1,0) is the first column, (a,c), and the vector attached to (0,1) is the second column, (b,d). Let’s see how those vectors affect the square’s area.

  16. Michael

    At (1,0), the vertical component c does not change the area in the relevant first-order picture. It can move a corner vertically, but the base and height of the parallelogram remain unchanged in that contribution. The horizontal component a does change the area, and its contribution to the rate of area change is exactly a.

  17. Corey

    At (0,1), the situation is reversed. The horizontal component b does not contribute to the area change, while the vertical component d does. So the total rate of area change is a + d, which is precisely the trace of A.

  18. Michael

    There is also a determinant-based way to confirm this. After a short time epsilon, the two basis points move according to their attached velocity vectors, so the new parallelogram’s area is given by a determinant. Expanding that determinant and taking the initial rate of change produces a + d, again showing that trace is divergence.

  19. Corey

    Now let’s use this picture to understand why the trace equals the sum of the eigenvalues. If x is an eigenvector of A, then Ax points along the same line as x, possibly in the opposite direction. Therefore, a point starting on that eigenvector line remains on the line as it flows.

  20. Michael

    Suppose there are two eigenvector lines, with eigenvalues lambda_1 and lambda_2. Choose a parallelogram whose sides lie along those two lines, with side lengths a and b, and let the angle between the lines be theta.

  21. Corey

    Along the first eigenvector line, the velocity has length lambda_1 a, because every vector on that line satisfies Ax = lambda_1 x. After a short time epsilon, that side becomes a times 1 plus epsilon lambda_1. Similarly, the other side becomes b times 1 plus epsilon lambda_2.

  22. Michael

    The new area is therefore a times 1 plus epsilon lambda_1, multiplied by b times 1 plus epsilon lambda_2, multiplied by sin theta. The original area is ab sin theta. When we compute the area change per area and let epsilon approach zero, the term involving epsilon squared disappears, leaving lambda_1 + lambda_2.

  23. Corey

    Since divergence is trace, this gives trace equal to the sum of the eigenvalues, at least in this two-eigenvector-line picture. The geometry makes the result natural: each eigenvalue gives the rate of stretching or shrinking along one independent direction, and the total first-order area change is their sum.

  24. Michael

    The next property involves the matrix exponential. A point with position vector x flowing for time t along the vector field generated by A ends up at e^(tA)x. So applying e^(tA) to a region is the same as letting that region evolve under the vector field for time t.

  25. Corey

    The determinant tells us the area scaling factor of a matrix transformation. If S(t) is the area of the region after time t, then det(e^(tA)) represents that area scaling. Because trace is the rate of area change per area, we have S'(t) divided by S(t) equal to tr(A).

  26. Michael

    The trace is constant with respect to time, so this differential equation has solution S(t) equal to S(0)e^(t tr(A)). If the initial region is the unit square, S(0) is one, and therefore det(e^(tA)) = e^(t tr(A)). The determinant of a matrix exponential is the exponential of the trace.

  27. Corey

    Now consider a change of basis, or more geometrically, applying an invertible linear transformation Q to the entire picture. A point x becomes Qx, and its attached vector Ax becomes QAx.

  28. Michael

    If we call the transformed position vector y, then y = Qx, so x = Q inverse times y. The transformed attached vector is QAx, which becomes QAQ inverse applied to y. Thus the transformed vector field is generated by QAQ inverse.

  29. Corey

    Why does the trace stay the same? Because Q scales every area by det(Q). But divergence is an area change divided by area, so both the numerator and denominator acquire the same factor, and it cancels.

  30. Michael

    Therefore, tr(A) = tr(QAQ inverse). In the usual change-of-basis notation, the expression is P inverse A P; we obtain it by taking Q to be P inverse. So trace is independent of the choice of basis.

  31. Corey

    That similarity-invariance property gives us a route to tr(AB) = tr(BA) when one matrix is invertible. Suppose B is invertible. We can insert B inverse B without changing the expression: tr(AB) = tr(B inverse B A).

  32. Michael

    Now rewrite that as tr(B inverse times BA). Since trace is unchanged under similarity transformations, this equals tr(BA). Geometrically, this corresponds to transforming the whole plane by B inverse and using the fact that the area-change-per-area ratio is unchanged.

  33. Corey

    There is also a more advanced route involving Lie brackets, but that is a separate story. For our purposes, the divergence picture explains why the trace survives a global change of coordinates, and that invariance produces the cyclic-looking identity when invertibility allows the algebraic rearrangement.

  34. Michael

    The final result is Jacobi’s formula. Let A depend on time, and assume A(t) is invertible. The formula is the derivative of det A equal to det A multiplied by tr(A inverse A prime).

  35. Corey

    To visualize the left-hand side, think of det A(t) as the area of the parallelogram formed by applying A(t) to the two standard basis vectors. As A changes with time, the two corners move, and their velocities are given by A prime acting on those basis vectors.

  36. Michael

    We would like to describe those moving corners using a vector field generated by some matrix M. At a point of the form A(t)x, the attached velocity is A prime x. Since x = A inverse applied to A x, that velocity can be written as A prime A inverse applied to the current position. Thus one possible generator is M = A prime A inverse.

  37. Corey

    Using the area-change formula, the derivative of the determinant becomes det A multiplied by tr(A prime A inverse). That is almost Jacobi’s formula, except the two factors inside the trace appear in the opposite order.

  38. Michael

    The order can be corrected using tr(AB) = tr(BA), since A is invertible. Alternatively, apply A inverse to the entire picture first. The parallelogram returns to the standard basis positions, while the attached vectors become A inverse A prime applied to those basis vectors.

  39. Corey

    So the vector field in that transformed picture is generated by A inverse A prime, giving exactly the formula: the derivative of det A equals det A times tr(A inverse A prime). The invertibility assumption is needed here because the expression contains A inverse; a more general version uses the adjoint matrix and can handle noninvertible matrices.

  40. Michael

    The unifying idea is that trace is not merely a diagonal sum. For a matrix-generated vector field, it measures divergence: the instantaneous rate of area change per unit area.

  41. Corey

    And from that one interpretation, we can understand the sum of eigenvalues, the determinant of a matrix exponential, invariance under change of basis, the identity tr(AB) = tr(BA) when invertibility permits the argument, and Jacobi’s formula.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent