Trace of a Matrix
Sum of the diagonal entries of a square matrix.
Formula
Variables
Example
The trace of [[1,2],[3,4]] is 1 + 4 = 5.
How it works
The trace of a square matrix is found by adding the entries on its main diagonal, from the top-left to the bottom-right. It appears naturally because diagonal entries often represent how each coordinate axis is scaled, and the trace captures the total of those self-effects. In many areas of linear algebra, it is also equal to the sum of the matrix’s eigenvalues, which is why it carries important structural information about the matrix.
When to use it
Use the trace when you need a quick summary of a square matrix, especially in eigenvalue problems, similarity transformations, and matrix invariants. It also shows up in applied settings such as differential equations, statistics, and physics when describing total scaling, divergence, or the sum of variances in covariance matrices.
Worked example, step by step
Let A = [[2, -1, 5], [0, 3, 4], [7, 8, -2]] Step 1: Identify the main diagonal entries: 2, 3, and -2 Step 2: Add them: 2 + 3 + (-2) = 3 Step 3: Therefore, tr(A) = 3
Common mistakes to avoid
- Adding all entries in the matrix instead of only the diagonal entries
- Using a non-square matrix, even though trace is defined only for square matrices
- Mixing up the main diagonal with the other diagonal running from top-right to bottom-left
Did You Know?
The trace — the sum of the diagonal — equals the sum of all the eigenvalues.
Share this formula
More in Linear Algebra
View allDeterminant (2×2)
IntermediateDeterminant of a 2×2 matrix.
Dot Product
IntermediateScalar product of two vectors.
Cross Product Magnitude
AdvancedMagnitude of the vector perpendicular to two vectors.
Vector Magnitude
IntermediateLength of a vector.
Eigenvalue Equation
AdvancedDefines eigenvalues and eigenvectors of a matrix.
Inverse of a 2×2 Matrix
AdvancedInverse of a 2×2 matrix (ad−bc ≠ 0).