Learn
Lesson · Lines, Functions and Graphs · Lines

Slope

Slope is the constant ratio of vertical change to horizontal change along a line. Getting it right is a matter of subtracting in a consistent order, and of keeping zero and undefined firmly apart.

m = (y₂ − y₁)/(x₂ − x₁) rise over run same order top and bottom, or the sign flips horizontal: m = 0 vertical: m undefined m > 0 rises left to right, m < 0 falls
Slope in four lines

Core ideas

What this lesson establishes

“Graphing a Linear Equation” noticed that equal steps in x gave equal steps in y. Slope is that observation turned into a number that can be computed and compared.

1

Slope is a ratio, not an angle

It is a quotient of two differences, so it survives any rescaling of the drawing. This is why slope is the reliable measure of steepness and the visual impression is not.

2

The answer does not depend on the two points

Pick any two distinct points on a line and the ratio comes out the same. Similar triangles are the reason, and it is what makes "the" slope of a line a well-defined thing at all.

3

Zero and undefined are opposite situations

A horizontal line has m = 0: the rise is zero. A vertical line has no slope at all: the run is zero and the division is illegal. Calling a vertical line's slope zero merges the two flattest and steepest cases.

The material

Measuring steepness

One formula, one ordering rule, and two special cases.

Definition · Slope

For two distinct points (x₁, y₁) and (x₂, y₂) on a line with x₁ ≠ x₂, the slope is m = (y₂ − y₁)/(x₂ − x₁), the rise divided by the run.

Read it as a rate: m is how much y changes per unit increase in x. A slope of 3/2 means that going 2 to the right takes you 3 up, and equally that going 1 to the right takes you 3/2 up. Both readings are useful and they are the same statement.

Theorem · Slope is well defined

Any two distinct points on a line give the same slope. Two choices of point pair produce similar right triangles — equal angles, because the hypotenuses lie along the same line and the legs are parallel to the axes — and similar triangles have proportional sides, so the ratio rise/run agrees.

Without that theorem the phrase "the slope of the line" would be meaningless, because different people would compute different numbers for the same line. It is the reason a single number can stand in for a whole line's steepness in every formula that follows.

The ordering rule

The subtraction must run in the same direction in the numerator and the denominator. Both (y₂ − y₁)/(x₂ − x₁) and (y₁ − y₂)/(x₁ − x₂) are correct and equal, because negating both parts of a fraction leaves it unchanged. What is wrong is mixing them:

points (-2, 1) and (4, 10) correct (10 - 1) / (4 - (-2)) = 9 / 6 = 3/2 correct (1 - 10) / (-2 - 4) = -9 / -6 = 3/2 WRONG (10 - 1) / (-2 - 4) = 9 / -6 = -3/2 sign flipped

The wrong version is not a small error. It reports a line that falls where the real one rises, and every later form built on that slope inherits the mistake. Fix the order once, at the point of writing the fraction: decide which point is first and use it first in both differences.

Sign and the two special cases

  • m > 0 — the line rises from left to right.
  • m < 0 — the line falls from left to right.
  • m = 0 — horizontal. The rise is zero for every pair of points, so the quotient is zero.
  • undefined — vertical. The run is zero, and division by zero is not an operation.

The last two are worth separating carefully, because English blurs them. "No slope" is ambiguous and best avoided; say m = 0 for horizontal and "slope undefined" for vertical. The distinction returns with consequences in “Parallel and Perpendicular Lines”, where the perpendicular rule needs both slopes to exist, and again in “What a Function Is”.

Example · Four slopes

(−2, 1) to (4, 10): 9/6 = 3/2, rising. (1, 7) to (3, 1): −6/2 = −3, falling. (−3, 4) to (6, 4): 0/9 = 0, horizontal. (5, 2) to (5, 9): run is 0, so the slope is undefined.

One habit worth forming now: after computing a slope, glance at the two points and ask whether the sign is plausible. Going from (1, 7) to (3, 1) clearly moves right and down, so a negative answer is expected and −3 passes the glance. This catches the ordering error in the time it takes to read.

Interactive

Slope

Rise over run, drawn as the triangle it is

A line
the lineyour two pointsinterceptssecond line

Method

Computing a slope from two points

Label, subtract in order, simplify, sanity-check the sign.

1

Label the points

Write (x₁, y₁) and (x₂, y₂) above the numbers. Which point you call first does not matter; that you then stay with the choice does.

2

Check for a vertical line first

If x₁ = x₂ the run is zero and the slope is undefined. Stop here rather than writing a fraction with zero underneath.

3

Subtract in the same order top and bottom

(y₂ − y₁) over (x₂ − x₁). Watch the double negatives: subtracting a negative x-coordinate adds.

4

Simplify, then check the sign against the picture

Reduce the fraction. Then confirm: right-and-up or left-and-down means positive, right-and-down means negative.

Rise over run

Score 0 / 0

The slope through (−2, 1) and (4, 10), three ways

Once in each order, then from a third point on the same line, to see that all three agree.

taking (-2, 1) first: m = (10 - 1) / (4 - (-2)) = 9 / (4 + 2) = 9/6 = 3/2 taking (4, 10) first: m = (1 - 10) / (-2 - 4) = -9 / -6 = 9/6 = 3/2 the point (0, 4) is on this line too, since 3/2 · 0 + 4 = 4: with (-2, 1): (4 - 1) / (0 - (-2)) = 3/2 with (4, 10): (10 - 4) / (4 - 0) = 6/4 = 3/2 all four computations: 3/2

The step 4 − (−2) = 6 is where arithmetic errors cluster. Subtracting a negative adds, and writing the parentheses rather than doing it in your head is what keeps the run from coming out as 2.

That every pair gives 3/2 is the theorem in action. It is also the reason “Point-Slope and Standard Form” can build the line from whichever point is convenient.

For a faded computation, use (−5, 4) and (1, −8). The numerator is supplied as −8 − 4 = −12; write the denominator in the matching order, simplify the ratio, and check its sign against the right-and-down movement. Then reverse both subtraction orders and confirm the same slope.

Common mistakes

1
Mixing the order of subtractionConsistency is the whole rule. (y₂ − y₁)/(x₂ − x₁) and (y₁ − y₂)/(x₁ − x₂) are both fine; one of each is a sign error that the answer alone will not reveal.
2
Writing run over riseThe definition is vertical change divided by horizontal change. Inverting it turns a slope of 3 into 1/3, which is a genuinely different line and, as “Parallel and Perpendicular Lines” shows, not even the perpendicular one.
3
Saying a vertical line has slope zeroZero rise gives m = 0 and describes a horizontal line. Zero run gives no slope at all. Merging them makes the flattest and the steepest lines indistinguishable in every formula that takes m as input.

Check your understanding

✓
Finish when you can compute a slope from any two points, including negative coordinates, and classify the two degenerate cases correctly.

Given eight point pairs, some with negative coordinates, one horizontal and one vertical, you should produce eight correct answers with the right signs and the word "undefined" exactly once. Slope feeds every form in “Slope-Intercept Form” and “Point-Slope and Standard Form”, so a sign error here is a wrong line there.

Note: Slope is the first rate of change in this library. The same quotient, taken between two points that are brought closer and closer together, is the derivative — which is calculus and out of scope here. What makes the linear case special is that the ratio is the same for every pair of points, so one number describes the whole line.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.