maths.freeArithmetic › 11. Graphs › Graphing Linear Equations

Graphing Linear Equations

Recognize the relation between the solutions of an equation and its graph

Recognize the Relation Between the Solutions of an Equation and its Graph

In Use the Rectangular Coordinate System, we found a few solutions to the equation \(3x+2y=6\). They are listed in the table below. So, the ordered pairs \((0,3)\), \((2,0)\), \((1,\frac{3}{2})\), \((4,-3)\), are some solutions to the equation\(3x+2y=6\). We can plot these solutions in the rectangular coordinate system as shown on the graph at right.

Notice how the points line up perfectly? We connect the points with a straight line to get the graph of the equation \(3x+2y=6\). Notice the arrows on the ends of each side of the line. These arrows indicate the line continues.

Every point on the line is a solution of the equation. Also, every solution of this equation is a point on this line. Points not on the line are not solutions!

Notice that the point whose coordinates are \((-2,6)\) is on the line shown in . If you substitute \(x=-2\) and \(y=6\) into the equation, you find that it is a solution to the equation.

Example

Try it.

The graph of \(y=2x-3\) is shown below.

For each ordered pair decide

  1. ⓐ Is the ordered pair a solution to the equation?
  2. ⓑ Is the point on the line?

  1. (a) \((0,-3)\)
  2. (b) \((3,3)\)
  3. (c) \((2,-3)\)
  4. (d) \((-1,-5)\)
Solution

Substitute the \(x\)- and \(y\)-values into the equation to check if the ordered pair is a solution to the equation.


ⓑ Plot the points A: \((0,-3)\) B: \((3,3)\) C: \((2,-3)\) and D: \((-1,-5)\).
The points \((0,-3)\), \((3,3)\), and \((-1,-5)\) are on the line \(y=2x-3\), and the point \((2,-3)\) is not on the line.

The points which are solutions to \(y=2x-3\) are on the line, but the point which is not a solution is not on the line.

Condensed — the full section is in OpenStax Prealgebra 2e.

Graph a Linear Equation by Plotting Points

There are several methods that can be used to graph a linear equation. The method we used at the start of this section to graph is called plotting points, or the Point-Plotting Method.

Let’s graph the equation \(y=2x+1\) by plotting points.

We start by finding three points that are solutions to the equation. We can choose any value for \(x\) or \(y,\) and then solve for the other variable.

Since \(y\) is isolated on the left side of the equation, it is easier to choose values for \(x.\) We will use \(0,1,\) and \(-2\) for \(x\) for this example. We substitute each value of \(x\) into the equation and solve for \(y.\)

We can organize the solutions in a table. See .

\(y=2x+1\)
\(x\)\(y\)\((x,y)\)
\(0\)\(1\)\((0,1)\)
\(1\)\(3\)\((1,3)\)
\(-2\)\(-3\)\((-2,-3)\)

Now we plot the points on a rectangular coordinate system. Check that the points line up. If they did not line up, it would mean we made a mistake and should double-check all our work. See .

Draw the line through the three points. Extend the line to fill the grid and put arrows on both ends of the line. The line is the graph of \(y=2x+1.\)

Example

Try it.

Graph the equation \(y=-3x.\)

Solution

Find three points that are solutions to the equation. It’s easier to choose values for \(x,\) and solve for \(y.\) Do you see why?

List the points in a table.

\(y=-3x\)
\(x\)\(y\)\((x,y)\)
\(0\)\(0\)\((0,0)\)
\(1\)\(3\)\((1,-3)\)
\(-2\)\(6\)\((-2,6)\)

Plot the points, check that they line up, and draw the line as shown.

Example

Try it.

Graph the equation \(y=\frac{1}{2}x+3.\)

Solution

Find three points that are solutions to the equation. Since this equation has the fraction \(\frac{1}{2}\) as a coefficient of \(x,\) we will choose values of \(x\) carefully. We will use zero as one choice and multiples of \(2\) for the other choices.

The points are shown in the table.

\(y=\frac{1}{2}x+3\)
\(x\)\(y\)\((x,y)\)
\(0\)\(3\)\((0,3)\)
\(2\)\(4\)\((2,4)\)
\(4\)\(5\)\((4,5)\)

Plot the points, check that they line up, and draw the line as shown.

\[2x+y=3\]\[y=-2x+3\]
\(y=-2x+3\)
\(x\)\(y\)\((x,y)\)
\(0\)\(3\)\((0,3)\)
\(1\)\(1\)\((1,1)\)
\(-1\)\(5\)\((-1,5)\)

Condensed — the full section is in OpenStax Prealgebra 2e.

Graph Vertical and Horizontal Lines

Can we graph an equation with only one variable? Just \(x\) and no \(y,\) or just \(y\) without an \(x?\) How will we make a table of values to get the points to plot?

Let’s consider the equation \(x=-3.\) The equation says that \(x\) is always equal to \(-3,\) so its value does not depend on \(y.\) No matter what \(y\) is, the value of \(x\) is always \(-3.\)

To make a table of solutions, we write \(-3\) for all the \(x\) values. Then choose any values for \(y.\) Since \(x\) does not depend on \(y,\) you can choose any numbers you like. But to fit the size of our coordinate graph, we’ll use \(1,2,\) and \(3\) for the \(y\)-coordinates as shown in the table.

\(x=-3\)
\(x\)\(y\)\((x,y)\)
\(-3\)\(1\)\((-3,1)\)
\(-3\)\(2\)\((-3,2)\)
\(-3\)\(3\)\((-3,3)\)

Then plot the points and connect them with a straight line. Notice in that the graph is a vertical line.

Example

Try it.

Graph the equation \(x=2.\) What type of line does it form?

Solution

The equation has only variable, \(x,\) and \(x\) is always equal to \(2.\) We make a table where \(x\) is always \(2\) and we put in any values for \(y.\)

\(x=2\)
\(x\)\(y\)\((x,y)\)
\(2\)\(1\)\((2,1)\)
\(2\)\(2\)\((2,2)\)
\(2\)\(3\)\((2,3)\)

Plot the points and connect them as shown.

The graph is a vertical line passing through the \(x\)-axis at \(2.\)

What if the equation has \(y\) but no \(x\)? Let’s graph the equation \(y=4.\) This time the \(y\)-value is a constant, so in this equation \(y\) does not depend on \(x.\)

To make a table of solutions, write \(4\) for all the \(y\) values and then choose any values for \(x.\)

We’ll use \(0,2,\) and \(4\) for the \(x\)-values.

\(y=4\)
\(x\)\(y\)\((x,y)\)
\(0\)\(4\)\((0,4)\)
\(2\)\(4\)\((2,4)\)
\(4\)\(4\)\((4,4)\)
Example

Try it.

Graph the equation \(y=-1.\)

Solution

The equation \(y=-1\) has only variable, \(y.\) The value of \(y\) is constant. All the ordered pairs in the table have the same \(y\)-coordinate, \(-1\). We choose \(0,3,\) and \(-3\) as values for \(x.\)

\(y=-1\)
\(x\)\(y\)\((x,y)\)
\(-3\)\(-1\)\((-3,-1)\)
\(0\)\(-1\)\((0,-1)\)
\(3\)\(-1\)\((3,-1)\)

The graph is a horizontal line passing through the \(y\)-axis at \(-1\) as shown.

Example

Try it.

Graph \(y=-3x\) and \(y=-3\) in the same rectangular coordinate system.

Solution

Find three solutions for each equation. Notice that the first equation has the variable \(x,\) while the second does not. Solutions for both equations are listed.

The graph shows both equations.

Condensed — the full section is in OpenStax Prealgebra 2e.

Key Concepts

  • Graph a linear equation by plotting points.
    1. Find three points whose coordinates are solutions to the equation. Organize them in a table.
    2. Plot the points on a rectangular coordinate system. Check that the points line up. If they do not, carefully check your work.
    3. Draw the line through the points. Extend the line to fill the grid and put arrows on both ends of the line.
  • Graph of a Linear Equation:The graph of a linear equation \(ax+by=c\) is a straight line.
    • Every point on the line is a solution of the equation.
    • Every solution of this equation is a point on this line.

Graphing Linear Equations

Recognize the Relation Between the Solutions of an Equation and its Graph

In each of the following exercises, an equation and its graph is shown. For each ordered pair, decide

  1. ⓐ is the ordered pair a solution to the equation?
  2. ⓑ is the point on the line?

Try it.

\(y=x+2\)

  1. \((0,2)\)
  2. \((1,2)\)
  3. \((-1,1)\)
  4. \((-3,1)\)
Solution

  1. ⓐ yes ⓑ yes
  2. ⓐ no ⓑ no
  3. ⓐ yes ⓑ yes
  4. ⓐ no ⓑ no

Try it.

\(y=x-4\)

  1. \((0,-4)\)
  2. \((3,-1)\)
  3. \((2,2)\)
  4. \((1,-5)\)

Try it.

\(y=\frac{1}{2}x-3\)

  1. \((0,-3)\)
  2. \((2,-2)\)
  3. \((-2,-4)\)
  4. \((4,1)\)
Solution

  1. ⓐ yes ⓑ yes
  2. ⓐ yes ⓑ yes
  3. ⓐ yes ⓑ yes
  4. ⓐ no ⓑ no

Try it.

\(y=\frac{1}{3}x+2\)

  1. \((0,2)\)
  2. \((3,3)\)
  3. \((-3,2)\)
  4. \((-6,0)\)

Graph a Linear Equation by Plotting Points

In the following exercises, graph by plotting points.

Try it.

\(y=3x-1\)

Solution


Try it.

\(y=2x+3\)

Try it.

\(y=-2x+2\)

Solution


Try it.

\(y=-3x+1\)

Try it.

\(y=x+2\)

Solution


Try it.

\(y=x-3\)

Try it.

\(y=-x-3\)

Solution


Try it.

\(y=-x-2\)

Try it.

\(y=2x\)

Solution


Try it.

\(y=3x\)

Try it.

\(y=-4x\)

Solution


Try it.

\(y=-2x\)

Try it.

\(y=\frac{1}{2}x+2\)

Solution


Try it.

\(y=\frac{1}{3}x-1\)

Try it.

\(y=\frac{4}{3}x-5\)

Solution


Try it.

\(y=\frac{3}{2}x-3\)

Try it.

\(y=-\frac{2}{5}x+1\)

Solution


Try it.

\(y=-\frac{4}{5}x-1\)

Try it.

\(y=-\frac{3}{2}x+2\)

Solution


Try it.

\(y=-\frac{5}{3}x+4\)

Try it.

\(x+y=6\)

Solution


Try it.

\(x+y=4\)

Try it.

\(x+y=-3\)

Solution


Try it.

\(x+y=-2\)

Try it.

\(x-y=2\)

Solution


Try it.

\(x-y=1\)

Try it.

\(x-y=-1\)

Solution


Try it.

\(x-y=-3\)

Try it.

\(-x+y=4\)

Solution


Try it.

\(-x+y=3\)

Try it.

\(-x-y=5\)

Solution


Try it.

\(-x-y=1\)

Try it.

\(3x+y=7\)

Solution


Try it.

\(5x+y=6\)

Try it.

\(2x+y=-3\)

Solution


Try it.

\(4x+y=-5\)

Try it.

\(2x+3y=12\)

Solution


Try it.

\(3x-4y=12\)

Try it.

\(\frac{1}{3}x+y=2\)

Solution


Try it.

\(\frac{1}{2}x+y=3\)

Graph Vertical and Horizontal lines

In the following exercises, graph the vertical and horizontal lines.

Try it.

\(x=4\)

Solution


Try it.

\(x=3\)

Try it.

\(x=-2\)

Solution


Try it.

\(x=-5\)

Try it.

\(y=3\)

Solution


Try it.

\(y=1\)

Try it.

\(y=-5\)

Solution


Try it.

\(y=-2\)

Try it.

\(x=\frac{7}{3}\)

Solution


Try it.

\(x=\frac{5}{4}\)

In the following exercises, graph each pair of equations in the same rectangular coordinate system.

Try it.

