<s>[INST] Linear algebra: Solving a system of equation matrix with a variable as coefficient. Let's consider this augmented matrix
$$\left(\begin{array}{ccc|c}
    3 &-6 &6 &15\\
    -2 &7 &a &-25\\
    2 &-6 &6 & 20
\end{array}\right)$$
I'm trying to figure how to solve a matrix like this when there is $a$ as one of the coefficients.  
 [/INST] Procede with the usual row reduction, trying to avoid pivoting on the element with $a$ as long as possible:
$$\left(\begin{array}{ccc|c}
    3 &-6 &6 &15\\
    -2 &7 &a &-25\\
    2 &-6 &6 & 20
\end{array}\right)
\xrightarrow{\begin{matrix}R1~/~3\\R3~/~2\end{matrix}}
\left(\begin{array}{ccc|c}
    1 &-2 &2 &5\\
    -2 &7 &a &-25\\
    1 &-3 &3 & 10
\end{array}\right)
\xrightarrow{\begin{matrix}R2~+~2R1\\R3~-~R1\end{matrix}}\\
\left(\begin{array}{ccc|c}
    1 &-2 &2 &5\\
    0 &3 &a+4 &-15\\
    0 &-1 &1 & 5
\end{array}\right)
\xrightarrow{\begin{matrix}R_3~\times~-1\\R3~\leftrightarrow~R2\end{matrix}}
\left(\begin{array}{ccc|c}
    1 &-2 &2 &5\\
    0 &1 &-1 & -5\\
    0 &3 &a+4 &-15
\end{array}\right)
\xrightarrow{\begin{matrix}R_3~-~3R2\end{matrix}}\\
\left(\begin{array}{ccc|c}
    1 &-2 &2 &5\\
    0 &1 &-1 & -5\\
    0 &0 &a+7 &0
\end{array}\right)
$$
What happens next depends on whether $a+7=0$:


*

*Case $a=-7$: then the bottom row is $0~0~0~|~0$, the set of equations is consistent and has an infinite number of solutions.

*Case $a\ne-7$: then we can divide $R3$ by $a+7$ to get $$\left(\begin{array}{ccc|c}
    1 &-2 &2 &5\\
    0 &1 &-1 & -5\\
    0 &0 &1 &\dfrac{1}{a+7}
\end{array}\right)
$$ and the set of equations has a unique solution.

</s>