---
title: det_and_trace
tags: Linear algebra
GA: G-77TT93X4N1
---
# Relations between trace, determinant and eigenvalues
## Determinant of A equals to the product of its eigenvalues
Given a $n\times n$ matrix $A$, define
$$
\tag{1}
P(\lambda) = det(\lambda I-A),
$$
then we have
$$
\tag{2}
P(\lambda) = \lambda^n + c_{n-1}\lambda^{n-1}\cdots + c_1\lambda + c_0.
$$
Since $P$ is a nth-degree polynomial that has $n$ roots $\lambda_1, \cdots, \lambda_n$, we can rewrite $P$ as
$$
\tag{3}
P(\lambda) = (\lambda - \lambda_1)\cdots (\lambda - \lambda_n).
$$
Finally, let us calculate $P(0)$.
* Using (1)
$$
\tag{4}
P(0) = det(-A) = (-1)^n det(A).
$$
* Using (3)
$$
\tag{5}
P(0) = (- \lambda_1)\cdots (- \lambda_n) = (-1)^n\lambda_1\cdots\lambda_n.
$$
Therefore, using (4) and (5),
$$
det(A) = \lambda_1\cdots\lambda_n.
$$
---
## Trace of A equals to the sum of its eigenvalues
Let $A$ be a $n\times n$ matrix written as
$$
\tag{6}
A = \begin{bmatrix}
a_{11} & \cdots & a_{1n}\\
\vdots & \ddots & \vdots\\
a_{n1} & \cdots & a_{nn}
\end{bmatrix},
$$
so that
$$
\tag{7}
\lambda I - A =
\begin{bmatrix}
\lambda - a_{11} & -a_{12} & \cdots & -a_{1n} \\
-a_{21} & \lambda-a_{22} & \cdots & -a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
-a_{n1} & -a_{n2} & \cdots & \lambda - a_{nn}
\end{bmatrix}.
$$
To calaulate $det(\lambda I - A)$, we use cofactor expansion along the first column:
$$
\tag{8}
det(\lambda I - A) =
(\lambda - a_{11})C_{11} +(- a_{21}) C_{21}+ \cdots,
$$
where
$$
C_{11} =
\begin{bmatrix}
\lambda-a_{22} & \cdots & -a_{2n}\\
\vdots & \ddots & \vdots\\
-a_{n2} & \cdots & \lambda - a_{nn}
\end{bmatrix}_{(n-1)\times(n-1)},
$$
and
$$
C_{21} =
\begin{bmatrix}
-a_{12} & -a_{13} & \cdots & -a_{1n}\\
-a_{32} & \lambda-a_{33} & \cdots & -a_{3n}\\
\vdots & \vdots & \ddots & \vdots\\
-a_{n2} & \cdots & \cdots & \lambda - a_{nn}
\end{bmatrix}_{(n-1)\times(n-1)}.
$$
The important observation is that $C_{21}$ is a polynomial of degree at most $n-2$. Also, all the $C_{k1}$, $k>1$, are polynomials of degree at most $n-2$. As a result, we have
$$
\tag{9}
det(\lambda I - A) = (\lambda - a_{11})C_{11} + \hat{Q}_{n-2}(\lambda),
$$
where $\hat{Q}_{n-2}(\lambda)$ is a polynomial of degree at most $n-2$.
Such an procedure can be performed iteratively, and eventually we have
$$
\tag{10}
det(\lambda I - A) = (\lambda - a_{11})(\lambda - a_{22})\cdots (\lambda - a_{nn}) + \tilde{Q}_{n-2}(\lambda),
$$
where $\tilde{Q}_{n-2}(\lambda)$ is a polynomial of degree at most $n-2$.
Equation~(10) can then be rewritten as
$$
\tag{11}
det(\lambda I - A) = \lambda^n - (a_{11} + a_{22} + \cdots + a_{nn})\lambda^{n-1} + Q_{n-2}(\lambda),
$$
where $Q_{n-2}(\lambda)$ is a polynomial of degree at most $n-2$.
On the other hand, from (3) we have
$$
\tag{12}
P(\lambda) = \lambda^n - (\lambda_1 + \lambda_2 + \cdots + \lambda_n)\lambda^{n-1} + \cdots.
$$
Therefore, using (11) and (12),
$$
a_{11} + a_{22} + \cdots + a_{nn} = \lambda_1 + \lambda_2 + \cdots + \lambda_n.
$$