Skip to content
Understand Slope of a Line

Understand Slope of a Line

By the end of this section, you will be able to: use m=riserunm = \tfrac{\text{rise}}{\text{run}} to find the slope of a line from its graph, find the slope of horizontal and vertical lines, use the slope formula to find the slope of a line between two points, graph a line given a point and the slope, and solve slope applications.

When you graph linear equations, you may notice that some lines tilt up as they go from left to right and some tilt down. Some lines are steep and some are flatter. What determines whether a line tilts up or down, or how steep or flat it is?

In mathematics, the “tilt” of a line is called the slope of the line. The slope of a line is the ratio of the vertical change to the horizontal change between any two points on the line.

Slope of a line. The slope of a line is m=riserunm = \tfrac{\text{rise}}{\text{run}}. The rise measures the vertical change and the run measures the horizontal change between two points on the line.

Use m=riserunm = \tfrac{\text{rise}}{\text{run}} to find the slope of a line from its graph

To find the slope of a line from its graph, we locate two points on the line whose coordinates are integers. Starting with the point on the left, we sketch a right triangle, going from the first point to the second, so we can count the rise and the run.

Find the slope of a line from its graph.

  1. Locate two points on the line whose coordinates are integers.
  2. Starting with the point on the left, sketch a right triangle, going from the first point to the second point.
  3. Count the rise and the run on the legs of the triangle.
  4. Take the ratio of rise to run to find the slope, m=riserunm = \tfrac{\text{rise}}{\text{run}}.

Example. Find the slope of the line shown.

xy(0, −3)(5, 1)rise = 4run = 5

We locate two points with integer coordinates, (0,3)(0, -3) and (5,1)(5, 1). Starting at the point on the left, (0,3)(0, -3), we sketch a right triangle to (5,1)(5, 1). The rise is 44 and the run is 55, so:

m=riserun=45m = \frac{\text{rise}}{\text{run}} = \frac{4}{5}

The slope of the line is 45\tfrac{4}{5}. This means that yy increases 44 units as xx increases 55 units.

It does not matter which of the two points you start from, or which point you call “first” — the slope of the line is always the same.

Find the slope of the line through the points (0, -1) and (3, 3). What is the slope?

Find the slope of the line through the points (0, 5) and (3, 3). What is the slope?

Find the slope of horizontal and vertical lines

Horizontal and vertical lines have equations with just one variable — y=by = b for a horizontal line and x=ax = a for a vertical line. What is their slope?

For a horizontal line, any two points on it have the same yy-coordinate, so the rise between them is always 00. Since m=riserun=0run=0m = \tfrac{\text{rise}}{\text{run}} = \tfrac{0}{\text{run}} = 0, every horizontal line has slope 00.

Slope of a horizontal line. The slope of a horizontal line, y=by = b, is 00.

For a vertical line, any two points on it have the same xx-coordinate, so the run between them is always 00. Since division by 00 is undefined, the slope of every vertical line is undefined.

Slope of a vertical line. The slope of a vertical line, x=ax = a, is undefined.

Example. Find the slope of each line: (a) x=8x = 8 (b) y=5y = -5.

(a) x=8x = 8 is a vertical line. Its slope is undefined.

(b) y=5y = -5 is a horizontal line. It has slope 00.

What is the slope of the line x=4x = -4?

What is the slope of the line y=7y = 7?

Use the slope formula to find the slope of a line between two points

Sometimes we need to find the slope of a line between two points without a graph to count the rise and run. To do this algebraically, we use subscript notation: (x1,y1)(x_1, y_1) ("xx sub 11, yy sub 11") names the first point and (x2,y2)(x_2, y_2) ("xx sub 22, yy sub 22") names the second.

The rise between two points is the difference in their yy-coordinates, y2y1y_2 - y_1, and the run is the difference in their xx-coordinates, x2x1x_2 - x_1. Substituting these into m=riserunm = \tfrac{\text{rise}}{\text{run}} gives the slope formula.

Slope formula. The slope of the line between two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is

m=y2y1x2x1m = \frac{y_2 - y_1}{x_2 - x_1}

The slope is: yy of the second point minus yy of the first point, over xx of the second point minus xx of the first point.

