Determinant from eigenvalues Is it always true that product of eigenvalues is determinant of a matrix ?
what if one of the eigenvalues are same and matrix is not diagonalizable ? Is this statement is still true ?
 A: $\DeclareMathOperator{\Tr}{Tr}$
The determinant is the product of the zeroes of the characteristic polynomial (counting with their multiplicity), and the trace is their sum, regardless of diagonalizability of the matrix. If the underlying field is algebraically closed (such as $\mathbb{C}$), then those zeroes will exactly be the eigenvalues.
Proof:
Let $k_A$ be the characteristic polynomial $k_A(\lambda)=\det(A-\lambda I)$ of the $n\times n$ matrix $A$. It's expanded form is $k_A(\lambda)=a_n\lambda^n + a_{n-1}\lambda^{n-1} + \cdots + a_1\lambda + a_0$, noting that the degree of the polynomial is $n$ because the determinant is a sum of products of $n$ matrix entries (each entry having at most one $\lambda$).
Observe that $k_A(0) = \det(A)$, so $a_0 = \det(A)$.
Notice that the only way to get the power $\lambda^n$ as a product of $n$ matrix entries, taking exactly one from every row and column, is to choose the entries on the main diagonal: $(a_{11} - \lambda)(a_{22} - \lambda)\cdots (a_{nn} - \lambda)$.
This yields $(-1)^n\lambda^n$ when expanded, so $a_n = (-1)^n$.
Now, let's calculate $a_{n-1}$: the power $\lambda^{n-1}$ is yielded also only from the product of main diagonal entries $(a_{11} - \lambda)(a_{22} - \lambda)\cdots (a_{nn} - \lambda)$, when multiplying $n-1$ terms with $-\lambda$, and one $a_{ii}$ term. This is multiplied to $a_{ii}(-1)^{n-1}\lambda^{n-1}$. Doing this for every $i \in \{1, 2, \ldots, n\}$ and summing the results, we get $(a_{11} + a_{22} + \cdots + a_{nn})(-1)^{n-1}\lambda^{n-1} = \Tr(A)(-1)^{n-1}\lambda^{n-1}$, so $a_{n-1} = \Tr(A)(-1)^{n-1}$
So, $k_A(\lambda)=(-1)^n\lambda^n + \Tr(A)(-1)^{n-1}\lambda^{n-1} + \cdots + a_1\lambda + \det(A)$. Let's denote the roots of $k_A$ with $\lambda_1, \ldots, \lambda_n$ (not necessarily distinct).
Now, using Vieta's formulas we have:
$$\lambda_1\lambda_2\cdots\lambda_n = (-1)^n\frac{a_0}{a_n} = \det(A)$$
$$\lambda_1 + \lambda_2 + \cdots + \lambda_n = -\frac{a_{n-1}}{a_n} = \Tr(A)$$
As you probably know, if $A$ is diagonalizable, then we can write:
$$A = P^{-1}\begin{bmatrix}
        \lambda_1 & 0 & 0 & \ldots & 0 \\
        0 & \lambda_2 & 0 & \ldots & 0 \\
        \vdots & \vdots & \vdots & & \vdots \\
        0 & 0 & 0 & \ldots & \lambda_n \\
        \end{bmatrix}P$$
for an invertible matrix $P$. Then, using the fact that $\det$ and $\Tr$ are similarity invariants, we get the desired identities.
