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 simplify the isolation step
  • 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 all pairs (x,y)(x, y) that satisfy both. In the last lesson you saw the picture: each equation draws a line. When there is exactly one solution, that pair sits where the two lines cross. Reading the crossing point off a graph is quick to picture but hard to do exactly, especially when the coordinates are fractions. Substitution, replacing a variable with an equal expression, finds the solution set exactly using the equation solving from the Linear Equations chapter.

The method rests on a rule you have followed since your 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.

Here is how it removes a whole variable. Take

y=x+1,2x+y=7.\begin{gathered} y = x + 1, \\ 2x + y = 7. \end{gathered}

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.\begin{gathered} 3x + 1 = 7, \\ 3x = 6, \\ x = 2. \end{gathered}

Then recover yy from the first equation: y=x+1=3y = x + 1 = 3. The solution is (2,3)(2, 3), the 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 isolation needs no division, at most a sign change. 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. The pair is a solution only if it satisfies both.

Steps 2 and 5 are the two most often skipped. Substituting into the other equation is how you make progress, and checking in both originals is how you catch 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.\begin{gathered} 3 + 6y + y = 17, \\ 3 + 7y = 17, \\ 7y = 14, \\ y = 2. \end{gathered}

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 ✓.\begin{gathered} x - 2y = 5 - 2(2) = 1 \ \checkmark, \\ 3x + y = 3(5) + 2 = 17 \ \checkmark. \end{gathered}

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

Replacing a variable by an equal expression keeps the same solutions, provided we keep the equation that tells us the two are equal.

Why substitution never gains or loses a solution#

Use x+y=10x+y=10 and 2x+y=142x+y=14. Subtracting xx from the first gives y=10−xy=10-x. For pairs on that first line, replacing yy in the second equation gives 2x+(10−x)=142x+(10-x)=14. This reduces to x=4x=4, and the kept equation then gives y=6y=6.

The replacement works both ways. A pair satisfying the originals has y=10−xy=10-x, so it also satisfies the substituted equation. A pair satisfying y=10−xy=10-x and the substituted equation also satisfies 2x+y=142x+y=14, because 10−x10-x and yy are equal. Adding xx back recovers x+y=10x+y=10.

The same reasoning applies to any two linear equations. Isolate a variable whose coefficient is nonzero, using reversible equation steps. Keep that equation and replace the variable in the other by its equal expression. Every original solution survives, and every resulting solution satisfies the originals. Back-substitution recovers the coordinate that was replaced.

The one-variable equation may fix a value, giving one pair. If it is false for every value, there is no solution. If it is true for every value, every point on the kept line solves the system.

Choosing what to solve for

Substitution works for every system of two linear equations, but choose a variable with a nonzero coefficient. A convenient choice keeps the first step simpler. Scan the four coefficients and look for 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. With integer coefficients and constants, neither choice introduces fractions during isolation. Fractions already in the equations, or in the final answer, may still remain. If neither 11 nor −1-1 is available, choose any nonzero coefficient.

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.\begin{gathered} 5x + 12 - 6x = 11, \\ -x + 12 = 11, \\ -x = -1, \\ x = 1. \end{gathered}

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 a fraction while isolating a variable in 3x+2y=123x + 2y = 12 and x−4y=5x - 4y = 5?

Answer choices

When the variable disappears: no solution and infinitely many

Usually the substituted equation gives one variable a single value. Once in a while the variable terms cancel completely and you are left with a bare numerical statement instead. Check whether that statement is true or false; the next two examples show what each one means.

Worked example 3 A system with no solution

Solve

y=2x+1,y=2x+4.\begin{gathered} y = 2x + 1, \\ y = 2x + 4. \end{gathered}

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.\begin{gathered} y = 3x - 2, \\ 6x - 2y = 4. \end{gathered}

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.\begin{gathered} 6x - 6x + 4 = 4, \\ 4 = 4. \end{gathered}

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

Below are the lines from the opening example, y=x+1y = x + 1 and 2x+y=72x + y = 7. They cross at (2,3)(2, 3), the pair substitution found.

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.

Substitution finds the crossing point exactly, even when it is a fraction that would be hard to read from a rough drawing.

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 returns to the opening system. Solid line A is y=x+1y=x+1; dashed line B is 2x+y=72x+y=7, rewritten as y=−2x+7y=-2x+7. Its crossing dot marks the pair substitution finds.

Set Rise B and Run B to 11, matching line A. With different vertical crossings, the lines are parallel and there is no solution. Watch the dot disappear and the readout change. Then set Crosses B to 11 too. The two lines coincide, so every point on that line is a solution. These are the pictures behind a false leftover statement and an always-true one.

The crossing point substitution computes

y = x + 1. y = -2x + 7. The lines cross exactly once, so one pair satisfies both equations. 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 lines cross exactly once, so one pair satisfies both equations. 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)

Much early algebra used words where we now use symbols. An unknown might be called “the thing,” and a calculation described in sentences. Historians call this rhetorical algebra. Replacing an unknown by a longer expression could make those instructions cumbersome to read.

Symbols developed over centuries. In La Geometrie, published in 1637, the French philosopher and mathematician Rene Descartes used letters near the beginning of the alphabet, such as aa, bb, and cc, for known quantities, and letters near the end, such as xx, yy, and zz, for unknowns. That convention became familiar enough that we still use it in these systems.

Descartes did not invent the idea of using letters in algebra. Francois Viete had already distinguished unknowns from known quantities in 1591, using vowels for the unknowns and consonants for the knowns. Descartes’s convention instead depended on a letter’s position in the alphabet.

MacTutor’s history of variable symbols traces the earlier uses and Descartes’s convention.

Your progress

See all your progress →