Prove $tr(A)=\sum\limits_{\lambda\in Spec(A)} m_\lambda\lambda$ where $m_\lambda$ is the algebraica multipicity.
My work
We know, The trace of a matrix coincides with the sum of all the eigenvalues of the matrix.
Then
$tr(A)=\sum\limits_{i=1}^n a_{ii}=\lambda_1+...+\lambda_n=\sum\limits_{i=1}^n\lambda_i$
Here, i'm stuck. Can someone help me?
Note: $Spec(A)$ is the set of eigenvalues of $A$
Put $A$ into the form $A = PDP^{-1}$ where $D$ denotes the Jordan canonical form. Then, $$\textrm{Tr} (A) = \textrm{Tr} ( P D P^{-1})$$ Recall that the trace is invariable under cyclic permutations of the inside matrices, so that $$\textrm{Tr} (PDP^{-1} ) = \textrm{Tr} (D P^{-1} P ) = \textrm{Tr} (D)$$ And the trace of the Jordan block matrix is precisely $\sum_{\lambda \in \textrm{Spec} (A)} m_{\lambda} \lambda$.