how do u solve a system of linear equations in three variables?

for example this problem
Ex.1 2x-2y+z=3
5y-z=-31
x+3y+2z=-21

http://www.mathwarehouse.com/algebra/planes/systems/three-variable-equations.php

y=3x+4

81x2-18x+1

To solve a system of linear equations in three variables, you can use the method of elimination or substitution. Here's how you can solve the example problem using these methods:

Method 1: Elimination

Step 1: Choose two equations and eliminate one variable by adding or subtracting the equations.

From the first and second equation, let's eliminate z:
- Multiply the first equation by 5 to make the coefficient of z in the first equation equal to the coefficient of z in the second equation:
10x - 10y + 5z = 15

- Multiply the second equation by 1 to make the coefficient of z in the second equation equal to the coefficient of z in the first equation:
5y - z = -31

- Subtract the second equation from the first equation to eliminate z:
10x - 10y + 5z - (5y - z) = 15 - (-31)

Simplifying the equation, we get:
10x - 10y + 5z - 5y + z = 15 + 31
10x - 15y + 6z = 46 (Equation 3)

Step 2: Choose another pair of equations and eliminate the same variable.

From the first and third equation, let's eliminate z:
- Multiply the first equation by 2 to make the coefficient of z in the first equation equal to the coefficient of z in the third equation:
4x - 4y + 2z = 6

- Multiply the third equation by 3 to make the coefficient of z in the third equation equal to the coefficient of z in the first equation:
3x + 9y + 6z = -63

- Subtract the first equation from the third equation to eliminate z:
3x + 9y + 6z - (4x - 4y + 2z) = -63 - 6

Simplifying the equation, we get:
3x + 9y + 6z - 4x + 4y - 2z = -69
-x + 13y + 4z = -69 (Equation 4)

Step 3: We now have two equations in two variables (Equations 3 and 4). Solve this new system using any of the available methods (e.g., elimination or substitution) to find the values of x, y, and z.

Method 2: Substitution

Step 1: Rearrange one of the equations to solve for one variable.

Let's rearrange the second equation to solve for z:
z = 5y + 31 (Equation 5)

Step 2: Substitute the expression for z from Equation 5 into the other equations and solve for the remaining variables.

Substitute z in Equation 5 into the first equation:
2x - 2y + (5y + 31) = 3

Simplifying the equation:
2x + 3y = -28 (Equation 6)

Substitute z in Equation 5 into the third equation:
x + 3y + 2(5y + 31) = -21

Simplifying the equation:
x + 13y = -83 (Equation 7)

Step 3: Solve the resulting system of two equations (Equations 6 and 7) using any available method (e.g., substitution or elimination) to find the values of x and y.

Once you have the values of x and y, you can substitute them back into Equation 5 to find the value of z.

Note: The resulting values of x, y, and z will satisfy all three equations simultaneously, giving the solution to the system of linear equations.