The slope formula turns two points on a line into a single number for its steepness, or rate of change. Use it whenever you know two points on the same line and want to know how fast yy changes relative to xx.

The Formula And Its Symbols

The slope of a line through two points (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2) is

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

The numerator y2y1y_2 - y_1 is the vertical change, also called the rise. The denominator x2x1x_2 - x_1 is the horizontal change, also called the run. So mm is simply rise over run, written in coordinates.

This works only when x2x1x_2 \ne x_1. If the two points have the same xx-value, the line is vertical, the denominator is 00, and the slope is undefined.

The sign of mm tells you the direction: if m>0m > 0, the line rises from left to right; if m<0m < 0, it falls; if m=0m = 0, the line is horizontal.

Why It Equals Rise Over Run

The slope formula and "rise over run" are the same idea, not two separate rules. Rise is how far you move vertically between the points, and run is how far you move horizontally. Dividing one by the other measures how steep the path is. The formula just reads those two changes straight off the coordinates, so the coordinate version and the verbal version always agree.

Worked Example: Find Slope From Two Points

Find the slope of the line through (2,3)(2, 3) and (5,9)(5, 9). Label the first point as (x1,y1)(x_1, y_1) and the second as (x2,y2)(x_2, y_2), then substitute in the same order:

m=9352=63=2m = \frac{9 - 3}{5 - 2} = \frac{6}{3} = 2

So the slope is 22, meaning whenever xx increases by 11, yy increases by 22. As rise over run, the rise from (2,3)(2, 3) to (5,9)(5, 9) is 66 and the run is 33, so

riserun=63=2\frac{\text{rise}}{\text{run}} = \frac{6}{3} = 2

Once you know the slope, you can write the full line using slope-intercept form y=mx+by = mx + b. With m=2m = 2 and the point (2,3)(2, 3):

3=2(2)+b    3=4+b    b=13 = 2(2) + b \;\Rightarrow\; 3 = 4 + b \;\Rightarrow\; b = -1

So the line is y=2x1y = 2x - 1.

Practice: Build The Equation Yourself

Use the points (1,2)(1, -2) and (4,7)(4, 7). First apply the slope formula, keeping the yy-differences and xx-differences in the same order, then substitute the slope and one point into y=mx+by = mx + b to solve for bb.

Check your result: the slope should come out to 33, and the equation should be y=3x5y = 3x - 5. If your slope is right but the equation is off, recheck the value of bb you substituted.

Calculation Pitfalls

The most common slip is subtracting the yy-values in one order and the xx-values in the opposite order. If you use y2y1y_2 - y_1, you must also use x2x1x_2 - x_1.

A second trap is saying a vertical line has slope 00. A horizontal line has slope 00; a vertical line has undefined slope because the denominator becomes 00.

A third is ignoring the sign. A negative slope means the line goes down as xx increases.

One more limit: if the graph is not a straight line, the slope between two points is only the slope of the secant line between them, not a single constant slope for the whole graph.

When To Use The Slope Formula

Reach for the slope formula when you know two points on a line and want its rate of change. It appears throughout algebra, coordinate geometry, graphing, and any linear relationship where equal changes in xx produce a constant change in yy.

Frequently Asked Questions

What is the slope formula?
The slope of a line through two points equals the difference of the y-values divided by the difference of the x-values, often described as rise over run. It measures the line's steepness or rate of change, and it requires the two points to have different x-values.
Why is slope called rise over run?
The numerator is the vertical change between the points, called the rise, and the denominator is the horizontal change, called the run. The slope formula is just the coordinate version of that ratio, so the formula and the phrase describe exactly the same idea.
When is the slope of a line undefined?
When the two points share the same x-value, the line is vertical and the denominator of the slope formula becomes zero, so the slope is undefined. A horizontal line, by contrast, has a slope of exactly zero. Confusing these two cases is a common mistake.
How do you find the equation of a line after using the slope formula?
Once you know the slope m, substitute it together with one known point into slope-intercept form, y equals mx plus b, and solve for b. For example, with slope 2 through the point (2, 3), substituting gives b equals negative 1, so the line is y equals 2x minus 1.

Need help with a problem?

Upload your question and get a verified, step-by-step solution in seconds.

Open GPAI Solver →