How this instrument works
The trace of a square matrix is the sum of the entries sitting on its main diagonal — for a 2×2 matrix A = [[a, b], [c, d]], that is simply tr(A) = a + d. Nothing about b or c enters the sum, no matter how large or small those two off-diagonal numbers happen to be. The definition is deliberately narrow: trace reads only the terms A_11, A_22, …, A_nn, one contribution per row, and a 2×2 matrix has exactly two such terms to add.
That narrowness is not a limitation so much as the whole point. Trace is invariant under a change of basis — tr(P⁻¹AP) = tr(A) for any invertible P — so the single number a + d describes something real about the linear map A represents, not an artefact of how its rows and columns happen to be written down. Row-reduce the matrix, rotate the coordinate system, or conjugate it by any invertible matrix, and the trace comes back unchanged even though every individual entry can move.
The genuinely useful consequence shows up alongside the determinant: for any square matrix, the trace equals the sum of the eigenvalues and the determinant equals their product, true before you ever solve the characteristic polynomial. For [[1, 2], [3, 4]], trace = 5 and determinant = −2 (as this site's determinant sheet already reports for the identical matrix), which pins both eigenvalues down to a single quadratic, λ² − 5λ − 2 = 0, without expanding det(A − λI) by hand.
- Enter the matrix's four entries into a (row1,col1), b (row1,col2), c (row2,col1), and d (row2,col2), read as [[a, b], [c, d]].
- Read Trace — it reports a + d, the sum of the two diagonal entries, and nothing else.
- Change b or c and confirm Trace does not move; only a and d can shift it.
- Change a or d and Trace shifts by that exact amount, since it is nothing more than their sum.
Worked example — reading the diagonal of [[1, 2], [3, 4]]
Set a (row1,col1) = 1, b (row1,col2) = 2, c (row2,col1) = 3, and d (row2,col2) = 4, so the matrix reads [[1, 2], [3, 4]]. Trace adds only the two diagonal entries: 1 + 4 = 5. The off-diagonal entries, 2 and 3, contribute nothing to the sum — halve them, double them, or swap them outright, and Trace still reads exactly 5.
That same matrix already has a determinant on record elsewhere on this site: ad − bc = 1×4 − 2×3 = −2. Together, trace = 5 and determinant = −2 are the two coefficients of the characteristic polynomial, λ² − 5λ − 2 = 0 — meaning the pair of numbers this sheet and the determinant sheet report between them is already enough to know both eigenvalues sum to 5 and multiply to −2, with no further matrix work required.
Questions
What is the trace of a matrix?
The trace of a square matrix is the sum of the entries on its main diagonal, running from the top-left corner to the bottom-right. For a 2×2 matrix [[a, b], [c, d]] that reduces to tr(A) = a + d — the off-diagonal entries b and c are never added in, however large they happen to be.
Why doesn't the trace use the off-diagonal entries?
Because trace is defined as the sum of the terms A_ii, one per row of the diagonal, and a 2×2 matrix only has two such terms: a and d. Operations that do combine b and c — the determinant, or a full row-by-column matrix multiplication — are different formulas entirely, built to mix an entire row against an entire column.
How does the trace relate to a matrix's eigenvalues?
The trace always equals the sum of a matrix's eigenvalues, and the determinant always equals their product — true before either eigenvalue is actually found. For [[1, 2], [3, 4]], trace = 5 and determinant = −2, so the characteristic polynomial λ² − 5λ − 2 = 0 is already pinned down without expanding det(A − λI) by hand.
Does swapping the b and c entries change the trace?
No. Trace reads only a and d, so swapping, scaling, or zeroing out b and c leaves tr(A) completely unchanged — even though that same swap can change the determinant unless b already equals c. Students often expect every matrix quantity to move when any entry changes; trace is deliberately blind to two of the four numbers.
Is the trace just the sum of all four entries?
No — that would be a + b + c + d, a different and less structurally meaningful number. Trace restricts the sum to the main diagonal, a + d, specifically because that restricted sum stays invariant under a change of basis, tr(P⁻¹AP) = tr(A), a property the sum of all four entries does not share.
Does trace distribute over matrix multiplication, so tr(AB) = tr(A)·tr(B)?
No — that identity does not hold in general. What does hold is the cyclic property, tr(AB) = tr(BA), true even though AB and BA are usually different matrices in their own right. Trace is linear rather than multiplicative: tr(A + B) = tr(A) + tr(B) always, added diagonal entry by diagonal entry.