How Matrix Trace Works
The trace of a square matrix is one of the simplest but most useful quantities in linear algebra. For an n×n matrix A, the trace, written tr(A), is defined as the sum of the entries on the main diagonal — the entries where the row index equals the column index: tr(A) = a11 + a22 + a33 + ... + ann. Trace is only defined for square matrices, since a non-square matrix has no single diagonal running from corner to corner.
How the trace is calculated
Enter the matrix size (2×2 or 3×3) and fill in the entries. The calculator reads off only the diagonal entries — a11 and a22 for a 2×2 matrix, or a11, a22, and a33 for a 3×3 matrix — and adds them together. For example, for A = [[4,1,2],[0,3,5],[1,2,6]], the diagonal entries are 4, 3, and 6, so tr(A) = 4 + 3 + 6 = 13. Every off-diagonal entry (like a12 or a31) is part of the matrix but plays no role in the trace itself.
Common mistakes
- Summing the wrong entries: the trace only uses a11, a22, ..., ann — do not add row sums, column sums, or off-diagonal entries.
- Confusing trace with determinant: the determinant measures how a matrix scales volume and involves every entry in a more complex formula; the trace is just the diagonal sum.
- Applying trace to a non-square matrix: a 2×3 or 3×2 matrix has no main diagonal in the usual sense, so trace is undefined for it.
Properties and applications
- Linearity: tr(A + B) = tr(A) + tr(B) and tr(cA) = c·tr(A) for a scalar c.
- Cyclic property: tr(AB) = tr(BA) for any matrices where both products are defined, even though AB ≠ BA in general.
- Sum of eigenvalues: tr(A) equals the sum of A's eigenvalues, and det(A) equals their product — two quick checks used when verifying eigenvalue calculations by hand.
- Basis independence: trace is invariant under similarity transformations, tr(A) = tr(P⁻¹AP), which is why it appears in physics and statistics as a coordinate-free scalar summary of a matrix or operator.
Frequently Asked Questions
What is the trace of a matrix?
The trace of a square n×n matrix A, written tr(A), is the sum of its main diagonal entries: tr(A) = a11 + a22 + ... + ann. For example, the matrix [[4,1,2],[0,3,5],[1,2,6]] has a trace of 4 + 3 + 6 = 13.
Can the trace be found for a non-square matrix?
No. Trace is only defined for square matrices, where the number of rows equals the number of columns, because it requires a well-defined main diagonal running from the top-left entry to the bottom-right entry.
How is the trace related to eigenvalues?
The trace of a matrix equals the sum of its eigenvalues, counted with algebraic multiplicity, even when the eigenvalues themselves are irrational or complex. This makes trace a fast way to sanity-check an eigenvalue calculation.
Is the trace the same no matter how the matrix is written?
The trace is invariant under similarity transformations, so tr(A) = tr(P⁻¹AP) for any invertible matrix P, and tr(AB) = tr(BA) whenever both products are defined. This basis-independence is why trace appears throughout linear algebra.
Common Tip Percentages
| Service | Typical Tip Range | Notes |
| Restaurant (sit-down) | 15–20% | 20%+ for exceptional service |
| Food delivery | 10–20% | Consider extra for long distances |
| Taxi / rideshare | 10–20% | More for assistance with luggage |
| Hotel housekeeping | $2–5/night | Leave daily, not just at checkout |
| Barber / hair salon | 15–20% | On pre-discount total |
| Pizza delivery | 10–15% or $3–5 minimum | Higher in bad weather |
General Household Budget Ratios (50/30/20 Rule)
| Category | % of Net Income | Examples |
| Needs | 50% | Rent, groceries, utilities, insurance |
| Wants | 30% | Dining out, entertainment, hobbies |
| Savings / Debt | 20% | Emergency fund, retirement, extra payments |
Common Measurement Conversions for Everyday Use
| Quantity | US / Imperial | Metric Equivalent |
| 1 cup | 8 fl oz | 237 mL |
| 1 pint | 16 fl oz | 473 mL |
| 1 quart | 32 fl oz | 946 mL |
| 1 gallon | 128 fl oz | 3.785 L |
| 1 lb | 16 oz | 453.6 g |
| 1 ft | 12 in | 30.48 cm |