Slope, Rate of Change and Difference Quotient
The slope of a line measures how steeply it rises or falls, and it equals the rate of change: the change in y divided by the change in x. In brief: for two points (x1, y1) and (x2, y2), the slope is m = (y2 − y1)/(x2 − x1). For (1, 2) and (4, 11) it is 9/3 = 3.
The same quotient, called the difference quotient, is used for any function: (f(x2) − f(x1))/(x2 − x1). For a line it is the same everywhere, and for a curve it gives an average rate of change over an interval. This is the idea behind the derivative. This guide shows how to calculate slope, how to interpret it and how the difference quotient works.
How do you calculate the slope of a line?
- Choose two different points on the line.
- Subtract the y-coordinates: rise = y2 − y1.
- Subtract the x-coordinates in the same order: run = x2 − x1.
- Divide: m = rise/run.
Example 1
Points (−2, 5) and (3, −5). Rise = −5 − 5 = −10 and run = 3 − (−2) = 5. The slope is −10/5 = −2. Using the points in the opposite order gives 10/(−5) = −2, the same result, as long as both subtractions use the same order.
Example 2: from an equation
For 4x + 2y = 10, solve for y: y = −2x + 5. The slope is −2. In slope-intercept form y = mx + b, the slope is the coefficient of x.
Example 3: from a graph
If a line passes through (0, 1) and (2, 4), the rise is 3 and the run is 2, so the slope is 3/2 = 1.5. Go 2 right and 3 up to find the next point, (4, 7).
What does the sign of the slope tell you?
- Positive slope: the line rises from left to right.
- Negative slope: the line falls from left to right.
- Zero slope: the line is horizontal, y = constant.
- Undefined slope: the line is vertical, x = constant, because the run is 0 and division by zero is not allowed.
The larger the absolute value of the slope, the steeper the line. A slope of −4 is steeper than a slope of 2, though it goes down.
What is the rate of change in a real situation?
The slope tells the rate of change with units: output units per input unit. If the distance of a cyclist is 5 km after 0.5 h and 20 km after 2 h, the average speed is (20 − 5)/(2 − 0.5) = 15/1.5 = 10 km/h. For a linear relationship, the rate is constant. A road sign “6% grade” means a slope of 0.06: the road rises 6 m for every 100 m of horizontal distance.
What is the difference quotient?
For any function f, the quotient (f(b) − f(a))/(b − a) is the average rate of change on [a, b]. It is the slope of the line through (a, f(a)) and (b, f(b)), called the secant line. With h = b − a the form is (f(a + h) − f(a))/h.
Example 4: f(x) = x2 on [1, 3]
(f(3) − f(1))/(3 − 1) = (9 − 1)/2 = 4. On [1, 2] it is (4 − 1)/1 = 3, and on [2, 3] it is (9 − 4)/1 = 5. The average rate depends on the interval, because the function is not linear.
Example 5: simplifying
For f(x) = 3x + 2: (f(x + h) − f(x))/h = (3x + 3h + 2 − 3x − 2)/h = 3h/h = 3. The answer does not depend on x or h, as expected for a line. For f(x) = x2 the quotient is (2xh + h2)/h = 2x + h. As h gets close to 0, it approaches 2x, which is the derivative.
Slope values and their meaning
| Slope m | Direction | Example of a step |
|---|---|---|
| 3 | Steeply up | 1 right, 3 up |
| 1 | Up at 45° | 1 right, 1 up |
| 1/2 | Gently up | 2 right, 1 up |
| 0 | Horizontal | any right, 0 up |
| −1/2 | Gently down | 2 right, 1 down |
| −1 | Down at 45° | 1 right, 1 down |
| −3 | Steeply down | 1 right, 3 down |
| undefined | Vertical | 0 right, any up |
Where does the concept come from?
Gradients of slopes were relevant in architecture and surveying long before algebra. In the seventeenth century, the problem of finding the slope of a tangent to a curve led Fermat, Newton and Leibniz to calculus. The letter m for slope is commonly used today, and its origin is not clearly documented; a frequently repeated explanation connecting it to a French word is not reliably supported.
Where is slope used today?
Road and roof designs are specified by slope or grade. Wheelchair ramps often have a maximum gradient, and a ratio of 1:12 means a slope of about 8.3%. In economics, the slope of a cost curve is the marginal cost. In science, the slope of a distance-time graph is speed, and the slope of a speed-time graph is acceleration.
Which mistakes are common?
Subtracting in different orders
(y2 − y1)/(x1 − x2) gives the wrong sign. Use the same order on top and bottom.
Inverting the ratio
Slope is rise over run, not run over rise.
Calling a vertical line zero slope
A horizontal line has slope 0. A vertical line has an undefined slope.
Ignoring units
In context, include units such as km/h or dollars per item.