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? 
 A: Let $A=\pmatrix{a&b\\0&d}$ instead, to avoid clutter. It's plain then that
$$A^n=\pmatrix{a^n&b_n\\0&d^n}$$
for some $b_n$. Then $b_1=b$ and in general $b_{n+1}=ab_n+b d^n$.
So $b_2=(a+d)b$, $b_3=(a^2+ad+d^2)b$, $b_4=(a^3+a^2d+ad^2+d^3)b$ etc. A pattern seems to emerge.
Is
$$b_n=(a^{n-1}+a^{n-2}d+\cdots+ad^{n-2}+d^{n-1})b
=\frac{a^n-d^n}{a-d}b?$$
One could try proving this by induction.
A: Let $P=\pmatrix{0&1\\ 0&1}$. Note that $P^k=P$ for every $k\ge1$. Therefore
\begin{align}
A^7
&=(e^{2x}I-P)^7\\
&=\sum_{k=0}^7\binom{7}{k}e^{2x(7-k)}(-1)^kP^k\\
&=e^{14x}I+\sum_{k=1}^7\binom{7}{k}e^{2x(7-k)}(-1)^kP^k\\
&=e^{14x}I+\sum_{k=1}^7\binom{7}{k}e^{2x(7-k)}(-1)^kP\\
&=e^{14x}(I-P)+\sum_{k=0}^7\binom{7}{k}e^{2x(7-k)}(-1)^kP\\
&=e^{14x}(I-P)+(e^{2x}-1)^7P\\
&=\pmatrix{e^{14x}&(e^{2x}-1)^7-e^{14x}\\ 0&(e^{2x}-1)^7}.
\end{align}
A: Observe that, for $x \neq 0$ this matrix has two eigenvalues, $\lambda_1 = \exp(2x)$ and $\lambda_2 = \exp(2x) -1$. The eigenvector corresponding to the second eigenvalue is $[1,1]^T$ since the rows all sum up to $\lambda_2$.
For the other eigenvector we compute:
$$A [a,b]^T = \lambda_1 [a,b]^T$$
$$\begin{cases}
a\exp(2x) - b = \exp(2x) a\\
b (\exp(2x) -1) = b \exp(2x)
\end{cases}$$
The first equation gives us $b = 0$, and $a$ is a free variable which we set to $1$.
We have now computed the diagonalisation of $A$. Let:
$ P = 
\begin{pmatrix}
        1 & 1 \\
        0 & 1  \\
        \end{pmatrix}
$
and $D = \begin{pmatrix}
        e^{2x} & 0  \\
        0 & e^{2x}-1  \\
        \end{pmatrix}$.
Then $A = PDP^{-1}$ and we have $A^7 = P D^7 P^{-1}$. Now, do you know how to compute power of a diagonal matrix?
The case $x=0$ is for you to figure out!
A: 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}.$$
A: You have $A=B+C$, where 
$$
B=\begin{bmatrix} e^{2x}&0\\0&e^{2x}-1\end{bmatrix},\ \ \ C=\begin{bmatrix}0&-1\\0&0\end{bmatrix}. 
$$
The key is that $C^2=0$, and that $CB^kC=0$. Also, 
\begin{align}
B^kCB^m&=\begin{bmatrix} e^{2kx}&0\\0&(e^{2x}-1)^k\end{bmatrix}\begin{bmatrix}0&-1\\0&0\end{bmatrix}
\begin{bmatrix} e^{2mx}&0\\0&(e^{2x}-1)^m\end{bmatrix}
=\begin{bmatrix} 0&-(e^{2x})^k(e^{2x}-1)^m\\0&0\end{bmatrix}\\ \ \\
&=(e^{2k})^k(e^{2x}-1)^m\,C.
\end{align}
Then, after cancelling all the zero terms, 
\begin{align}
(B+C)^7&=B^7+\sum_{k=0}^7B^kCB^{7-k}=B^7+\sum_{k=0}^7(e^{2x})^k(e^{2x}-1)^{7-k}C
\end{align}
So
$$
A^7=(B+C)^7=\begin{bmatrix} e^{14x}&-\displaystyle\sum_{k=0}^7(e^{2x})^k(e^{2x}-1)^{7-k}\\0&(e^{2x}-1)^7\end{bmatrix}.
$$
The sum can be simplified by noting that 
$$
\sum_{k=0}^7a^kb^{7-k}=\frac{b^7-a^7}{b-a}.
$$
Thus
$$
A^7=(B+C)^7=\begin{bmatrix} e^{14x}&\displaystyle (e^{2x}-1)^{7}-e^{14x}\\0&(e^{2x}-1)^7\end{bmatrix}.
$$
