Algebra 1Systems of Equations and Inequalities2 of 5
Systems of Equations and Inequalities · 2

Solving Systems by Substitution

To solve a system of two equations with algebra, we need a way to get down to one variable at a time.

1

Swapping One Variable for Another

We want to find the values of xx and yy that make both of these equations true at the same time:

x+y=10y=4x\displaystyle \begin{aligned} \first{x + y} &= \first{10} \\ \second{y} &= \second{4x} \end{aligned}

The top equation has both xx and yy, so we can't solve it on its own. Since the second equation tells us what yy is in terms of xx, we can trade yy for 4x\second{4x}.

Swapping One Variable for Another
x+y=10y=4x(x,y)=  ?\displaystyle \begin{aligned}\first{x + y} &= \first{10}\\ \second{y} &= \second{4x}\\[.5em] (x, y) &= \;?\end{aligned}
Text solution
Swap 4x\second{4x} in for yy and solve for xxBecause yy and 4x\second{4x} have the exact same value, replacing yy with 4x\second{4x} in the top equation gives an equation with only xx:
x+4x=105x=10x=2\displaystyle \begin{aligned} \first{x} + \second{4x} &= \first{10} \\ 5x &= \first{10} \\ x &= 2 \end{aligned}
Plug x=2x = 2 into y=4x\second{y} = \second{4x} to find yyNow that xx is known, putting 22 in place of xx in the second equation gives yy directly:
y=4(2)y=8\displaystyle \begin{aligned} \second{y} &= \second{4}(2) \\ y &= 8 \end{aligned}

So the solution is x=2x = 2 and y=8y = 8, the single pair of numbers that makes both equations true at once.

2

Substituting a Package in Parentheses

Now let's solve a system where yy equals x+1\second{x + 1}, which has two terms, and yy is multiplied by 3\first{3} in the other equation:

2x+3y=18y=x+1\displaystyle \begin{aligned} \first{2x + 3y} &= \first{18} \\ \second{y} &= \second{x + 1} \end{aligned}
Substituting a Package in Parentheses
2x+3y=18y=x+1(x,y)=  ?\displaystyle \begin{aligned}\first{2x + 3y} &= \first{18}\\ \second{y} &= \second{x + 1}\\[.5em] (x, y) &= \;?\end{aligned}
Text solution
Substitute (x+1)\second{(x + 1)} for yy in parentheses and solve for xxSince 3y\first{3y} means 3\first{3} times all of yy, we wrap the package x+1\second{x + 1} in parentheses so the 3\first{3} multiplies both terms rather than just the xx:
2x+3(x+1)=182x+3x+3=185x+3=185x=15x=3\displaystyle \begin{aligned} \first{2x} + \first{3}\second{(x + 1)} &= \first{18} \\ \first{2x} + \second{3x + 3} &= \first{18} \\ 5x + \second{3} &= \first{18} \\ 5x &= 15 \\ x &= 3 \end{aligned}
Plug x=3x = 3 into y=x+1\second{y} = \second{x + 1} to find yyWe use the bottom equation because it already has yy by itself:
y=3+1y=4\displaystyle \begin{aligned} \second{y} &= 3 + \second{1} \\ y &= 4 \end{aligned}
xx
yy
00
2x+3y=18\htmlClass{lc-blue}{2x + 3y} = \htmlClass{lc-blue}{18}
y=x+1\htmlClass{lc-violet}{y} = \htmlClass{lc-violet}{x + 1}
(3,4)(3, 4)

So the solution is x=3,y=4x = 3, y = 4, or the point (3,4)(3, 4) where the two lines cross on a graph.

3

Getting a Variable Alone First

Neither equation in this next system starts with x=x = or y=y =, and we want to find the pair (x,y)(x, y) that solves both:

x+2y=93x+5y=24\displaystyle \begin{aligned} \first{x + 2y} &= \first{9} \\ \second{3x + 5y} &= \second{24} \end{aligned}

When neither equation gives a ready-made swap, we rearrange one of the equations first to get a variable by itself.

