Matrix Trace Calculator

Select the matrix size and enter its values to calculate the trace.

Quick Examples

Rate this tool

Solved Problems

The following are examples of problems solved by the calculator.

Exercise 1

Calculate the trace of the matrix:

$$ \displaystyle A = \begin{bmatrix} 2 & 1 & 0 \\[0.5em] 4 & 3 & -1 \\[0.5em] 5 & 2 & 4 \end{bmatrix} $$

Result

The trace is defined as the sum of the elements on the main diagonal, that is:

$$ \displaystyle \text{tr}(A) = 2 + 3 + 4 $$
$$ \displaystyle \text{tr}(A) = 9 $$
Exercise 2

Find the trace of the following 3x3 matrix:

$$ \displaystyle A = \begin{bmatrix} \frac{1}{3} & 2 & 1 \\[0.5em] 0 & \frac{2}{3} & 4 \\[0.5em] -1 & 3 & -\frac{1}{3} \end{bmatrix} $$

Result

To calculate the trace, we directly add the values located on the main diagonal:

$$ \displaystyle \text{tr}(A) = \frac{1}{3} + \frac{2}{3} + \left(-\frac{1}{3}\right) $$
$$ \displaystyle \text{tr}(A) = \frac{1}{3} + \frac{2}{3} - \frac{1}{3} $$
$$ \displaystyle \text{tr}(A) = \frac{2}{3} $$
Exercise 3

Determine the trace of the 4x4 matrix:

$$ \displaystyle A = \begin{bmatrix} \frac{1}{2} & 1 & 2 & 3 \\[0.5em] 4 & -\frac{3}{2} & 5 & 6 \\[0.5em] 7 & 8 & \frac{5}{2} & 9 \\[0.5em] 1 & 2 & 3 & \frac{1}{2} \end{bmatrix} $$

Result

The trace corresponds to the sum of the values on its main diagonal:

$$ \displaystyle \text{tr}(A) = \frac{1}{2} + \left(-\frac{3}{2}\right) + \frac{5}{2} + \frac{1}{2} $$
$$ \displaystyle \text{tr}(A) = \frac{1}{2} - \frac{3}{2} + \frac{5}{2} + \frac{1}{2} $$
$$ \displaystyle \text{tr}(A) = 2 $$

Related Tools

Daniel Machado

Professor of Mathematics, graduated from the Faculty of Exact, Chemical and Natural Sciences of the National University of Misiones (UNAM). Developer and creator of RigelUp, dedicated to building tools for mathematical learning.