[Math] Raising a matrix to a power

linear algebra

I have the following matrix:

$$
\begin{bmatrix}
7 & -1\\
2 & 4 \\
\end{bmatrix}
$$

I would like to raise it to the power n. I understand the method with finding the matrices P and D through eigenvalues and corresponding eigenvectors. However, my question is, if I transform the above matrix into a diagonal matrix through row operation to obtain the following matrix:

$$
\begin{bmatrix}
1 & 0\\
0 & -15 \\
\end{bmatrix}
$$

Could I treat this the same way one would treat the diagonal matrix D, where the entries in the diagonal are the eigenvalues? As in, could I just raise each entry of the above diagonal matrix to the power n instead of doing the method with eigenvalues and finding matrices P, inverse P and D, then raising D to the power n and multiplying them? I wasn't sure if we could treat all diagonal matrices this way.

Thank you!

Best Answer

Solving $\det(A - \lambda I) = 0 \implies \lambda_{1} = 6, \lambda_{2} = 5$ with the associated eigenvectors $v_{1} = \begin{pmatrix}1 \\1 \end{pmatrix}$ and $v_{2} = \begin{pmatrix}1 \\2 \end{pmatrix}$.

Let $P = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix}$. Then $P^{-1} = \begin{pmatrix} 2 & -1 \\ -1 & 1 \end{pmatrix}$.

We have $P^{-1}AP = \text{diag}(6, 5) \implies P^{-1}A^{n}P = \text{diag}(6^{n}, 5^{n})$.