|
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.
3x-z+120=y
y-2z=30
x+y+z=180Step 1: Solve eq.1 for z.
3x-z+120=y
z=3x+120-yStep 2: Substitute z in eq.2
y-2z=30
y-2(3x+120-y)=30Step 3: Solve the equation you wrote in step 2 for y.
y-2(3x+120-y)=30
y-6x-240+2y=30
3y-6x=270
y-2x=90
y=90+2xStep 4: Substitute z, then substitute y in eq.3.
x+y+z=180
x+y+(3x+120-y)=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+120-90-2x=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+120-y
z=3(15)+120-120
z=45+120-120
z=45
Now you should check your answers in the original equations.
3x-z+120=y
3(15)-45+120=120
45-45+120=120
120=120
True.y-2z=30
120-2(45)=30
120-90=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 odd-numbered steps, getting numeric answers for each variable in turn.
The webmaster and author of this Math Help site is Graeme McRae.