<s>[INST] Given a $2\times 2$ matrix $A$, compute $A^7$. Let $A =
        \begin{pmatrix}
        e^{2x} & -1  \\
        0 & e^{2x}-1  \\
        \end{pmatrix}
$. Compute $A^7$. 
I've tried the obvious way of multiplying $A$ with $A$, then $A^2$ with $A^2$, but I arrived at a messy result in the top right member of the matrix. Is there a general form to be noticed here? 
 [/INST] For the 7th power, it pays already off to diagonalize the matrix. It is easy to see that the eigenvalues are $e^{2x}$ and $e^{2x}-1$ with the eigenvectors $(1,0)^T$ and $(1,1)^T$. Thus, we can write $A$ as
$A = T D T^{-1}$
with $$T= \begin{pmatrix}1 &1\\
0 &1 \end{pmatrix}, \quad D= \begin{pmatrix}e^{2x} &0\\
0 &e^{2x}-1 \end{pmatrix}, \quad T^{-1}=\begin{pmatrix}1 &-1\\
0 &1 \end{pmatrix}.$$
The 7-th power is thus given by
$$A^7 = T D^7 T^{-1} = \begin{pmatrix}1 &1\\
0 &1 \end{pmatrix}\begin{pmatrix}e^{14x} &0\\
0 &(e^{2x}-1)^7 \end{pmatrix}\begin{pmatrix}1 &-1\\
0 &1 \end{pmatrix}= \begin{pmatrix}e^{14 x} &(e^{2x}-1)^7-e^{14 x}\\
0 &(e^{2x}-1)^7 \end{pmatrix}.$$
</s>