Example. Use the slope formula to find the slope of the line through the points (1,2)(1, 2) and (4,5)(4, 5).

We call (1,2)(1, 2) point #1 and (4,5)(4, 5) point #2, so (x1,y1)=(1,2)(x_1, y_1) = (1, 2) and (x2,y2)=(4,5)(x_2, y_2) = (4, 5). Substituting into the slope formula:

m=y2y1x2x1=5241=33=1m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{5 - 2}{4 - 1} = \frac{3}{3} = 1

It does not matter which point you call point #1 and which you call point #2 — the slope will be the same either way.

Example. Use the slope formula to find the slope of the line through the points (2,3)(-2, -3) and (7,4)(-7, 4).

m=y2y1x2x1=4(3)7(2)=75=75m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{4 - (-3)}{-7 - (-2)} = \frac{7}{-5} = -\frac{7}{5}

Use the slope formula to find the slope of the line through the points (8, 5) and (6, 3). What is the slope?

Use the slope formula to find the slope of the line through the points (-3, 4) and (2, -1). What is the slope?

Graph a line given a point and the slope

We have graphed lines by plotting points, by using intercepts, and by recognizing horizontal and vertical lines. Another method, the point-slope method, graphs a line from one known point and the slope: we plot the point, then use the definition of slope to find and mark a second point.

Graph a line given a point and the slope.

  1. Plot the given point.
  2. Use the slope formula m=riserunm = \tfrac{\text{rise}}{\text{run}} to identify the rise and the run.
  3. Starting at the given point, count out the rise and run to mark the second point.
  4. Connect the two points with a line.

Example. Graph the line passing through the point (1,1)(1, -1) whose slope is m=34m = \tfrac{3}{4}.

We plot (1,1)(1, -1). The slope m=34m = \tfrac{3}{4} gives rise =3= 3 and run =4= 4. Starting at (1,1)(1, -1), we count up 33 and right 44 to mark the second point, (5,2)(5, 2), then connect the two points with a line.

xy(1, −1)(5, 2)rise = 3run = 4

Graph the line passing through the point (2,2)(2, -2) with slope m=43m = \tfrac{4}{3}. Starting at (2,2)(2, -2) and counting the rise and run, what is the second point as an ordered pair (x,y)(x, y)?

Solve slope applications

Slope has many applications in the real world — the pitch of a roof, the grade of a highway, and the drop of a pipe are all slopes.

Example. The pitch of a building’s roof is the slope of the roof. A roof rises 99 feet over a run of 1818 feet. What is the slope of the roof?

m=riserun=918=12m = \frac{\text{rise}}{\text{run}} = \frac{9}{18} = \frac{1}{2}

The roof rises 11 foot for every 22 feet of horizontal run.

A roof rises 14 feet over a run of 24 feet. What is the slope of the roof, as a fully simplified fraction?

Example. Sewage pipes must slope down 14\tfrac{1}{4} inch per foot in order to drain properly. What is the required slope?

Since 11 foot is 1212 inches, and the pipe drops (a negative rise) of 14\tfrac{1}{4} inch:

m=riserun=14 inch12 inches=148m = \frac{\text{rise}}{\text{run}} = \frac{-\tfrac{1}{4}\text{ inch}}{12\text{ inches}} = -\frac{1}{48}

The pipe drops 11 inch for every 4848 inches of horizontal run.

Find the slope of a pipe that slopes down 13\tfrac{1}{3} inch per foot (12 inches).

Key terms

slope of a line — the ratio of the rise (vertical change) to the run (horizontal change) between two points on the line, m=riserun=y2y1x2x1m = \tfrac{\text{rise}}{\text{run}} = \tfrac{y_2 - y_1}{x_2 - x_1}. slope formula — the algebraic formula for computing slope from two named points, (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2). point-slope method — graphing a line by plotting one known point, then using the slope to count out and mark a second point.


This section is adapted from Elementary Algebra 2e, Section 4.4: Understand Slope of a Line by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated the geoboard and coordinate-plane figures as accessible inline graphics and condensed the geoboard-modeling activity into a single worked introduction of rise and run; omitted the Be Prepared quiz, Media links, and Section Exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback.