Using the Slope Formula to Find the Slope of a Line Between Two Points

Using the Slope Formula to Find the Slope of a Line Between Two Points

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 \(\left(x,y\right)\) gives the coordinates of a point. But when we work with slopes, we use two points. How can the same symbol \(\left(x,y\right)\) be used to represent two different points? Mathematicians use subscripts to distinguish the points.

\(\begin{array}{ccc}\left({x}_{1},{y}_{1}\right)\hfill & & \text{read ‘}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{sub 1,}\phantom{\rule{0.2em}{0ex}}y\phantom{\rule{0.2em}{0ex}}\text{sub 1’}\hfill \\ \left({x}_{2},{y}_{2}\right)\hfill & & \text{read ‘}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{sub 2,}\phantom{\rule{0.2em}{0ex}}y\phantom{\rule{0.2em}{0ex}}\text{sub 2’}\hfill \end{array}\)

The use of subscripts in math is very much like the use of last name initials in elementary school. Maybe you remember Laura C. and Laura M. in your third grade class?

We will use \(\left({x}_{1},{y}_{1}\right)\) to identify the first point and \(\left({x}_{2},{y}_{2}\right)\) to identify the second point.

If we had more than two points, we could use \(\left({x}_{3},{y}_{3}\right)\), \(\left({x}_{4},{y}_{4}\right)\), and so on.

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 \(\left(2,3\right)\) and \(\left(7,6\right)\).

The graph shows the x y coordinate plane. The x and y-axes run from 0 to 7. A line passes through the points (2, 3) and (7, 6), which are plotted and labeled. The ordered pair (2, 3) is labeled (x subscript 1, y subscript 1). The ordered pair (7, 6) is labeled (x subscript 2, y subscript 2). An additional point is plotted at (2, 6). The three points form a right triangle, with the line from (2, 3) to (7, 6) forming the hypotenuse and the lines from (2, 3) to (2, 6) and from (2, 6) to (7, 6) forming the legs. The first leg, from (2, 3) to (2, 6) is labeled y subscript 2 minus y subscript 1, 6 minus 3, and 3. The second leg, from (2, 3) to (7, 6), is labeled x subscript 2 minus x subscript 1, y minus 2, and 5.

Since we have two points, we will use subscript notation, \(\left(\stackrel{{x}_{1},}{2,}\stackrel{{y}_{1}}{3}\right)\)\(\left(\stackrel{{x}_{2},{y}_{2}}{7,6}\right)\).

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

Notice that the rise of 3 can be found by subtracting the y-coordinates 6 and 3.

\(3=6-3\)

And the run of 5 can be found by subtracting the x-coordinates 7 and 2.

\(5=7-2\)

We know \(m=\frac{\text{rise}}{\text{run}}\). So \(m=\frac{3}{5}\).

We rewrite the rise and run by putting in the coordinates \(m=\frac{6-3}{7-2}\).

But 6 is \({y}_{2}\), the y-coordinate of the second point and 3 is \({y}_{1}\), the y-coordinate of the first point.

So we can rewrite the slope using subscript notation. \(m=\frac{{y}_{2}-{y}_{1}}{7-2}\)

Also, 7 is \({x}_{2}\), the x-coordinate of the second point and 2 is \({x}_{1}\), the x-coordinate of the first point.

So, again, we rewrite the slope using subscript notation. \(m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\)

We’ve shown that \(m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\) is really another version of \(m=\frac{\text{rise}}{\text{run}}\). We can use this formula to find the slope of a line when we have two points on the line.

Slope Formula

The slope of the line between two points \(\left({x}_{1},{y}_{1}\right)\) and \(\left({x}_{2},{y}_{2}\right)\) is

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

This is the slope formula.

The slope is:

\(\begin{array}{}\hfill y\phantom{\rule{0.2em}{0ex}}\text{of the second point minus}\phantom{\rule{0.2em}{0ex}}y\phantom{\rule{0.2em}{0ex}}\text{of the first point}\hfill \\ \hfill \text{over}\hfill \\ \hfill x\phantom{\rule{0.2em}{0ex}}\text{of the second point minus}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{of the first point.}\hfill \end{array}\)

Example

Use the slope formula to find the slope of the line between the points \(\left(1,2\right)\) and \(\left(4,5\right)\).

Solution

