Traço de Matriz

tr(M) = soma dos elementos da diagonal.
Created by
Renato Passos, Eng. de Software
Reviewed by
Renato Passos, Eng. de Software

Last updated: Apr 18, 2026

tr(M)
5,00

Formula

tr(M) = Σ mᵢᵢ

About this calculator

The matrix trace calculator computes the sum of the diagonal elements of a square matrix. The trace, denoted tr(M), is a fundamental operation in linear algebra, with applications in physics, engineering, and data science. The formula is simple: tr(M) = Σ mᵢᵢ, where mᵢᵢ are the elements at position (i,i) of the matrix.

To use the calculator, enter the matrix elements row by row, separating numbers by commas or spaces. The tool accepts square matrices of any order (2x2, 3x3, etc.). The result is displayed instantly. It is useful for checking manual calculations, especially in problems involving eigenvalues, as the trace equals the sum of the eigenvalues.

Common use cases include: verifying matrix properties in linear transformations, calculating tensor invariants in physics, or simplifying expressions in computer graphics. Caution: the matrix must be square; otherwise, the trace is not defined. Also, note that the trace is linear and invariant under cyclic permutations, but not under arbitrary transformations.

To avoid errors, ensure the matrix is well formatted. Use dots as decimal separators if needed. The calculator does not support symbolic variables, only real numbers. If you need to compute the trace of a matrix product, remember that tr(AB) = tr(BA), but tr(ABC) = tr(BCA) = tr(CAB).

Frequently asked questions

Can I compute the trace of a non-square matrix?

No, the trace is only defined for square matrices. If the matrix is not square, the calculator will display an error.

What does a trace of zero mean?

A trace of zero means the sum of the diagonal elements is zero. It does not imply the matrix is zero or singular.

How does the trace relate to eigenvalues?

The trace of a matrix equals the sum of its eigenvalues (counting multiplicities). This is useful for verifying eigenvalue calculations.

Does the calculator accept complex numbers?

No, currently the calculator only accepts real numbers. For complex numbers, you need specialized tools.

What is the difference between trace and determinant?

The trace is the sum of diagonal elements, while the determinant is a scalar that indicates invertibility. Both are invariant under basis changes, but the determinant is more complex to compute.

Other Algebra Linear calculators