Getting a Variable Alone First
x+2y=93x+5y=24(x,y)=  ?\displaystyle \begin{aligned}\first{x + 2y} &= \first{9}\\ \second{3x + 5y} &= \second{24}\\[.5em] (x, y) &= \;?\end{aligned}
Text solution
Get the lone x\first{x} by itself in the first equationOut of the four variable terms x\first{x}, 2y\first{2y}, 3x\second{3x}, and 5y\second{5y}, the top x\first{x} has no number in front of it, so subtracting 2y\first{2y} isolates it in one step without creating fractions:
x\displaystyle \first{x} =9−2y\displaystyle = \first{9 - 2y}
Substitute (9−2y)\first{(9 - 2y)} into the other equation and solve for yyPlugging 9−2y\first{9 - 2y} back into the first equation where it came from just cancels out to 9=99 = 9, so we put the package into the unused second equation 3x+5y=24\second{3x + 5y} = \second{24}:
3(9−2y)+5y=2427−6y+5y=2427−y=24−y=−3y=3\displaystyle \begin{aligned} \second{3}\first{(9 - 2y)} + \second{5y} &= \second{24} \\ \first{27 - 6y} + \second{5y} &= \second{24} \\ \first{27} - y &= \second{24} \\ -y &= -3 \\ y &= 3 \end{aligned}
Plug y=3y = 3 into the rearranged equation x=9−2y\first{x} = \first{9 - 2y} to find xxThat equation from the first step is already set up to give xx right away:
x=9−2(3)x=9−6x=3\displaystyle \begin{aligned} \first{x} &= \first{9} - \first{2}(3) \\ \first{x} &= \first{9} - 6 \\ x &= 3 \end{aligned}

So the solution is x=3,y=3x = 3, y = 3, or the point (3,3)(3, 3).

Isolating any of the four variable terms in x+2y=9\first{x + 2y} = \first{9} and 3x+5y=24\second{3x + 5y} = \second{24} leads to the exact same solution (3,3)(3, 3), while only the lone x\first{x} avoids fractions along the way.

Solving for any of the four terms gives the exact same answer, and starting with the variable with no number in front avoids fractions along the way.
4

When the Variables Cancel Out

Now let's see what happens in two systems where substituting the package makes the variables disappear completely:

y=2x+1and2x−y=5y=2x+3and4x−2y=−6\displaystyle \begin{aligned} \first{y} &= \first{2x + 1} &&\quad \text{and} \quad & \second{2x - y} &= \second{5} \\ \first{y} &= \first{2x + 3} &&\quad \text{and} \quad & \second{4x - 2y} &= \second{-6} \end{aligned}
When the Variables Cancel Out
y=2x+12x−y=5(x,y)=  ?y=2x+34x−2y=−6(x,y)=  ?\displaystyle \begin{aligned}\first{y} &= \first{2x + 1}\\ \second{2x - y} &= \second{5}\\[.3em] (x, y) &= \;?\\[1.3em] \first{y} &= \first{2x + 3}\\ \second{4x - 2y} &= \second{-6}\\[.3em] (x, y) &= \;?\end{aligned}
Text solution
Substitute (2x+1)\first{(2x + 1)} for yy in 2x−y=5\second{2x - y} = \second{5}Distributing the minus sign across the entire package (2x+1)\first{(2x + 1)} cancels the xx terms and leaves a false statement:
2x−(2x+1)=52x−2x−1=5−1=5\displaystyle \begin{aligned} \second{2x} - \first{(2x + 1)} &= \second{5} \\ \second{2x} - \first{2x} - \first{1} &= \second{5} \\ -1 &= 5 \end{aligned}
Because −1-1 never equals 55, the two equations contradict each other (y=2x+1\first{y} = \first{2x + 1} and y=2x−5\second{y} = \second{2x - 5} are parallel lines that never cross), so there is no solution.
Substitute (2x+3)\first{(2x + 3)} for yy in 4x−2y=−6\second{4x - 2y} = \second{-6}Distributing −2\second{-2} across the package (2x+3)\first{(2x + 3)} also cancels the xx terms, this time leaving a statement that is always true:
4x−2(2x+3)=−64x−4x−6=−6−6=−6\displaystyle \begin{aligned} \second{4x} - \second{2}\first{(2x + 3)} &= \second{-6} \\ \second{4x} - \first{4x} - \first{6} &= \second{-6} \\ -6 &= -6 \end{aligned}

Because −6=−6-6 = -6 for every xx, both equations describe the exact same line, y=2x+3\first{y} = \first{2x + 3}, so every point on that line works and there are infinitely many solutions.