\(y=-\frac{1}{2}x\) and \(y=-\frac{1}{2}\)

Solution


Try it.

\(y=-\frac{1}{3}x\) and \(y=-\frac{1}{3}\)

Try it.

\(y=2x\) and \(y=2\)

Solution


Try it.

\(y=5x\) and \(y=5\)

Mixed Practice

In the following exercises, graph each equation.

Try it.

\(y=4x\)

Solution


Try it.

\(y=2x\)

Try it.

\(y=-\frac{1}{2}x+3\)

Solution


Try it.

\(y=\frac{1}{4}x-2\)

Try it.

\(y=-x\)

Solution

Try it.

\(y=x\)

Try it.

\(x-y=3\)

Solution

Try it.

\(x+y=-5\)

Try it.

\(4x+y=2\)

Solution

Try it.

\(2x+y=6\)

Try it.

\(y=-1\)

Solution

Try it.

\(y=5\)

Try it.

\(2x+6y=12\)

Solution

Try it.

\(5x+2y=10\)

Try it.

\(x=3\)

Solution

Try it.

\(x=-4\)

Try it.

Explain how you would choose three \(x\text{-values}\) to make a table to graph the line \(y=\frac{1}{5}x-2.\)

Solution

Answers will vary.

Try it.

What is the difference between the equations of a vertical and a horizontal line?

Condensed — the full section is in OpenStax Prealgebra 2e.

