Slope Formula

The slope of a straight line describes the line’s angle of steepness from the horizontal whether it rises or falls.

When the line neither rises nor falls, then we claim that it has a slope of zero. This is, in fact, the case of a horizontal line where it extends infinitely to its left or right but without any sign of “rising” or “falling”.

In this lesson, the focus is to go over lots of worked examples to illustrate how to use the formula itself. Remember that two points determine a line. Thus, it is possible to calculate the slope of a straight line, denoted by the symbol, m, when we know at least two points where the line passes through.


The Slope Formula

The slope, m, of a line passing through two arbitrary points \left( {{x_1},{y_1}} \right) and \left( {{x_2},{y_2}} \right) is calculated as follows.

illustrates how the slope formula is used how to find the slope of the line passing through a given two points or ordered pairs which are (x1,y1) and (x2,y2)

Few observations:

  • The coordinates of the first point are assigned with subscript 1.
The subscript of 1 indicates that the x and y are the components of the first ordered pair or point.

While, the coordinates of the second point are assigned with subscript 2.

The subscript of 2 indicates that the x and y are the components of the second ordered pair or point.
  • The numerical value for slope is expressed as a ratio or fraction. The numerator contains the difference of y-values, while the denominator contains the difference of x-values.
slope represented by "m" is equal to the quantity y2 minus y1, then divide it by the quantity x2 minus x1
  • The slope formula is conceptually defined as the rise over run. The “rise” pertains to the movement of the point along the y-axis, and the “run” pertains to the movement along the x-axis.
the formula of the slope is equal to the ratio of the difference in y's and the difference in x's. sometimes it is considered to be the rise over run.

Examples of How to Find the Slope of a Line using the Slope Formula

Example 1: Determine the slope of the line passing through the points \left( {3,5} \right) and \left( {7,13} \right).

Start by assigning which ones will be our first and second points. If we decide to make \left( {3,5} \right) as the first point, then \left( {7,13} \right) should automatically be the second.  The first point uses subscript 1, and the second point uses subscript 2. The diagram below should help us visualize the first step.

the first point (x1,y1) is the ordered pair (3,5) while the second point (x2,y2) is the ordered pair (7,13)

Next, it is now easy to extract the values that we will substitute in the slope formula.

(3,5) and (7,13)

We are now ready to substitute the known values into the formula.

using the formula to find the slope, we have m = (y2-y1)/(x2-x1) = (13-5)/(7-3) = 8/4 = 2, therefore slope is equal to 2.

At m=2, we have a positive slope and therefore the straight line is rising or increasing from left to right. In other words, having a positive slope is like climbing up a hill. See the graph below.

the graph of the line passing through the points (3,5) and (7,13) has a slope of m = 2.

Example 2: Determine the slope of the line passing through the points \left( {2,10} \right) and \left( {5,1} \right).

Identify the first and second points.

if we consider the first point to be (2,10) then x1 = 2 and y1 =10. in addition, if we want the second point to be (5,1) then x2=5 and y2=1.

Plug these values in the slope formula. Make sure that you subtract the numbers correctly. This is usually where students commit errors because they tend to be careless when doing basic arithmetic operations.

m=(y2-y1)/(x2-x1) = (1-10)/(5-2) = -9/3 = -3 therefore the slope is negative 3

Here is the graph of the line passing through points \left( {2,10} \right) and \left( {5,1} \right) with its corresponding negative slope of m = - 3. This means that the straight line is falling/decreasing from left to right. You may think of it as somebody going down the hill.

the graph of the line passing through the points (2,10) and (5,1) has a negative slope of m=-3

Example 3: Determine the slope of the line passing through the points \left( { - \,7,3} \right) and \left( {15, - \,5} \right).

In this example, I’d like to show you that the numerical value of the slope is ALWAYS the same, regardless of which point you pick to be the “first” or “second”. As long as you maintain the correct order by subtracting the corresponding y and x coordinates, the slope should come out unchanged.

Let me illustrate the idea by solving the slope two-ways. See comparison below.

CASE 1 (usual order of points)

the first point is (-7,3) while the second point is (15,-5)
  • Label each point with appropriate x and y coordinates.
for the first order pair, we have xsub1=-7 and ysub1=3, while the second ordered pair is xsub2=15 and ysub2=-5
  • Evaluate the values into the slope formula
the slope of line passing through the points (-7,3) and (15,-5) is -4/11.

CASE 2 (reverse order of points)

reversing the roles of the two points do not change the value of the slope
  • Label each point with appropriate x and y coordinates.
(-7,3) and (15,-5)
  • Evaluate the values into the slope formula
m=(ysub2-ysub1)/(xsub2-xsub1) = (3+5)/(-7-15)=8/-22=-4/11

That’s right! We have shown that the final answers for slope came out to be the same although we switched the order of points.

