# Gauss-Jordan Elimination to solve for variables

I have the following linear system:

$$x + 2y - 3z = 4$$ $$3x - y + 5z = 2$$ $$4x + y + (s^2 - 14)z = s+2$$

Im trying to solve for $s$ to figure out how many solutions it has (if any).

I know how to implement Gauss-Jordan Elimination on matrices without variables but any help on how to go about solving this?

• By implementing you mean Matlab/Mathematica/Excel... implementing? Commented Jan 22, 2014 at 9:44
• @Dmoreno Whoops, I mean I know how use Gauss-Jordan Elimination to get the reduced row echelon form for matrices without variables Commented Jan 22, 2014 at 9:46
• Ok. Notice that, if you put your system as $M \mathbf{x} = \mathbf{v}$, then $|M| = 112-7s^2$, which vanishes if $s = \pm 4$ and therefore there is no solution for the system. Everywhere else you can use GJ elimination as usual. If you are still stuck , let me know. Cheers! Commented Jan 22, 2014 at 9:50
• If the determinant vanishes there may either be no solutions or infinitely many. In fact in this problem $s=4$ leads to infinitely many solutions while $s=-4$ leads to no solutions. Commented Jan 22, 2014 at 9:58
• Sorry, I should have said the system has not unique solution. In fact, when $s=4$ the 3rd row becomes the sum of the first two others so the system becomes underdetermined. Thanks for the correction @coffeemath. Commented Jan 22, 2014 at 10:14

First we eliminate the first terms taking 3 of the first row from the second and 4 of the first row from the third, to get $$x+2y-3z=4$$ $$-7y+14z=-10$$ $$-7y+(s^{2}-2)z=s-14$$
Then we simply take 1 of the new second row from the new third row, and our transformed system is just $$x+2y-3z=4$$ $$-7y+14z=-10$$ $$(s^{2}-16)z=s-4$$
If $s=+4$, the last equation becomes $0=0$ and your set is underdetermined, with solution $$x=z+\frac{20}{7}, \quad y=2z+\frac{10}{7}$$ for any $z$. The solutions lie on a line.
If $s=-4$, the last equation becomes $0=-8$, and your set is overdetermined, with no solution.
If $s$ is any other value, then simply $z=\frac{1}{s+4}$ and the other variables can be found by back-substitution. This solution is unique.