MathematicsLinear AlgebraUniversity
OCRAPOntarioNSWCBSEGCE O-LevelMoECAPS

Matrix Trace

The sum of the diagonal elements of a square matrix, which also equals the sum of its eigenvalues.

Understand the formulaSee the free derivationOpen the full walkthrough

This public page keeps the free explanation visible and leaves premium worked solving, advanced walkthroughs, and saved study tools inside the app.

Core idea

Overview

The trace of a square matrix is the scalar value defined as the sum of the elements along its main diagonal. It is a fundamental operator in linear algebra that is equal to the sum of the matrix's eigenvalues and remains invariant under similarity transformations.

When to use: Use the trace when you need to calculate the sum of eigenvalues or identify invariant properties of a linear transformation. It is also applied when computing the inner product of two matrices or analyzing the divergence of a vector field in tensor calculus.

Why it matters: The trace is vital because it simplifies complex matrix operations into a single scalar that captures essential information about the system. In physics, it is used in quantum mechanics to find expectation values and in thermodynamics to define the partition function.

Symbols

Variables

tr(A) = Matrix Trace, = Diagonal Element a11, = Diagonal Element a22

tr(A)
Matrix Trace
The sum of the diagonal elements
Diagonal Element a11
The first element on the main diagonal
Diagonal Element a22
The second element on the main diagonal

Walkthrough

Derivation

Derivation/Understanding of Matrix Trace

This derivation defines the trace of a square matrix as the sum of its diagonal elements and demonstrates that it is also equal to the sum of its eigenvalues.

  • A is an n x n square matrix with real or complex entries.
  • Understanding of eigenvalues and eigenvectors.
  • Familiarity with the characteristic polynomial of a matrix.
1

Definition of the Trace:

The trace of a square matrix A is defined as the sum of the elements on its main diagonal.

2

Characteristic Polynomial and Eigenvalues:

The eigenvalues of a matrix A are the roots of its characteristic polynomial p() = (A - I). Expanding this determinant reveals that the coefficient of is (-1)^{n-1} (A).

3

Relationship between Roots and Coefficients:

Since , , are the roots of the characteristic polynomial, we can also express p() in factored form. Expanding this product, the coefficient of is (-1)^n (- ) = (-1)^{n+1} .

4

Equating Coefficients:

By equating the coefficients of from both expansions of the characteristic polynomial, we find that the trace of the matrix is equal to the sum of its eigenvalues.

Result

Source: Lay, D. C., Lay, S. R., & McDonald, J. J. (2016). Linear Algebra and Its Applications. Pearson.

Visual intuition

Graph

Graph unavailable for this formula.

The graph is a constant horizontal line because the trace of a fixed square matrix is a single scalar value regardless of the independent variable. Since the sum of the diagonal elements and the sum of the eigenvalues are invariant for a given matrix, the result does not change as the independent variable varies.

Graph type: constant

Why it behaves this way

Intuition

Imagine the trace as a measure of how much a linear transformation 'stretches' or 'shrinks' space along its principal directions, summing up these scaling effects into a single number.

tr(A)
The scalar sum of the diagonal entries of a square matrix A.
A single number that captures an invariant property of a linear transformation, related to its overall 'scaling' effect regardless of the chosen coordinate system.
A square matrix, which represents a linear transformation from a vector space to itself.
A mathematical object that transforms vectors by mapping them to new vectors, often involving rotation, scaling, or shearing.
The elements located on the main diagonal of the matrix A (where the row index equals the column index).
These elements directly contribute to the scaling components of the transformation along the standard basis vectors.
The eigenvalues of matrix A, which are the scalar factors by which eigenvectors are scaled under the transformation.
These are the fundamental scaling factors of the transformation along its special, invariant directions (eigenvectors), and their sum provides an alternative, coordinate-independent way to calculate the trace.

Free study cues

Insight

Canonical usage

The trace of a matrix inherits the units of its elements.

Common confusion

A common mistake is assuming the trace is always dimensionless, or confusing its units with those of the determinant (which are units of elements raised to the power of the matrix dimension).

Unit systems

tr(A)Unit of A's elements - The trace of a square matrix is a sum of its diagonal elements, and thus its units are identical to the units of those elements. If the matrix elements are dimensionless (e.g., probabilities or pure numbers), the trace

One free problem

Practice Problem

A 2×2 square matrix A has diagonal elements a₁₁ = x and a₂₂ = y. Calculate the trace (result) of matrix A.

Diagonal Element a1114 The first element on the main diagonal
Diagonal Element a22-5 The second element on the main diagonal

Solve for: result

Hint: The trace is found by adding the numbers located on the main diagonal from the top-left to the bottom-right.

The full worked solution stays in the interactive walkthrough.

Where it shows up

Real-World Context

In quantum mechanics, the expectation value of an observable is calculated as the trace of the product of the density matrix and the corresponding operator.

Study smarter

Tips

  • Confirm the matrix is square (n ×n) before attempting to find the trace.
  • Remember the cyclic property: tr(AB) = tr(BA).
  • The trace of a sum is the sum of the traces: tr(A + B) = tr(A) + tr(B).
  • Eigenvalue sum check: Use it to verify if your calculated eigenvalues are correct.

Avoid these traps

Common Mistakes

  • Attempting to calculate the trace for a non-square matrix.
  • Assuming tr(ABC) = tr(ACB); only cyclic permutations like tr(ABC) = tr(BCA) = tr(CAB) are guaranteed.
  • Confusing the trace with the determinant.

Common questions

Frequently Asked Questions

This derivation defines the trace of a square matrix as the sum of its diagonal elements and demonstrates that it is also equal to the sum of its eigenvalues.

Use the trace when you need to calculate the sum of eigenvalues or identify invariant properties of a linear transformation. It is also applied when computing the inner product of two matrices or analyzing the divergence of a vector field in tensor calculus.

The trace is vital because it simplifies complex matrix operations into a single scalar that captures essential information about the system. In physics, it is used in quantum mechanics to find expectation values and in thermodynamics to define the partition function.

Attempting to calculate the trace for a non-square matrix. Assuming tr(ABC) = tr(ACB); only cyclic permutations like tr(ABC) = tr(BCA) = tr(CAB) are guaranteed. Confusing the trace with the determinant.

In quantum mechanics, the expectation value of an observable is calculated as the trace of the product of the density matrix and the corresponding operator.

Confirm the matrix is square (n ×n) before attempting to find the trace. Remember the cyclic property: tr(AB) = tr(BA). The trace of a sum is the sum of the traces: tr(A + B) = tr(A) + tr(B). Eigenvalue sum check: Use it to verify if your calculated eigenvalues are correct.

References

Sources

  1. Linear Algebra and Its Applications by Gilbert Strang
  2. Wikipedia: Trace (linear algebra)
  3. Bird, R. Byron; Stewart, Warren E.; Lightfoot, Edwin N. (2007). Transport Phenomena (2nd ed.). John Wiley & Sons.
  4. Callen, Herbert B. (1985). Thermodynamics and an Introduction to Thermostatistics (2nd ed.). John Wiley & Sons.
  5. Lay, David C. Linear Algebra and Its Applications. Pearson, 2016.
  6. Trace (linear algebra). Wikipedia. https://en.wikipedia.org/wiki/Trace_(linear_algebra)
  7. Lay, D. C., Lay, S. R., & McDonald, J. J. (2016). Linear Algebra and Its Applications. Pearson.