\(\begin{array}{cccc}\text{We’ll call}\phantom{\rule{0.2em}{0ex}}\left(1,2\right)\phantom{\rule{0.2em}{0ex}}\text{point #1 and}\phantom{\rule{0.2em}{0ex}}\left(4,5\right)\phantom{\rule{0.2em}{0ex}}\text{point #2.}\hfill & & & \phantom{\rule{5em}{0ex}}\left(\stackrel{{x}_{1},{y}_{1}}{1,2}\right)\phantom{\rule{0.5em}{0ex}}{\left(\stackrel{{x}_{2},{y}_{2}}{4,5}\right)}_{}\hfill \\ \text{Use the slope formula.}\hfill & & & \phantom{\rule{5em}{0ex}}m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\hfill \\ \text{Substitute the values.}\hfill & & \\ y\phantom{\rule{0.2em}{0ex}}\text{of the second point minus}\phantom{\rule{0.2em}{0ex}}y\phantom{\rule{0.2em}{0ex}}\text{of the first point}\hfill & & & \phantom{\rule{5em}{0ex}}m=\frac{5-2}{{x}_{2}-{x}_{1}}\hfill \\ x\phantom{\rule{0.2em}{0ex}}\text{of the second point minus}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{of the first point}\hfill & & & \phantom{\rule{5em}{0ex}}m=\frac{5-2}{4-1}\hfill \\ \text{Simplify the numerator and the denominator.}\hfill & & & \phantom{\rule{5em}{0ex}}m=\frac{3}{3}\hfill \\ \text{Simplify.}\hfill & & & \phantom{\rule{5em}{0ex}}m=1\hfill \end{array}\)

Let’s confirm this by counting out the slope on a graph using \(m=\frac{\text{rise}}{\text{run}}\).

The graph shows the x y-coordinate plane. The x and y-axes of the plane run from 0 to 7. A line passes through the points (1, 2) and (4, 5), which are plotted. An additional point is plotted at (1, 5). The three points form a right triangle, with the line from (1, 2) to (4, 5) forming the hypotenuse and the lines from (1, 2) to (1, 5) and from (1, 5) to (4, 5) forming the legs. The leg from (1, 2) to (1, 5) is labeled “rise” and the leg from (1, 5) to (4, 5) is labeled “run”.

It doesn’t matter which point you call point #1 and which one you call point #2. The slope will be the same. Try the calculation yourself.

Example

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

Solution

\(\begin{array}{ccccc}\text{We’ll call}\phantom{\rule{0.2em}{0ex}}\left(-2,-3\right)\phantom{\rule{0.2em}{0ex}}\text{point #1 and}\phantom{\rule{0.2em}{0ex}}\left(-7,4\right)\phantom{\rule{0.2em}{0ex}}\text{point #2.}\hfill & & \phantom{\rule{5em}{0ex}}& & \left(\stackrel{{x}_{1},\text{ }{y}_{1}}{-2,-3}\right)\phantom{\rule{0.5em}{0ex}}\left(\stackrel{{x}_{2},\text{ }{y}_{2}}{-7,4}\right)\hfill \\ \text{Use the slope formula.}\hfill & & \phantom{\rule{5em}{0ex}}& & m=\frac{{y}_{2}-{y}_{1}}{{x}_{2}-{x}_{1}}\hfill \\ \text{Substitute the values.}\hfill & & \phantom{\rule{5em}{0ex}}& & \\ y\phantom{\rule{0.2em}{0ex}}\text{of the second point minus}\phantom{\rule{0.2em}{0ex}}y\phantom{\rule{0.2em}{0ex}}\text{of the first point}\hfill & & \phantom{\rule{5em}{0ex}}& & m=\frac{4-\left(-3\right)}{{x}_{2}-{x}_{1}}\hfill \\ x\phantom{\rule{0.2em}{0ex}}\text{of the second point minus}\phantom{\rule{0.2em}{0ex}}x\phantom{\rule{0.2em}{0ex}}\text{of the first point}\hfill & & \phantom{\rule{5em}{0ex}}& & m=\frac{4-\left(-3\right)}{-7-\left(-2\right)}\hfill \\ \text{Simplify.}\hfill & & \phantom{\rule{5em}{0ex}}& & m=\frac{7}{-5}\hfill \\ & \phantom{\rule{5em}{0ex}}& & & m=-\frac{7}{5}\hfill \end{array}\)

Let’s verify this slope on the graph shown.

The graph shows the x y-coordinate plane. The x-axis of the plane runs from negative 8 to 2 and the y-axis of the plane runs from negative 6 to 5. A line passes through the points (negative 7, 4) and (negative 2, negative 3), which are plotted and labeled. An additional point is plotted at (negative 7, negative 3). The three points form a right triangle, with the line from (negative 7, 4) to (negative 2, negative 3) forming the hypotenuse and the lines from (negative 7, 4) to (negative 7, negative 3) and from (negative 7, negative 3) to (negative 2, negative 3) forming the legs. The leg from (negative 7, 4) to (negative 7, negative 3) is labeled “rise” and the leg from (negative 7, negative 3) to (negative 2, negative 3) is labeled “run”.
\(\begin{array}{ccc}\hfill m& =\hfill & \frac{\text{rise}}{\text{run}}\hfill \\ \hfill m& =\hfill & \frac{-7}{5}\hfill \\ \hfill m& =\hfill & -\frac{7}{5}\hfill \end{array}\)

This lesson is part of:

Graphs and Equations

View Full Tutorial

Track Your Learning Progress

Sign in to unlock unlimited practice exams, tutorial practice quizzes, personalized weak area practice, AI study assistance with Lexi, and detailed performance analytics.