# Matrix equation, how to

$A = \begin{bmatrix} 3 & 1 & -1 \\ 2 & 5 & a \\ 1 & a & 5 \end{bmatrix};$ $AX = 2X+4A$

How would one solve this matrix equation, for all $a$ for which it is solvable? I need an easy solution.

Find out, for which values of a is $A-2I$ invertible ($\Leftrightarrow 2$ is NOT eigenvalue for A). Then: $(A-2I)X=4A$, so $X=(A-2I)^{-1}4A$. For those values (if any) for which $A-2I$ is not invertible, you must check if there is a $X$ which solves equation for each value seperatly.