Calculator
Use the responsive controls below. The options area is three columns on large screens, two on tablets, and one on mobile.
Example Data Table
| Example | Matrix | Diagonal entries | Trace | Note |
|---|---|---|---|---|
| Example 1 | [[5, 2, -1], [0, 3, 4], [7, 1, 6]] | 5, 3, 6 | 14 | Standard square matrix with positive trace. |
| Example 2 | [[1, 0, 0], [0, 1, 0], [0, 0, 1]] | 1, 1, 1 | 3 | Identity matrix. Trace equals matrix order. |
| Example 3 | [[4, 8], [2, -6]] | 4, -6 | -2 | Mixed diagonal signs produce a negative trace. |
Formula Used
The trace of a square matrix is the sum of the entries on its main diagonal.
- Only square matrices have a trace.
- The main diagonal runs from the top-left corner to the bottom-right corner.
- For a 3 × 3 matrix, trace equals a11 + a22 + a33.
- The trace also equals the sum of eigenvalues, counting multiplicity.
- Similarity transformations preserve the trace, making it useful in linear algebra and matrix analysis.
How to Use This Calculator
- Select the matrix size from 1 × 1 up to 8 × 8.
- Choose the output precision and number format.
- Enter each matrix value manually or use a quick-fill button.
- Press Calculate Trace to display the result below the header and above the form.
- Review the trace, diagonal statistics, matrix traits, and the plotted diagonal chart.
- Use the CSV or PDF buttons to export the current result set.
Frequently Asked Questions
1. What is matrix trace?
Matrix trace is the sum of the main diagonal entries of a square matrix. It is written as tr(A) and is widely used in algebra, statistics, and physics.
2. Can rectangular matrices have a trace?
No. The trace is defined only for square matrices because the main diagonal must have matching row and column positions from start to end.
3. Why does the calculator highlight matrix traits?
Those checks help you interpret the matrix quickly. They show whether the matrix is diagonal, scalar, identity, or symmetric, which can matter in proofs and applications.
4. Does changing off-diagonal values affect the trace?
Off-diagonal values do not change the trace directly. Only entries on the main diagonal contribute to the trace total.
5. Why is the trace useful in linear algebra?
Trace connects matrix entries to deeper properties. It equals the sum of eigenvalues and stays unchanged under similarity transformations, which makes it a powerful invariant.
6. What does the diagonal chart show?
The chart displays each main diagonal value separately. It helps you see which positions add positively, negatively, or contribute zero to the total trace.
7. Can I export the results?
Yes. The page includes CSV and PDF download buttons after calculation, so you can save the summary, diagonal entries, and matrix values.
8. What happens if I use decimals or negative numbers?
The calculator handles decimals, positive values, negatives, and zeros. You can also choose fixed, scientific, or trimmed output formatting for cleaner results.