Skip to ContentGo to accessibility page
Algebra 1

1.10.2 Graphing Equations in Context

Algebra 11.10.2 Graphing Equations in Context

1.10.2 Graphing Equations in Context

1.10.2 • Graphing Equations in Context

Activity

For questions 1 – 7, use the equation x + y = 20 x + y = 20 which represents the relationship between the number of games, x x , the number of rides, y y , and the dollar amount a student is spending on games and rides at an amusement park.

1.

What’s the number of rides the student could get on if they don’t play any games?

2.

What would the coordinate be on the graph to represent the answer to question 1?

3.

What’s the number of games the student could play if they don’t get on any rides?

4.

What would the coordinate be on the graph to represent the answer to question 3?

Self Check

Which of the following equations correctly solved  2 x + 4 y = 8 for y ?
  1. y = − 1 2 x + 8
  2. y = 1 2 x + 2
  3. y = − 2 x + 4
  4. y = − 1 2 x + 2

Additional Resources

Find the Slope of a Line

When you graph linear equations, you may notice that some lines tilt up as they go from left to right and some lines tilt down. Some lines are very steep and some lines are flatter.

In mathematics, the measure of the steepness of a line is called the of slope the line. The concept of slope has many applications in the real world. In construction the pitch of a roof, the slant of the plumbing pipes, and the steepness of the stairs are all applications of slope. As you ski or jog down a hill, you definitely experience a slope. We can assign a numerical value to the slope of a line by finding the ratio of the rise and run. The rise is the amount the vertical distance changes while the run measures the horizontal change, as shown in this illustration. Slope is a rate of change.

Slope of a Line

The slope of a line is m = r i s e r u n m = r i s e r u n . The rise measures the vertical change and the run measures the horizontal change. To find the slope of a line, we locate two points on the line whose coordinates are integers. Then we sketch a right triangle where the two points are vertices and one side is horizontal and one side is vertical. To find the slope of the line, we measure the vertical distance is called the rise and the horizontal distance is called the run.

How To Find the Slope from a Graph

Find the slope of a line from its graph using m = r i s e r u n m = r i s e r u n

Step 1 - Locate two points on the line whose coordinates are integers.

Step 2 - Starting with one point, sketch a right triangle, going from the first point to the second point.

Step 3 - Count the rise and the run on the legs of the triangle.

Step 4 - Take the ratio of rise to run to find the slope: m = r i s e r u n m = r i s e r u n .

Example 1

Find the slope of the line shown.

Solution

Step 1 - Locate two points on the graph whose coordinates are integers.

( 0 , 5 ) ( 0 , 5 ) and ( 3 , 3 ) ( 3 , 3 )

Step 2 - Starting at ( 0 , 5 ) ( 0 , 5 ) , sketch a right triangle to ( 3 , 3 ) ( 3 , 3 ) as shown in this graph.

Step 3 - Count the rise(how many spaces up or down)— since it goes down, it is negative.

The rise is − 2 − 2 .

Step 4 - Count the run (how many spaces to the right or left).

The run is 3.

Step 5 - Use the slope formula.

m = r i s e r u n m = r i s e r u n

Step 6 - Substitute the values of the rise and run.

m = − 2 3 m = − 2 3

Step 7 - Simplify.

m = − 2 3 m = − 2 3

So  y y decreases by 2 units as  x x increases by 3 units.

Slopes of Horizontal and Vertical Lines

How do we find the slope of horizontal and vertical lines? To find the slope of the horizontal line, y = 4 y = 4 , we could graph the line, find two points on it, and count the rise and the run. Let’s see what happens when we do this, as shown in the graph below.

Step 1 - What is the rise?

The rise is 0.

Step 2 - What is the run?

The run is 3.

Step 3 - What is the slope?

m = r i s e r u n m = r i s e r u n

m = 0 3 m = 0 3

m = 0 m = 0

So The slope of the horizontal line y = 4 y = 4 is 0.

Let's also consider a vertical line, the line x = 3 x = 3 , as shown in the graph below.

Step 1 - What is the rise?

The rise is 2.

Step 2 - What is the run?

The run is 0.

Step 3 - What is the slope?

m = r i s e r u n m = r i s e r u n

m = 2 0 m = 2 0

The slope is undefined since division by zero is undefined. So we say that the slope of the vertical line is undefined.

  • All horizontal lines have slope 0. When the y y –coordinates are the same, the rise is 0.
  • The slope of any vertical line is undefined. When the x x –coordinates of a line are all the same, the run is 0.

Quick Guide to the Slopes of Lines

Sometimes we’ll need to find the slope of a line between two points when we don’t have a graph to count out the rise and the run. We could plot the points on grid paper, then count out the rise and the run, but as we’ll see, there is a way to find the slope without graphing. Before we get to it, we need to introduce some algebraic notation.

We have seen that an ordered pair ( x , y ) ( x , y ) gives the coordinates of a point. But when we work with slopes, we use two points. How can the same symbol ( x , y ) ( x , y ) be used to represent two different points? Mathematicians use subscripts to distinguish the points.

