<s>[INST] Find $k^{th}$ power of a square matrix I am trying to find the $A^{k}$, for all  $k \geq 2$  of a matrix, \begin{pmatrix}  a & b \\ 0 & 1  \end{pmatrix} 
My approach:
$A^{2}=\begin{pmatrix}  a^2 & ab+b \\ 0 & 1 \end{pmatrix}$
$A^{3}=\begin{pmatrix}  a^3 & a^{2}b+ab+b \\ 0 & 1 \end{pmatrix}$
$A^{4}=\begin{pmatrix}  a^4 & a^{3}b+a^{2}b+ab+b \\ 0 & 1 \end{pmatrix}$
$A^{5}=\begin{pmatrix}  a^5 & a^{4}b+a^{3}b+a^{2}b+ab+b  \\ 0 & 1 \end{pmatrix}$
Continuing this way, we obtain
$A^{k}=\begin{pmatrix}  a^k & (a^{k-2}+a^{k-3}+a^{k-4}+.....+1)b  \\ 0 & 1 \end{pmatrix}$ 
I am stuck here! I was wondering if you could give me some hints to move further. I appreciate your time. 
 [/INST] Writing $A^n$ as $\begin{bmatrix}a^n & b_n\\ 0 & 1\end{bmatrix}$. Expanding  $A^{n+1} = AA^n$ leads to a recurrence relation of the form:
$$b_{n+1} = a b_n + b$$
Since $b_1 = b$, solving the recurrence relation will lead to $$b_n = (a^{n-1}+ a^{n-2} + \cdots + 1)b = \begin{cases} \frac{a^n-1}{a-1} b, & a \ne 1\\ nb, & a = 1\end{cases}$$
</s>