xx
yy
00
No solution\text{No solution}
y=2x+1\htmlClass{lc-blue}{y} = \htmlClass{lc-blue}{2x + 1}
2x−y=5\htmlClass{lc-violet}{2x - y} = \htmlClass{lc-violet}{5}
xx
yy
00
Infinitely many solutions\text{Infinitely many solutions}
y=2x+3\htmlClass{lc-blue}{y} = \htmlClass{lc-blue}{2x + 3}
4x−2y=−6\htmlClass{lc-violet}{4x - 2y} = \htmlClass{lc-violet}{-6}
(0,3)(0, 3)
(1,5)(1, 5)
xx
yy
00
No solution\text{No solution}
y=2x+1\htmlClass{lc-blue}{y} = \htmlClass{lc-blue}{2x + 1}
2x−y=5\htmlClass{lc-violet}{2x - y} = \htmlClass{lc-violet}{5}
xx
yy
00
Infinitely many solutions\text{Infinitely many solutions}
y=2x+3\htmlClass{lc-blue}{y} = \htmlClass{lc-blue}{2x + 3}
4x−2y=−6\htmlClass{lc-violet}{4x - 2y} = \htmlClass{lc-violet}{-6}
(0,3)(0, 3)
(1,5)(1, 5)

When we compare a second line to 4x−2y=−6\second{4x - 2y} = \second{-6}, crossing lines keep an xx term that solves for the intersection point, parallel lines cancel the xx terms to a false statement, and overlapping lines cancel the xx terms to −6=−6-6 = -6.

When you substitute one line into the other, the x terms stay if the lines cross and cancel out if the lines have the same slope.

Key concepts

Substitution turns a two-variable system into a one-variable equation by trading a variable for an equal package from the other equation. When one equation already has a variable alone, like y=x+1\second{y} = \second{x + 1} in 2x+3y=18\first{2x + 3y} = \first{18}, don't rearrange anything; wrap that package in parentheses and plug it straight into the other equation as 2x+3(x+1)=18\first{2x} + \first{3}\second{(x + 1)} = \first{18}. When neither equation has a variable alone, like x+2y=9\first{x + 2y} = \first{9} and 3x+5y=24\second{3x + 5y} = \second{24}, pick the variable term with no number in front of it (x=9−2y\first{x} = \first{9 - 2y}) so you don't create fractions, and always plug that package into the other equation, 3(9−2y)+5y=24\second{3}\first{(9 - 2y)} + \second{5y} = \second{24}. Once you find the first variable, plug it back into the x=x = or y=y = equation to get the second variable. If substituting into the other equation cancels every variable out, check the numbers left behind: a false statement like −1=5-1 = 5 means no solution, and a true statement like −6=−6-6 = -6 means infinitely many solutions.

5

Practice

1

Solve the system by substitution: x+y=12\first{x + y} = \first{12} and y=3x\second{y} = \second{3x}.

y=3x\second{y} = \second{3x} already has yy alone. What does x+y=12\first{x + y} = \first{12} become when you swap 3x\second{3x} into yy's spot?

Replace yy with 3x\second{3x} in the first equation:
x+3x\displaystyle \first{x} + \second{3x} =12\displaystyle = \first{12}
(Watch out: x+3x\first{x} + \second{3x} is 1x+3x=4x\first{1x} + \second{3x} = 4x, not 3x\rejected{3x}. Dropping the 1x\first{1x} gives 3x=12\rejected{3x} = 12, which leads to the wrong answer (4,12)\rejected{(4, 12)}.)
4x=12x=3\displaystyle \begin{aligned} 4x &= \first{12} \\ x &= 3 \end{aligned}
Plug x=3x = 3 into y=3x\second{y} = \second{3x}:
y=3(3)y=9\displaystyle \begin{aligned} \second{y} &= \second{3}(3) \\ y &= 9 \end{aligned}
Answer(3,9)(3, 9)
2

Solve the system by substitution: 2x+5y=20\first{2x + 5y} = \first{20} and x=y+3\second{x} = \second{y + 3}.

Here xx is the isolated variable. Which letter in 2x+5y=20\first{2x + 5y} = \first{20} gets replaced by the package (y+3)\second{(y + 3)}?

Replace xx in the first equation with the package (y+3)\second{(y + 3)} in parentheses:
2(y+3)+5y\displaystyle \first{2}\second{(y + 3)} + \first{5y} =20\displaystyle = \first{20}
(Watch out: keep parentheses around y+3\second{y + 3} so the 2\first{2} multiplies the 3\second{3} as well. Writing 2y+3+5y=20\rejected{2y + 3} + 5y = 20 gives 7y=177y = 17 and the wrong answer (387,177)\rejected{\left(\tfrac{38}{7}, \tfrac{17}{7}\right)}.)
2y+6+5y=207y+6=207y=14y=2\displaystyle \begin{aligned} \second{2y + 6} + \first{5y} &= \first{20} \\ 7y + \second{6} &= \first{20} \\ 7y &= 14 \\ y &= 2 \end{aligned}
Plug y=2y = 2 into x=y+3\second{x} = \second{y + 3}:
x=2+3x=5\displaystyle \begin{aligned} \second{x} &= 2 + \second{3} \\ x &= 5 \end{aligned}
(Watch out: a coordinate point is always written (x,y)(x, y), so even though we found y=2y = 2 first, putting yy first gives the reversed point (2,5)\rejected{(2, 5)}.)
Answer(5,2)(5, 2)
3

