Let A=

[7 -4 4]
[-4 5 0]
[4 0 9]

a) Orthogonally diagonalize A

b) Use answer from a) to construct a spectral decomposition for A.

c) Suppose that x=[1 2 1] and let u be the eigen vector from a) corresponding to the largest eigen-value of A. If W=Span {u}, then use b) to decompose x into a sum of vectors, one in W and the other in W¡Í.

To orthogonally diagonalize matrix A:

a) First, find the eigenvalues of A by solving the characteristic equation det(A - λI) = 0, where λ is the eigenvalue and I is the identity matrix.

In this case, we have:
det(A - λI) = det([7 -4 4] - λ[1 0 0]) [-4 5 0] [4 0 9] - λ[0 1 0] [4 0 9]
= (7 - λ)(5 - λ)(9 - λ) - 4(-4)(0) = 0

Expanding the determinant and simplifying, we get:
(7 - λ)(5 - λ)(9 - λ) = 0
Solving this equation, we find three eigenvalues: λ₁ = 7, λ₂ = 5, λ₃ = 9.

b) Next, for each eigenvalue, find the corresponding eigenvector by solving the equation (A - λI)x = 0.

For λ = 7:
(A - 7I)x = [7 -4 4] - 7[1 0 0] [x₁] = [0]
[-4 5 0] [x₂]
[4 0 9] [x₃]

Simplifying, we get the following system of equations:
-6x₁ - 4x₂ + 4x₃ = 0
-4x₁ - 2x₂ = 0
4x₁ + 4x₃ = 0

Solving this system, we find the eigenvector corresponding to λ = 7: u₁ = [2 -1 1]

Similarly, for λ = 5, we find the eigenvector: u₂ = [-4 2 0]

And for λ = 9, we find the eigenvector: u₃ = [2 0 3]

c) Finally, to construct the spectral decomposition, we need to normalize the eigenvectors and form the diagonal matrix Λ.

Normalize the eigenvectors:
u₁' = u₁ / ||u₁|| = [2/3 -1/3 1/3]
u₂' = u₂ / ||u₂|| = [-2/3 1/3 0]
u₃' = u₃ / ||u₃|| = [2/3 0 1/3]

Form the diagonal matrix Λ:
Λ = [λ₁ 0 0]
[0 λ₂ 0]
[0 0 λ₃]
= [7 0 0]
[0 5 0]
[0 0 9]

The orthogonal diagonalization of matrix A can be written as:
A = QΛQ^T, where Q is an orthogonal matrix consisting of the normalized eigenvectors and Λ is the diagonal matrix of eigenvalues.

To find the decomposition of x = [1 2 1] using the spectral decomposition:

Decompose x as:
x = au + b⊥u

Where u is the eigenvector corresponding to the largest eigenvalue of A, and ⊥u is the projection of x onto the orthogonal complement of the eigenspace of u.

Using the normalized eigenvectors, we have:
u = u₁' = [2/3 -1/3 1/3]

Calculate a:
a = (x DOT u) / (||u||^2)
= [1 2 1] DOT [2/3 -1/3 1/3] / (2/3)^2 + (-1/3)^2 + (1/3)^2
= (2/3 - 2/3 + 1/3) / (4/9 + 1/9 + 1/9)
= 1 / (2/3)
= 3/2

Calculate b⊥u:
b⊥u = x - au
= [1 2 1] - (3/2)[2/3 -1/3 1/3]
= [1 2 1] - [1 3/2 - 3/2]
= [1 2 1] - [1 3/2 - 3/2]
= [0 1 -1/2]

Therefore, x can be decomposed as:
x = (3/2)u + [0 1 -1/2]