1. Definition & Formula: What is the trace of a matrix?
The trace of an $n\times n$ square matrix $A=[a_{ij}]$ is the sum of its diagonal entries:
Trace is only defined for square matrices and is a simple, useful invariant in linear algebra.
Key properties:
- Linearity: $\mathrm{tr}(A+B)=\mathrm{tr}(A)+\mathrm{tr}(B)$ and $\mathrm{tr}(cA)=c\,\mathrm{tr}(A)$.
- Similarity invariance: if $B=P^{-1}AP$, then $\mathrm{tr}(B)=\mathrm{tr}(A)$.
- Cyclic property: $\mathrm{tr}(AB)=\mathrm{tr}(BA)$ (when dimensions agree).
2. How to compute trace (quick rule)
To compute the trace, simply add the diagonal entries of a square matrix. You do not need row reduction, determinants, or inversion.
Only square matrices have a trace. For non-square matrices, the trace is undefined.
3. Worked examples
Example 1 (2×2)
Compute the trace:
Example 2 (3×3)
Compute the trace:
4. Common mistakes
- Applying trace to non-square matrices: trace is not defined for non-square matrices.
- Including off-diagonal entries: only add diagonal elements $a_{11},a_{22},\dots$.
- Forgetting signs: negative diagonal entries must be included correctly.
- Expecting trace to equal determinant: trace and determinant are different invariants.
5. Practice problems (answers hidden)
Try these; click Show Answer to reveal the trace.
Exercise 1
Show Answer
Exercise 2
Show Answer
Exercise 3
Show Answer
Exercise 4
Show Answer
The trace of a matrix is also connected with the matrix inverse, matrix rank, and eigenvectors calculator.