Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

$$\begin{array}{rcrcrcr} x & - & 2y & + & 3z & = & 7 \\\ 2x & + & y & + & z & = & 4 \\\ -3 x & + & 2y &- &2z & = & -10 \end{array}$$

I have no idea how to do this and my math book is just telling me to do it, and explains nothing. I have a problem containing 3 equations with 3 variables. What do I do? I tried to solve for x and y and then find z but that didn't work and I got the wrong answer. What do I do? My book tells me to "Multiply each side of equation by -1 and add the result to equation 2, also add equations 2 and 3" I have no idea what this means or why they do it, it is never explained in this book anywhere and they seem like completely arbirtrary number not dependent upon anything, like the author is doing it for fun.

share|improve this question
It may be helpful if you include the actual system of equations you are working with. –  yunone Apr 16 '11 at 19:59
Maybe it would be a good idea to post the problem you're talking about and show what you did, because like that one can't do much more than point you to Wikipedia. (ah, @yunone you beat me by 17 seconds!) –  t.b. Apr 16 '11 at 19:59
Do you know how to solve 2 equations with 2 variables? –  Graphth Apr 16 '11 at 20:00
Yes, I know how to do 2 variables, but with 3 the book is telling me to multiply by the coefficients on one variable to solve for the others or something very strange, and then add them. I have no idea, it doesn't explain at all. x-2y+3z = 7 2x+y+z = 4 -3x+2y-2z = -10 I got z= -1 but that isn't right. –  Adam Apr 16 '11 at 20:01
@Theo, whoops, didn't mean to snipe your comment there! –  yunone Apr 16 '11 at 20:03
show 5 more comments

3 Answers

An organizational trick I wish I had learned sooner is to represent your system as a matrix, and then solve accordingly. Your system is given by $$ \begin{bmatrix} 1 & -2 & 3 & 7\\ 2 & 1 & 1 & 4\\ -3 & 2 & -2 & -10\\ \end{bmatrix} $$ Notice this the entries of the matrix are just the coefficients of $x,y,z$ and the sum of the equation in each row. Let's say you want to solve for $z$ by eliminating $x$ and $y$ from the third equation. Start by substracting twice the first equation from the second, and adding three times the first equation to the third to clear the $x$ from the first and second equations. That is, $$(2x+y+z)-2(x-2y+3z)=5y-5z=4-2(7)=-10$$ and $$3(x-2y+3z)+(-3x+2y-2z)=3(7)+(-10)=11.$$ So the trick is to find some multiple of the leading coefficient to add or subtract from another to get a $0$ coefficient for $x$. This gives in the matrix $$ \begin{bmatrix} 1 & -2 & 3 & 7\\ 0 & 5 & -5 & -10\\ 0 & -4 & 7 & 11\\ \end{bmatrix} $$

Immediately you have your last two equations as a system in terms of only $y$ and $z$, namely $5y-5z=-10$ and $-4y+7z=11$, which you should be able to solve normally. Continuing in the manner above...

Since $2x+y+z-2(x-2y+3z)=5y-5z=4-2(7)=-10$, and similarly for the third row. Notice also that the second row now gives the equation $5y-5z=-10$, which is equivalent to $y-z=-2$. Simplifying the matrix gives

$$ \begin{bmatrix} 1 & -2 & 3 & 7\\ 0 & 1 & -1 & -2\\ 0 & -4 & 7 & 11\\ \end{bmatrix} $$

This nice thing about having $x$ cleared from the second equations means you can now clear $y$ from the third equations by manipulating the second equation, without having to worry about introducing a new $x$. So adding 4 times the second equation to the third, that is, $4(y-z)+(-4y+7z)=4(-2)+11=3$, gives a new matrix $$ \begin{bmatrix} 1 & -2 & 3 & 7\\ 0 & 1 & -1 & -2\\ 0 & 0 & 3 & 3\\ \end{bmatrix} $$

But this last row gives the equation $3z=3$, or $z=1$. Immediately from $y-z=-2$, you see $y=-2+z=-1$. You can then solve for $x$. This is a nice algorithm for solving a system of linear equations of reasonable size.

