Trace of a Matrix — Definition, Formula & Examples
The trace of a matrix is the sum of the entries on its main diagonal. It is only defined for square matrices (same number of rows and columns).
For an matrix , the trace is defined as , the sum of all diagonal elements .
Key Formula
Where:
- = An $n \times n$ square matrix
- = The diagonal entry in row $i$, column $i$
- = The number of rows (and columns) of $A$
How It Works
To find the trace, identify the main diagonal of the square matrix — these are the entries where the row index equals the column index. Then add those entries together. The trace has several useful properties: , for any scalar , and even when . The trace also equals the sum of the eigenvalues of the matrix, counted with multiplicity.
Worked Example
Problem: Find the trace of the matrix .
Identify diagonal entries: The main diagonal entries are at positions (1,1), (2,2), and (3,3).
Sum the diagonal entries: Add these three values together.
Answer:
Why It Matters
The trace appears throughout linear algebra and its applications. In differential equations, the trace of a system matrix determines whether solutions spiral inward or outward. In physics and data science, the trace of a covariance matrix gives the total variance across all variables.
Common Mistakes
Mistake: Trying to compute the trace of a non-square matrix.
Correction: The trace is only defined for square matrices. A matrix, for instance, does not have a well-defined main diagonal that spans all rows and columns, so its trace does not exist.
