MathPath
Grades 1–13 Math Hub
Grades 8–10 · Algebra I · Formula Deep Dive

Slope Formula: Derivation, Graph & Worked Examples

The Slope Formula measures how steep a straight line is and which direction it tilts by comparing its vertical change (rise) to its horizontal change (run) between any two points on the line.

$$m = \frac{y_2 - y_1}{x_2 - x_1}$$

Variables: $(x_1, y_1)$ and $(x_2, y_2)$ are two distinct points on the line ($x_2 \neq x_1$).

When to use: Finding the steepness and direction of a line passing through two known points.

Visual Interpretation: Rise Over Run

xy-4-224-4-2246(-1,-1)(2,5)

Line through (−1, −1) and (2, 5): vertical rise = 5 − (−1) = 6, horizontal run = 2 − (−1) = 3, so slope m = 6 / 3 = 2.

Why the Slope Formula Works (Derivation)

Because a straight line has a constant rate of change, any two points on it form a right triangle whose vertical and horizontal legs stay in the exact same ratio.

  1. Pick any two distinct points $(x_1, y_1)$ and $(x_2, y_2)$ on the line with $x_2 \neq x_1$.
  2. Measure the vertical change (rise): $\Delta y = y_2 - y_1$.
  3. Measure the horizontal change (run): $\Delta x = x_2 - x_1$.
  4. By similar right triangles along the same straight line, the ratio $\frac{\Delta y}{\Delta x}$ is identical for every pair of points on the line, giving $m = \frac{y_2 - y_1}{x_2 - x_1}$.

The 4 Types of Slope You Must Recognize

Positive Slope ($m > 0$)

Line rises from left to right. As $x$ increases, $y$ increases.

Negative Slope ($m < 0$)

Line falls from left to right. As $x$ increases, $y$ decreases.

Zero Slope ($m = 0$)

Horizontal line ($y_2 = y_1$). Rise is $0$, so $m = \frac{0}{\Delta x} = 0$.

Undefined Slope

Vertical line ($x_2 = x_1$). Run is $0$, and division by $0$ is undefined.

Step-by-Step Worked Examples

Example 1: Finding Positive Slope with Negative Coordinates

Problem: Find the slope of the line passing through $(-1, -1)$ and $(2, 5)$.
  1. Label the points: $(x_1, y_1) = (-1, -1)$ and $(x_2, y_2) = (2, 5)$.
  2. Substitute carefully with parentheses: $m = \frac{5 - (-1)}{2 - (-1)}$.
  3. Subtracting a negative becomes addition: $m = \frac{5 + 1}{2 + 1} = \frac{6}{3} = 2$.
  4. Check by reversing the order: $\frac{-1 - 5}{-1 - 2} = \frac{-6}{-3} = 2$ (identical!).

Example 2: Finding a Negative Fractional Slope

Problem: Find the slope of the line through $(4, 7)$ and $(10, 3)$.
  1. Compute the rise: $y_2 - y_1 = 3 - 7 = -4$.
  2. Compute the run: $x_2 - x_1 = 10 - 4 = 6$.
  3. Divide and simplify to lowest terms: $m = \frac{-4}{6} = -\frac{2}{3}$.

Common Mistakes to Avoid

Mistake 1: Flipping Run Over Rise (Putting $x$ on Top)

✗ Wrong: Computing $m = \frac{x_2 - x_1}{y_2 - y_1} = \frac{5 - 1}{11 - 3} = \frac{1}{2}$ instead of $2$.
✓ Correct: Always place vertical change ($y$) in the numerator and horizontal change ($x$) in the denominator: $m = \frac{y_2 - y_1}{x_2 - x_1}$.

Why: Slope is 'rise over run'—remember you have to rise up out of bed before you can run.

Mistake 2: Mixing Point Order Between Numerator and Denominator

✗ Wrong: Writing $\frac{y_2 - y_1}{x_1 - x_2}$, which reverses the sign of the slope.
✓ Correct: Start both subtractions from the same point: either $\frac{y_2 - y_1}{x_2 - x_1}$ or $\frac{y_1 - y_2}{x_1 - x_2}$.

Why: Swapping only one subtraction multiplies the result by $-1$, turning an uphill line into a downhill line.

Frequently Asked Questions

Does it matter which point is $(x_1, y_1)$ and which is $(x_2, y_2)$?

No. As long as you start both the numerator and denominator with the same point, the two minus signs cancel out and produce the exact same slope.

What is the difference between zero slope and undefined slope?

A horizontal line has zero slope ($m = 0/\text{run} = 0$). A vertical line has undefined slope ($m = \text{rise}/0$) because you cannot divide by zero.

How is the slope formula related to $y = mx + b$?

Once you compute $m$ using the slope formula, plug $m$ and either point $(x_1, y_1)$ into $y = mx + b$ to solve for the y-intercept $b$.

Practice & Related Resources

Apply Slope Formula (Two Points) on interactive problems, printable PDF worksheets, and calculators.

Slope-Intercept Form (y = mx + b) →Grade 8 Linear Functions & Slope Quiz →Printable Grade 8 Slope Worksheets →Interactive Algebra Calculator → ← Back to Algebra Formulas Cheat Sheet