Skip to main content
Mathematics LibreTexts

1.29: Solving a System of Equations Algebraically

  • Page ID
    41230
  • \( \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}}\)

    Suppose that Adam has 7 bills, all fives and tens, and that their total value is \(\$ 40 .\) How many of each bill does he have? In order to solve such a problem we must first define variables.

    Let \(x\) be the number of five dollar bills.

    Let \(y\) be the number of ten dollar bills.

    Next, we write equations that describe the situation:

    \(5 x+10 y=40 \quad:\) The combined value of the bills is \(\$ 40 .\)

    That is, we must solve the following system of two linear equations in two variables (unknowns):

    \(x+y=7 \quad\) : Adam has 7 bills.

    \(5 x+10 y=40\) : The combined value of the bills is \(\$ 40 .\)

    That is, we must solve the following system of two linear equations in two variables (unknowns):

    \[\left(\begin{align*}
    x+y &=7 \\
    5 x+10 y & =40
    \end{align*}\right)\nonumber\]

    This chapter deals with solving systems of two linear equations with two variable, such as the one above. We will consider two different algebraic methods: the substitution method and the elimination method.

    The Substitution Method

    In this section we solve systems of two linear equations in two variables using the substitution method. To illustrate, we will solve the system above with this method. We begin by solving the first equation for one variable in terms of the other. In this case we will solve for the variable \(y\) in terms of \(x\):

    \[\begin{align*}
    & x+y=7 \\
    \Longrightarrow & y=7-x
    \end{align*}\nonumber\]

    Next, we substitute \(y=7-x\) into the second equation \(5 x+10 y=40:\)

    \[5 x+10(7-x)=40\nonumber\]

    The equation above can now be solved for \(x\) since it only involves one variable:

    \[\begin{align*}
    5 x+10(7-x) &=40 \\
    5 x+70-10 x &=40 \quad \text{distribute 10 into the parentheses} \\
    -5 x+70 &=40 \quad \text{collect like terms} \\
    -5 x &=-30 \quad \text{subtract 70 from both sides} \\
    x &=6 \quad \text{divide both sides by −5}
    \end{align*}\nonumber\]

    Hence, we get \(x=6 .\) To find \(y,\) we substitute \(x=6\) into the first equation of the system and solve for \(y\) (Note: We may substitute \(x=6\) into either of the two original equations or the equation \(y=7-x\) ):

    \[\begin{array}{l}
    6+y=7 \\
    y=1 \text{subtract 6 from both sides}
    \end{array}\nonumber\]

    Therefore the solution to the system of linear equations is

    \[x=6, \quad y=1\nonumber\]

    Before we are truly finished, we should check our solution. The solution of a system of equations are the values of its variables which, when substituted into the two original equations, give us true statements. So to check, we substitute \(x=6\) and \(y=1\) into each equation of the system:

    \[\begin{array}{l}
    x+y=7 \Longrightarrow 6+1=7 \Longrightarrow 7=7 \text { true! } \\
    5 x+10 y=40 \Longrightarrow 5(6)+10(1)=40 \Longrightarrow 30+10=40 \Longrightarrow 40=40 \text { true! }
    \end{array}\nonumber\]

    Hence, our solution is correct. To answer the original word problem - recalling that \(x\) is the number of five dollar bills and \(y\) is the number of ten dollar bills we have that:

    \[Adam~has~6~five~ dollar~ bills~ and~ 1~ ten~ dollar~ bill.\nonumber\]

    Example 27.1

    \[\left(\begin{array}{l}
    6 x+2 y=72 \\
    3 x+8 y=78
    \end{array}\right)\nonumber\]

    Again, here we solve the system of equations using substitution. First, solve the first equation \(6 x+2 y=72\) for \(y:\)

    \[\begin{array}{rrr}
    & 6 x+2 y=72 \\
    \Longrightarrow & 2 y=-6 x+72 & \text{subtract 6x from both sides} \\
    \Longrightarrow & y=-3 x+36 & \text{divide both sides by 2}
    \end{array}\nonumber\]

    Substitute \(y=-3 x+36\) into the second equation \(3 x+8 y=78\) :

    \[\begin{align*}
    & 3 x+8 y=78 \\
    \Longrightarrow & 3 x+8(-3 x+36)=78 \\
    \Longrightarrow & x=10
    \end{align*}\nonumber\]

    Hence \(x=10 .\) Now substituting \(x=10\) into the equation \(y=-3 x+36\) yields \(y=6,\) so the solution to the system of equations is \(x=10, y=6 .\) The final step is left for the reader. It must be checked that \(x=10\) and \(y=6\) give true statements when substituted into the original system of equations.

    To summarize the steps we followed to solve a system of linear equations in two variables using the algebraic method of substitution, we have:

    Solving a System of Two Linear Equations in Two Variables using Substitution

    1. Solve one equation for one variable.
    2. Substitute the expression found in step 1 into the other equation.
    3. Solve the resulting equation.
    4. Substitute the value from step 3 back into the equation in step 1 to find the value of the remaining variable. 5
    5. Check your solution!
    6. Answer the question if it is a word problem.

    A system of two linear equations in two variables may have one solution, no solutions, or infinitely many solutions. In Example 27.2 we will see a system with no solution.

    Example 27.2

    Solve the following system of equations by substitution.

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

    The second equation is already solved for \(y\) in terms of \(x\) so we can substitute it directly into \(x+y=1\) :

    \[x+(-x+2)=1 \Longrightarrow 2=1 \quad \text { False! }\nonumber\]

    Since we get the false statement \(2=1,\) the system of equations has no solution.

    The Elimination Method

    A second algebraic method for solving a system of linear equations is the elimination method. The basic idea of the method is to get the coefficients of one of the variables in the two equations to be additive inverses, such as -3 and \(3,\) so that after the two equations are added, this variable is eliminated. Let's use one of the systems we solved in the previous section in order to illustrate the method:

    \[\left(\begin{array}{l}
    x+y=7 \\
    5 x+10 y=40
    \end{array}\right)\nonumber\]

    The coefficients of the \(x\) variable in our two equations are 1 and \(5 .\) We can make the coefficients of \(x\) to be additive inverses by multiplying the first equation by \(-5\) and keeping the second equation untouched:

    \[\left(\begin{array}{lllll}
    x & + &y & = & 7 \\
    5 x &+ & 10 y & = & 40
    \end{array}\right) \Longrightarrow\left(\begin{array}{lllll}
    (-5)(x &+ & y) & = & (-5) 7 \\
    5 x & + & 10 y & = & 40
    \end{array}\right)\nonumber\]

    Using the distributive property, we rewrite the first equation as:

    \[-5 x-5 y=-35\nonumber\]

    Now we are ready to add the two equations to eliminate the variable \(x\) and solve the resulting equation for \(y\) :

    \[\begin{array}{llll}
    & -5 x & - & 5 y & =& -35 \\
    + & 5 x & + & 10 y & = & 40 \\
    \hline & & & 5 y & = & 5 \\
    & & \Longrightarrow & y & = & 1
    \end{array}\nonumber\]

    To find \(x,\) we can substitute \(y=1\) into either equation of the original system to solve for \(x:\)

    \[x+1=7 \quad \Longrightarrow \quad x=6\nonumber\]

    Hence, we get the same solution as we obtained using the substitution method in the previous section:

    \[x=6, \quad y=1\nonumber\]

    In this example, we only need to multiply the first equation by a number to make the coefficients of the variable \(x\) additive inverses. Sometimes, we need to multiply both equations by two different numbers to make the coefficients of one of the variables additive inverses. To illustrate this, let's look at Example 27.3.

    Example 27.3

    \[\nonumber\]

    Lets aim to eliminate the \(y\) variable here. Since the least common multiple of 2 and 3 is \(6,\) we can multiply the first equation by 3 and the second equation by \(2,\) so that the coefficients of \(y\) are additive inverses:

    \[\left(\begin{array}{lllll}
    -3 x & + & 2 y & = & 3 \\
    4 x & - & 3 y & = & -6
    \end{array}\right) \Longrightarrow\left(\begin{array}{lllll}
    (3)(-3 x & + & 2 y & = & (3) 3 \\
    (2)(4 x & - & 3 y & = & (2)(-6)
    \end{array}\right)\nonumber\]

    Using the distributive property, we rewrite the two equations as:

    \[\left(\begin{array}{lllll}
    -9 x & + & 6 y & = & 9 \\
    8 x & - & 6 y & = & -12
    \end{array}\right)\nonumber\]

    Adding them together gives:

    \[-1 x=-3 \quad \Longrightarrow \quad x=3\nonumber\]

    To find \(y,\) we can substitute \(x=3\) into the first equation (or the second equation) of the original system to solve for \(y:\)

    \[-3(3)+2 y=3 \Longrightarrow-9+2 y=3 \Longrightarrow 2 y=12 \Longrightarrow y=6\nonumber\]

    Hence, the answer to the problem is:

    \[x=3 \quad y=6\nonumber\]

    We can check the answer by substituting both numbers into the original system and see if both equations are correct.

    The following steps summarize how to solve a system of equations by the elimination method:

    Solving a System of Two Linear Equations in Two Variables using Elimination

    1. Multiply one or both equations by a nonzero number so that the coefficients of one of the variables are additive inverses.
    2. Add the equations to eliminate the variable.
    3. Solve the resulting equation.
    4. Substitute the value from step 3 back into either of the original equations to find the value of the remaining variable.
    5. Check your solution!
    6. Answer the question if it is a word problem.

    Exit Problem

    Solve algebraically:

    \(\begin{array}{lllll}
    8 x & - & 4 y & = & 4 \\
    3 x & - & 2 y & = & 3
    \end{array}\)