
There are two basic ways to solve n equations with n unknowns: substitution and elimination. Each of them can have variations. For example, matrix methods are extensions of the elimination method. In this section, we will explore substitution.
Let the variables be x, y, and z. The equations are eq.1, eq.2, and eq.3. The substitution method has these basic steps:
Now I will apply these steps to an example, and I will label them so you can understand what I'm doing at each step.
3xz+120=y
y2z=30
x+y+z=180Step 1: Solve eq.1 for z.
3xz+120=y
z=3x+120yStep 2: Substitute z in eq.2
y2z=30
y2(3x+120y)=30Step 3: Solve the equation you wrote in step 2 for y.
y2(3x+120y)=30
y6x240+2y=30
3y6x=270
y2x=90
y=90+2xStep 4: Substitute z, then substitute y in eq.3.
x+y+z=180
x+y+(3x+120y)=180
x+(90+2x)+(3x+120(90+2x))=180Step 5: Solve the equation you wrote in step 4 to get the value of x.
x+(90+2x)+(3x+120(90+2x))=180
x+90+2x+3x+120902x=180
4x+120=180
x=15Step 6: Use this value of x in the equation you wrote in step 3 to solve for y.
y=90+2x
y=90+2(15)
y=120Step 7: Use these values of x and y in the equation you wrote in step 1 to solve for z.
z=3x+120y
z=3(15)+120120
z=45+120120
z=45
Now you should check your answers in the original equations.
3xz+120=y
3(15)45+120=120
4545+120=120
120=120
True.y2z=30
1202(45)=30
12090=30
30=30
True.x+y+z=180
15+120+45=180
180=180
True.
You should be able to see how this generalizes to n equations in n unknowns. You would solve the first equation for the first unknown, then substitute this in the second equation, and solve for the second unknown. Then substitute both variables in the third equation, and solve for the third unknown. Then substitute all three variables in the fourth equation, and solve for the fourth unknown, etc. When you get to the last equation, and solve it for the last unknown, you should be down to a numeric answer. Then work backwards through the oddnumbered steps, getting numeric answers for each variable in turn.
The webmaster and author of this Math Help site is Graeme McRae.