Skip to main content
Mathematics LibreTexts

3.2: Graphs and Solutions to Systems of Linear Equations

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

    Learning Objectives

    • Graph systems of equations
      • Graph a system of two linear equations
      • Graph a system of two linear inequalities
    • Evaluate ordered pairs as solutions to systems
      • Determine whether an ordered pair is a solution to a system of linear equations
      • Determine whether an ordered pair is a solution to a system of linear inequalities
    • Classify solutions to systems
      • Identify what type of solution a system will have based on its graph

    The way a river flows depends on many variables including how big the river is, how much water it contains, what sorts of things are floating in the river, whether or not it is raining, and so forth. If you want to best describe its flow, you must take into account these other variables. A system of linear equations can help with that.

    A system of linear equations consists of two or more linear equations made up of two or more variables such that all equations in the system are considered simultaneously. You will find systems of equations in every application of mathematics. They are a useful tool for discovering and describing how behaviors or processes are interrelated. It is rare to find, for example, a pattern of traffic flow that that is only affected by weather. Accidents, time of day, and major sporting events are just a few of the other variables that can affect the flow of traffic in a city. In this section, we will explore some basic principles for graphing and describing the intersection of two lines that make up a system of equations.

    Graph a system of linear equations

    In this section, we will look at systems of linear equations and inequalities in two variables. First, we will practice graphing two equations on the same set of axes, and then we will explore the different considerations you need to make when graphing two linear inequalities on the same set of axes. The same techniques are used to graph a system of linear equations as you have used to graph single linear equations. We can use tables of values, slope and y-intercept, or x– and y-intercepts to graph both lines on the same set of axes.

    For example, consider the following system of linear equations in two variables.

    \(\begin{array}{r}2x+y=-8\\ x-y=-1\end{array}\)

    Let’s graph these using slope-intercept form on the same set of axes. Remember that slope-intercept form looks like \(y\).

    First, solve for y in \(2x+y=-8\)

    \(\begin{array}{c}2x+y=-8\\ y=-2x - 8\end{array}\)

    Second, solve for y in \(x-y=-1\)
    \(\begin{array}{r}x-y=-1\,\,\,\,\,\\ y=x+1\end{array}\)

    The system is now written as

    \(\begin{array}{c}y=-2x - 8\\y=x+1\end{array}\)

    Now you can graph both equations using their slopes and intercepts on the same set of axes, as seen in the figure below. Note how the graphs share one point in common. This is their point of intersection, a point that lies on both of the lines. In the next section we will verify that this point is a solution to the system.

    A graph of two lines running through the point negative 3, negative 2. The first line's equation is y equals minus 2x minus 8. The second line's equation is y equals x+1.

    In the following example, you will be given a system to graph that consists of two parallel lines.

    Example

    Graph the system \(\begin{array}{c}y=2x+1\\y=2x-3\end{array}\) using the slopes and y-intercepts of the lines.
    [reveal-answer q=”478796″]Show Solution[/reveal-answer]
    [hidden-answer a=”478796″]

    First, graph \(y=2x+1\) using the slope m = 2 and the y-intercept (0,1)

    y=2x+1

    Next, add \(y=2x-3\) using the slope m = 2, and the y-intercept (0,-3)

    y = 2x+1 and y = 2x-3

    Notice how these are parallel lines, and they don’t cross. In the next section we will discuss how there are no solutions to a system of equations that are parallel lines.

    [/hidden-answer]

    In the next example, you will be given a system whose equations look different, but after graphing, turn out to be the same line.

    Example

    Graph the system \(\begin{array}{c}y=\frac{1}{2}x+2\\2y-x=4\end{array}\) using the x – and y-intercepts.
    [reveal-answer q=”342515″]Show Solution[/reveal-answer]
    [hidden-answer a=”342515″]

    First, find the x- and y- intercepts of \(y=\frac{1}{2}x+2\)

    The x-intercept will have a value of 0 for y, so substitute y=0 into the equation, and isolate the variable x.

    \(\begin{array}{c}0=\frac{1}{2}x+2\\\underline{\,\,\,\,\,\,\,\,-2\,\,\,\,\,\,-2}\\-2=\frac{1}{2}x\\\left(2\right)\left(-2\right)=\left(2\right)\frac{1}{2}x\\-4=x\end{array}\)

    The x-intercept of \(\left(-4,0\right)\).

    The y-intercept is easier to find since this equation is in slope-intercept form. The y-intercept is (2,0).

    Now we can plot \(y=\frac{1}{2}x+2\) using the intercepts

    Now find the intercepts of \(2y-x=4\)

    Substitute y = 0 in to the equation to find the x-intercept.

    \(\begin{array}{c}2y-x=4\\2\left(0\right)-x=4\\x=-4\end{array}\)

    The x-intercept of \(\left(-4,0\right)\).

    Now substitute x = 0 into the equation to find the y-intercept.

    \(\begin{array}{c}2y-x=4\\2y-0=4\\2y=4\\y=2\end{array}\)

    The y-intercept of \(\left(0,2\right)\).

    WAIT, these are the same intercepts as \(y=\frac{1}{2}x+2\)and \(2y-x=4\) are really the same equation, expressed in different ways. If you were to write them both in slope-intercept form you would see that they are the same equation.

    When you graph them, they are the same line. In the next section, we will see that systems with two of the same equations in them have an infinite number of solutions.

    [/hidden-answer]

    Thumbnail for the embedded element "Graphing a System of Linear Equations"

    A YouTube element has been excluded from this version of the text. You can view it online here: pb.libretexts.org/ba/?p=78

    Graphing a system of linear equations consists of choosing which graphing method you want to use and drawing the graphs of both equations on the same set of axes. When you graph a system of linear inequalities on the same set of axes, there are a few more things you will need to consider.

    Graph a system of two inequalities

    Remember from the module on graphing that the graph of a single linear inequality splits the coordinate plane into two regions. On one side lie all the solutions to the inequality. On the other side, there are no solutions. Consider the graph of the inequality \(y<2x+5\).

    An upward-sloping dotted line with the region below it shaded. The shaded region is labeled y is less than 2x+5. A is equal to (-1,1). B is equal to (3,1).

    The dashed line is \(y<2x+5\), as all of the points below the line will make the inequality true. If you doubt that, try substituting the x and y coordinates of Points A and B into the inequality—you’ll see that they work. So, the shaded area shows all of the solutions for this inequality.

    The boundary line divides the coordinate plane in half. In this case, it is shown as a dashed line as the points on the line don’t satisfy the inequality. If the inequality had been \(y\leq2x+5\), then the boundary line would have been solid.

    Let’s graph another inequality: \(y>−x\). You can check a couple of points to determine which side of the boundary line to shade. Checking points M and N yield true statements. So, we shade the area above the line. The line is dashed as points on the line are not true.

    Downward-sloping dotted line with the region above it shaded. The shaded region is y is greater than negative x. Point M=(-2,3). Point N=(4,-1).

    To create a system of inequalities, you need to graph two or more inequalities together. Let’s use \(y>−x\) since we have already graphed each of them.

    The two previous graphs combined. A blue dotted line with the region above shaded and labeled y is greater than negative x. A red dotted line with the region below it shaded and labeled y is less than 2x+5. The region where the shaded areas overlap is labeled y is greater than negative x and y is less than 2x+5. The point M equals (-2,3) and is in the blue shaded region. The point A equals (-1,-1) and is in the red shaded region. The point B equals (3,1) and is in the purple overlapping region. The point N equals (4,-1) and is also in the purple overlapping region.

    The purple area shows where the solutions of the two inequalities overlap. This area is the solution to the system of inequalities. Any point within this purple region will be true for both \(y<2x+5\).

    In the next example, you are given a system of two inequalities whose boundary lines are parallel to each other.

    Examples

    Graph the system \(\begin{array}{c}y\ge2x+1\\y\lt2x-3\end{array}\)
    [reveal-answer q=”780322″]Show Solution[/reveal-answer]
    [hidden-answer a=”780322″]

    The boundary lines for this system are the same as the system of equations from a previous example:

    \(\begin{array}{c}y=2x+1\\y=2x-3\end{array}\)

    Plotting the boundary lines will be similar, except that the inequality \(y\ge2x+1\) will require a solid line. The graphs will look like this:

    y=2x+1

    Now we need to add the regions that represent the inequalities. For the inequality \(\left(0,0\right)\) to make it easy.

    Substitute \(y\ge2x+1\)

    \(\begin{array}{c}y\ge2x+1\\0\ge2\left(0\right)+1\\0\ge{1}\end{array}\)

    This is not true, so we know that we need to shade the other side of the boundary line for the inequality \(y\ge2x+1\). The graph will now look like this:

    y=2x+1

    Now let’s shade the region that shows the solutions to the inequality \(\left(0,0\right)\) to test because it makes easy algebra.

    Substitute \(y\lt2x-3\)

    \(\begin{array}{c}y\lt2x-3\\0\lt2\left(0,\right)x-3\\0\lt{-3}\end{array}\)

    This is not true, so we know that we need to shade the other side of the boundary line for the inequality\(y\lt2x-3\). The graph will now look like this:

    y=2x+1

    This system of inequalities shares no points in common.

    What would the graph look like if the system had looked like this?

    \(\begin{array}{c}y\ge2x+1\\y\gt2x-3\end{array}\).

    Testing the point \(y\gt2x-3\), and the graph would then look like this:

    image2x-3 and y>=2x+1″ width=”388″ height=”392″>

    The purple region is the region of overlap for both inequalities.

    [/hidden-answer]

    Thumbnail for the embedded element "Ex 1: Graph a System of Linear Inequalities"

    A YouTube element has been excluded from this version of the text. You can view it online here: pb.libretexts.org/ba/?p=78

    In the next section, we will see that points can be solutions to systems of equations and inequalities. We will verify algebraically whether a point is a solution to a linear equation or inequality.

    Determine whether an ordered pair is a solution for a system of linear equations

    image009-2

    The lines in the graph above are defined as

    \(\begin{array}{r}2x+y=-8\\ x-y=-1\end{array}\).

    They cross at what appears to be \(\left(-3,-2\right)\).

    Using algebra, we can verify that this shared point is actually \(\left(-2.999,-1.999\right)\). By substituting the x– and y-values of the ordered pair into the equation of each line, you can test whether the point is on both lines. If the substitution results in a true statement, then you have found a solution to the system of equations!

    Since the solution of the system must be a solution to all the equations in the system, you will need to check the point in each equation. In the following example, we will substitute -3 for x and -2 for y in each equation to test whether it is actually the solution.

    Example

    Is \(\left(-3,-2\right)\) a solution of the system

    \(\begin{array}{r}2x+y=-8\\ x-y=-1\end{array}\)

    [reveal-answer q=”919027″]Show Solution[/reveal-answer]
    [hidden-answer a=”919027″]Test \(2x+y=-8\) first:

    \(\begin{array}{r}2(-3)+(-2) = -8\\-8 = -8\\\text{TRUE}\end{array}\)

    Now test \(x-y=-1\).

    \(\begin{array}{r}(-3)-(-2) = -1\\-1 = -1\\\text{TRUE}\end{array}\)

    \(x-y=-1\)

    Since\(\left(-3,-2\right)\) is a solution of the system.

    Answer

    \(\left(-3,-2\right)\) is a solution to the system.

    [/hidden-answer]

    Example

    Is (3, 9) a solution of the system

    \(\begin{array}{r}y=3x\\2x–y=6\end{array}\)

    [reveal-answer q=”190963″]Show Solution[/reveal-answer]
    [hidden-answer a=”190963″]Since the solution of the system must be a solution to all the equations in the system, check the point in each equation.

    Substitute 3 for x and 9 for y in each equation.

    \(\begin{array}{l}y=3x\\9=3\left(3\right)\\\text{TRUE}\end{array}\)

    (3, 9) is a solution of \(y=3x\).

    \(\begin{array}{r}2x–y=6\\2\left(3\right)–9=6\\6–9=6\\-3=6\\\text{FALSE}\end{array}\)

    (3, 9) is not a solution of \(2x–y=6\).

    Since (3, 9) is not a solution of one of the equations in the system, it cannot be a solution of the system.

    Answer

    (3, 9) is not a solution to the system.

    [/hidden-answer]

    Think About It

    Is \((−2,4)\) a solution for the system

    \(\begin{array}{r}y=2x\\3x+2y=1\end{array}\)

    Before you do any calculations, look at the point given and the first equation in the system. Can you predict the answer to the question without doing any algebra?
    [reveal-answer q=”598405″]Show Solution[/reveal-answer]
    [hidden-answer a=”598405″]

    Substitute -2 for x, and 4 for y into the first equation:

    \(\begin{array}{l}y=2x\\4=2\left(-2\right)\\4=-4\\\text{FALSE}\end{array}\)

    You can stop testing because a point that is a solution to the system will be a solution to both equations in the system.

    \((−2,4)\) is NOT a solution for the system

    \(\begin{array}{r}y=2x\\3x+2y=1\end{array}\)

    [/hidden-answer]

    Thumbnail for the embedded element "Determine if an Ordered Pair is a Solution to a System of Linear Equations"

    A YouTube element has been excluded from this version of the text. You can view it online here: pb.libretexts.org/ba/?p=78

    Remember that in order to be a solution to the system of equations, the values of the point must be a solution for both equations. Once you find one equation for which the point is false, you have determined that it is not a solution for the system.

    We can use the same method to determine whether a point is a solution to a system of linear inequalities.

    Determine whether an ordered pair is a solution to a system of linear inequalities

    image014

    On the graph above, you can see that the points B and N are solutions for the system because their coordinates will make both inequalities true statements.

    In contrast, points M and A both lie outside the solution region (purple). While point M is a solution for the inequality \(y<2x+5\), neither point is a solution for the system. The following example shows how to test a point to see whether it is a solution to a system of inequalities.

    Example

    Is the point (2, 1) a solution of the system \(2x+y<8\)?

    [reveal-answer q=”84880″]Show Solution[/reveal-answer]
    [hidden-answer a=”84880″]Check the point with each of the inequalities. Substitute 2 for x and 1 for y. Is the point a solution of both inequalities?

    \(\begin{array}{r}x+y>1\\2+1>1\\3>1\\\text{TRUE}\end{array}\)

    (2, 1) is a solution for \(x+y>1\).

    \(\begin{array}{r}2x+y<8\\2\left(2\right)+1<8\\4+1<8\\5<8\\\text{TRUE}\end{array}\)

    (2, 1) is a solution for \(2x+y<8.\)

    Since (2, 1) is a solution of each inequality, it is also a solution of the system.

    Answer

    The point (2, 1) is a solution of the system \(2x+y<8\).

    [/hidden-answer]

    Here is a graph of the system in the example above. Notice that (2, 1) lies in the purple area, which is the overlapping area for the two inequalities.

    Two dotted lines, one red and one blue. The region below the blue dotted line is shaded and labeled 2x+y is less than 8. The region above the dotted red line is shaded and labeled x+y is greater than 1. The overlapping shaded region is purple and is labeled x+y is greater than 1 and 2x+y is less than 8. The point (2,1) is in the overlapping purple region.

    Example

    Is the point (2, 1) a solution of the system \(3x+y<4\)?

    [reveal-answer q=”833522″]Show Solution[/reveal-answer]
    [hidden-answer a=”833522″]

    Check the point with each of the inequalities. Substitute 2 for x and 1 for y. Is the point a solution of both inequalities?

    \(\begin{array}{r}x+y>1\\2+1>1\\3>1\\\text{TRUE}\end{array}\)

    (2, 1) is a solution for \(x+y>1\).

    \(\begin{array}{r}3x+y<4\\3\left(2\right)+1<4\\6+1<4\\7<4\\\text{FALSE}\end{array}\)

    (2, 1) is not a solution for \(3x+y<4\).

    Since (2, 1) is not a solution of one of the inequalities, it is not a solution of the system.

    Answer

    The point (2, 1) is not a solution of the system \(3x+y<4\).

    [/hidden-answer]

    Here is a graph of this system. Notice that (2, 1) is not in the purple area, which is the overlapping area; it is a solution for one inequality (the red region), but it is not a solution for the second inequality (the blue region).

    A downward-sloping bue dotted line with the region below shaded and labeled 3x+y is less than 4. A downward-sloping red dotted line with the region above it shaded and labeled x+y is greater than 1. An overlapping purple shaded region is labeled x+y is greater than 1 and 3x+y is less than 4. A point (2,1) is in the red shaded region, but not the blue or overlapping purple shaded region.

    As shown above, finding the solutions of a system of inequalities can be done by graphing each inequality and identifying the region they share. Below, you are given more examples that show the entire process of defining the region of solutions on a graph for a system of two linear inequalities. The general steps are outlined below:

    • Graph each inequality as a line and determine whether it will be solid or dashed
    • Determine which side of each boundary line represents solutions to the inequality by testing a point on each side
    • Shade the region that represents solutions for both inequalities

    Example

    Shade the region of the graph that represents solutions for both inequalities. \(y–x\geq5\).

    [reveal-answer q=”873537″]Show Solution[/reveal-answer]
    [hidden-answer a=”873537″]Graph one inequality. First graph the boundary line, using a table of values, intercepts, or any other method you prefer. The boundary line for \(x+y=1\), or \(y=−x+1\). Since the equal sign is included with the greater than sign, the boundary line is solid.

    A downward-sloping solid line labeled x+y is greater than 1.

    Find an ordered pair on either side of the boundary line. Insert the x– and y-values into the inequality \(x+y\geq1\) and see which ordered pair results in a true statement.

    \(\begin{array}{r}\text{Test }1:\left(−3,0\right)\\x+y\geq1\\−3+0\geq1\\−3\geq1\\\text{FALSE}\\\\\text{Test }2:\left(4,1\right)\\x+y\geq1\\4+1\geq1\\5\geq1\\\text{TRUE}\end{array}\)

    Since (4, 1) results in a true statement, the region that includes (4, 1) should be shaded.

    A solid downward-sloping line with the region above it shaded and labeled x+y is greater than or equal to 1. The point (4,1) is in the shaded region. The point (-3,0) is not.

    Do the same with the second inequality. Graph the boundary line, then test points to find which region is the solution to the inequality. In this case, the boundary line is \(y–x\geq5\), and test point (0, 6) is a solution.

    A solid blue line with the region above it shaded and labeled y-x is greater than or equal to 5. A solid red line with the region above it shaded and labeled x+y is greater than 1. The point (-3,0) is not in any shaded region. The point (0,6) is in the overlapping shaded region.

    Answer

    The purple region in this graph shows the set of all solutions of the system.

    The previous graph, with the purple overlapping shaded region labeled x+y is greater than or equal to 1 and y-x is greater than or equal to 5.

    [/hidden-answer]

    Thumbnail for the embedded element "Determine if an Ordered Pair is a Solution to a System of Linear Inequalities"

    A YouTube element has been excluded from this version of the text. You can view it online here: pb.libretexts.org/ba/?p=78

    In this section we have seen that solutions to systems of linear equations and inequalities can be ordered pairs. In the next section, we will work with systems that have no solutions or infinitely many solutions.

    Use a graph to classify solutions to systems

    Recall that a linear equation graphs as a line, which indicates that all of the points on the line are solutions to that linear equation. There are an infinite number of solutions. As we saw in the last section, if you have a system of linear equations that intersect at one point, this point is a solution to the system. What happens if the lines never cross, as in the case of parallel lines? How would you describe the solutions to that kind of system? In this section, we will explore the three possible outcomes for solutions to a system of linear equations.

    Three possible outcomes for solutions to systems of equations

    Recall that the solution for a system of equations is the value or values that are true for all equations in the system. There are three possible outcomes for solutions to systems of linear equations. The graphs of equations within a system can tell you how many solutions exist for that system. Look at the images below. Each shows two lines that make up a system of equations.

    One Solution No Solutions Infinite Solutions
    Two intersecting lines. Two parallel lines Two identical lines that overlap so that they appear to be one line
    If the graphs of the equations intersect, then there is one solution that is true for both equations. If the graphs of the equations do not intersect (for example, if they are parallel), then there are no solutions that are true for both equations. If the graphs of the equations are the same, then there are an infinite number of solutions that are true for both equations.
    • One Solution: When a system of equations intersects at an ordered pair, the system has one solution.
    • Infinite Solutions: Sometimes the two equations will graph as the same line, in which case we have an infinite number of solutions.
    • No Solution: When the lines that make up a system are parallel, there are no solutions because the two lines share no points in common.

    Example

    Using the graph of \(\begin{array}{r}y=x\\x+2y=6\end{array}\), shown below, determine how many solutions the system has.

    A line labeled x+2y=6 and a line labeled y=x.

    [reveal-answer q=”896900″]Show Solution[/reveal-answer]
    [hidden-answer a=”896900″]The lines intersect at one point. So the two lines have only one point in common, there is only one solution to the system.

    Answer

    There is one solution to this system.

    [/hidden-answer]

    Example (Advanced)

    Using the graph of \(\begin{array}{r}y=3.5x+0.25\\14x–4y=-4.5\end{array}\), shown below, determine how many solutions the system has.

    Two parallel lines. One line is y=3.5x+0.25. The other line is 14x-4y=-4.5.

    [reveal-answer q=”337033″]Show Solution[/reveal-answer]
    [hidden-answer a=”337033″]The lines are parallel, meaning they do not intersect. There are no solutions to the system.

    Answer

    There are no solutions to the system.

    [/hidden-answer]

    Example

    How many solutions does the system \(\begin{array}{r}y=2x+1\\−4x+2y=2\end{array}\) have?
    [reveal-answer q=”94971″]Show Solution[/reveal-answer]
    [hidden-answer a=”94971″]
    First, graph both equations on the same axes.

    Two lines that overlap each other. One line is y=2x+1. The other line is -4x+2y=2.

    The two equations graph as the same line. So every point on that line is a solution for the system of equations.

    Answer

    The system \(\begin{array}{r}y=2x+1\\−4x+2y=2\end{array}\) has an infinite number of solutions.

    [/hidden-answer]

    Thumbnail for the embedded element "Determine the Number of Solutions to a System of Linear Equations From a Graph"

    A YouTube element has been excluded from this version of the text. You can view it online here: pb.libretexts.org/ba/?p=78

    In the next section, we will learn some algebraic methods for finding solutions to systems of equations. Recall that linear equations in one variable can have one solution, no solution, or many solutions and we can verify this algebraically. We will use the same ideas to classify solutions to systems in two variables algebraically.

    CC licensed content, Original
    CC licensed content, Shared previously
    • Unit 14: Systems of Equations and Inequalities, from Developmental Math: An Open Program. Provided by: Monterey Institute of Technology and Education. Located at: nrocnetwork.org/resources/downloads/nroc-math-open-textbook-units-1-12-pdf-and-word-formats/. License: CC BY: Attribution

    3.2: Graphs and Solutions to Systems of Linear Equations is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?