We will use ( x 1 x 1 , y 1 y 1 ) to identify the first point and ( x 2 x 2 , y 2 y 2 ) to identify the second point. Let’s see how the rise and run relate to the coordinates of the two points by taking another look at the slope of the line between the points 2 ,   3 2 ,   3 , and 7 ,   6 7 ,   6 , as shown in this graph.

Step 1 - Since we have two points, we will use subscript notation.

x 1 , y 1 2 , 3 x 1 , y 1 2 , 3 x 2 , y 2 7 , 6 x 2 , y 2 7 , 6

Step 2 - What is the slope?

The rise is 3.

The run is 5.

Step 3 - What is the slope?

m = r i s e r u n m = r i s e r u n

On the graph, we counted the rise of 3 and the run of 5. m = 3 5 m = 3 5

Notice that the rise of 3 can be found by subtracting the y y –coordinates, 6 and 3, and the run of 5 can be found by subtracting the x x –coordinates, 7 and 2.

Step 4 - We rewrite the rise and run by putting in the coordinates.

m = 6 − 3 7 − 2 m = 6 − 3 7 − 2

But 6 is y y 2, the y y –coordinate of the second point and 3 is y y 1, the y y –coordinate of the first point. So we can rewrite the slope using subscript notation.

m = y 2 − y 1 7 − 2 m = y 2 − y 1 7 − 2

Also, 7 is x x 2, the x x –coordinate of the second point and 2 is x x 1, the x x –coordinate of the first point. So again, we rewrite the slope using subscript notation

m = y 2 − y 1 x 2 − x 1 m = y 2 − y 1 x 2 − x 1

We’ve shown that m = y 2 − y 1 x 2 − x 1 m = y 2 − y 1 x 2 − x 1 is really another version of m = r i s e r u n m = r i s e r u n . We can use this formula to find the slope of a line when we have two points on the line.

How to Find the Slope from Two Points

The slope of the line between two points ( x 1 , y 1 ) x 1 , y 1 ) and ( x 2 , y 2 x 2 , y 2 )  is:  m = y 2 − y 1 x 2 − x 1 m = y 2 − y 1 x 2 − x 1

Example 2

Step 1 - We’ll call (-2, -3) point #1 and (-7, 4) point #2.

( x 1 , y 1 − 2 , − 3 ) ( x 1 , y 1 − 2 , − 3 ) ( x 2 , y 2 − 7 , 4 ) ( x 2 , y 2 − 7 , 4 )

Step 2 - Use the slope formula.

m = y 2 − y 1 x 2 − x 1 m = y 2 − y 1 x 2 − x 1

Step 3 - Substitute the values.

y y of the second point minus y y of the first point.

x x of the second point minus x x of the first point

m = 4 − ( − 3 ) − 7 − ( − 2 ) m = 4 − ( − 3 ) − 7 − ( − 2 )

Step 4 - Simplify.

m = 4 + 3 − 7 + 2 m = 4 + 3 − 7 + 2

m = 7 − 5 m = 7 − 5

m = − 7 5 m = − 7 5

Step 5 - Let's verify this slope on the graph shown.

m = y 2 − y 1 x 2 − x 1 m = y 2 − y 1 x 2 − x 1

Try it

Find the Slope of a Line

Find the slope of the line graph below.

Citation/Attribution
Reuse and redistribution of this content in digital or print format:
  • This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's prior written permission.
  • This book uses the Creative Commons Attribution-NonCommercial-ShareAlike License, which means that you can reuse and modify the material only for noncommercial purposes, must attribute OpenStax, and must distribute any derivative works under the same license.
  • Any commercial printing of this textbook, including using a local or custom printer, must be approved by OpenStax, and proper citation provided.
  • OpenStax-copyrighted images, activities, assessments, and similar components of this book are subject to the same licensing – CC-BY-NC-SA. They can be used for noncommercial purposes with attribution. Commercial use requires permission.
  • Permission requests: Anyone who intends to incorporate this content (including text, images, and other components) into large language models, use it in AI offerings, use it commercially (including in print), and/or has questions about another use case is welcome to complete our reuse request form.
Attribution information
  • If you are redistributing all or part of this book in a noncommercial print format, then you must include on every physical page the following attribution:

    Access for free at https://openstax.org/books/algebra-1/pages/about-this-course

  • If you are redistributing all or part of this book in a noncommercial digital format, then for every page that includes OpenStax content, you must license the derivative work under the same CC-BY-NC-SA license as the original, and include on every digital page view the following attribution:

    Access for free at https://openstax.org/books/algebra-1/pages/about-this-course

Citation information

The information below includes the information needed to generate citations in most major styles (APA, MLA, etc.); you must reformat and organize the information as needed to fit the requirements of the style. Use the information below to generate a citation. We recommend using a citation tool such as this one.

© Apr 23, 2026 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License. The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo, and Rice University name, and Rice University logo trademarks, or wordmarks are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.