Sum of eigenvalues of a symmetric matrix
Problem to calculate the sum of eigenvalues of a matrix:
$$ \begin{pmatrix} 1 & 1 & 3 \\ 1 & 5 & 1 \\ 3 & 1 & 1 \\ \end{pmatrix}$$
I can calculate the eigenvalues by using the characteristic equation and then add them up. However, the given hint for this problem was that the sum of eigenvalues is the sum of diagonal elements, making this a $10$ sec problem.
So I am wondering if all symmetric matrices have this property (sum of eigenvalues of a symmetric matrix is the sum of its diagonal elements)?
But I couldn't find such property mentioned online or in the book.
I tried with a few symmetric matrices on wolframalpha and it seems to be true.
Please help to clarify this doubt.
$\endgroup$3 Answers
$\begingroup$The sum of the eigenvalues is just the sum of the roots of the characteristic polynomial, hence it is encoded in a coefficient of such polynomial by Viete's theorem. Such coefficient is just the sum of the diagonal entries of the matrix, hence the sum of the eigenvalues equals the sum of the diagonal entries for any matrix.
$\endgroup$ 2 $\begingroup$The characteristic polynomial of a $n \times n$ matrix $A$ is $p(t)=\det(tI-A)=(t-\lambda_1)...(t-\lambda_n)$, where $\lambda_1,..,\lambda_n$ are the eigenvalues of $A$. You can see that $p(t)= t^n - (\lambda_1+...+\lambda_n)t^{n-1}+...$
On the other hand, write the expansion of the determinant and see that the only place where you can find the term $t^{n-1}$ is in the expansion of $(t-a_{11})...(t-a_{nn})$ and you can see that the coefficient of $t^{n-1}$ is $-(a_{11}+...+a_{nn})$.
$\endgroup$ $\begingroup$By the Spectral Theorem we can write a symmetric matrix $A$ as $UDU^*$ where $D$ is a diagonal matrix with the eigenvalues of $A$ as its entries and $U$ an orthonormal matrix containing the eigenvectors of $A$.
The trace is invariant under orthonormal transformations so $trace(A) = trace(UDU^*) = trace(D)$ is the sum of the eigenvalues.
$\endgroup$