Solve the system by substitution: 3x+y=11\first{3x + y} = \first{11} and 4x−3y=6\second{4x - 3y} = \second{6}.

Look at the four variable terms 3x\first{3x}, y\first{y}, 4x\second{4x}, and −3y\second{-3y}: which one has no number in front of it to get alone first?

Isolate y\first{y} in the first equation by subtracting 3x\first{3x} from both sides:
y\displaystyle \first{y} =11−3x\displaystyle = \first{11 - 3x}
Substitute (11−3x)\first{(11 - 3x)} for yy in the second equation:
4x−3(11−3x)\displaystyle \second{4x} - \second{3}\first{(11 - 3x)} =6\displaystyle = \second{6}
(Watch out: distribute the negative sign along with the 3\second{3}, so −3(−3x)\second{-3}\first{(-3x)} becomes +9x\first{+9x}. Writing −9x\rejected{-9x} gives −5x=39-5x = 39 and the wrong answer (−395,1725)\rejected{\left(-\tfrac{39}{5}, \tfrac{172}{5}\right)}.)
4x−33+9x=613x−33=613x=39x=3\displaystyle \begin{aligned} \second{4x} - \first{33} + \first{9x} &= \second{6} \\ 13x - \first{33} &= \second{6} \\ 13x &= 39 \\ x &= 3 \end{aligned}
Plug x=3x = 3 into y=11−3x\first{y} = \first{11 - 3x}:
y=11−3(3)y=11−9y=2\displaystyle \begin{aligned} \first{y} &= \first{11} - \first{3}(3) \\ \first{y} &= \first{11} - 9 \\ y &= 2 \end{aligned}
Answer(3,2)(3, 2)
4

Solve the system by substitution: y=3x−4\first{y} = \first{3x - 4} and 6x−2y=10\second{6x - 2y} = \second{10}.

Replace yy in 6x−2y=10\second{6x - 2y} = \second{10} with the package (3x−4)\first{(3x - 4)} in parentheses and watch what happens to the xx terms.

Substitute (3x−4)\first{(3x - 4)} for yy in the second equation:
6x−2(3x−4)\displaystyle \second{6x} - \second{2}\first{(3x - 4)} =10\displaystyle = \second{10}
(Watch out: 6x−6x\second{6x} - \first{6x} is 00, not x\rejected{x}, and −2(−4)\second{-2}\first{(-4)} is +8\first{+8}, not −8\rejected{-8}. Leaving an xx behind as x+8=10\rejected{x} + 8 = 10 gives the wrong answer (2,2)\rejected{(2, 2)}.)
6x−6x+8=108=10\displaystyle \begin{aligned} \second{6x} - \first{6x} + \first{8} &= \second{10} \\ 8 &= 10 \end{aligned}
AnswerNo solution
5

Solve the system by substitution: x+2y=5\first{x + 2y} = \first{5} and 3x+6y=15\second{3x + 6y} = \second{15}.

Isolate the lone x\first{x} in the first equation, then make sure you substitute that package into the other equation.

Subtract 2y\first{2y} from both sides of the first equation to get x\first{x} alone:
x\displaystyle \first{x} =5−2y\displaystyle = \first{5 - 2y}
Substitute (5−2y)\first{(5 - 2y)} for xx into the second equation:
3(5−2y)+6y\displaystyle \second{3}\first{(5 - 2y)} + \second{6y} =15\displaystyle = \second{15}
(Watch out: distribute the 3\second{3} to −2y\first{-2y} as well as 5\first{5}. Writing 15−2y+6y=1515 - \rejected{2y} + 6y = 15 gives 4y=04y = 0 and the wrong single-point answer (5,0)\rejected{(5, 0)}.)
15−6y+6y=1515=15\displaystyle \begin{aligned} \first{15 - 6y} + \second{6y} &= \second{15} \\ 15 &= 15 \end{aligned}
AnswerInfinitely many solutions