How to compute matrices raised to large powers? 
Compute the matrix $$ Q = \begin{pmatrix} \frac{3}{4} &   4-\frac{\sqrt 3}{4}\\ 4+\frac{\sqrt 3}{4} &  -\frac{1}{4}\end{pmatrix}$$ raised to power $2005$.

Is there any algebraic property that can be used always as a formula? I don't have a very good intuition for algebra so help me if I am missing this because of poor basics. Thank you :)
 A: I am sure this has been answered before, but I am unable to find the original. (Edit: found it!) In general, suppose $\lambda_1,\lambda_2$ are the two eigenvalues of a $2\times2$ matrix $Q$ (note: $Q$ doesn't need to be diagonalisable). Then Cayley-Hamilton theorem says that $(Q-\lambda_1I)(Q-\lambda_2I)=0$. Now suppose we want to find $Q^m$ for some integer $m\ge0$. By long division, we may write
$$
x^m=(x-\lambda_1)(x-\lambda_2)p(x)+ax+b\tag{1}
$$
for some polynomial $p$ and some numbers $a$ and $b$. It follows that $Q^m=aQ+bI$ and all we need is to determine $a$ and $b$. In case $\lambda_1\ne\lambda_2$, by substituting $x=\lambda_1,\lambda_2$ into $(1)$, we get $\lambda_1^m=a\lambda_1+b$ and $\lambda_2^m=a\lambda_2+b$. Solving them, we get $a=\dfrac{\lambda_1^m-\lambda_2^m}{\lambda_1-\lambda_2},\ b=\dfrac{\lambda_1\lambda_2^m-\lambda_2\lambda_1^m}{\lambda_1-\lambda_2}$.
A: Hint. One may first diagonalize the given matrix,
$$
A=\begin{pmatrix}\frac34&4-\frac{\sqrt 3}{4}\\4+\frac{\sqrt 3}{4}&-\frac14\\ \end{pmatrix}
$$ that is finding a diagonal matrix $D$ and an invertible matrix $J$ such that
$$
A=J\cdot D \cdot J^{-1}
$$ then using that
$$
A^n=J\cdot D^n \cdot J^{-1}.
$$
A: Using the Jordan Normal Form makes this easier
$$
\begin{align}
M
&=\begin{bmatrix}\frac34&4-\frac{\sqrt3}4\\4+\frac{\sqrt3}4&-\frac14\end{bmatrix}\\
&=\begin{bmatrix}\frac{2-\sqrt{257}}{16+\sqrt3}&\frac{2+\sqrt{257}}{16+\sqrt3}\\1&1\end{bmatrix}
\begin{bmatrix}\frac{1-\sqrt{257}}4&0\\0&\frac{1+\sqrt{257}}4\end{bmatrix}
\begin{bmatrix}\frac{2-\sqrt{257}}{16+\sqrt3}&\frac{2+\sqrt{257}}{16+\sqrt3}\\1&1\end{bmatrix}^{\large-1}\\[12pt]
&=PDP^{-1}
\end{align}
$$
then
$$
M^{2005}=PD^{2005}P^{-1}
$$
and $D^{2005}$ is much simpler to compute.
A: Find the eigenvectors of the matrix and use them to construct a matrix of change of basis, $S$. From this you can diagonalize the matrix with $S^{-1}QS=D$ where $D$ is a diagonal matrix. Then you raise $D$ to the power of $2005$ and change it back using $SDS^{-1}$.
A: You can for example do matrix logarithm + exponential followed by usage of power laws:
$$\log(X^k) = k \log(X) \Rightarrow \\X^k = \exp(k\log(X))$$
which means if the matrix logarithm converges, you can first calculate it, then multiply with the scalar $k$ and then exponentiate the result.
One simple (but not extremely efficient) way to calculate exp and log is by their usual Taylor series from calculus in one variable.
