x + y + 2z = 2 (1st equation)
3x + 4y - z = 25 (2nd equation)
4x - y + 3z = -7 (3rd equation)
The idea behind the elimination method is to cancel variables to reduce the number of variables in the system which makes it easier to solve for each variable. Firstly, we can take any 2 equations first and try to cancel one of the variable. Lets take the first and second equation:
x + y + 2z = 2
2[3x + 4y - z = 25] Lets multiply 2nd equation by 2 to get -2z so we can cancel out the z
_______________
x + y + 2z = 2
6x + 8y - 2z =50
___________ Now combine them
7x + 9y = 52 (Lets call this 4th Equation)
Now, we can take any other combination of equations except for equation 1 and 2 since we already chose those at first. Though we do know that we have to make them cancel out z again so it lines up with equation 4 and we are able to eliminate another variable.
So, lets take equations 1 and 3:
3[x + y + 2z = 2] Multiply 1st equation by 3
-2[4x - y + 3z = -7] Multiply 2nd equation by -2
_______________ It cancels out the z's
3x + 3y + 6z = 6
-8x + 2y - 6z = 14
________________ Combine them
-5x + 5y = 20 (Lets call this 5th equation)
We can now take the 4th and 5th equations and try to cancel out one of the variables so that we are able to solve for a variable:
5[7x + 9y = 52] Multiply it by 5 to cancel out x
7[-5x + 5y = 20] Multiply it by 7 to cancel out x
_____________
35x + 45y = 260
-35x + 35y = 140
_____________ Combine them
80y = 400 Divide by 80 on both sides to solve for y
y = 5
Now that we got the value of y, we can substitute it into the 4th equation or the 5th equation to solve for x. Lets choose the 4th equation:
7x + 9y = 52 Plug in the value of y=5
7x + 9(5) = 52 Simplify
7x + 45 = 52 Subtract by 45 on both sides
7x = 7 Divide by 7 on both sides to isolate x
x = 1
We now have the value of x and y. We can take those values and plug them into either the 1st, 2nd or the 3rd equation to get the value of z. Lets take the 1st equation since it seems to be the most simple one to solve:
x + y + 2z = 2 Plug in x = 1 and y = 5
1 + 5 + 2z = 2 Add like terms
6 + 2z = 2 Subtract 6 on both sides
2z = -4 Divide by 2 on both sides to isolate z
z = -2
We have finally solved for all variables.
x = 1; y = 5; z = -2