Systems of Equations

Substitution Method: Solving Systems of Equations Step by Step

The substitution method solves a system by isolating one variable, such as y=mx+by = mx + b, and replacing that variable in the other equation so only one unknown remains. Solve that equation, then plug the value back in to find the second variable.

y=mx+b  ⇒  Ax+By=C becomes Ax+B(mx+b)=Cy = mx + b \;\Rightarrow\; Ax + By = C \text{ becomes } Ax + B(mx + b) = C

Try it with your numbers

Show every step

Try your own numbers in the solver above to see every step. When you want more drills, the substitution method practice problems go from easy to tricky, and the sections below explain why each step works and where it goes wrong.

How does the substitution method work?

The whole method rests on one fact: if two quantities are equal, you can swap one for the other anywhere. A system gives two conditions on the same point (x,y)(x, y). If the first condition says y=3x−1y = 3x - 1, then at the solution yy and 3x−13x - 1 are the same number, so the second equation can use 3x−13x - 1 wherever it has a yy. An equation with two unknowns becomes an equation with one.

In general, if one equation gives y=mx+by = mx + b and the other is Ax+By=CAx + By = C, the swap produces a single-variable equation:

Ax+B(mx+b)=CAx + B(mx + b) = C

Geometrically, each linear equation is a line and the solution is where the lines cross. Solving systems by graphing can only estimate that crossing point, while substitution finds it exactly. It also works on curves, which graphing handles poorly.

The swap is legal only because the first equation is true at the solution. That is why the expression must go into the other equation. Putting it back into the one it came from only restates what you already know, and nothing new gets solved.

Quick check

If y=4x−1y = 4x - 1, what value of xx solves 2x+y=112x + y = 11?

Solving systems by substitution: a full example

Here is the routine, which never changes:

  1. Solve one equation for one variable.
  2. Substitute that expression, in parentheses, into the other equation.
  3. Solve the new one-variable equation.
  4. Substitute the answer into the isolated expression to get the other variable.
  5. Check the ordered pair in both original equations.

Take this system:

x+2y=113x−y=5\begin{aligned} x + 2y &= 11 \\ 3x - y &= 5 \end{aligned}

The first equation has xx with coefficient 11, so solve it for xx: x=11−2yx = 11 - 2y. Substitute into the second equation:

3(11−2y)−y=53(11 - 2y) - y = 5

Distribute, combine, and solve:

33−6y−y=5  ⇒  33−7y=5  ⇒  −7y=−28  ⇒  y=433 - 6y - y = 5 \;\Rightarrow\; 33 - 7y = 5 \;\Rightarrow\; -7y = -28 \;\Rightarrow\; y = 4

Now go back to the expression that was already isolated: x=11−2(4)=3x = 11 - 2(4) = 3. The solution is (3,4)(3, 4). Check: 3+2(4)=113 + 2(4) = 11 and 3(3)−4=53(3) - 4 = 5. Both hold.

Try this: Solve the same system again, but isolate yy in the second equation first (y=3x−5y = 3x - 5). You should get x=3x = 3 and y=4y = 4 again, which shows the answer does not depend on your first choice.

The route does change the amount of work, though. Back-substituting into the expression you isolated is almost always the shortest finish, because it is one multiplication and one subtraction instead of a whole equation.

Which variable should you solve for first?

Scan both equations for a coefficient of 11 or −1-1. In 4x+y=94x + y = 9, solving for yy gives y=9−4xy = 9 - 4x, which is clean. In 2x+3y=122x + 3y = 12, solving for xx gives x=12−3y2x = \frac{12 - 3y}{2}, and every later step carries a fraction. Fractions are not wrong, only slower and easier to botch.

Equations already written in slope-intercept form are free: the y=mx+by = mx + b shape is step 1 done. A line given in point-slope form, like y−2=3(x−1)y - 2 = 3(x - 1), is one distribution away from the same thing. If no coefficient is ±1\pm 1 anywhere, consider solving the system by elimination instead, since it avoids the fraction cleanup.

Never substitute into the equation you rearranged