Practice (40)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Evaluate: \(3x+2\) when \(x=-1.\)
    If you missed this problem, review .

    ჲრკპთირვ ჲრდჲგჲპა.

    \(-1\)

  2. Solve the formula: \(5x+2y=20\) for \(y.\)
    If you missed this problem, review .

    ჲრკპთირვ ჲრდჲგჲპა.

    \(y=\frac{20-5x}{2}\)

  3. Simplify: \(\frac{3}{8}(-24)\text{.}\)
    If you missed this problem, review .

    ჲრკპთირვ ჲრდჲგჲპა.

    \(-9\)

  4. The graph of \(y=2x-3\) is shown below.

    For each ordered pair decide

    1. ⓐ Is the ordered pair a solution to the equation?
    2. ⓑ Is the point on the line?

    1. (a) \((0,-3)\)
    2. (b) \((3,3)\)
    3. (c) \((2,-3)\)
    4. (d) \((-1,-5)\)
    ჲრკპთირვ ჲრდჲგჲპა.

    Substitute the \(x\)- and \(y\)-values into the equation to check if the ordered pair is a solution to the equation.


    ⓑ Plot the points A: \((0,-3)\) B: \((3,3)\) C: \((2,-3)\) and D: \((-1,-5)\).
    The points \((0,-3)\), \((3,3)\), and \((-1,-5)\) are on the line \(y=2x-3\), and the point \((2,-3)\) is not on the line.

    The points which are solutions to \(y=2x-3\) are on the line, but the point which is not a solution is not on the line.

  5. The graph of \(y=3x-1\) is shown.

    For each ordered pair, decide

    1. ⓐ is the ordered pair a solution to the equation?
    2. ⓑ is the point on the line?
    1. \((0,-1)\)
    2. \((2,2)\)
    3. \((3,-1)\)
    4. \((-1,-4)\)
    ჲრკპთირვ ჲრდჲგჲპა.
    1. ⓐ yes ⓑ yes
    2. ⓐ no ⓑ no
    3. ⓐ no ⓑ no
    4. ⓐ yes ⓑ yes
  6. Graph the equation \(y=-3x.\)

    ჲრკპთირვ ჲრდჲგჲპა.

    Find three points that are solutions to the equation. It’s easier to choose values for \(x,\) and solve for \(y.\) Do you see why?

    List the points in a table.

    \(y=-3x\)
    \(x\)\(y\)\((x,y)\)
    \(0\)\(0\)\((0,0)\)
    \(1\)\(3\)\((1,-3)\)
    \(-2\)\(6\)\((-2,6)\)

    Plot the points, check that they line up, and draw the line as shown.

  7. Graph the equation by plotting points: \(y=-4x.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  8. Graph the equation by plotting points: \(y=x.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  9. Graph the equation \(y=\frac{1}{2}x+3.\)

    ჲრკპთირვ ჲრდჲგჲპა.

    Find three points that are solutions to the equation. Since this equation has the fraction \(\frac{1}{2}\) as a coefficient of \(x,\) we will choose values of \(x\) carefully. We will use zero as one choice and multiples of \(2\) for the other choices.

    The points are shown in the table.

    \(y=\frac{1}{2}x+3\)
    \(x\)\(y\)\((x,y)\)
    \(0\)\(3\)\((0,3)\)
    \(2\)\(4\)\((2,4)\)
    \(4\)\(5\)\((4,5)\)

    Plot the points, check that they line up, and draw the line as shown.

  10. Graph the equation: \(y=\frac{1}{3}x-1.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  11. Graph the equation: \(y=\frac{1}{4}x+2.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  12. Graph the equation \(x+y=5.\)

    ჲრკპთირვ ჲრდჲგჲპა.

    Find three points that are solutions to the equation. Remember, you can start with any value of \(x\) or \(y.\)

    We list the points in a table.

    \(x+y=5\)
    \(x\)\(y\)\((x,y)\)
    \(0\)\(5\)\((0,5)\)
    \(1\)\(4\)\((1,4)\)
    \(4\)\(1\)\((4,1)\)

    Then plot the points, check that they line up, and draw the line.

  13. Graph the equation: \(x+y=-2.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  14. Graph the equation: \(x-y=6.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  15. Graph the equation \(3x+y=-1.\)

    ჲრკპთირვ ჲრდჲგჲპა.

    Find three points that are solutions to the equation.

    First, solve the equation for \(y.\)

    \(\begin{array}{lll}3x+y & = & -1 \\ y & = & -3x-1\end{array}\)

    We’ll let \(x\) be \(0,1,\) and \(-1\) to find three points. The ordered pairs are shown in the table. Plot the points, check that they line up, and draw the line.

    \(y=-3x-1\)
    \(x\)\(y\)\((x,y)\)
    \(0\)\(-1\)\((0,-1)\)
    \(1\)\(-4\)\((1,-4)\)
    \(-1\)\(2\)\((-1,2)\)

    If you can choose any three points to graph a line, how will you know if your graph matches the one shown in the answers in the book? If the points where the graphs cross the \(x\text{-}\) and \(y\)-axes are the same, the graphs match.

  16. Graph each equation: \(2x+y=2.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  17. Graph each equation: \(4x+y=-3.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  18. Graph the equation \(x=2.\) What type of line does it form?

    ჲრკპთირვ ჲრდჲგჲპა.

    The equation has only variable, \(x,\) and \(x\) is always equal to \(2.\) We make a table where \(x\) is always \(2\) and we put in any values for \(y.\)

    \(x=2\)
    \(x\)\(y\)\((x,y)\)
    \(2\)\(1\)\((2,1)\)
    \(2\)\(2\)\((2,2)\)
    \(2\)\(3\)\((2,3)\)

    Plot the points and connect them as shown.

    The graph is a vertical line passing through the \(x\)-axis at \(2.\)

  19. Graph the equation: \(x=5.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  20. Graph the equation: \(x=-2.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  21. Graph the equation \(y=-1.\)

    ჲრკპთირვ ჲრდჲგჲპა.

    The equation \(y=-1\) has only variable, \(y.\) The value of \(y\) is constant. All the ordered pairs in the table have the same \(y\)-coordinate, \(-1\). We choose \(0,3,\) and \(-3\) as values for \(x.\)

    \(y=-1\)
    \(x\)\(y\)\((x,y)\)
    \(-3\)\(-1\)\((-3,-1)\)
    \(0\)\(-1\)\((0,-1)\)
    \(3\)\(-1\)\((3,-1)\)

    The graph is a horizontal line passing through the \(y\)-axis at \(-1\) as shown.

  22. Graph the equation: \(y=-4.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  23. Graph the equation: \(y=3.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  24. Graph \(y=-3x\) and \(y=-3\) in the same rectangular coordinate system.

    ჲრკპთირვ ჲრდჲგჲპა.

    Find three solutions for each equation. Notice that the first equation has the variable \(x,\) while the second does not. Solutions for both equations are listed.

    The graph shows both equations.

  25. Graph the equations in the same rectangular coordinate system: \(y=-4x\) and \(y=-4.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  26. Graph the equations in the same rectangular coordinate system: \(y=3\) and \(y=3x.\)

    ჲრკპთირვ ჲრდჲგჲპა.


  27. \(y=x+2\)

    1. \((0,2)\)
    2. \((1,2)\)
    3. \((-1,1)\)
    4. \((-3,1)\)
    ჲრკპთირვ ჲრდჲგჲპა.

    1. ⓐ yes ⓑ yes
    2. ⓐ no ⓑ no
    3. ⓐ yes ⓑ yes
    4. ⓐ no ⓑ no

  28. \(y=x-4\)

    1. \((0,-4)\)
    2. \((3,-1)\)
    3. \((2,2)\)
    4. \((1,-5)\)
  29. \(y=\frac{1}{2}x-3\)

    1. \((0,-3)\)
    2. \((2,-2)\)
    3. \((-2,-4)\)
    4. \((4,1)\)
    ჲრკპთირვ ჲრდჲგჲპა.

    1. ⓐ yes ⓑ yes
    2. ⓐ yes ⓑ yes
    3. ⓐ yes ⓑ yes
    4. ⓐ no ⓑ no

  30. \(y=\frac{1}{3}x+2\)

    1. \((0,2)\)
    2. \((3,3)\)
    3. \((-3,2)\)
    4. \((-6,0)\)
  31. \(y=\frac{1}{2}x+2\)

    ჲრკპთირვ ჲრდჲგჲპა.


  32. \(y=\frac{1}{3}x-1\)

  33. \(y=\frac{4}{3}x-5\)

    ჲრკპთირვ ჲრდჲგჲპა.


  34. \(y=\frac{3}{2}x-3\)

  35. \(y=-\frac{2}{5}x+1\)

    ჲრკპთირვ ჲრდჲგჲპა.


  36. \(y=-\frac{4}{5}x-1\)

  37. \(y=-\frac{3}{2}x+2\)

    ჲრკპთირვ ჲრდჲგჲპა.


  38. \(y=-\frac{5}{3}x+4\)

  39. \(2x+3y=12\)

    ჲრკპთირვ ჲრდჲგჲპა.


  40. \(3x-4y=12\)

Symbols used here

\pm
plus or minus
Both signs at once: x = 3 ± 2 means 5 and 1.
\neq
not equal
The two sides are different.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\approx
approximately equal
Equal to the precision shown, not exactly.
\sqrt{x},\ \sqrt[n]{x}
square root, n-th root
The non-negative number whose square (n-th power) is x.
a \bmod n
remainder
What is left after dividing a by n.
\%
per cent
Per hundred: 15% = 15/100.
a : b,\ \frac{a}{b}
ratio, fraction
a for every b; a divided by b.

How to: Graphing Linear Equations

  1. Recognize the relation between the solutions of an equation and its graph
  2. Graph a linear equation by plotting points
  3. Graph vertical and horizontal lines
  4. Every point on the line is a solution of the equation.
  5. Every solution of this equation is a point on this line.
  6. (a)
  7. (b)
  8. (c)

Questions people ask

Why does the order of operations matter?

Because 2 + 3 × 4 would otherwise be two different numbers. The convention (brackets, exponents, multiplication and division, addition and subtraction) exists so every reader gets the same value from the same expression.

How do I check an arithmetic answer?

Estimate first (round every number and compute roughly), then compare. If the estimate and the exact answer disagree by more than a little, one of them is wrong. The solver shows every operation, so you can find which line went astray.

Why are fractions harder than decimals?

They are not harder, they are more exact: 1/3 is a precise number, 0.333 is an approximation. Fractions need a common denominator to add, which is the one extra step people trip on.

ჲოთრაი ჟამ.

Parts of this page are adapted from OpenStax Prealgebra 2e (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.

მეტი Arithmetic