There's this system of equations
$$(8 − a)x_1 + 2x_2 + 3x_3 + ax_4 = 2$$
$$x_1 + (9 − a)x_2 + 4x_3 + ax_4 = 1$$
$$x_1 + 2x_2 + (10 − a)x_3 + ax_4 = 2$$
$$x_1 + 2x_2 + 3x_3 + ax_4 = 2$$
Now I have managed to find $a$, $(a=7)$ using substitution. However if you were to use matrices to do it, how would you solve the system depending on the parameter $a$?
\begin{pmatrix} (8-a) & 2 & 3 & a & 2 \\ 1 & (9-a) & 4 & a & 1 \\ 1 & 2 & (10-a) & a & 2 \\ 1 & 2 & 3 & a & 2 \\ \end{pmatrix}
You can use Gauss or Gauss-Jordan elimination to determine the solutions: $$ A x = b \Rightarrow [A\vert b] \to \left[ \begin{array}{rrrr|r} (8-a) & 2 & 3 & a & 2 \\ 1 & (9-a) & 4 & a & 1 \\ 1 & 2 & (10-a) & a & 2 \\ 1 & 2 & 3 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 2 - 2(8-a) & 3 - 3(8-a) & a - a(8-a) & 2-2(8-a) \\ 0 & (9-a)-2 & 1 & 0 & -1 \\ 0 & 0 & (10-a)-3 & 0 & 0 \\ 1 & 2 & 3 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & -14 + 2 a & -21 + 3 a & -7a + a^2 & -14 + 2a \\ 0 & 7-a & 1 & 0 & -1 \\ 0 & 0 & 7-a & 0 & 0 \\ 1 & 2 & 3 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & -21 + 3 a + 2 & -7a + a^2 & -14 + 2a - 2 \\ 0 & 7-a & 1 & 0 & -1 \\ 0 & 0 & 7-a & 0 & 0 \\ 1 & 2 & 3 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & 2 & -7a + a^2 & -14 + 2a - 2 \\ 0 & 7-a & 1 & 0 & -1 \\ 0 & 0 & 7-a & 0 & 0 \\ 1 & 2 & 3 & a & 2 \\ \end{array} \right] $$
We now have to make a case distinction 1.) $a = 7 $ or 2.) $a \ne 7 $, because this determines if we can divide a row by $(7-a)$ or not, or if there is a leading non-zero entry or not, which affects the dimension of the solution space.
Case 1 ($a = 7$):
$$ [A\vert b] \to \left[ \begin{array}{rrrr|r} 0 & 0 & 2 & 0 & - 2 \\ 0 & 0 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 0 \\ 1 & 2 & 3 & 7 & 2 \\ \end{array} \right] \\ \to \left[ \begin{array}{rrrr|r} 1 & 2 & 3 & 7 & 2 \\ 0 & 0 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \end{array} \right] \\ \to \left[ \begin{array}{rrrr|r} 1 & 2 & 0 & 7 & 5 \\ 0 & 0 & 1 & 0 & -1 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ \end{array} \right] $$
Case 2 ($a \ne 7$):
$$ [A\vert b] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & 2 & -7a + a^2 & -14 + 2a - 2 \\ 0 & 1 & 1/(7-a) & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 2 & 3 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & 0 & -7a + a^2 & -14 + 2a - 2 \\ 0 & 1 & 0 & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 2 & 0 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & 0 & -a & -2 - 2/(7-a) \\ 0 & 1 & 0 & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 2 & 0 & a & 2 \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & 0 & -a & -2 - 2/(7-a) \\ 0 & 1 & 0 & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 2 & 0 & 0 & -2/(7-a) \\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 0 & 0 & 0 & a & 2 + 2/(7-a) \\ 0 & 1 & 0 & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0\\ \end{array} \right] \to \\ \left[ \begin{array}{rrrr|r} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & a & 2 + 2/(7-a) \\ \end{array} \right] $$ The last row implies $a \ne 0$ for a solution, otherwise there would be a condition $0 = 16/7$ which is not to fulfill by any vector $x$.
Case 3 ($a\ne 0, a\ne 7$):
$$ [A\vert b] \to \to \\ \left[ \begin{array}{rrrr|r} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & -1/(7-a) \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & (2/a) + 2/((7-a)a) \\ \end{array} \right] $$
Result:
Thus the system has the unique solution $$ \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{pmatrix} = \begin{pmatrix} 0 \\ -1/(7-a) \\ 0 \\ (2/a) + 2/((7-a)a) \end{pmatrix} $$ for $a \ne 0, a \ne 7$.
For $a = 0$ there is no solution.
For $a = 7$ there are infinite many solutions $$ \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{pmatrix} = \begin{pmatrix} 5 -2s - 7t \\ s \\ -1 \\ t \end{pmatrix} $$ for $s, t \in \mathbb{R}$.