Let $A=\begin{bmatrix} 2 & 6 \\ 0 & 2 \end{bmatrix}$ and $X$ be a $2\text{x}2$ matrix with real entries. Solve the following equation: $$X^5+X=A$$ I solved this, but I feel like I got lucky. First, $\det X \neq 0$, since $\det A=4$ and so $X$ is invertible. Multiplying the equation by its inverse yields $$AX^{-1}=X^{-1}A$$ and we obtain the following form for the inverse: $X^{-1}=\begin{bmatrix} a & b \\ 0 & a \end{bmatrix}$. Then we use $X^{-1}=\frac{1}{\det X}X^*$ and also get that $X=\begin{bmatrix} x & y \\ 0 & x \end{bmatrix}$ for some real numbers $x,y$. Then, knowing that $X^n=\begin{bmatrix} x^n & nx^{n-1}y \\ 0 & x^n \end{bmatrix}$ and plugging this back into the initial equation, we get $\begin{align*}x^5+x-2=0 \\ 5x^4y+y-6=0 \end{align*}$. This is easily solvable over $\mathbb{R}$ because the first one's only real solution is $x=1$.
This is why I said I got lucky. Is it any other way of doing this?