Steply

Diagonalize [5, 4; 1, 2]

Step by step, with the reason for every step · Diagonalizing a matrix · Linear Algebra

Step by step

The question

Question: diagonalize A.

A = [5, 4; 1, 2]

Diagonalizing means writing A as P times D times P inverse.

The columns of P are eigenvectors.

D is diagonal: the eigenvalues down the diagonal, 0s elsewhere.

A = P D P−1
P: eigenvectors as columns
D: their λs down the diagonal

1 Find the eigenvalues

As in the eigenvalue lesson: take λ off the diagonal of A.

A − λI = [5 − λ, 4; 1, 2 − λ]

Its determinant, down minus up, must be 0.

So (5 − λ)(2 − λ) − 1 × 4 = 0.

(5 − λ)(2 − λ) − 1 × 4 = 0

Multiply out the brackets, and 1 × 4 = 4.

10 − 5λ − 2λ + λ2 − 4 = 0

Like terms together, the highest power first: λ² − 7λ + 6 = 0.

λ2 − 7λ + 6 = 0

It factors, as in the factoring lesson.

(λ − 1)(λ − 6) = 0

So λ = 1 or λ = 6.

λ = 1 or λ = 6

2 Eigenvector for λ = 1

We take 1 off the diagonal: 5 − 1 = 4 and 2 − 1 = 1.

A − 1I = [4, 4; 1, 1]
→ [1, 1; 4, 4]
→ [1, 1; 0, 0]

A row of 0s: the letter y is free.

That is why there are eigenvectors.

Row 1 as an equation: x + y = 0.

x + y = 0

We want x alone.

To remove + y, we take away y on both sides.

x + y − y = −y

They cancel on the left.

So x = −y.

x = −y

We pick y = 1.

So an eigenvector for λ = 1 is (−1, 1).

v = [−1; 1]

3 Eigenvector for λ = 6

We take 6 off the diagonal: 5 − 6 = −1 and 2 − 6 = −4.

A − 6I = [−1, 4; 1, −4]
→ [1, −4; −1, 4]
→ [1, −4; 0, 0]

A row of 0s: the letter y is free.

That is why there are eigenvectors.

Row 1 as an equation: x − 4y = 0.

x − 4y = 0

We want x alone.

To remove − 4y, we add 4y on both sides.

x − 4y + 4y = 4y

They cancel on the left.

So x = 4y.

x = 4y

We pick y = 1.

So an eigenvector for λ = 6 is (4, 1).

v = [4; 1]

4 Build P and D

P: the eigenvector for λ = 1 is column 1, the one for λ = 6 is column 2.

D: 1 first, then 6, in the same order.

P = [−1, 4; 1, 1], D = [1, 0; 0, 6]

Careful!

The order matters.

The first λ in D goes with the first column of P.

Careful: D in the same order as the columns of P

So A = P D P⁻¹, with this P and D.

A = P D P−1

5 Check

Let's check without the inverse: A = P D P⁻¹ means A P = P D.

We work out both sides.

First A times P.

A P = [5, 4; 1, 2] × [−1, 4; 1, 1]
A P = [5 × (−1) + 4 × 1, 5 × 4 + 4 × 1; 1 × (−1) + 2 × 1, 1 × 4 + 2 × 1]
A P = [−1, 24; 1, 6]

Now P times D.

P D = [−1, 4; 1, 1] × [1, 0; 0, 6]
P D = [−1 × 1 + 4 × 0, −1 × 0 + 4 × 6; 1 × 1 + 1 × 0, 1 × 0 + 1 × 6]
P D = [−1, 24; 1, 6]

Both give rows −1, 24 and 1, 6.

So A P = P D, and the answer is right!

Let's look back.

First: find the eigenvalues.

Then: eigenvector for λ = 1.

Then: eigenvector for λ = 6.

Then: build P and D.

Last: check.

Answer
A = P D P−1

Your turn

Try this one yourself, then check:

Diagonalize [4, 6; 1, 3]
Show the answer
P = [−2, 3; 1, 1], D = [1, 0; 0, 6]

More from Diagonalizing a matrix

The whole lesson: Diagonalizing a matrix →