# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/ai-ds/linear-methods/eigenvalue-diagonal-matrix
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/ai-ds/linear-methods/eigenvalue-diagonal-matrix/en.mdx

Learn how to read eigenvalues from diagonal entries of diagonal and triangular matrices, including determinant-trace relationships.

---

## Diagonal Matrices and Their Special Properties

For diagonal matrices, eigenvalues can be read directly from their main diagonal entries. This is one of the most fascinating features in linear algebra.

The eigenvalues of a square diagonal matrix or triangular matrix $$A \in \mathbb{K}^{n \times n}$$

Visible text: The eigenvalues of a square diagonal matrix or triangular matrix

Component: MathContainer
Children:

```math
A = \begin{pmatrix} a_{11} & & 0 \\ & \ddots & \\ 0 & & a_{nn} \end{pmatrix}
```

```math
\text{or } A = \begin{pmatrix} a_{11} & * \\ & \ddots & \\ 0 & & a_{nn} \end{pmatrix}
```

```math
\text{or } A = \begin{pmatrix} a_{11} & & 0 \\ & \ddots & \\ * & & a_{nn} \end{pmatrix}
```

are its main diagonal entries:

```math
\lambda_1 = a_{11}, \ldots, \lambda_n = a_{nn}
```

Why is this true? Since $$\chi_A(t) = \det(A - t \cdot I) = (a_{11} - t) \cdots (a_{nn} - t)$$ with roots $$a_{11}, \ldots, a_{nn}$$.

Visible text: Why is this true? Since with roots .

This property greatly simplifies our work because we don't need to calculate determinants or solve complex characteristic equations.

## Upper and Lower Triangular Matrices

Triangular matrices have the same property as diagonal matrices. For both upper and lower triangular matrices, the eigenvalues are still the main diagonal entries.

This happens because when we calculate $$\det(A - tI)$$, the entries above or below the main diagonal don't affect the determinant calculation. The triangular structure allows the determinant to be computed as the product of diagonal entries.

Visible text: This happens because when we calculate , the entries above or below the main diagonal don't affect the determinant calculation. The triangular structure allows the determinant to be computed as the product of diagonal entries.

## Direct Calculation Examples

Let's look at some concrete examples to better understand this concept.

### Complex Eigenvalues

Suppose $$A = \begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}$$. Its characteristic polynomial is:

Visible text: Suppose . Its characteristic polynomial is:

Component: MathContainer
Children:

```math
\chi_A(t) = \det \begin{pmatrix} 1-t & -1 \\ 1 & 1-t \end{pmatrix}
```

```math
= (1-t) \cdot (1-t) - 1 \cdot (-1) = t^2 - 2t + 2
```

which has roots $$\lambda_1 = 1 + i$$ and $$\lambda_2 = 1 - i$$.

Visible text: which has roots and .

### Zero Eigenvalues

For $$A = \begin{pmatrix} 1 & -i \\ i & 1 \end{pmatrix}$$, the characteristic polynomial is:

Visible text: For , the characteristic polynomial is:

Component: MathContainer
Children:

```math
\chi_A(t) = \det \begin{pmatrix} 1-t & -i \\ i & 1-t \end{pmatrix}
```

```math
= (1-t) \cdot (1-t) - i \cdot (-i) = t^2 - 2t
```

with roots $$\lambda_1 = 2$$ and $$\lambda_2 = 0$$.

Visible text: with roots and .

## Characteristic Polynomial Factorization

When matrix $$A \in \mathbb{C}^{n \times n}$$ has $$n$$ eigenvalues that don't have to be distinct $$\lambda_1, \ldots, \lambda_n \in \mathbb{C}$$, the characteristic polynomial $$\chi_A(t)$$ can be factored as:

Visible text: When matrix has eigenvalues that don't have to be distinct , the characteristic polynomial can be factored as:

```math
\chi_A(t) = (\lambda_1 - t) \cdots (\lambda_n - t)
```

The sum of algebraic multiplicities of all eigenvalues is $$n$$:

Visible text: The sum of algebraic multiplicities of all eigenvalues is :

```math
\sum_{\lambda \in \mathbb{C}} \mu_A(\lambda) = n
```

In a more compact form:

```math
\chi_A(t) = \prod_{\lambda \in \mathbb{C}} (\lambda - t)^{\mu_A(\lambda)}
```

This property holds naturally for complex eigenvalues of matrices with real entries. Eigenvalues can be real numbers or complex conjugate pairs.

## Relationship Between Determinant and Trace

There's a fundamental relationship between eigenvalues and the determinant and trace of a matrix. If the characteristic polynomial $$\chi_A(t)$$ can be factored linearly in $$\mathbb{K}$$, which means matrix $$A$$ has $$n$$ eigenvalues $$\lambda_1, \ldots, \lambda_n \in \mathbb{K}$$, then:

Visible text: There's a fundamental relationship between eigenvalues and the determinant and trace of a matrix. If the characteristic polynomial can be factored linearly in , which means matrix has eigenvalues , then:

Component: MathContainer
Children:

```math
\det A = \prod_{i=1}^n \lambda_i
```

```math
\text{tr} A = \sum_{i=1}^n \lambda_i
```

**The determinant is the product** of all eigenvalues, and **the trace is the sum** of all eigenvalues.

Let's verify with our previous examples:

For $$A = \begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}$$ with $$\lambda_1 = 1 + i$$, $$\lambda_2 = 1 - i$$:

Visible text: For with , :

Component: MathContainer
Children:

```math
\det A = 1 \cdot 1 - 1 \cdot (-1) = 2 = \lambda_1 \cdot \lambda_2
```

```math
\text{tr} A = 1 + 1 = 2 = \lambda_1 + \lambda_2
```

For $$A = \begin{pmatrix} 1 & -i \\ i & 1 \end{pmatrix}$$ with $$\lambda_1 = 2$$, $$\lambda_2 = 0$$:

Visible text: For with , :

Component: MathContainer
Children:

```math
\det A = 1 \cdot 1 - i \cdot (-i) = 0 = \lambda_1 \cdot \lambda_2
```

```math
\text{tr} A = 1 + 1 = 2 = \lambda_1 + \lambda_2
```

This relationship is very useful for verifying calculations and provides geometric insights into the linear transformation represented by the matrix.