Skip to content
Solving Systems of Equations by Substitution

Solving Systems of Equations by Substitution

By the end of this section, you will be able to: solve a system of equations by substitution, and solve applications of systems of equations by substitution.

Solving systems of linear equations by graphing is a good way to visualize the types of solutions that may result. However, there are many cases where solving a system by graphing is inconvenient or imprecise. If the graphs extend beyond the small grid with xx and yy both between 10-10 and 1010, graphing the lines may be cumbersome. And if the solutions to the system are not integers, it can be hard to read their values precisely from a graph.

In this section, we will solve systems of linear equations by the substitution method.

Solve a System of Equations by Substitution

We will use the same system we used first for graphing.

{2x+y=7x2y=6 \begin{cases} 2x+y=7 \\ x-2y=6 \end{cases}

We will first solve one of the equations for either xx or yy. We can choose either equation and solve for either variable — but we’ll try to make a choice that will keep the work easy. Then we substitute that expression into the other equation. The result is an equation with just one variable — and we know how to solve those! After we find the value of one variable, we substitute that value into one of the original equations and solve for the other variable. Finally, we check our solution and make sure it makes both equations true.

Example. Solve the system by substitution: {2x+y=7x2y=6\begin{cases} 2x+y=7 \\ x-2y=6 \end{cases}.

StepWhat to doResult
1. Solve one of the equations for either variable.We’ll solve the first equation for yy.2x+y=72x+y=7 becomes y=72xy=7-2x
2. Substitute the expression from Step 1 into the other equation.Replace yy in the second equation with 72x7-2x.x2(72x)=6x-2(7-2x)=6
3. Solve the resulting equation.Now we have an equation with just one variable.x14+4x=6x-14+4x=6, so 5x=205x=20, so x=4x=4
4. Substitute the solution in Step 3 into one of the original equations to find the other variable.We’ll use the first equation and replace xx with 44.2(4)+y=72(4)+y=7, so 8+y=78+y=7, so y=1y=-1
5. Write the solution as an ordered pair.The ordered pair is (x,y)(x,y).(4,1)(4,-1)
6. Check that the ordered pair is a solution to both original equations.Substitute (4,1)(4,-1) into both equations.2(4)+(1)=?7, so 7=7 42(1)=?6, so 6=6 \begin{aligned} 2(4)+(-1) &\overset{?}{=} 7, \text{ so } 7=7\ \checkmark \\ 4-2(-1) &\overset{?}{=} 6, \text{ so } 6=6\ \checkmark \end{aligned}

Both equations are true, so (4,1)(4,-1) is the solution to the system.

Solve the system by substitution: 2x+y=11-2x + y = -11 and x+3y=9x + 3y = 9.

How to solve a system of equations by substitution.

  1. Solve one of the equations for either variable.
  2. Substitute the expression from Step 1 into the other equation.
  3. Solve the resulting equation.
  4. Substitute the solution in Step 3 into one of the original equations to find the other variable.
  5. Write the solution as an ordered pair.
  6. Check that the ordered pair is a solution to both original equations.

If one of the equations in the system is already given in slope-intercept form, Step 1 is done for us.

Example. Solve the system by substitution: {x+y=1y=x+5\begin{cases} x+y=-1 \\ y=x+5 \end{cases}.

The second equation is already solved for yy, so we substitute the expression x+5x+5 in place of yy in the first equation: x+(x+5)=1x+(x+5)=-1, so 2x+5=12x+5=-1, so 2x=62x=-6, and x=3x=-3. Substitute x=3x=-3 into y=x+5y=x+5 to find yy: y=3+5=2y=-3+5=2. The ordered pair is (3,2)(-3,2).

Check: let x=3x=-3 and y=2y=2. Then 3+2=?1-3+2\overset{?}{=}-1, so 1=1 -1=-1\ \checkmark; and 2=?3+52\overset{?}{=}-3+5, so 2=2 2=2\ \checkmark. Both equations are true, so (3,2)(-3,2) is the solution to the system.

Solve the system by substitution: x+y=6x + y = 6 and y=3x2y = 3x - 2.

If the equations are given in standard form, we’ll need to start by solving for one of the variables.

Example. Solve the system by substitution: {3x+y=52x+4y=10\begin{cases} 3x+y=5 \\ 2x+4y=-10 \end{cases}.

We need to solve one equation for one variable. Solving the first equation for yy gives y=3x+5y=-3x+5. Substitute 3x+5-3x+5 for yy in the second equation: 2x+4(3x+5)=102x+4(-3x+5)=-10, so 2x12x+20=102x-12x+20=-10, so 10x=30-10x=-30, and x=3x=3. Substitute x=3x=3 into y=3x+5y=-3x+5 to find yy: y=3(3)+5=4y=-3(3)+5=-4. The ordered pair is (3,4)(3,-4).

Check: let x=3x=3 and y=4y=-4. Then 3(3)+(4)=?53(3)+(-4)\overset{?}{=}5, so 94=?59-4\overset{?}{=}5, and 5=5 5=5\ \checkmark; and 2(3)+4(4)=?102(3)+4(-4)\overset{?}{=}-10, so 616=?106-16\overset{?}{=}-10, and 10=10 -10=-10\ \checkmark. The solution is (3,4)(3,-4).

Solve the system by substitution: 4x+y=24x + y = 2 and 3x+2y=13x + 2y = -1.

Sometimes it is easier to solve for xx rather than yy — look for a variable whose coefficient is 11.

Example. Solve the system by substitution: {x2y=23x+2y=34\begin{cases} x-2y=-2 \\ 3x+2y=34 \end{cases}.

We will solve the first equation for xx and then substitute the expression into the second equation. Solving for xx gives x=2y2x=2y-2. Substitute 2y22y-2 for xx in the second equation: 3(2y2)+2y=343(2y-2)+2y=34, so 6y6+2y=346y-6+2y=34, so 8y=408y=40, and y=5y=5. Substitute y=5y=5 into x=2y2x=2y-2 to find xx: x=2(5)2=8x=2(5)-2=8. The ordered pair is (8,5)(8,5).

Check: let x=8x=8 and y=5y=5. Then 82(5)=?28-2(5)\overset{?}{=}-2, so 810=?28-10\overset{?}{=}-2, and 2=2 -2=-2\ \checkmark; and 3(8)+2(5)=?343(8)+2(5)\overset{?}{=}34, so 24+10=?3424+10\overset{?}{=}34, and 34=34 34=34\ \checkmark. The solution is (8,5)(8,5).

Solve the system by substitution: x5y=13x - 5y = 13 and 4x3y=14x - 3y = 1.

When both equations are already solved for the same variable, it is easy to substitute!

Example. Solve the system by substitution: {y=2x+5y=12x\begin{cases} y=-2x+5 \\ y=\tfrac{1}{2}x \end{cases}.

Since both equations are solved for yy, we can substitute one into the other: 12x=2x+5\tfrac{1}{2}x=-2x+5. Clear the fraction by multiplying both sides by 22: x=4x+10x=-4x+10, so 5x=105x=10, and x=2x=2. Substitute x=2x=2 into y=12xy=\tfrac{1}{2}x to find yy: y=12(2)=1y=\tfrac{1}{2}(2)=1. The ordered pair is (2,1)(2,1).

Check: let x=2x=2 and y=1y=1. Then 1=?12(2)1\overset{?}{=}\tfrac{1}{2}(2), and 1=1 1=1\ \checkmark; and 1=?2(2)+51\overset{?}{=}-2(2)+5, so 1=?4+51\overset{?}{=}-4+5, and 1=1 1=1\ \checkmark. The solution is (2,1)(2,1).

Solve the system by substitution: y=3x16y = 3x - 16 and y=13xy = \tfrac{1}{3}x.

Be very careful with the signs in the next example.

Example. Solve the system by substitution: {4x+2y=46xy=8\begin{cases} 4x+2y=4 \\ 6x-y=8 \end{cases}.

We need to solve one equation for one variable. Solving the first equation for yy gives 2y=4x+42y=-4x+4, so y=2x+2y=-2x+2. Substitute 2x+2-2x+2 for yy in the second equation: 6x(2x+2)=86x-(-2x+2)=8, so 6x+2x2=86x+2x-2=8, so 8x=108x=10, and x=54x=\tfrac{5}{4}. Substitute x=54x=\tfrac{5}{4} into 4x+2y=44x+2y=4 to find yy: 4(54)+2y=44\left(\tfrac{5}{4}\right)+2y=4, so 5+2y=45+2y=4, so 2y=12y=-1, and y=12y=-\tfrac{1}{2}. The ordered pair is (54,12)\left(\tfrac{5}{4},-\tfrac{1}{2}\right).

Check: let x=54x=\tfrac{5}{4} and y=12y=-\tfrac{1}{2}. Substituting back into both original equations gives 4=4 4=4\ \checkmark and 8=8 8=8\ \checkmark. The solution is (54,12)\left(\tfrac{5}{4},-\tfrac{1}{2}\right).

Solve the system by substitution: x4y=4x - 4y = -4 and 3x+4y=0-3x + 4y = 0.

Sometimes, when we solve the resulting equation, all the variable terms cancel out.

Example. Solve the system by substitution: {4x3y=615y20x=30\begin{cases} 4x-3y=6 \\ 15y-20x=-30 \end{cases}.

We need to solve one equation for one variable. Solving the first equation for xx gives x=34y+32x=\tfrac{3}{4}y+\tfrac{3}{2}. Substitute this expression into the second equation: 15y20(34y+32)=3015y-20\left(\tfrac{3}{4}y+\tfrac{3}{2}\right)=-30, so 15y15y30=3015y-15y-30=-30, so 30=30-30=-30.

Since 30=30-30=-30 is a true statement, the system is consistent. The equations are dependent. The graphs of these two equations would give the same line. The system has infinitely many solutions.

Solve the system by substitution: 2x3y=122x - 3y = 12 and 12y+8x=48-12y + 8x = 48. What kind of system is this?

Look back at the equations in the last example — is there any way to recognize that they are the same line? Let’s see what happens when the lines are parallel instead.

Example. Solve the system by substitution: {5x2y=10y=52x\begin{cases} 5x-2y=-10 \\ y=\tfrac{5}{2}x \end{cases}.

The second equation is already solved for yy, so we substitute 52x\tfrac{5}{2}x for yy in the first equation: 5x2(52x)=105x-2\left(\tfrac{5}{2}x\right)=-10, so 5x5x=105x-5x=-10, so 0=100=-10.

Since 0=100=-10 is a false statement, the equations are inconsistent. The graphs of the two equations would be parallel lines. The system has no solution.

Solve the system by substitution: 3x+2y=93x + 2y = 9 and y=32x+1y = -\tfrac{3}{2}x + 1. What kind of system is this?

Solve Applications of Systems of Equations by Substitution

We’ll use the same problem-solving strategy we used for solving systems of equations by graphing. Now that we know how to solve systems by substitution, that’s what we’ll do in Step 5.

How to use a problem-solving strategy for systems of linear equations.

  1. Read the problem. Make sure all the words and ideas are understood.
  2. Identify what we are looking for.
  3. Name what we are looking for. Choose variables to represent those quantities.
  4. Translate into a system of equations.
  5. Solve the system of equations using good algebra techniques.
  6. Check the answer in the problem and make sure it makes sense.
  7. Answer the question with a complete sentence.

Example. The sum of two numbers is zero. One number is nine less than the other. Find the numbers.

Let nn be the first number and mm be the second number. The sum of the two numbers is zero, so n+m=0n+m=0. One number is nine less than the other, so n=m9n=m-9. The system is {n+m=0n=m9\begin{cases} n+m=0 \\ n=m-9 \end{cases}.

We’ll solve by substitution, since the second equation is already solved for nn. Substitute m9m-9 for nn in the first equation: (m9)+m=0(m-9)+m=0, so 2m9=02m-9=0, so 2m=92m=9, and m=92m=\tfrac{9}{2}. Substitute m=92m=\tfrac{9}{2} into n=m9n=m-9 to find nn: n=929=92n=\tfrac{9}{2}-9=-\tfrac{9}{2}.

The numbers are 92\tfrac{9}{2} and 92-\tfrac{9}{2}.

The sum of two numbers is 10. One number is 4 less than the other. Find the numbers, entering the smaller number first, as an ordered pair (smaller, larger).

Example. The perimeter of a rectangle is 8888. The length is five more than twice the width. Find the length and the width.

Let LL be the length and WW be the width. The perimeter of a rectangle is 2L+2W=P2L+2W=P, so 2L+2W=882L+2W=88. The length is five more than twice the width, so L=2W+5L=2W+5. The system is {2L+2W=88L=2W+5\begin{cases} 2L+2W=88 \\ L=2W+5 \end{cases}.

Substitute 2W+52W+5 for LL in the first equation: 2(2W+5)+2W=882(2W+5)+2W=88, so 4W+10+2W=884W+10+2W=88, so 6W+10=886W+10=88, so 6W=786W=78, and W=13W=13. Substitute W=13W=13 into L=2W+5L=2W+5 to find LL: L=2(13)+5=31L=2(13)+5=31.

Does a rectangle with length 3131 and width 1313 have perimeter 8888? Yes. The length is 3131 and the width is 1313.

The perimeter of a rectangle is 40. The length is 4 more than the width. Find the length and width as an ordered pair (length, width).

Example. The measure of one of the small angles of a right triangle is ten more than three times the measure of the other small angle. Find the measures of both angles.

Let aa be the measure of the first angle and bb be the measure of the second angle. One small angle is ten more than three times the other, so a=3b+10a=3b+10. The sum of the measures of the angles of a triangle is 180180, and one angle of a right triangle already measures 90°90°, so a+b+90=180a+b+90=180. The system is {a=3b+10a+b+90=180\begin{cases} a=3b+10 \\ a+b+90=180 \end{cases}.

Substitute 3b+103b+10 for aa in the second equation: (3b+10)+b+90=180(3b+10)+b+90=180, so 4b+100=1804b+100=180, so 4b=804b=80, and b=20b=20. Substitute b=20b=20 into a=3b+10a=3b+10 to find aa: a=3(20)+10=70a=3(20)+10=70.

The measures of the small angles are 20°20° and 70°70°.

The measure of one of the small angles of a right triangle is 2 more than 3 times the measure of the other small angle. Find the measures of both angles as an ordered pair (smaller angle, larger angle).

Example. Heather has been offered two options for her salary as a trainer at the gym. Option A would pay her $25,000\text{\textdollar}25{,}000 plus $15\text{\textdollar}15 for each training session. Option B would pay her $10,000\text{\textdollar}10{,}000 plus $40\text{\textdollar}40 for each training session. How many training sessions would make the salary options equal?

Let ss be Heather’s salary and nn be the number of training sessions. Option A gives s=25,000+15ns=25{,}000+15n. Option B gives s=10,000+40ns=10{,}000+40n. The system is {s=25,000+15ns=10,000+40n\begin{cases} s=25{,}000+15n \\ s=10{,}000+40n \end{cases}.

Substitute 25,000+15n25{,}000+15n for ss in the second equation: 25,000+15n=10,000+40n25{,}000+15n=10{,}000+40n, so 25,000=10,000+25n25{,}000=10{,}000+25n, so 15,000=25n15{,}000=25n, and n=600n=600.

Are 600 training sessions a reasonable number, and are the two options equal when n=600n=600? Yes. The salary options would be equal for 600600 training sessions.

Geraldine has been offered positions by two insurance companies. The first pays a salary of $12,000 plus a commission of $100 for each policy sold. The second pays a salary of $20,000 plus a commission of $50 for each policy sold. How many policies would need to be sold to make the total pay the same?

Key terms

substitution method — solving one equation of a system for a variable, then replacing that variable with the resulting expression in the other equation so it becomes an equation in one variable. consistent, dependent system — a system whose equations, after substitution, reduce to a true numeric statement (like 30=30-30=-30); the two equations describe the same line and the system has infinitely many solutions. inconsistent system — a system whose equations, after substitution, reduce to a false numeric statement (like 0=100=-10); the two equations describe parallel lines and the system has no solution.


This section is adapted from Elementary Algebra 2e, Section 5.2: Solving Systems of Equations by Substitution by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recast the first worked example’s step-by-step breakdown as a markdown table and condensed the remaining worked examples into prose with inline checks; omitted the Be Prepared quiz, Self Check checklist, media links, and end-of-section exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback — including turning the dependent/inconsistent-system Try Its into a multiple-choice classification, since the math checker cannot reliably grade a bare true/false numeric statement as an answer.