Compute the $n$-th power of triangular $3\times3$ matrix I have the following matrix
$$
\begin{bmatrix}
1 & 2 & 3\\
0 & 1 & 2\\
0 & 0 & 1
\end{bmatrix}
$$
and I am asked to compute its $n$-th power (to express each element as a function of $n$). I don't know at all what to do. I tried to compute some values manually to see some pattern and deduce a general expression but that didn't gave anything (especially for the top right). Thank you.

Define
$$J = \begin{bmatrix}
0 & 2 & 3\\
0 & 0 & 2\\
0 & 0 & 0
\end{bmatrix} $$
so that the problem is to compute $(I+J)^n$. The big, important things to note here are


*

*$I$ and $J$ commute

*$J^3 = 0$


which enables the following powerful tricks: the first point lets us expand it with the binomial theorem, and the second point lets us truncate to the first few terms:
$$ (I+J)^n = \sum_{k=0}^n \binom{n}{k} I^{n-k} J^k = I + nJ + \frac{n(n-1)}{2} J^2 $$

More generally, for any function $f$ that is analytic at $1$, (such as any polynomial), if you extend it to matrices via Taylor expansion, then under the above conditions, its value at $I+J$ is given by
$$ f(I+J) = \sum_{k=0}^\infty f^{(k)}(1) \frac{J^k}{k!} = f(1) I + f'(1) J + \frac{1}{2} f''(1) J^2 $$
As examples of things whose result you can check simply (so you can still use the method even if you're uncomfortable with it, because you can check the result), you can compute the inverse by
$$ (I+J)^{-1} = I - J + J^2 =  \begin{bmatrix}
1 & -2 & 1\\
0 & 1 & -2\\
0 & 0 & 1
\end{bmatrix} $$
and if you want a square root, you can get
$$\sqrt{I+J} = I + \frac{1}{2} J - \frac{1}{8} J^2
=  \begin{bmatrix}
1 & 1 & 1\\
0 & 1 & 1\\
0 & 0 & 1
\end{bmatrix} $$
(These are actually special cases of $(I+J)^n$ by the generalized binomial theorem for values of $n$ that aren't nonnegative integers)