share|improve this answer
"Start by substracting twice the first equation from the second, and adding three times the first equation to the third to clear the x from the first and second equations. " Why would I want to do that and what does it achieve? Where do these number originate from and why have you chose that order? –  Adam Apr 16 '11 at 20:44
@Adam You want to get rid of $x$ in your second equation and third equations. You have 2 xs in your second equation, and only 1 x in your first. So multiplying the first equation by 2 gives you 2xs, and then upon subtracting, the xs cancel, and you're left with a new equation in only y and z. Likewise for the third equation, you have -3 xs in the third equation, so multiplying the first equation by 3 gives you three xs, and upon adding, the xs cancel. This gives you two new second and third equations, which are a system in only two variables y and z which you know how to solve. –  yunone Apr 16 '11 at 20:47
You can add and subtract multiples of one equation to and from another without changing the solution of your system. –  yunone Apr 16 '11 at 20:48
This isn't substitution thought is it? That is the only way I know how to do these. –  Adam Apr 16 '11 at 20:51
When you get to systems larger than 2 variables, it is best to clear some variables to get a smaller system, and you can solve that with substitution. The result is still the same. –  yunone Apr 16 '11 at 20:53
add comment

I assume you know how to solve a system of two linear equations such as

$$\left\{ \begin{array}{c} -5x-5y=-5 \\ x+4y=-2% \end{array}% \right.\qquad(\ast)$$

but not how to represent it in terms of a matrix. I start with your system of 3 equations

$$\left\{ \begin{array}{c} x-2y+3z=7 \\ 2x+y+z=4 \\ -3x+2y-2z=-10.% \end{array}% \begin{array}{c} \text{(eq. 1)} \\ \text{(eq. 2)} \\ \text{(eq. 3)}% \end{array}% \right.\qquad(\ast\ast)$$

In order to eliminate one of the variables $x,y,z$ you can replace one of the 3 equations as follows. Multiply another equation by an adequate multiplier and add the result termwise to it. Suppose you want to eliminate $z$. If you multiply eq. 2 by $2$ you obtain the equivalent equation


Now add it to eq. 3 to get the equation

$$\left( 4-3\right) x+\left( 2+2\right) y+\left( 2-2\right) z=8-10\Leftrightarrow x+4y=-2,$$

which means you did eliminate the variable $z$. The multiplier $m=2$ was chosen so that $1$ (coeff. of $z$ in eq. 2) $\times m-2$ (coeff.of $z$ in eq.3)$=0$, i.e. $m=2$. Thus you can replace your system by the equivalent one

$$\left\{ \begin{array}{c} x-2y+3z=7 \\ 2x+y+z=4 \\ x+4y=-2% \end{array}% \begin{array}{c} \text{(eq. 1)} \\ \text{(eq. 2)} \\ \text{(new eq. 3)}% \end{array}% \right.$$

Similarly you get

$$\left\{ \begin{array}{c} \left( 1-6\right) x-\left( 2+3\right) y+\left( 3-3\right) z=7-12 \\ 2x+y+z=4 \\ x+4y=-2% \end{array}% \begin{array}{c} \text{(new eq. 1)} \\ \text{(eq. 2)} \\ \text{(new eq. 3)}% \end{array}% \right.$$

by multiplying eq. 2 by the multiplier $m=-3$ (so that $1\times c+3=0$, as above) and adding it to eq.1, which simplifies to

$$\left\{ \begin{array}{c} -5x-5y=-5 \\ 2x+y+z=4 \\ x+4y=-2% \end{array}% \begin{array}{c} \text{(new eq. 1)} \\ \text{(eq. 2)} \\ \text{(new eq. 3)}% \end{array}% \right.$$

From these new eqs. 1 and 3, you can compute $x$ and $y$ (the initial system $(\ast)$ of 2 eqs. can be solved by this method too. Do you see how?). Inserting them in eq. 2 we obtain $z=4-2x-y$.

share|improve this answer
add comment

If you know how to solve two equations in two unknowns, here is how I'd approach it without have to figure out any weird or tricky substitutions.

Multiply the first equation by $-2$ and add it to the second. The point is to eliminate the $x$ term in the equation. Now you have




Now do the same thing with the third equation. Multiply the first by 3 and add to the third to get




Now the last two equations are a system of two equations and two unknowns. Solve those like you normally do, and you get $y=$ something and $z=$ something. You can now plug those into the first equation to solve for $x$, and you get the solution.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.