Solving Systems by Substitution

Learning goals

  • Replace a variable with an equal expression to leave one unknown
  • Choose a coefficient of 11 or −1-1 to avoid fractions
  • Substitute into the other equation, then back-substitute
  • Read the pair as the crossing point of two lines
  • Interpret a canceled variable as parallel lines or one line
  • Check both coordinates in both original equations

Turning two unknowns into one

A system of two linear equations presents two equations that must hold at the same time, and asks for the pair (x,y)(x, y) that satisfies both. In the last lesson you saw the picture: each equation draws a line, and the one pair solving both sits exactly where the two lines cross. Reading that crossing point off a graph is quick to picture but hard to do exactly, especially when the coordinates are fractions. Substitution finds it precisely, and it needs nothing beyond the equation solving from the Linear Equations chapter.

The method rests on a single principle you have used since your very first equation: equals may be replaced by equals. If one equation tells you that y=7−2xy = 7 - 2x, then yy and 7−2x7 - 2x are two names for the same number. So anywhere yy appears you may write 7−2x7 - 2x instead without changing what is true.

Watch it clear an entire variable out of the way. Take

y=x+1,2x+y=7.y = x + 1, \qquad 2x + y = 7.

The first equation says yy is the same as x+1x + 1. Replace yy in the second equation with x+1x + 1:

2x+(x+1)=7.2x + (x + 1) = 7.

The yy is gone. What remains has only xx in it, and you already know how to finish:

3x+1=7,3x=6,x=2.3x + 1 = 7, \qquad 3x = 6, \qquad x = 2.

Then recover yy from the first equation: y=x+1=3y = x + 1 = 3. The solution is (2,3)(2, 3), the very point where these two lines cross.

The substitution method step by step

The example above followed a fixed routine, and every system starts with the same moves. (If the variable terms cancel completely in step 3, there is no second coordinate to find, and step 4 does not happen. That case gets its own section below.)

  1. Solve one equation for one variable. Pick a variable that is easy to isolate, ideally one whose coefficient is 11 or −1-1 so no fractions appear. This gives an expression for that variable in terms of the other.
  2. Substitute into the other equation. Replace that variable, in the equation you did not use in step 1, with the expression you found. The result is a single equation in one variable.
  3. Solve the one-variable equation. Use the ordinary methods from the Linear Equations chapter.
  4. Back-substitute. Put that value into the expression from step 1 to get the second variable.
  5. Check. Substitute the pair into both original equations. A genuine solution satisfies each one.

Steps 2 and 5 are the two most often skipped. Substituting into the other equation is what makes progress, and checking in both originals is what catches a slip.

Worked example 1 Solve x−2y=1x - 2y = 1 and 3x+y=173x + y = 17

Neither equation is solved for a variable yet, so start with step 1. In x−2y=1x - 2y = 1 the variable xx has coefficient 11, so isolating it is clean. Add 2y2y to both sides:

x=1+2y.x = 1 + 2y.

Substitute this expression for xx into the other equation, 3x+y=173x + y = 17:

3(1+2y)+y=17.3(1 + 2y) + y = 17.

Now there is only yy to find. Distribute and collect:

3+6y+y=17,3+7y=17,7y=14,y=2.3 + 6y + y = 17, \qquad 3 + 7y = 17, \qquad 7y = 14, \qquad y = 2.

Back-substitute y=2y = 2 into x=1+2yx = 1 + 2y:

x=1+2(2)=5.x = 1 + 2(2) = 5.

So the candidate solution is (5,2)(5, 2). Check it in both original equations, not just the one you solved:

x−2y=5−2(2)=1 ✓,3x+y=3(5)+2=17 ✓.x - 2y = 5 - 2(2) = 1 \ \checkmark, \qquad 3x + y = 3(5) + 2 = 17 \ \checkmark.

Both hold, so (5,2)(5, 2) is the solution.

Check your understanding

In the system y=x−2y = x - 2 and 3x+y=103x + y = 10, what do you get right after substituting for yy in the second equation?

Answer choices

Check your understanding

Solve the system x+y=8x + y = 8 and y=x−2y = x - 2 by substitution. What is the full solution pair (x,y)(x, y)?

Answer choices

Check your understanding

Solving x+y=9x + y = 9 and y=x−3y = x - 3 by substitution, a student finds the candidate pair (6,3)(6, 3). Checking the first equation gives 6+3=96 + 3 = 9, which holds. What must the student still do before calling (6,3)(6, 3) the solution?

Answer choices

Why substitution works

Substitution can feel almost too easy, so it is worth seeing exactly why the pair it produces is guaranteed to be the solution of the system. The argument below also shows that no solutions are gained and none are lost.

