## Section3.8Trace

The trace of a (square) matrix is just the sum of all of its diagonal elements. In terms of components,

$$\mathrm{tr}(A)=\sum_i A_{ii}\text{.}\tag{3.8.1}$$

For example, if

$$A=\left(\begin{array}{ccc} 1\amp 2\amp 3\\ 4\amp 5\amp 6\\ 7\amp 8\amp 9 \end{array} \right)\tag{3.8.2}$$

then

$$\mathrm{tr}(A)=1+5+9=15\text{.}\tag{3.8.3}$$

Try it for yourself by computing

$$\mathrm{tr}\left(\begin{array}{ccc} 1\amp 34\amp 5\\ 23\amp 5\amp 98\\ 132\amp 7\amp 9 \end{array} \right)\text{.}\tag{3.8.4}$$