<s>[INST] Linear algebra: power of diagonal matrix? Let A = $\begin{pmatrix} 3 & -5 \\ 1 & -3 \end{pmatrix}$. Compute $A^{9}$. (Hint: Find a matrix P such that $P^{-1}AP$ is a diagonal matrix D and show that $A^{9}$= $PD^{9}P^{-1}$
Answer: $\begin{pmatrix} 768 & -1280 \\ 256 & -768 \end{pmatrix}$
I keep getting $\begin{pmatrix} -768 & 1280 \\ -256 & 768 \end{pmatrix}$ but could it be still right? I have D=$\begin{pmatrix} -2 & 0\\ 0& 2\end{pmatrix}$ and P =$\begin{pmatrix} 5&1 \\1 & 1 \end{pmatrix}$ with $P^{-1}$= $\begin{pmatrix} \frac{1}{4} & \frac{1}{-4} \\ \frac{1}{-4} & \frac{5}{4} \end{pmatrix}$
 [/INST] With $P=\begin{pmatrix} 5&1 \\1 & 1 \end{pmatrix}$ we have $P^{-1}AP = \left(\begin{array}{rr}2 & 0\\0 & -2\end{array}\right)$ then you can use your formula $PA^{9}P^{-1}$ and calculate $PA^{9}P^{-1}$.
$ \left(\begin{array}{rr}2 & 0\\0 & -2\end{array}\right)^9=\left(\begin{array}{rr}\,\,2^9 & 0\,\,\,\,\,\,\,\\0 &  \,(-2)^9\end{array}\right)$
Now you can calculate $A^9$
</s>