This site is a work in progress. New lessons are added regularly. Contact us

Solving Systems by Substitution

Learning goals

  • Replace a variable with an equal expression to leave one unknown
  • Choose a coefficient of 11 to avoid fractions
  • Substitute into the other equation, then back-substitute
  • Read the pair as the crossing point of two lines
  • Interpret a cancelled 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=72xy = 7 - 2x, then yy and 72x7 - 2x are two names for the same number. So anywhere yy appears you may write 72x7 - 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 yields to the same five moves.

  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 x2y=1x - 2y = 1 and 3x+y=173x + y = 17

Neither equation is solved for a variable yet, so start with step 1. In x2y=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:

x2y=52(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=x2y = x - 2 and 3x+y=103x + y = 10, what do you get right after substituting for yy in the second equation?

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 replacing a variable preserves the solution set#

A system of two equations asks for every pair (x,y)(x, y) that makes both equations true at once, and that collection of pairs is the solution set. Substitution swaps the system for a smaller problem, so we must confirm it keeps this set exactly.

Suppose the first equation can be solved for yy, giving y=Ey = E, where EE is some expression built from xx (for instance E=x+1E = x + 1). Solving an equation does not change which pairs satisfy it. Every step is reversible: adding the same amount to both sides can be undone, and so can dividing both sides by a nonzero number. So the pairs satisfying the first equation are precisely the pairs for which y=Ey = E. A pair lies on the first line exactly when its yy-coordinate equals EE.

Now look at one such pair, a pair with y=Ey = E. For it, the symbol yy and the expression EE stand for the same number. Substituting EE in place of yy in the second equation therefore cannot change whether that pair satisfies it, because we are replacing a quantity by an equal quantity. The second equation written with yy and the second equation with EE in place of yy are true for exactly the same pairs of this kind.

Put the two observations together. A pair solves the system exactly when it satisfies the first equation and the second. The first condition says y=Ey = E. Granting that, the second condition becomes the substituted equation, which contains only xx. So the pairs solving the system are exactly the pairs whose xx solves the substituted one-variable equation and whose yy equals EE. Substitution loses nothing and invents nothing: it trades the system for an equivalent single equation. Every solution of that equation extends to one solution of the system. And every solution of the system arises this way, from exactly one solution of that equation.

This also explains what the graph does. When the substituted equation fixes 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 can satisfy it, so the lines share no point and run parallel. When it collapses to a statement that is 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. Solving for that variable never introduces a denominator, because isolating it takes only additions and subtractions, never a division. 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=63x.y = 6 - 3x.

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

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

Distribute and collect the xx terms:

5x+126x=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=63xy = 6 - 3x:

y=63(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 x4y=5x - 4y = 5 by substitution?

Answer choices

When the variable disappears: no solution and infinitely many

Usually the substituted equation pins xx 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=3x2,6x2y=4.y = 3x - 2, \qquad 6x - 2y = 4.

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

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

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

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

Every xx has cancelled 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=3x2y = 3x - 2 gives 3xy=23x - y = 2, and doubling that gives 6x2y=46x - 2y = 4. The two equations describe the same line, so its every point, written (x,3x2)(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

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.

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 awkward cases from earlier in this lesson concrete, because they are the ones that look like nothing on paper. Give the dashed line the same slope as the solid one, a rise of 11 over a run of 11. Now the crossing point disappears, and that vanishing is what a contradiction like 7=17 = 1 is telling you. Then slide the dashed line’s crossing point down onto the solid one’s. Nothing is left but a single visible line, and the sentence changes to say the two equations describe the same line, which is the identity case. The two states differ in one control and nothing else, and they look almost identical, which is exactly why the algebra distinguishes them and your eyes cannot.

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 share a point a dot marks it 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, or are two ways of writing one line, there is no dot and the sentence says which of those it is.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

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

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions 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. No wonder the shortcut was hard to notice.

Symbols arrived in stages, and the final piece was a decision about which letters to use. Rene Descartes, a French philosopher and mathematician, settled it 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.