How to compute matrices raised to large powers? Compute the matrix $$ Q = \begin{pmatrix} \frac{3}{4} &amp;   4-\frac{\sqrt 3}{4}\\ 4+\frac{\sqrt 3}{4} &amp;  -\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 :)
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}$.
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.