Matrix Trace
Calculate the trace (sum of diagonal elements) of any 2x2 or 3x3 square matrix instantly. Free online matrix trace calculator with step-by-step results for linear algebra students and professionals.
About This Calculator
The matrix trace calculator computes the trace (sum of diagonal elements) of any square matrix from 2x2 up to 3x3. The trace of a matrix is one of the most fundamental concepts in linear algebra, with deep connections to eigenvalues, determinants, and matrix invariants. This tool is designed for mathematics students, engineers, data scientists, and anyone working with linear transformations who needs a quick and accurate trace computation.
The trace of a matrix A, denoted tr(A), is defined as the sum of the entries on the main diagonal: tr(A) = a11 + a22 + ... + aₙₙ. For a 2x2 matrix [[a, b], [c, d]], the trace simplifies to a + d. For a 3x3 matrix, it is the sum of the three diagonal entries. The trace is a linear operation, meaning tr(A + B) = tr(A) + tr(B) and tr(kA) = k·tr(A). It also satisfies the cyclic property: tr(ABC) = tr(BCA) = tr(CAB).
The trace has important applications across mathematics and physics. In quantum mechanics, the trace of a density matrix gives the expectation value of observables. In differential geometry, the trace of the shape operator relates to mean curvature. In machine learning, the trace of the covariance matrix represents total variance. The trace of a matrix also equals the sum of its eigenvalues, making it a quick way to verify eigenvalue computations.
Select your matrix size (2x2 or 3x3), enter the coefficients in the grid, and click Calculate Trace to get the result with up to 6 decimal places of precision. The calculator supports real numbers including negative values, decimals, and large numbers.
Frequently Asked Questions
What is the trace of a matrix?
The trace of a square matrix is the sum of all the elements on its main diagonal (from the top-left to the bottom-right). For a 2x2 matrix [[a, b], [c, d]], the trace is a + d. For a 3x3 matrix, it is a11 + a22 + a33.
Is the trace of a matrix a linear transformation?
Yes, the trace operation is linear. It satisfies tr(x·A + y·B) = x x tr(A) + y x tr(B) for any square matrices A and B of the same size and scalars x and y.
What is the cyclic property of the trace?
The trace is invariant under cyclic permutations: tr(ABC) = tr(BCA) = tr(CAB) for any conformable matrices A, B, C. This property is crucial in quantum mechanics and linear algebra proofs.
How is the trace related to eigenvalues?
The trace of a matrix equals the sum of its eigenvalues. For a 2x2 matrix, if the eigenvalues are lambda1 and lambda2, then tr(A) = lambda1 + lambda2. The characteristic polynomial is p(lambda) = lambda^2 - tr(A)·lambda + det(A).
What is the trace of a projection matrix?
The trace of a projection matrix equals the dimension of the space it projects onto (its rank). This follows from the general result that the trace of an idempotent matrix (A^2 = A) is equal to its rank.
What is the trace of a 3x3 identity matrix?
The trace of an nxn identity matrix Iₙ is n. So tr(I2) = 2 and tr(I3) = 3, since the identity matrix has 1s on all diagonal entries.
Can the trace of a matrix be negative?
Yes, the trace can be negative if the diagonal elements sum to a negative value. For example, the matrix [[-5, 0], [0, -3]] has a trace of -8. The trace has no sign restrictions.
What is the relationship between trace, determinant, and eigenvalues of a 2x2 matrix?
For a 2x2 matrix, the characteristic polynomial is p(lambda) = lambda^2 - tr(A)·lambda + det(A). The eigenvalues lambda1, lambda2 are given by 1/2·tr(A) +/- 1/2·sqrt(tr(A)^2 - 4·det(A)). This formula connects the trace and determinant directly to the eigenvalues.