Why substitution never gains or loses a solution#

A system asks for every pair (x,y)(x, y) that makes both equations true. Substitution swaps the system for one smaller equation, so it is worth checking that the swap keeps exactly the same pairs. Take the opening example again: y=x+1y = x + 1 and 2x+y=72x + y = 7.

Solving the first equation for yy did not remove or add any pairs. Every step used to get y=x+1y = x + 1 can be undone, so a pair satisfies that equation exactly when its yy-coordinate equals x+1x + 1.

Now look only at pairs with y=x+1y = x + 1. For any one of them, yy and x+1x + 1 are just two names for the same number. So writing x+1x + 1 in place of yy inside the second equation cannot change whether that pair satisfies it: you are only replacing a quantity with an equal one. That is why 2x+y=72x + y = 7 and 2x+(x+1)=72x + (x + 1) = 7 are true for exactly the same pairs of this kind, for any starting equations, not just these two.

Put the two facts together. A pair solves the system exactly when y=x+1y = x + 1 and 2x+(x+1)=72x + (x + 1) = 7 are both true. The second condition pins down xx, and the first then hands you yy. So substitution trades the system for one equivalent equation. Every xx that solves it gives one solution of the system, and every solution of the system comes from exactly one such xx. Nothing is gained, and nothing is lost.

This also explains what the graph does. When the substituted equation pins down one value of xx, the two lines meet at one point. When it collapses to a false statement such as 1=41 = 4, no xx works, so the lines are parallel. When it collapses to something always true such as 4=44 = 4, every xx on the first line works, so the two equations describe the same line.

Choosing what to solve for

Every system yields to substitution, but a smart first choice saves you from fractions. Scan the four coefficients and look for a variable whose coefficient is 11 or −1-1. A coefficient of 11 needs only addition or subtraction to isolate; a coefficient of −1-1 needs one extra sign flip. Neither ever divides by anything other than 11, so no denominator appears. If no coefficient is 11 or −1-1, any choice works; you will just carry a fraction through the arithmetic.

Worked example 2 Solve 3x+y=63x + y = 6 and 5x+2y=115x + 2y = 11

Look for the easiest variable to isolate. In 3x+y=63x + y = 6 the variable yy has coefficient 11, so solve that equation for yy:

y=6−3x.y = 6 - 3x.

Substitute into the other equation, 5x+2y=115x + 2y = 11:

5x+2(6−3x)=11.5x + 2(6 - 3x) = 11.

Distribute and collect the xx terms:

5x+12−6x=11,−x+12=11,−x=−1,x=1.5x + 12 - 6x = 11, \qquad -x + 12 = 11, \qquad -x = -1, \qquad x = 1.

Back-substitute x=1x = 1 into y=6−3xy = 6 - 3x:

y=6−3(1)=3.y = 6 - 3(1) = 3.

The solution is (1,3)(1, 3). A quick check confirms it: 3(1)+3=63(1) + 3 = 6 and 5(1)+2(3)=115(1) + 2(3) = 11, both true. Had we instead solved 5x+2y=115x + 2y = 11 for xx, we would have divided by 55 and dragged a fraction through every line. Choosing the coefficient of 11 kept the numbers whole.

Check your understanding

Which first move avoids fractions when solving 3x+2y=123x + 2y = 12 and x−4y=5x - 4y = 5 by substitution?

Answer choices

When the variable disappears: no solution and infinitely many

Usually the substituted equation pins one variable to a single value. Once in a while the variable terms cancel completely and you are left with a bare numerical statement instead. That is not a dead end; it is the system telling you how the two lines lie.

Worked example 3 A system with no solution

Solve

y=2x+1,y=2x+4.y = 2x + 1, \qquad y = 2x + 4.

Both equations are already solved for yy, so set the two expressions for yy equal (each equals yy, so they equal each other):

2x+1=2x+4.2x + 1 = 2x + 4.

Subtract 2x2x from both sides, and every xx vanishes:

1=4.1 = 4.

This is false: no value of xx can make 11 equal 44. So there is no pair (x,y)(x, y) satisfying both equations, and the system has no solution. Geometrically, both lines climb 22 units for every step right but start at different heights, so they are parallel and never cross.

Worked example 4 A system with infinitely many solutions

Solve

y=3x−2,6x−2y=4.y = 3x - 2, \qquad 6x - 2y = 4.

Substitute y=3x−2y = 3x - 2 into the second equation:

6x−2(3x−2)=4.6x - 2(3x - 2) = 4.

Distribute carefully, watching the sign on the −2-2:

6x−6x+4=4,4=4.6x - 6x + 4 = 4, \qquad 4 = 4.

