# The Trace of a Square Matrix

Before we look at what the trace of a matrix is, let’s first define what the main diagonal of a square matrix is.

Definition: If $A$ is an square $n \times n$ matrix, then the Main Diagonal of $A$ consists of the entries $a_{11}, a_{22}, …, a_{nn}$ (entries whose row number is the same as their column number). |

The following image is a graphical representation of the main diagonal of a square matrix.

We are now ready to looking at the definition of the trace of a square matrix.

Definition: If $A$ is a square $n \times n$ matrix, then the Trace of $A$ denoted $\mathrm{tr}(A)$ is the sum of all of the entries in the main diagonal, that is $tr(A) = \sum_{i=1}^n a_{ii}$. If $A$ is not a square matrix, then the trace of $A$ is undefined. |

Calculating the trace of a matrix is relatively easy. For example, given the following $4 \times 4$ matrix $A = \begin{bmatrix} 3 & 2 & 0 & 4\\ 4 & 1 & -2 & 3\\ -3 & -2 & -4 & 7 \\ 3 & 1 & 1 & 5 \end{bmatrix}$ then $\mathrm{tr}(A) = 3 + 1 + (-4) + 5 = 5$.

## Example 1

**Given the following matrix $B$, calculate $\mathrm{tr}(B)$:**

(1)

We note that there are five entries of the main diagonal, that is $b_{11} = 1, \: b_{22} = 11, \: b_{33} = 3, \: b_{44} = 1, \: b_{55} = 14$. The sum of these entries is the trace of $B$, that is $\mathrm{tr}(B) = 1 + 11 + 3 + 1 + 14 = 30$.

## Example 2

**Find all values of $n$ such that $\mathrm{tr}(C) = 23$.**

(2)

We only give notice to entries in the main diagonal. By the definition of a trace of a matrix, it follows that $\mathrm{tr}(C) = 3 + n^2 + 4$. We were given that $\mathrm{tr}(C) = 23$, and we can therefore solve for $n$ as follows:

(3)

Hence $n = \pm 4$ then $\mathrm{tr} (C) = 23$.

## Example 3

**Prove that if $C = A + B$, then $\mathrm{tr}(C) = \mathrm{tr}(A) + \mathrm{tr}(B)$ (assume $A, \: B, \: C$ are all $n \times n$ square matrices).**

**Proof:**If $C = A + B$, then:

(4)

- And therefore we have that:

(5)

### Related post:

- FHSU fills need for teachers in rural areas – Hays Post
- Cabinet throwing up some odd ideas – Bangkok Post
- JEE Main Exam 2020 application process begins next week, everything you need to know – Hindustan Times
- A Library Browse Leads Math’s Bill Dunham to Question the Origins of the Möbius Function – Bryn Mawr Now
- Women Seen as Vital as Science Advances – All China Women’s Federation – Women of China
- Hard work pays off for Cardinal Newman students on GCSE results day – Brighton and Hove News
- 5 places to take your class for a Maths-themed trip – School Travel Organiser
- Mathematics Software Market SWOT Analysis of Top Key Player & Forecasts To 2025 – Tribaux
- ‘We are in a math crisis’ – Samuda laments poor performance in subject area, calls on retired teachers to help – Jamaica Gleaner
- Shape-shifting sheets | Harvard John A. Paulson School of Engineering and Applied Sciences – Harvard School of Engineering and Applied Sciences