I'm trying to find the nth power of the followin matrice. \begin{bmatrix}2&2&0\\1&2&1\\1&2&1\end{bmatrix} I have computed the eigen values of this matrice which are $\lambda_1=0$ $\lambda_2=1$ and $\lambda_3=4$. I have written down the diagonal matrice D: \begin{bmatrix}0&0&0\\0&1&0\\0&0&4\end{bmatrix} Now I know the this equality holds: $P^{-1}AP=D \implies A=PDP^{-1}$ and I can find the following relation $A^n=PD^nP^{-1}$ I can find P bu putting eigenvalues one by one into my matrice. I have found P to be
\begin{bmatrix}0&0&1\\1&1&1\\-1&1&1\end{bmatrix} and also $P^{-1}$ to be the following \begin{bmatrix}0&\dfrac{1}{2}&-\dfrac{1}{2}\\-1&\dfrac{1}{2}&\dfrac{1}{2}\\1&0&0\end{bmatrix}
all I need to do is multiply theese 3 matrices but I keep finding a different solution than my textbook anwser key. Where am I doing a mistake? Is there something wrong with my approach.
The textbook answer is the following: \begin{bmatrix}4+2\cdot4^n&3\cdot4^n & -4+4^n\\-2+2\cdot4^n&3\cdot4^n&2+4^n\\-2+2\cdot4^n&3\cdot4^n&2+4+n\end{bmatrix} the matrix times $\dfrac{1}{6}$
There is a problem with your $P$ since $(1,-1,1)$ should be present as column since it is the eigenvector for $\lambda=0$, let check indeed that $A(1,-1,1)=0$.
Check again your derivation.
You should obtain that Wolfram solution