Answer: (a) A suitable choice is
\(\mathbf{P}=\begin{pmatrix}1&1&1\\0&-1&-1\\0&0&1\end{pmatrix}\), \(\mathbf{D}=\begin{pmatrix}32&0&0\\0&3125&0\\0&0&-32\end{pmatrix}\).
Then \(\mathbf{A}^5=\mathbf{PDP}^{-1}\).
(b) The characteristic equation is \((\lambda-2)(\lambda-5)(\lambda+2)=0\), so \(\lambda^3-5\lambda^2-4\lambda+20=0\).
Hence \(\mathbf{A}^3-5\mathbf{A}^2-4\mathbf{A}+20\mathbf{I}=\mathbf{0}\), and therefore \(\mathbf{A}^4=29\mathbf{A}^2-100\mathbf{I}\).
So \(a=29\) and \(b=-100\).
(a) Since \(\mathbf{A}\) is upper triangular, its eigenvalues are the diagonal entries:
\(2,\ 5,\ -2\).
For \(\lambda=2\), solve \((\mathbf{A}-2\mathbf{I})\mathbf{x}=\mathbf{0}\):
\(\mathbf{A}-2\mathbf{I}=\begin{pmatrix}0&-3&-7\\0&3&7\\0&0&-4\end{pmatrix}.\)
From the third row, \(z=0\). Then the second row gives \(y=0\). So \(x\) is free, and an eigenvector is \(\begin{pmatrix}1\\0\\0\end{pmatrix}\).
For \(\lambda=5\), solve \((\mathbf{A}-5\mathbf{I})\mathbf{x}=\mathbf{0}\):
\(\mathbf{A}-5\mathbf{I}=\begin{pmatrix}-3&-3&-7\\0&0&7\\0&0&-7\end{pmatrix}.\)
This gives \(z=0\) and then \(x=-y\), so one eigenvector is \(\begin{pmatrix}1\\-1\\0\end{pmatrix}\).
For \(\lambda=-2\), solve \((\mathbf{A}+2\mathbf{I})\mathbf{x}=\mathbf{0}\):
\(\mathbf{A}+2\mathbf{I}=\begin{pmatrix}4&-3&-7\\0&7&7\\0&0&0\end{pmatrix}.\)
The second row gives \(y=-z\). Substituting into the first row:
\(4x-3(-z)-7z=0\Rightarrow 4x-4z=0\Rightarrow x=z\).
Taking \(z=1\), an eigenvector is \(\begin{pmatrix}1\\-1\\1\end{pmatrix}\).
Using these eigenvectors as columns,
\(\mathbf{P}=\begin{pmatrix}1&1&1\\0&-1&-1\\0&0&1\end{pmatrix}.\)
Then
\(\mathbf{A}=\mathbf{P}\begin{pmatrix}2&0&0\\0&5&0\\0&0&-2\end{pmatrix}\mathbf{P}^{-1}.\)
Hence
\(\mathbf{A}^5=\mathbf{P}\begin{pmatrix}2^5&0&0\\0&5^5&0\\0&0&(-2)^5\end{pmatrix}\mathbf{P}^{-1}\)
so
\(\mathbf{D}=\begin{pmatrix}32&0&0\\0&3125&0\\0&0&-32\end{pmatrix}.\)
Therefore \(\mathbf{A}^5=\mathbf{PDP}^{-1}\).
(b) The characteristic equation is
\((\lambda-2)(\lambda-5)(\lambda+2)=0.\)
Expanding:
\((\lambda-2)(\lambda-5)(\lambda+2)=\lambda^3-5\lambda^2-4\lambda+20.\)
So \(\mathbf{A}\) satisfies
\(\mathbf{A}^3-5\mathbf{A}^2-4\mathbf{A}+20\mathbf{I}=\mathbf{0}.\)
Thus
\(\mathbf{A}^3=5\mathbf{A}^2+4\mathbf{A}-20\mathbf{I}.\)
Multiply by \(\mathbf{A}\):
\(\mathbf{A}^4=5\mathbf{A}^3+4\mathbf{A}^2-20\mathbf{A}.\)
Now substitute for \(\mathbf{A}^3\):
\(\mathbf{A}^4=5(5\mathbf{A}^2+4\mathbf{A}-20\mathbf{I})+4\mathbf{A}^2-20\mathbf{A}.\)
Simplifying,
\(\mathbf{A}^4=25\mathbf{A}^2+20\mathbf{A}-100\mathbf{I}+4\mathbf{A}^2-20\mathbf{A}=29\mathbf{A}^2-100\mathbf{I}.\)
Hence \(a=29\) and \(b=-100\).