Trace of Matrix Product

From ProofWiki
Jump to navigation Jump to search


Let $\mathbf A$ and $\mathbf B$ be square matrices of order $n$.

Let $\mathbf A \mathbf B$ be the (conventional) matrix product of $\mathbf A$ and $\mathbf B$.


$\ds \map \tr {\mathbf A \mathbf B} = \sum_{i \mathop = 1}^n \sum_{j \mathop = 1}^n a_{i j} b_{j i}$

where $\map \tr {\mathbf A \mathbf B}$ denotes the trace of $\mathbf A \mathbf B$.

Using the Einstein summation convention, this can be expressed as:

$\map \tr {\mathbf A \mathbf B} = a_{i j} b_{j i}$


Let $\mathbf C := \mathbf A \mathbf B$.

By definition of matrix product:

$\ds c_{i k} = \sum_{j \mathop = 1}^n a_{i j} b_{j k}$

Thus for the diagonal elements:

$\ds c_{i i} = \sum_{j \mathop = 1}^n a_{i j} b_{j i}$

By definition of trace:

$\ds \map \tr {\mathbf C} = \sum_{i \mathop = 1}^n c_{i i}$

Hence the result.