Every xx has canceled and the statement left over is always true. That means every pair on the first line already satisfies the second, so the system has infinitely many solutions. In fact the second equation is the first one in disguise: rearranging y=3x−2y = 3x - 2 gives 3x−y=23x - y = 2, and doubling that gives 6x−2y=46x - 2y = 4. The two equations describe the same line, so its every point, written (x, 3x−2)(x,\, 3x - 2), is a solution.

Check your understanding

Solving a system by substitution, you arrive at 0=70 = 7. What does this tell you?

Answer choices

Check your understanding

Solving a system by substitution, you arrive at 0=00 = 0. What does this tell you?

Answer choices

Seeing the answer as a crossing point

Substitution never draws a picture, but it is worth remembering that the pair it returns is exactly the point the two lines share. Below are the lines from the opening example, y=x+1y = x + 1 and 2x+y=72x + y = 7. Substitution replaced yy in the second equation and returned (2,3)(2, 3), and that is precisely where the two lines cross.

Two lines crossing at the solution found by substitutionThe lines y = x + 1 and 2x + y = 7 drawn on a coordinate grid, intersecting at the point (2, 3), the solution of the system.xy01234123456y = x + 12x + y = 7(2, 3)
The system y = x + 1 and 2x + y = 7 drawn as two lines. Substitution replaces y in the second equation, and the pair it returns, (2, 3), is exactly the point where the two lines cross.

The algebra and the picture agree, which is the point. Substitution is just a way to compute the crossing point without the guesswork of reading it off a grid. The method also stays exact even when the answer is a fraction that no drawing could pin down.

Check your understanding

Substitution turns the system y=2x−1y = 2x - 1 and x+y=8x + y = 8 into the pair (3,5)(3, 5). If both lines were graphed, what does the point (3,5)(3, 5) represent?

Answer choices

The figure below opens on that same system, y=x+1y = x + 1 as the solid line and y=−2x+7y = -2x + 7 as the dashed one. The figure reports the crossing point, when there is one, as you move either line. Substitution and the picture are answering the same question, so the coordinates under the figure should always be the pair substitution would return.

Use it to make the two special cases from earlier in this lesson concrete, because they can look like nothing on paper. Set Rise B and Run B to match Rise A and Run A, a rise of 11 over a run of 11. Now the dashed line has the same slope as the solid one, and the dot disappears. The lines are parallel, which is what a false statement like 7=17 = 1 was telling you. Next also lower Crosses B until it matches Crosses A, at 11. The dashed line now sits exactly on top of the solid one. The sentence changes to say every point is a solution, which is what an always-true statement like 4=44 = 4 was telling you. Look closely at what changed. The parallel case still shows two separate lines side by side. The matching case shows only one, because the dashed line has landed exactly on the solid one.

The crossing point substitution computes

y = x + 1. y = -2x + 7. The slopes 1 and -2 are different, so they cross exactly once. They cross at (2, 3). A coordinate plane with two straight lines drawn across it, and a dot marking where they cross when they do. Use the controls below the figure to change the rise, the run or the crossing point of either line. -2 2 4 6 8 -2 2 4 6 8
Rise A Run A Crosses A Rise B Run B Crosses B

y = x + 1. y = -2x + 7. The slopes 1 and -2 are different, so they cross exactly once. They cross at (2, 3).

Two lines on one coordinate plane, one solid and one dashed. When they cross inside this window, a dot marks the point and the sentence below the figure names its coordinates exactly, as a fraction when the crossing does not land on a grid point. When they are parallel, are two ways of writing one line, or cross outside this window, there is no dot, and the sentence still names what happened.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)
A bit of history (optional)

For most of its history, algebra was written out in sentences. No letters stood for numbers. A writer called the unknown “the thing”, and gave each step of a solution as a line of prose. Take the thing, add five to it, and so on. Historians call this rhetorical algebra.

Now try this lesson’s method in that style. Replacing one unknown by an expression equal to it meant rewriting an entire paragraph. Then you had to read the new paragraph closely to see what had changed. The move you now make in one line was a page of careful writing.

Symbols arrived in stages, and one important piece was a decision about which letters to use. Rene Descartes, a French philosopher and mathematician, popularized this one in a book published in 16371637. Letters from the front of the alphabet, aa, bb and cc, would stand for quantities already known. Letters from the back, xx, yy and zz, would stand for the quantities being hunted. That convention has held ever since, which is why the systems in this lesson are written in xx and yy.

The choice did more than tidy the page. Once an unknown was a single symbol, you could lift it out of one equation and set it into another. Substitution stopped being a paragraph of prose. It became one line of algebra, short enough to check at a glance.