<s>[INST] Balancing chemical equations using linear algebraic methods I know there are already plenty of questions on this site regarding this topic but I am having difficulty with a particular chemical equation.
I am trying to balance the following:
$$
{ C }_{ 2 }{ H }_{ 2 }{ Cl }_{ 4 }\quad +\quad { C }a{ { (OH }) }_{ 2 }\quad \xrightarrow [  ]{  } \quad { C }_{ 2 }{ H }{ Cl }_{ 3 }\quad +\quad Ca{ Cl }_{ 2 }\quad +\quad { H }_{ 2 }{ O }
$$
The system of linear equations produces the following augmented matrix:
$$
\begin{pmatrix} 2 & 0 & -2 & 0 & 0 & 0 \\ 2 & 2 & -1 & 0 & -2 & 0 \\ 4 & 0 & -3 & -2 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 2 & 0 & 0 & -1 & 0 \end{pmatrix}
$$
With the rows in the following order:
Carbon
Hydrogen
Chlorine
Calcium
Oxygen
In row echelon form this reduces to:
$$
\begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \end{pmatrix}
$$
Which would indicate that:
x1 = 0; x2 = 0; x3 = 0; x4 = 0; x5 = 0
which is obviously not correct. What have I done wrong?
 [/INST] The 4th row of your matrix is missing a minus sign, i.e.
$$
\begin{pmatrix} 2 & 0 & -2 & 0 & 0 & 0 \\ 2 & 2 & -1 & 0 & -2 & 0 \\ 4 & 0 & -3 & -2 & 0 & 0 \\ 0 & 1 & 0 & -1 & 0 & 0 \\ 0 & 2 & 0 & 0 & -1 & 0 \end{pmatrix}
$$
$$ $$
But instead of forming an augmented matrix, you should drop that last column of zeroes, use the next-to-last column as a $b$-vector (equivalent to setting $x_5=1$), and solve for the remaining four coefficients from the linear system 
$$
A\,x = b
$$ 
where 
$$ \eqalign{
A &= \begin{pmatrix} 2 & 0 & -2 & 0 \\ 2 & 2 & -1 & 0 \\ 4 & 0 & -3 & -2 \\ 0 & 1 & 0 & -1 \\ 0 & 2 & 0 & 0 \end{pmatrix} \cr\cr
b &= \begin{pmatrix} 0 \\ 2 \\ 0 \\ 0 \\ 1 \end{pmatrix} \cr
}$$
This is an overdetermined system which can be solved as
$$ \eqalign{
 x &= (A^TA)^{-1}A^T\,b \cr
   &= A^+\,b \cr 
}$$
Finally, you can multiply the x-vector by a scalar factor to round any fractional components to whole integers.
</s>