# If A is any matrix , to what is tr(AA^t) equal?Where tr denotes the trace of a matrix.Which is the sum of the entries on its main diagonal. If you could put it in step by step form how you get the...

If A is any matrix , to what is tr(AA^t) equal?

Where tr denotes the trace of a matrix.Which is the sum of the entries on its main diagonal. If you could put it in step by step form how you get the answer it would be much appreciated.

### 2 Answers | Add Yours

If `A` is any m x n matrix which we write as

`A` = (a11 a12 a13 ... a1n)

a21 a22 a23 ... a2n

a31 a32 a33 ... a3n

.

.

(am1 am2 am3 ... amn)

then

`tr(A A^T) = Sigma_(j=1)^nSigma_(i=1)^m a_(ij)^2 `

ie the sum of all the squared elements of `A`

For example, if `A` is a 4 x 3 matrix

`A A^T` = (a11 a12 a13) . (a11 a21 a31 a41)

a21 a22 a23 a12 a22 a32 a42

a31 a32 a33 (a13 a23 a33 a43)

(a41 a42 a43)

= (a11^2 + a12^2 + a13^2 . . . )

. a21^2 + a22^2 + a23^2 . .

. . a31^2 + a32^2 + a33^3 .

( . . . a41^2 + a42^2 + a43^2)

The entries marked '.' are not important for this calculation.

For general m and n, ` `the sum of all the diagonal entries of `A A^T`where `A`is any m x n matrix is given by` `` `

`tr(A A^T) = Sigma_(j=1)^nSigma_(i=1)^m a_(ij)^2` ** answer**

When we multiply two square matrices A & B, of the same size, the ith diagonal entry in AB will be equal to

a{i1} * b{1i} + a{i2} * b{2i} + ... + a{in} * b{ni}

where a{ij} is the entry in the ith row and jth column of matrix A.

Now if A^t = B we will have that

the ith entry will be:

a{i1} * a{i1} + a{i2} * a{i2} + ... + a{in} * a{in} = a{i1}^2 + a{i2}^2 + ... + a{in}^2

The trace of the matrix is thus

sum_i [ a{i1}^2 + a{i2}^2 + ... + a{in}^2 ] = sum_i sum_j [ a{ij}^2 ]

i.e. the sum of squares of all the entries of A.