Solve linear equation I am working on some practice linear algebra problems but I am not understanding how the answers where gotten for the following problem.
Problem:
find all values of $a$ for which the resulting linear system has (a) no solution, (b) a unique solution, and (c) infinitely many solutions.
\begin{cases} x + y - z =2\\ x + 2y + z = 3 \\ x + y + (a^2 -5)z = a \end{cases}
Answer:
(a) $a= -2,\;$ (b) $\;a\neq \pm2,\;$ (c) $a=2$
I can't for the life figure how they got the answer in the book. I only got as far as the row echelon matrix.
$\begin{bmatrix}1 & 1 & -1 & 2\\0 & 1 & 2 & 1\\ 0 & 0 & a^2 - 4 & a-2\end{bmatrix}$
Can anyone recommend an approach for solving the problem.

our equations: (a^2 means a * a)
x+y−z=2
x+2y+z=3
x+y+(a^2−5)z=a
general equation form:
a1*x+b1*y+c1*z = d1
a2*x+b2*y+c2*z = d2
a3*x+b3*y+c3*z = d3
matrix A:
a1 b1 c1
a2 b2 c2
a3 b3 c3
matrix B:
d1 b1 c1
d2 b2 c2
d2 b3 c3
matrix C:
a1 d1 c1
a2 d2 c2
a3 d3 c3
matrix D:
a1 b1 d1
a2 b2 d2
a3 b3 d3
x = det(B) / det(A); 
y = det(C) / det(A); 
z = det(D) / det(A)
matrix A general format:
a11 a12 a13
a21 a22 a23
a31 a32 a33
det(A) = a11*a22*a33 + a12*a23*a31 + a13*a21*32 - a13*a22*a31 - a12*a21*a33 - a11*a23*a32
det(B) = d1*b2*c3 + b1*c2*d3 + c1*d2*b3 - c1*b2*d3 - b1*d2*c3 - d1*c2*b3
det(C) = a1*d2*c3 + d1*c2*a3 + c1*a2*d3 - c1*d2*a3 - d1*a2*c3 - a1*c2*d3
det(D) = a1*b2*d3 + b1*d2*a3+ d1*a2*b3 - d1*b2*a3- b1*a2*d3 - a1*d2*b3
assuming if my math below is correct, we get:
det(A) = a^2 - 4
det(B) = a^2+3a-10
det(C) = a^2-2a
det(D) = a - 2
x = (a^2+3a-10) / (a^2 - 4)
y = (a^2+3a-10) / (a^2 - 4)
z = (a-2)/(a^2 - 4)
If a^2 = 4, then the equation has no solution b/c we can't divide by zero
So, we can't have a = -2 or a = 2
Otherwise, the equation has the unique solution.
