Skip to main content
Mathematics LibreTexts

4.2: Solving Systems by Substitution

  • Page ID
    19871
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    In this section we introduce an algebraic technique for solving systems of two equations in two unknowns called the substitution method. The substitution method is fairly straightforward to use. First, you solve either equation for either variable, then substitute the result into the other equation. The result is an equation in a single variable. Solve that equation, then substitute the result into any of the other equations to find the remaining unknown variable.

    Example \(\PageIndex{1}\)

    Solve the following system of equations:

    \[2x-5 y=-8 \label{Eq4.2.1} \]

    \[y=3x-1 \label{Eq4.2.2} \]

    Solution

    Equation \ref{Eq4.2.2} is already solved for \(y\). Substitute Equation \ref{Eq4.2.2} into Equation \ref{Eq4.2.1}. This means we will substitute \(3x−1\) for \(y\) in Equation \ref{Eq4.2.1}.

    \[\begin{aligned} 2x-5y &= -8 \quad {\color {Red} \text { Equation }} \ref{Eq4.2.1} \\ 2x-5({\color {Red}3x-1}) &= -8 \quad {\color {Red} \text { Substitute } 3x-1 \text { for } y \text { in }} \ref{Eq4.2.1} \end{aligned} \nonumber \]

    Now solve for \(x\).

    \[\begin{aligned} 2x-15x+5 &= -8 \quad \color {Red} \text { Distribute }-5 \\ -13x+5 &= -8 \quad \color {Red} \text { Simplify. } \\ -13x &= -13 \quad \color {Red} \text { Subtract } 5 \text { from both sides, } \\ x &= 1 \quad \color {Red} \text { Divide both sides by }-13 \end{aligned} \nonumber \]

    As we saw in Solving Systems by Graphing, the solution to the system is the point of intersection of the two lines represented by the equations in the system. This means that we can substitute the answer \(x = 1\) into either equation to find the corresponding value of \(y\). We choose to substitute \(1\) for \(x\) in Equation \ref{Eq4.2.2}, then solve for \(y\), but you will get exactly the same result if you substitute \(1\) for \(x\) in Equation \ref{Eq4.2.1}.

    \[\begin{aligned} y &= 3x-1 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.2} \\ y &= 3(1)-1 \quad \color {Red} \text { Substitute } 1 \text { for } x \\ y &= 2 \quad \color {Red} \text { Simplify. } \end{aligned} \nonumber \]

    Hence, \((x,y) = (1 ,2)\) is the solution of the system.

    Check: To show that the solution \((x,y) = (1 ,2)\) is a solution of the system, we need to show that \((x,y) = (1 ,2)\) satisfies both equations \ref{Eq4.2.1} and \ref{Eq4.2.2}.

    Substitute \((x,y) = (1 ,2)\) in Equation \ref{Eq4.2.1}:

    \[\begin{aligned} 2 x-5 y &=-8 \\ 2(1)-5(2) &=-8 \\ 2-10 &=-8 \\-8 &=-8 \end{aligned} \nonumber \]

    Thus, (1,2) satisfies Equation \ref{Eq4.2.1}.

    Substitute \((x,y) = (1 ,2)\) in Equation \ref{Eq4.2.2}:

    \[\begin{array}{l}{y=3 x-1} \\ {2=3(1)-1} \\ {2=3-1} \\ {2=2}\end{array} \nonumber \]

    Thus, (1,2) satisfies Equation \ref{Eq4.2.2}.

    Because \((x,y) = (1 ,2)\) satisfies both equations, it is a solution of the system.

    fig 4.2.1.png
    Figure \(\PageIndex{1}\): \(2x − 5y = −8\) and \(y = x − 3\) intersect at \((1,2)\).

    Exercise \(\PageIndex{1}\)

    Solve the following system of equations:

    \[\begin{aligned} 9 x+2 y &=-19 \\ y &=13+3 x \end{aligned} \nonumber \]

    Answer

    \((-3,4)\)

    Substitution Method

    The substitution method involves these steps:

    1. Solve either equation for either variable.
    2. Substitute the result from step one into the other equation. Solve the resulting equation.
    3. Substitute the result from step two into either of the original system equations or the resulting equation from step one (whichever seems easiest), then solve to find the remaining unknown variable.

    Example \(\PageIndex{2}\)

    Solve the following system of equations:

    \[5x-2y=12 \label{Eq4.2.3} \]

    \[4x+y=6 \label{Eq4.2.4} \]

    Solution

    The first step is to solve either equation for either variable. This means that we can solve the first equation for \(x\) or \(y\), but it also means that we could first solve the second equation for \(x\) or \(y\). Of these four possible choices, solving the second Equation \ref{Eq4.2.4} for \(y\) seems the easiest way to start.

    \[\begin{aligned} 4x+y &= 6 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.4} \\ y &= 6-4x \quad \color {Red} \text { Subtract } 4x \text { from both sides. } \end{aligned} \nonumber \]

    Next, substitute \(6−4x\) for \(y\) in Equation \ref{Eq4.2.3}.

    \[\begin{aligned} 5x-2y &= 12 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.3} \\ 5x-2(6-4x) &= 12\quad {\color {Red} \text { Substitute } 6-4 x \text { for } y \text { in }}\ref{Eq4.2.3} \\ 5x-12+8x &= 12 \quad \color {Red} \text { Distribute }-2 \\ 13x-12 &= 12 \quad \color {Red} \text { Simplify. }\\ 13x &= 24 \quad \color {Red} \text { Add } 12 \text { to both sides. } \\ x &= \dfrac{24}{13} \quad \color {Red} \text { Divide both sides by } 13 \end{aligned} \nonumber \]

    Finally, to find the \(y\)-value, substitute \(24/13\) for \(x\) in the equation \(y =6−4x\) (you can also substitute \(24/13\) for \(x\) in equations \ref{Eq4.2.3} or \ref{Eq4.2.4}).

    \[\begin{aligned} y &= 6-4x \\ y &= 6-4\left(\dfrac{24}{13}\right) \quad \color {Red} \text { Substitute } 24 / 13 \text { for } x \text { in } y=6-4x \\ y &= \dfrac{78}{13}-\dfrac{96}{13}\quad \color {Red} \text { Multiply, then make equivalent fractions. } \\ y &= -\dfrac{18}{13} \quad \color {Red} \text { Simplify. } \end{aligned} \nonumber \]

    Hence, \((x,y) = (24 /13,−18/13)\) is the solution of the system.

    fig 4.2.2.png
    Figure \(\PageIndex{2}\): \(5x − 2y = 12\) and \(4x + y = 6\) intersect at \((24/13,−18/13)\).

    Check: Let’s use the graphing calculator to check the solution. First, we store \(24/13\) in \(X\) with the following keystrokes (see the result in Figure \(\PageIndex{3}\)).

    fig 4.2.2a.png
    Figure \(\PageIndex{3}\)).

    fig 4.2.2b.png

    fig 4.2.3.png
    Figure \(\PageIndex{3}\): Storing \(24/13\) and \(−18/13\) in \(X\) and \(Y\).

    Now, clear the calculator screen by pressing the CLEAR button, then enter the left-hand side of Equation \ref{Eq4.2.3} with the following keystrokes (see the result in Figure \(\PageIndex{4}\)).

    fig 4.2.2c.png
    Figure \(\PageIndex{4}\)). Note that each left-hand side produces the number on the right-hand sides of equations \ref{Eq4.2.3} and \ref{Eq4.2.4}. Thus, the solution \((x,y) = (24 /13,−18/13)\) checks.

    fig 4.2.2d.png

    fig 4.2.4.png
    Figure \(\PageIndex{4}\): Checking equations \ref{Eq4.2.3} and \ref{Eq4.2.4}.

    Exercise \(\PageIndex{2}\)

    Solve the following system of equations:

    \[\begin{aligned} x-2 y &=13 \\ 4 x-3 y &=26 \end{aligned} \nonumber \]

    Answer

    \((13 / 5,-26 / 5)\)

    Example \(\PageIndex{3}\)

    Solve the following system of equations:

    \[3x-2y=6 \label{Eq4.2.5} \]

    \[4x+5y=20 \label{Eq4.2.6} \]

    Solution

    Dividing by \(−2\) gives easier fractions to deal with than dividing by \(3\), \(4\), or \(5\), so let’s start by solving equation (\ref{Eq4.2.5}) for \(y\).

    \[\begin{aligned} 3x-2y &= 6\quad {\color {Red} \text { Equation }}\ref{Eq4.2.5} \\ -2y &= 6-3x \quad \color {Red} \text { Subtract } 3 x \text { from both sides. } \\ y &= \dfrac{6-3 x}{-2} \quad \color {Red} \text { Divide both sides by }-2 \\ y &= -3+\dfrac{3}{2} x \quad \color {Red} \text { Divide both } 6 \text { and }-3 x \text { by }-2 \text { using distributive property. } \end{aligned} \nonumber \]

    Substitute \(-3+\dfrac{3}{2} x\) for \(y\) in Equation \ref{Eq4.2.6}

    \[\begin{aligned}
    4x+5y &= 20 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.6} \\
    4x+5\left(-3+\dfrac{3}{2} x\right) &= 20 \quad \color {Red} \text { Substitute }-3+\dfrac{3}{2} x \text { for } y \\
    4x-15+\dfrac{15}{2} x &= 20 \quad \color {Red} \text { Distribute the } 5\\
    8x-30+15x &= 40 \quad \color {Red} \text { Clear fractions by multiplying } \\
    23x &= 70 \quad \color {Red} \text { Simplify. Add } 30 \text { to both sides. } \\
    x &= \dfrac{70}{23} \quad \color {Red} \text { Divide both sides by } 23
    \end{aligned} \nonumber \]

    To find \(y\), substitute \(70/23\) for \(x\) into equation \(y=-3+\dfrac{3}{2} x\). You could also substitute \(70/23\) for \(x\) in equations \ref{Eq4.2.5} or \ref{Eq4.2.6} and get the same result.

    \[\begin{aligned} y &= -3+\dfrac{3}{2} x \\ y &= -3+\dfrac{3}{2}\left(\dfrac{70}{23}\right) \quad \color {Red} \text { Substitute } 70 / 23 \text { for } x \\ y &= -\dfrac{69}{23}+\dfrac{105}{23} \quad \color {Red} \text { Multiply. Make equivalent fractions. } \\ y &= \dfrac{36}{23} \quad \text { Simplify. } \end{aligned} \nonumber \]

    Hence, \((x,y) = (70 /23,36/23)\) is the solution of the system.

    fig 4.2.5.png
    Figure \(\PageIndex{5}\): \(3x − 2y =6\) and \(4x +5y = 20\) intersect at \((70/23,36/23)\).

    Check: To check this solution, let’s use the graphing calculator to find the solution of the system. We already know that \(3x − 2y = 6\) is equivalent to \(y=-3+\dfrac{3}{2} x\). Let’s also solve Equation \ref{Eq4.2.6} for \(y\).

    \[\begin{aligned} 4x+5y &= 20 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.6} \\ 5y &= 20-4x \quad \color {Red} \text { Subtract } 4 x \text { from both sides. } \\ y &= \dfrac{20-4 x}{5} \quad \color {Red} \text { Divide both sides by } 5 \\ y &= 4-\dfrac{4}{5} x \quad \color {Red} \text { Divide both } 20 \text { and }-4 x \text { by } 5 \text { using the distributive property. } \end{aligned} \nonumber \]

    Enter \(y=-3+\dfrac{3}{2} x\) and \(y=4-\dfrac{4}{5} x\) into the Y= menu of the graphing calculator (see Figure 4.32).

    fig 4.2.6.png
    Figure \(\PageIndex{6}\): Enter\(y-3+\dfrac{3}{2} x\) and \(y=4-\dfrac{4}{5} x\) in Y1 and Y2, respectively.

    Press the ZOOM button and select 6:ZStandard. Press 2ND CALC to open the CALCULATE menu, select 5:intersect, then press the ENTER key three times in succession to enter “Yes” to the queries “First curve,” “Second curve,” and “Guess.” The result is shown in Figure \(\PageIndex{7}\).

    fig 4.2.7.png
    Figure \(\PageIndex{7}\): Use 5:intersect on the CALC menu to calculate the point of intersection.

    At the bottom of the viewing window in Figure \(\PageIndex{7}\), note how the coordinates of the point of intersection are stored in the variables X and Y. Without moving the cursor, (the variables X and Y contain the coordinates of the cursor), quit the viewing window by pressing 2ND QUIT, which is located above the MODE key. Then press the CLEAR button to clear the calculator screen.

    Now press the \(\mathrm{X}, \mathrm{T}, \theta, \mathrm{n}\) key, then the MATH button on your calculator:

    fig 4.2.7a.png
    Figure \(\PageIndex{8}\)).
    fig 4.2.8.png
    Figure \(\PageIndex{8}\): The MATH menu.

    Select 1:►Frac, then press the ENTER key to produce the fractional equivalent of the decimal content of the variable \(X\) (see Figure \(\PageIndex{9}\)).

    fig 4.2.9.png
    Figure \(\PageIndex{9}\): Changing the contents of the variables \(X\) and \(Y\) to fractions.

    Repeat the procedure for the variable \(Y\). Enter:

    fig 4.2.9a.png
    Figure \(\PageIndex{9}\)). Note that the fractional equivalents for \(X\) and \(Y\) are \(70/23\) and \(36/23\), precisely the same answers we got with the substitution method above.

    Exercise \(\PageIndex{3}\)

    Solve the following system of equations:

    \[\begin{aligned}3 x-5 y&=3 \\ 5 x-6 y&=2\end{aligned} \nonumber \]

    Answer

    \((-8 / 7,-9 / 7)\)

    Exceptional Cases Revisited

    It is entirely possible that you might apply the substitution method to a system of equations that either have an infinite number of solutions or no solutions at all. Let’s see what happens should you do that.

    Example \(\PageIndex{4}\)

    Solve the following system of equations:

    \[2 x+3 y=6 \label{Eq4.2.7} \]

    \[y=-\dfrac{2}{3} x+4 \label{Eq4.2.8} \]

    Solution

    Equation \ref{Eq4.2.8} is already solved for \(y\), so let’s substitute \(-\dfrac{2}{3} x+4\) for \(y\) in Equation \ref{Eq4.2.7}.

    \[\begin{aligned} 2x+3y &= 6 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.7} \\ 2x+3\left(-\dfrac{2}{3} x+4\right) &= 6 \quad \color {Red} \text { Substitute }-\dfrac{2}{3} x+4 \text { for } y \\ 2x-2x+12 &= 6 \quad \color {Red} \text { Distribute the } 3 \\ 12 &= 6\quad \color {Red} \text { Simplify. } \end{aligned} \nonumber \]

    Goodness! What happened to the \(x\)? How are we supposed to solve for \(x\) in this situation? However, note that the resulting statement, \(12 = 6\), is false, no matter what we use for \(x\) and \(y\). This should give us a clue that there are no solutions. Perhaps we are dealing with parallel lines?

    Let’s solve Equation \ref{Eq4.2.7} for \(y\), putting the equation into slope-intercept form, to help determine the situation.

    \[\begin{aligned} 2x+3y &= 6 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.7} \\ 3y &= -2x+6 \quad \color {Red} \text { Subtract } 2 x \text { from both sides. } \\ y &= -\dfrac{2}{3} x+2 \quad \color {Red} \text { Divide both sides by } 3 \end{aligned} \nonumber \]

    Thus, our system is equivalent to the following two equations.

    \[\begin{aligned} y &= -\dfrac{2}{3} x+2 \\ y &= -\dfrac{2}{3} x+4 \end{aligned} \nonumber \]

    These lines have the same slope \(−2/3\), but different \(y\)-intercepts (one has \(y\)-intercept \((0,2)\), the other has \(y\)-intercept \((0,4)\)). Hence, these are two distinct parallel lines and the system has no solution.

    fig 4.2.10.png
    Figure \(\PageIndex{10}\): \(2x +3y = 6\) and \(y=-\dfrac{2}{3} x+4\) are parallel. No solution.

    Exercise \(\PageIndex{4}\)

    Solve the following system of equations:

    \[\begin{aligned} x &=\dfrac{4}{3} y-7 \\ 6 x-8 y &=-3 \end{aligned} \nonumber \]

    Answer

    no solution

    Example \(\PageIndex{5}\)

    Solve the following system of equations:

    \[2x-6y=-8 \label{Eq4.2.9} \]

    \[x=3y-4 \label{Eq4.2.10} \]

    Solution

    Equation \ref{Eq4.2.10} is already solved for \(x\), so let’s substitute \(3y−4\) for \(x\) in Equation \ref{Eq4.2.9}.

    \[\begin{aligned} 2x-6y &= -8 \quad {\color {Red} \text { Equation }}\ref{Eq4.2.9} \\ 2(3y-4)-6y &= -8 \quad \color {Red} \text { Substitute } 3 y-4 \text { for } x \\ 6y-8-6y &= -8 \quad \color {Red} \text { Distribute the } 2 \\ -8 &= -8 \quad \color {Red}\text { Simplify. } \end{aligned} \nonumber \]

    Goodness! What happened to the \(x\)? How are we supposed to solve for \(x\) in this situation? However, note that the resulting statement, \(−8=−8\), is a true statement this time. Perhaps this is an indication that we are dealing with the same line? Let’s put both equations \ref{Eq4.2.9} and \ref{Eq4.2.10} into slope-intercept form so that we can compare them.

    Solve Equation \ref{Eq4.2.9} for \(y\):

    \[\begin{aligned} 2 x-6 y &=-8 \\-6 y &=-2 x-8 \\ y &=\dfrac{-2 x-8}{-6} \\ y &=\dfrac{1}{3} x+\dfrac{4}{3} \end{aligned} \nonumber \]

    Solve Equation \ref{Eq4.2.10} for \(y\):

    \[\begin{aligned} x &=3 y-4 \\ x+4 &=3 y \\ \dfrac{x+4}{3} &=y \\ y &=\dfrac{1}{3} x+\dfrac{4}{3} \end{aligned} \nonumber \]

    Hence, the lines have the same slope and the same \(y\)-intercept and they are exactly the same lines. Thus, there are an infinite number of solutions. Indeed, any point on either line is a solution. Examples of solution points are \((−4,0)\), \((−1,1)\), and \((2,2)\).

    fig 4.2.11.png
    Figure \(\PageIndex{1}\): \(2x − 6y = −8\) and \(x =3 y−4\) are the same line. Infinite number of solutions.

    Exercise \(\PageIndex{5}\)

    Solve the following system of equations:

    \[\begin{aligned}-28 x+14 y &=-126 \\ y &=2 x-9 \end{aligned} \nonumber \]

    Answer

    There are an infinite number of solutions. Examples of solution points are \((0,−9)\), \((5,1)\), and \((−3,−15)\).

    Tip

    When you substitute one equation into another and the variable disappears, consider:

    1. If the resulting statement is false, then you have two distinct parallel lines and there is no solution.
    2. If the resulting statement is true, then you have the same lines and there are an infinite number of solutions.

    This page titled 4.2: Solving Systems by Substitution is shared under a CC BY-NC-ND 3.0 license and was authored, remixed, and/or curated by David Arnold via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.