Visualizing Matrix Trace
Trace as Divergence: A Geometric Understanding of Matrix Properties
The trace of a square matrix is usually introduced algebraically: add the entries on the main diagonal. For a matrix
A=(acbd),the trace is
tr(A)=a+d.That calculation is simple, but it does not immediately explain why the diagonal entries are important or why trace appears in so many different formulas. A geometric viewpoint provides that explanation.
The central idea is:
The trace of a matrix is the divergence of the vector field generated by that matrix.
Divergence measures how quickly a small region expands or contracts as it moves through a vector field. Once this connection is understood, several properties of trace—including its relationship to eigenvalues, determinants, matrix exponentials, changes of basis, and Jacobi’s formula—become natural.
Matrices as Vector Fields
Consider a matrix A and a point in the plane represented by its position vector x. The matrix attaches a new vector to that point:
x⟼Ax.Thus, every point x has an associated vector Ax. Drawing all these vectors produces a vector field.
The vectors may have very different lengths. For visualization, diagrams often standardize the lengths and preserve only the directions. Colors can then be used to indicate the original magnitudes. The mathematical vector field itself still consists of the actual vectors Ax.
Two especially important points are the standard basis vectors:
e1=(10),e2=(01).For the matrix
A=(acbd),the vectors attached to these points are
Ae1=(ac),Ae2=(bd).These are precisely the first and second columns of A. This is one reason columns are geometrically significant: each column records where a standard basis direction is sent.
Divergence and Area Change
The local meaning of divergence
Suppose a small region surrounds a point in a vector field. Every point in that region is allowed to move according to the vector attached to it. As the points move, the region may expand, contract, or change shape.
The divergence at the point measures the initial rate of area change per unit area:
divergence=ε→0limε⋅initial areachange in area.Here, ε represents a very short amount of time.
- Positive divergence means that the region initially expands.
- Negative divergence means that the region initially contracts.
- Zero divergence means that there is no initial net change in area.
The phrase per area is essential. If the initial region is made four times larger, the absolute change in area is also four times larger. However, the change divided by the original area remains the same.
For example, suppose one region experiences an area change of approximately −0.148. If a region with four times the initial area experiences a change of approximately −0.595, the second change is about four times the first. The divergence is unchanged because both the change and the original area were multiplied by the same factor.
Why divergence is normally local
In a general vector field, divergence can vary from point to point. A small region near one point may expand while a small region elsewhere contracts.
A matrix-generated vector field has a special structure. Let x be a point and let x+d be a nearby point, where d is a small displacement. Their attached vectors are
AxandA(x+d).After a short time ε, the two points move approximately to
x+εAxand
x+d+εA(x+d).The new displacement between them is
d+εAd.The key feature is that the original position x has disappeared. The change in the displacement depends only on d and A, not on where the region was located.
Therefore, any two initially identical small regions undergo the same shape change under the flow generated by A. The area change is the same everywhere, so the divergence is constant throughout the entire matrix-generated vector field.
From small regions to ordinary regions
Because the divergence is constant, the region used to measure it does not need to be infinitesimally small. A larger region can be divided into many small pieces. If each small piece has its area multiplied by approximately
1+εdivergence,then the entire region is multiplied by the same factor.
This allows a convenient region to be chosen: the unit square spanned by the standard basis vectors. Its initial area is 1, so its area change directly represents the rate of area change.
For a matrix-generated vector field, divergence is constant everywhere, so a convenient finite region can be used to calculate it.
Why Trace Equals Divergence
Consider again
A=(acbd).The unit square has corners determined by the vectors e1 and e2. The vector attached to e1 is
Ae1=(ac).The horizontal component a changes the width of the square. The vertical component c merely slides the corresponding side upward or downward; it changes the shape but does not contribute to the first-order change in area.
Likewise, the vector attached to e2 is
Ae2=(bd).The vertical component d changes the height of the square. The horizontal component b shears the square sideways but does not contribute to the first-order area change.
Consequently:
- The first diagonal entry a measures the contribution from horizontal expansion.
- The second diagonal entry d measures the contribution from vertical expansion.
- The off-diagonal entries b and c produce shearing effects, which do not change area to first order.
The total rate of area change is therefore
a+d.Since this is exactly the trace,
tr(A)=divergence of the vector field Ax.The determinant confirmation
The same result can be obtained through the determinant. After a short time ε, the standard basis vectors move to approximately
(10)+ε(ac)=(1+εaεc)and
(01)+ε(bd)=(εb1+εd).The new area is the determinant of the matrix whose columns are these two vectors:
det(1+εaεcεb1+εd).Expanding gives
(1+εa)(1+εd)−ε2bc.Ignoring terms of order ε2 when considering the initial rate of change, this becomes
1+ε(a+d).Thus, the area changes at the rate a+d, again showing that
tr(A)=a+dis the divergence.
Think About It
If a matrix has zero trace but nonzero off-diagonal entries, what kind of geometric effect can it produce? The answer is that it may shear or rotate regions without causing a first-order net expansion or contraction of area.
Trace and Eigenvalues
An eigenvector of A is a direction that the matrix does not turn away from itself. If x is an eigenvector, then
Ax=λx,where λ is the corresponding eigenvalue.
In the vector-field picture, the attached vector Ax lies on the same line as x. The vector may point in the same direction or the opposite direction:
- If λ>0, the vector points along the same direction.
- If λ<0, it points in the opposite direction.
- The magnitude of the velocity is scaled by ∣λ∣.
Suppose there are two independent eigenvector directions with eigenvalues λ1 and λ2. A parallelogram can be chosen whose sides lie along these two eigenvector directions. Let the side lengths be r and s, and let the angle between the directions be θ.
The initial area is
rssinθ.Along the first eigenvector direction, the side length changes after a short time ε to
r(1+ελ1).Along the second direction, it changes to
s(1+ελ2).The new area is therefore
rs(1+ελ1)(1+ελ2)sinθ.The area ratio is
old areanew area=(1+ελ1)(1+ελ2).Expanding:
(1+ελ1)(1+ελ2)=1+ε(λ1+λ2)+ε2λ1λ2.The divergence is the initial relative area-change rate:
ε1[old areanew area−old area].As ε approaches 0, the term involving ε2 disappears, leaving
divergence=λ1+λ2.Since divergence equals trace,
tr(A)=λ1+λ2.Thus, the trace is the sum of the eigenvalues. Geometrically, each eigenvalue contributes the expansion or contraction rate along one independent eigenvector direction.
Matrix Exponentials and Determinants
The vector field generated by A describes a continuous flow. If a point begins at x and moves for time t, its position is
etAx,where etA is the matrix exponential.
The matrix exponential transforms an initial region into the region obtained after flowing for time t. The determinant measures the area-scaling factor of that transformation. If S(t) denotes the area of a region at time t, then
S(t)=det(etA)S(0).Because the trace is the divergence, it is the rate of area change per unit area:
S(t)S′(t)=tr(A).Equivalently,
S′(t)=tr(A)S(t).The trace is constant because A is fixed. Solving this differential equation gives
S(t)=S(0)ettr(A).Therefore,
det(etA)=ettr(A).In particular, setting t=1 yields
det(eA)=etr(A).This identity is not an isolated algebraic coincidence. It says that the exponential of the total infinitesimal area-growth rate produces the total area-scaling factor after time evolution.
Think About It
If tr(A)>0, the flow produces exponential area growth. If tr(A)<0, it produces exponential area decay. If tr(A)=0, the flow preserves area to the level described by this divergence calculation.
Trace and Change of Basis
A matrix depends on the coordinates used to describe it, but its trace does not. The vector-field viewpoint explains why.
Let Q be an invertible linear transformation applied to the entire geometric picture. A point x becomes
Qx.An attached vector Ax becomes
Q(Ax)=QAx.Introduce a new position vector
y=Qx.Since
x=Q−1y,the transformed attached vector is
QAQ−1y.Thus, in the new coordinates, the vector field is generated by the matrix
QAQ−1.This is a similarity transformation.
The transformation Q changes every area by the factor det(Q). However, divergence is a ratio:
initial areaarea change.Both the numerator and denominator acquire the same factor, so the factor cancels. The rate of area change per area remains unchanged.
Therefore,
tr(A)=tr(QAQ−1).The usual change-of-basis expression is P−1AP. Taking Q=P−1 gives
tr(A)=tr(P−1AP).This means that trace is an intrinsic property of the linear transformation, not an artifact of a particular coordinate system.
The Cyclic Property: tr(AB)=tr(BA)
A famous property of trace is
tr(AB)=tr(BA).Suppose B is invertible. Since
B−1B=I,one may insert this product without changing AB:
AB=B−1(BAB−1)Bor, more directly, write
tr(AB)=tr(B−1(BA)B).The expression inside the trace is a similarity transformation of BA. Using invariance under similarity,
tr(B−1(BA)B)=tr(BA).Hence,
tr(AB)=tr(BA).The geometric interpretation is that transforming the whole plane by an invertible change of coordinates does not alter divergence. The two products represent the same overall relationship viewed through a change of coordinates.
The derivation above assumes that one of the matrices is invertible so that the similarity transformation can be formed. The trace identity itself is more general, but the geometric derivation here uses invertibility.
Think About It
Matrix multiplication is generally not commutative: AB usually differs from BA. The trace is unusual because it ignores enough coordinate detail that these two products have the same total diagonal effect.
Jacobi’s Formula
The final property concerns a time-dependent matrix A(t). For an invertible matrix, Jacobi’s formula states
dtddetA(t)=detA(t)tr(A(t)−1A′(t)).Here, A′(t) is the derivative of the matrix with respect to time.
Understanding the determinant geometrically
In two dimensions, the determinant of A(t) is the signed area of the parallelogram formed by applying A(t) to the two standard basis vectors. As t changes, the matrix changes, so the parallelogram changes.
Its corners move at velocities determined by
A′(t)e1andA′(t)e2.The determinant’s derivative,
dtddetA(t),is therefore the rate at which the parallelogram’s area changes.
To use the divergence interpretation, the changing parallelogram can be viewed as part of a vector field. The goal is to find a matrix M whose attached vector at each current position is the velocity of that position.
The current position vectors are of the form
A(t)ei.The corresponding velocities are
A′(t)ei.A matrix that maps the current position to its velocity is
A′(t)A(t)−1,because
A′(t)A(t)−1(A(t)ei)=A′(t)ei.Thus, the relevant vector field is generated by
M=A′(t)A(t)−1.Since trace is divergence, the relative area-change rate is
detA(t)dtddetA(t)=tr(A′(t)A(t)−1).Multiplying by detA(t) gives
dtddetA(t)=detA(t)tr(A′(t)A(t)−1).Using the cyclic trace property,
tr(A′(t)A(t)−1)=tr(A(t)−1A′(t)),so Jacobi’s formula becomes
dtddetA(t)=detA(t)tr(A(t)−1A′(t)).An equivalent geometric viewpoint
Instead of viewing the changing parallelogram in its current position, apply A(t)−1 to the whole picture. This sends the parallelogram back to the standard basis positions. The attached velocity vectors then become
A(t)−1A′(t)e1andA(t)−1A′(t)e2.Therefore, the matrix generating the transformed vector field is
A(t)−1A′(t),which produces the formula directly:
dtddetA(t)=detA(t)tr(A(t)−1A′(t)).The invertibility assumption is needed here because A(t)−1 appears. A more general version can be written using the adjugate matrix, which remains defined even when A(t) is not invertible, but the divergence-based visualization is clearest in the invertible case.
Comprehensive Review
The geometric interpretation of trace begins with a matrix-generated vector field:
x⟼Ax.Every point is assigned a velocity vector. When a region flows according to these velocities, its area changes. The divergence measures the initial rate of area change per unit area.
For a matrix-generated field, nearby points have displacement changes governed by
d⟼d+εAd,which does not depend on the location of the original point. Therefore, the divergence is constant throughout the field.
For
A=(acbd),the diagonal entries a and d produce first-order expansion or contraction, while the off-diagonal entries primarily produce shearing. Hence,
tr(A)=a+dis exactly the divergence.
This single interpretation explains the major properties:
-
Trace equals divergence: tr(A)=area-growth rate per area.
-
Trace equals the sum of eigenvalues: tr(A)=λ1+λ2, because eigenvalues describe expansion or contraction along eigenvector directions.
-
Determinant of a matrix exponential: det(etA)=ettr(A), because constant relative area growth accumulates exponentially over time.
-
Invariance under change of basis: tr(A)=tr(QAQ−1), because coordinate transformations scale both area and area change by the same factor.
-
Cyclic property: tr(AB)=tr(BA), which follows from similarity invariance when the required inverse exists.
-
Jacobi’s formula:
= \det A(t)\, \operatorname{tr}\left(A(t)^{-1}A'(t)\right),$$ because the trace measures the relative rate at which the determinant, interpreted as area, changes.
The trace is therefore much more than a diagonal sum. It is the total infinitesimal expansion rate of the space under a linear transformation.

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