Just a quick reminder, be very careful when you are subtracting negative numbers. Remember that subtraction by a negative number is the same as adding the negative value of that number. We can think of it as x - a = x + \left( { - a} \right).

You may have heard before that “two negative signs” becomes positive. That is the reason why when I was subtracting by a negative number, I intentionally placed that negative number inside a parenthesis to prompt me to be a little bit careful in dealing with signs.


Example 4: Find the slope of the line that goes through the points \left( { - \,11, - \,5} \right) and \left( {1, - \,12} \right).

Solve this again side by side in two ways, to nail down the concept that reversing the order of points doesn’t affect the final outcome of the slope.

CASE 1 (usual order of points)

let (-11,-5) be the first ordered pair and (1,-12) be the second ordered pair
  • Label each point with appropriate x and y coordinates.
since the first point is (-11,-5) that means xsub1 =-11 and ysub1=-5. in the same manner, the second point (1,-12) implies that xsub2=1 and ysub2=-12.
  • Evaluate the values into the slope formula
m=(y sub 2 minus y sub 1) divided by (x sub 2 minus x sub 1) = [(-12-(-5)]/[1-(-5)] = (-12+5)/(1+11) = -7/12

CASE 2 (reverse order of points)

reversing the order points in the calculation of finding the slope does not change the slope value
  • Label each point with appropriate x and y coordinates.
the first ordered pair is (-11,-5) while the second ordered pair is (1,-12)
  • Evaluate the values into the slope formula
slope is negative 7 over 12

This is wonderful! We arrived at the same final answer using two different routes of calculation.


Example 5: Find the slope of the line that goes through the points \left( {5,17} \right) and \left( {0, - \,3} \right).

If you want to solve this step by step, you may do it this way.

  • Step 1: Label the points
first ordered pair is (5,17) while the second ordered pair is (0,-3)
  • Step 2: Extract values
  • Step 3: Write the slope formula
the slope of the line is equal to the quotient of delta y and delta x
  • Step 4: Substitute values from Step 2, then simplify.
m = -20/-5 = 4

Notes:

  • For the numerator: adding two negative numbers yields a negative answer. Since,
-3-17=(-3)+(-17)=-20
  • Also, dividing two negative numbers results to a positive answer. That’s why our final answer for slope is m = + \,4.

Example 6: Find the slope of the line that goes through the points \left( { - \,1, - \,2} \right) and \left( { - \,3, - \,4} \right).

This looks like a fun problem because all the entries of the two points are negative numbers. I bet you that your teacher may throw something like this in order to test if you are careful dealing with the subtraction of negative numbers.

Let the first point be \left( { - \,3, - \,4} \right) and \left( { - \,1, - \,2} \right) be the second. Labeling their corresponding coordinate values, and substituting we should get

  • First point
xsub1 = -3 while ysub1=-4
  • Second point
xsub2=-1 while ysub2 = -2
  • Evaluate values into the slope formula
the slope is calculated as m = (y sub 2 minus y sub 1)/ (x sub 2 minus x subs 1) = 2/2 = 1, therefore m = 1

Example 7: Solve the slope of the line passing through the points \left( {6, - \,8} \right) and \left( {14, - \,8} \right).

This problem is an example of a horizontal line. It happens when the computed value of the slope equals zero!

Suppose 

xsub1 = 6 and ysub1 = -8

 and 

xsub2=14 and ysub2=-8

The computation of the slope of the line is shown below.

m=[-8-(-8)]/(14-6) = (-8+8)/(14-6) = 0/8 = 0, thus the slope is equal to zero, or m=0

Indeed, the line is horizontal as shown in the graph. The line behaves this way because no matter how the x-coordinates vary, the y-values are constant or not changing. The effect is that as long as the y doesn’t change, the plotted points will all remain in that same horizontal line where y = - 8.

the graph of the line passing through the points (6,-8) and (14,-8) has slope of zero or m=0

Example 8: Solve the slope of the line passing through the points \left( {10,0} \right) and \left( {10,9} \right).

This last example illustrates when the line passing through two given points is a vertical line.

All vertical lines have no slope because the numerical value of their slopes results in the division by zero, commonly known as undefined.

Let \left( {{x_1},{y_1}} \right) = \left( {10,0} \right) and \left( {{x_2},{y_2}} \right) = \left( {10,9} \right).

The slope of the straight line is calculated as follows.

m=(9-0)/(10-10) = 9/0 which is undefined since division by zero is not allowed

Any nonzero number divided by zero has no answer. That’s why we just call it undefined. Here’s the graph to show the vertical line.

the graph of the vertical line passing through the points (10,9) and (10,0) has an undefined slope

Practice with Worksheets

You might also be interested in:

Types of Slopes of a Line

Slope-Intercept Form of a Line

Point-Slope Form of a Line