If you isolate x=11−2yx = 11 - 2y from x+2y=11x + 2y = 11 and put it back there, you get 11−2y+2y=1111 - 2y + 2y = 11, which is 11=1111 = 11. That true statement does not mean infinitely many solutions. It means you used the same equation twice.

A quick tie-breaker when two choices look equal: pick the variable whose isolated expression has the smaller numbers, since you will substitute it twice.

Substitution method with negatives and fractions

The trap that costs the most points is a dropped parentheses. Solve:

y=3x−55x−2y=4\begin{aligned} y &= 3x - 5 \\ 5x - 2y &= 4 \end{aligned}

Substitute the whole expression for yy and keep it in brackets:

5x−2(3x−5)=45x - 2(3x - 5) = 4

The −2-2 multiplies both terms inside, and −2⋅(−5)=+10-2 \cdot (-5) = +10:

5x−6x+10=4  ⇒  −x+10=4  ⇒  x=65x - 6x + 10 = 4 \;\Rightarrow\; -x + 10 = 4 \;\Rightarrow\; x = 6

Then y=3(6)−5=13y = 3(6) - 5 = 13, so the solution is (6,13)(6, 13). Check: 5(6)−2(13)=30−26=45(6) - 2(13) = 30 - 26 = 4. If the bracket is skipped, you write 5x−6x−5=45x - 6x - 5 = 4 and get x=−9x = -9, a clean-looking wrong answer. Any time you substitute into something with a minus sign in front, that sign applies to everything you insert.

For fractions, clear them first. Multiply each equation by its least common denominator before you isolate anything. For x2+y3=4\frac{x}{2} + \frac{y}{3} = 4, multiplying by 66 gives 3x+2y=243x + 2y = 24. Paired with y=x+2y = x + 2, you get 3x+2(x+2)=243x + 2(x + 2) = 24, so 5x+4=245x + 4 = 24 and x=4x = 4, y=6y = 6. A mental check on the original: 42+63=2+2=4\frac{4}{2} + \frac{6}{3} = 2 + 2 = 4.

Quick check

Solve by substitution: y=x−5y = x - 5 and x−3y=7x - 3y = 7.

What if the variables cancel out?

Substitution ending in a false statement beside two parallel lines on a coordinate grid
Substituting y = 2x + 1 into 4x − 2y = 6 gives −2 = 6, and the graph shows two parallel lines that never cross.

Sometimes both variables vanish during substitution. That is not an error. It tells you something about the lines. Substitute y=2x+1y = 2x + 1 into 4x−2y=64x - 2y = 6:

4x−2(2x+1)=6  ⇒  4x−4x−2=6  ⇒  −2=64x - 2(2x + 1) = 6 \;\Rightarrow\; 4x - 4x - 2 = 6 \;\Rightarrow\; -2 = 6

That is false, so no point satisfies both equations. Change the right side to −2-2 and the same steps end at −2=−2-2 = -2, which is always true, so every point on the line works. For more on telling these cases apart, see no solution vs infinitely many solutions.

What you end with What it means The lines
A value, such as x=6x = 6 One solution Cross once
A false statement, such as −2=6-2 = 6 No solution Parallel
A true statement, such as −2=−2-2 = -2 Infinitely many solutions Identical
Predict it from slopes

Write both equations as y=mx+by = mx + b. Same mm with different bb means no solution. Same mm and same bb means infinitely many. Different mm means exactly one.

The slope test is a useful sanity check: if the slopes differ and you still reach a false statement, an arithmetic slip happened somewhere.

Substitution for nonlinear systems and word problems

Substitution is the standard tool when one equation is not a line, because elimination cannot cancel a squared term cleanly. Solve:

y=x2−3y=x−1\begin{aligned} y &= x^2 - 3 \\ y &= x - 1 \end{aligned}

Both equations equal yy, so set the right sides equal:

x2−3=x−1  ⇒  x2−x−2=0  ⇒  (x−2)(x+1)=0x^2 - 3 = x - 1 \;\Rightarrow\; x^2 - x - 2 = 0 \;\Rightarrow\; (x - 2)(x + 1) = 0

So x=2x = 2 or x=−1x = -1. Use the line to find yy: x=2x = 2 gives y=1y = 1, and x=−1x = -1 gives y=−2y = -2. The solutions are (2,1)(2, 1) and (−1,−2)(-1, -2). Check the curve too: 22−3=12^2 - 3 = 1 and (−1)2−3=−2(-1)^2 - 3 = -2. A line and a parabola can meet twice, once, or never. If the quadratic does not factor, the quadratic formula finishes the job, and a negative discriminant means no crossing at all.

Word problems fit the same pattern. Suppose adult tickets cost $12, student tickets cost $8, and 5050 tickets bring in $520. With a+s=50a + s = 50 and 12a+8s=52012a + 8s = 520, isolate a=50−sa = 50 - s, then 12(50−s)+8s=52012(50 - s) + 8s = 520 gives 600−4s=520600 - 4s = 520, so s=20s = 20 and a=30a = 30. When a constraint involves inequalities instead, the plug-in idea still helps you test points, as in systems of linear inequalities.

Quick check

Find all solutions of y=x2y = x^2 and y=2x+3y = 2x + 3.

How to check the answer and when elimination is faster

Always test the pair in both original equations, not in a rearranged version. Back-substitution only used one equation, so the other is the one that can expose a mistake. If you plugged into the isolated expression to get your second value, the check on the other original equation is the one that matters most.

Choose your method by what the equations look like:

  • Use substitution when a variable is already isolated or has a coefficient of ±1\pm 1.
  • Use elimination when both equations are in standard form with awkward coefficients, as practiced in elimination method practice problems.
  • Use substitution when one equation is nonlinear.

Carry substitution through symbolically on ax+by=eax + by = e and cx+dy=fcx + dy = f and you get formulas for the answer:

x=ed−bfad−bc,y=af−ecad−bcx = \frac{ed - bf}{ad - bc}, \qquad y = \frac{af - ec}{ad - bc}

That is Cramer’s rule, and the denominator ad−bcad - bc is the determinant of a 2×2 matrix. When it equals zero, the slopes match, which is exactly the no-solution or infinite-solution case from earlier. In the first example, a=1a = 1, b=2b = 2, c=3c = 3, d=−1d = -1, e=11e = 11, f=5f = 5 gives x=−11−10−1−6=3x = \frac{-11 - 10}{-1 - 6} = 3, matching the work above. For three unknowns, the same swap-and-reduce idea scales up in solving a system of three equations.

Practice problems

0 of 5 solved

  1. Solve by substitution: y=2xy = 2x and x+y=12x + y = 12.

  2. Solve by substitution: x=y+3x = y + 3 and 2x+y=122x + y = 12.

  3. Solve by substitution: x+3y=5x + 3y = 5 and 2x−5y=−122x - 5y = -12.

  4. Solve by substitution: x3−y2=1\frac{x}{3} - \frac{y}{2} = 1 and 2x+y=142x + y = 14.

  5. Solve by substitution: 2x+3y=12x + 3y = 1 and 5x−4y=145x - 4y = 14.

Common questions

What is the substitution method in simple terms?

You rewrite one equation so a variable stands alone, then swap that expression into the other equation. This leaves one equation with one unknown, which you solve and then use to find the second variable.

How do you know which variable to solve for first?

Pick a variable with a coefficient of 11 or −1-1, because isolating it creates no fractions. If every coefficient is larger than that, elimination is usually cleaner.

What does it mean if you get 0=50 = 5 or 3=33 = 3 while substituting?

A false statement like 0=50 = 5 means the system has no solution, because the lines are parallel. A true statement like 3=33 = 3 means infinitely many solutions, because both equations describe the same line.

Is substitution or elimination better?

Substitution is faster when a variable is already isolated or has a coefficient of 11 or −1-1. Elimination is faster when both equations are in standard form and no variable has an easy coefficient.

Can you use substitution on nonlinear systems?

Yes. It is often the best method for a line and a parabola or circle, since you substitute the line's expression into the curve and solve the resulting quadratic. Expect up to two solutions.

Where do you substitute the first value to find the second variable?

Use any original equation, but the one already solved for a variable is quickest. Then confirm the pair in the other equation as a check.

Up next