Return to the Purplemath home page


Try a demo lesson Join Login to


Index of lessons | Purplemath's lessons in offline form |
Forums | Print this page (print-friendly version) | Find local tutors


Slope of a Straight Line (page 1 of 2)

One of the most important properties of a straight line is in how it angles away from the horizontal. This concept is reflected in something called the "slope" of the line.

Let's take a look at the straight line y = ( 2/3 ) x – 4. Its graph looks like this:

y = (2/3)x - 4

To find the slope, we will need two points from the line.

Pick two x's and solve for each corresponding y: If, say, x = 3, then y = ( 2/3 )(3) – 4 = 2 – 4 = –2. If, say, x = 9, then y = ( 2/3 )(9) – 4 = 6 – 4 = 2. (By the way, I picked the x-values to be multiples of three because of the fraction. It's not a rule that you have to do that, but it's a helpful technique.) So the two points (3, –2) and (9, 2) are on the line y = ( 2/3 )x – 4.

To find the slope, you use the following formula:

    slope formula: m = [y1 - y2] / [x1 - x2]

(Why "m" for "slope", rather than, say, "s"? The official answer is: Nobody knows.)

The subscripts merely indicate that you have a "first" point (whose coordinates are subscripted with a "1") and a "second" point (whose coordinates are subscripted with a "2"); that is, the subscripts indicate nothing more than the fact that you have two points to work with. It is entirely up to you which point you label as "first" and which you label as "second". For computing slopes with the slope formula, the important thing is that you subtract the x's and y's in the same order. For our two points, if we choose (3, –2) to be the "first" point, then we get the following:




    slope calculation: m = 2/3

The first y-value above, the –2, was taken from the point (3, –2) ; the second y-value, the 2, came from the point (9, 2); the x-values 3 and 9 were taken from the two points in the same order. If we had taken the coordinates from the points in the opposite order, the result would have been exactly the same value:

    slope calculation: m = 2/3

As you can see, the order in which you list the points really doesn't matter, as long as you subtract the x-values in the same order as you subtracted the y-values. Because of this, the slope formula can be written as it is above, or alternatively it can be written as:

    slope: another version of the formula Copyright © Elizabeth Stapel 2000-2011 All Rights Reserved

Let me emphasize: it does not matter which of the two formulas you use or which point you pick to be "first" and which you pick to be "second". The only thing that matters is that you subtract your x-values in the same order as you had subtracted your y-values.

Technically, the equivalence of the two slope formulas above can be proved by noting that:

    y1  y2 = y2 + y1 = (y2  y1)
     x2 = x2 + x1 = (x2  x1)

Doing the subtraction in the so-called "wrong" order serves only to create two "minus" signs which cancel out. The upshot: Don't worry too much about which point is the "first" point, because it really doesn't matter. (And please don't send me an e-mail claiming that the order does somehow matter, or that one of the above two formulas is somehow "wrong". If you think I'm wrong, plug pairs of points into both formulas, and try to prove me wrong! And keep on plugging until you "see" that the mathematics is in fact correct.)

Let's find the slope of another line equation:

  • Find the slope of  y = –2x + 3.
  • Graphing the line, it looks like this:


    y = -2x + 3

    I'll pick a couple of values for x, and find I'll find the corresponding values for y. Picking x = –1, I get y = –2(–1) + 3 = 2 + 3 = 5. Picking x = 2, I get y = –2(2) + 3 = –4 + 3 = –1. Then the points (–1, 5) and (2, –1) are on the line y = –2x + 3. The slope of the line is then calculated as:

      slope calculation: m = -2

Now YOU try it!

Scroll back up this page and look at those equations and their graphs. For the first equation, y
= ( 2/3 )x – 4
, the slope was m = 2/3. And the line, as you moved from left to right along the x-axis, was heading up toward the top of the drawing; technically, the line was "increasing". For the second line, y = –2x + 3, the slope was m = –2. And the line, as you moved from left to right along the x-axis, was heading down toward the bottom of the drawing; technically, the line was "decreasing". This relationship is always true: Increasing lines have positive slopes, and decreasing lines have negative slopes. Always!

This fact can help you check your calculations: if you calculate a slope as being negative, but you can see from the graph that the line is increasing (so the slope must be positive), you know you need to re-do your calculations. Being aware of this connection can save you points on a test because it will enable you to check your work before you hand it in.

Increasing lines have positive slopes; decreasing lines have negative slopes. With this in mind, consider the following horizontal line:

    y = 4

Its graph is shown to the right.


horizonal line: y = 4

Is the horizontal line going up; that is, is it an increasing line? No, so its slope won't be positive. Is the horizontal line going down; that is, is it a decreasing line? No, so its slope won't be negative. What number is neither positive nor negative? Zero! So the slope of this horizontal line is zero. Let's do the calculations to confirm this value. Using the points (–3, 4) and (5, 4), the slope is:

    slope is zero

This relationship is true for every horizontal line: a slope of zero means the line is horizontal, and a horizontal line means you'll get a slope of zero. (By the way, all horizontal lines are of the form "y = some number", and the equation "y = some number" always graphs as a horizontal line.)


Now consider the vertical line x = 4:


Is the vertical line going up on one end? Well, kind of. Is the vertical line going down on the other end? Well, kind of. Is there any number that is both positive and negative? Nope.


vertical line: x = 4

Verdict: vertical lines have NO SLOPE. In particular, the concept of slope simply does not work for vertical lines. The slope doesn't exist! Let's do the calculations. I'll use the points (4, 5) and (4, –3); the slope is:

    slope is undefined

(We can't divide by zero, which is of course why this slope value is "undefined".)

This relationship is always true: a vertical line will have no slope, and "the slope is undefined" means that the line is vertical. (By the way, all vertical lines are of the form "x = some number", and "x = some number" means the line is vertical. Any time your line involves an undefined slope, the line is vertical, and any time the line is vertical, you'll end up dividing by zero if you try to compute the slope.)

Warning: It is very common to confuse these two lines and their slopes, but they are very different. Just as "horizontal" is not at all the same as "vertical", so also "zero slope" is not at all the same as "no slope". The number "zero" exists, so horizontal lines do indeed have a slope. But vertical lines don't have any slope; "slope" just doesn't have any meaning for vertical lines. It is very common for tests to contain questions regarding horizontals and verticals. Don't mix them up!

Now YOU try it!

Top  |  1 | 2  |  Return to Index  Next >>

Cite this article as:

Stapel, Elizabeth. "Slope of a Straight Line." Purplemath. Available from Accessed



This lesson may be printed out for your personal use.

Content copyright protected by Copyscape website plagiarism search

  Copyright 2000-2014  Elizabeth Stapel   |   About   |   Terms of Use   |   Linking   |   Site Licensing


 Feedback   |   Error?