# Raising a matrix to a power

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!

• Using row operations to obtain the diagonal matrix, usually don't work in general cases. Especially, if you are finding powers of the matrix. – Sungjin Kim Dec 6 '16 at 0:45
• You need a similarity transformation, not a reduction to row echelon form. Note that the row reduction here gives the identity matrix, and so taking powers of that cannot give anything new. – hardmath Dec 6 '16 at 0:49
• Your matrices $P$ and $D$ probably refer to finding $P$ and $D$ such that given $A$, $D$ is diagonal and $D = P^{-1}AP$. Then you can compute powers of $A$ from the powers of $D$. – Ethan Bolker Dec 6 '16 at 0:49

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})$.
Just row operations don't work for the following reason: these amount to pre-multiplying the given matrix $Q$ with a product $A$ of elementary operations matrices, and, unfortunately, $(QA)^n\neq Q(A^n)$ in general. It is not even equal to $Q^nA^n$, unless $Q$ and $A$ commute.
When $A=P^{-1}DP$ then $A^2=P^{-1}DPP^{-1}DP=P^{-1}D^2P$.
If instead $A=Q^{-1}DP$ then you cannot get rid of the matrices in between.