home icon
Related Lessons: Types of Slopes Slope Intercept Form Point Slope Form Slopes of Parallel and Perpendicular Lines Equations of Parallel and Perpendicular Lines


Slope Formula of a Straight Line | Step by Step

The slope of a straight 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.


Slope Formula


The slope, m, of a line passing through two arbitrary points (xsub1,ysub1) and (xsub2,ysub2) is calculated as follows...




Few observations:

  • The first point is assigned with subscript 1, while the second point is assigned with subscript 2.


(x1,y1) divider (x2,y2)


  • The numerical value for slope is expressed in fraction. The numerator contains the difference of y-values, while the denominator contains the difference of x-values.


subtract y-values in the numerator and subtract x-values in the denominator


  • 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.


m=rise/run; rise=up or down movement; run=left or right movement


tip Another way of remembering the slope formula is to think of it as the ratio of the change in y-coordinates and x-coordinates, or the division between the difference in y-values and x-values. The y's must stay on top the x's.


m=difference in y-values/difference in x-values=change in y-coordinates/change in x-coordinates


Direction: Find the slope of the line passing through the given two points.


Example 1: (3,5) and (7,13) See Solution
Example 2: (2,10) and (5,1) See Solution
Example 3: (-7,3) and (15,-5) See Solution
Example 4: (-11,-5) and (1,-12) See Solution
Example 5: (5,17) and (0,-3) See Solution
Example 6: (-1,-2) and (-3,-4) See Solution
Example 7: (6,-8) and (14,-8) See Solution
Example 8: (10,0) and (10,9) See Solution


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

Start by assigning which ones will be our first and second points. If we decide to make (3,5) as the first point, then (7,13) 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.

(xsub1,ysub1)=(3,5) and (xsub2,ysub2)=(7,13)

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


xsub1=3, ysub1=5, xsub2=7, ysub2=13

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


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


graph showing points (3,5) and (7,13) with m=2



Example 2: Determine the slope of the line passing through the points (2,10) and (5,1).

Identify the first and second points.


If we assigned the points to be... The coordinate values of each point will be...
(xsub1,ysub1)=(2,10) xsub1= 2, ysub1=10

(xsub2,ysub2)=(5,1) xsub2= 5, ysub2=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.


be careful with the numerator; m=(1-10)/(5-2)=-9/3=-3


Here is the graph of the line passing through points (2,10) and (5,1) 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.


graph with points (2,10) and (5,1) with slope m=-3



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

In this example, I'd like to show you that the numerical value of the slope is ALWAYS the same, regardless which points you pick to be the "first" or "second". As long as you maintain the correct order in 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 side by side comparison below.


Case 1 (usual order of points)   Case 2 (reverse order of points)
first point=(-7,3); second point=(15,-5)   first point=(15,-5); second point=(-7,3)
Label each point with appropriate x and y coordinates.
xsub1,ysub1=(-7,3) and xsub2,ysub2=(15,-5)   xsub2,ysub2=(-7,3) and xsub1,ysub1=(15,-5)
Evaluate the values into the slope formula
m=(-5-3)/[15-(-7)]=(-5-3)/(15+7)=-88/22=-4/11   m=[3-(-5)]/(-7-15)=(3+5)/(-7-15)=8/-22=-4/11

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

  • Just a quick reminder, be very careful when you are subtracting negative numbers. Remember that subtracting by a negative number is the same as adding the positive value of that number. 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 (-11,-5) and (1,-12).

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)   Case 2 (reverse order of points)
first point=(-11,-5); second point=(1,-12)   first point=(1,-12); second point=(-11,-5)
Label each point with appropriate x and y coordinates.
xsub1,ysub1=(-11,-5) and xsub2,ysub2=(1,-12)   xsub2,ysub2=(-11,-5) and xsub1,ysub1=(1,-12)
Evaluate the values into the slope formula
m=[-12-(-5)]/[1-(-11)]=(-12+5)/(1+11)=-7/12   m=[-5-(-12)]/(-11-1)=(-5+12)/-12=7/(-12)=(-7)/12


This is wonderful! The same final answers using two different routes of calculation.

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

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


Step 1: Label the points first point=(5,17); second point=(0,-3)
Step 2: Extract values xsub1=5 and ysub1=17; xsub2=0 and ysub2=-3
Step 3: Write the slope formula m=(ysub2-ysub1)/(xsub2-xsub1)
Step 4: Substitute values from Step 2, then simplify. m=(-3-17)/(0-5)=-20/-5=4


  • 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 (-1,-2) and (-3,-4).

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 (−3,−4), and (−1,−2) be the second. Labeling their corresponding coordinate values, and substituting we should get


First point Second point
xsub1=-3 and ysub1=-4 xsub2=-1 and ysub2=-2
Evaluate values into the slope formula




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

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

Suppose (xsub1,ysub1)=(6,-8), and (xsub2,ysub2)=(14,-8). The slope of this straight line equals...

m=[-8-(-8)/(14-6)=(-8+8)/(14-6)=0/8=0; all horizontal lines have a slope equal to zero


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.

graph showing points (6,-8) and (14,-8) with m=0



Example 8: Solve the slope of the line passing through the points (10,0) and (10,9).

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 to the division by zero, commonly known as undefined.

Suppose (xsub1,ysub1)=(10,0), and (xsub2,ysub2)=(10,9). The slope of the straight line equals


m=(9-0)/(10-10)=9/0=undefined; 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.

graph at points (10,0) and (10,9); slope is undefined



Practice Problems with Answers
Worksheet 1 Worksheet 2


Top of Page
Algebra Lessons
Algebra Lessons (A-Z)
Algebra Worksheets
Free Math Solver

ASVAB Test Prep 







Copyright 2011-2017   ChiliMath  All Rights Reserved

Powered by Liquid Web