Slope (or Gradient)
So far, we have learned that the equation for any line can be written in the form y = mx + b. We have also found that the value of b is given by the y-intercept. Now let's have a look at what m represents.
Let (x1,y1) and (x2,y2) be two distinct points on the line given by y = mx + b. Then
Subtracting the second equation from the first gives
Factoring out the m we get
Dividing both sides by (x1 - x2)
This relationship is true no matter which two distinct points on the line we choose. We call m the slope or gradient of the line. It represents the change in y-value per unit change in x-value.
For example, consider the line given by the equation y = 2x + 1. Here are some points on the line.
Note that the difference between any two y-values divided by the difference of the corresponding x-values is always 2. Thus the slope of the line is m = 2.
Note that the slope of a vertical line is undefined as the change in x coordinates is zero:
Try finding the slope of a line which passes through two given points:
Now that we know how to calculate the slope, what does it actually represent? If we imagine a point moving along a straight-line graph from P to R, then the x- and y- coordinates of the point will change and in fact
In other words, the slope of the line tells us the rate of change of y relative to x. If the slope is 2, then y is changing twice as fast as x; if the slope is 1/2, then y is changing half as fast as x, and so on.
For a linear function, the rate of change of y relative to x is always constant, i.e. is the same no matter which values x is changing between.
Note that the slope of the line may be negative; this tells us that y is decreasing as x increases. For example:
The larger the magnitude of the slope, the steeper the line is, i.e. the more it approaches the vertical. In other words, if the line is near vertical then y is changing very fast relative to x. If the slope is small in magnitude, then y is changing slowly relative to x and the line is nearly horizontal. If the slope is zero, then the line is horizontal and y does not change at all (the equation of the line has the form y = c and y = c for all values of x.)
Experiment with the applet below, varying the value of m in the linear equation y = mx + b to see how changing the slope m changes the graph. The initial graph shown is y = 0x + 2 or y = 2. This has a slope of zero and remains stationary for comparison. See how the line changes as the slope m becomes positive or negative.
Determining the Sign of a Slope from its Graph Exercises (opens in new window)