Slope formula

The slope of a line, "m" in the equation for a line of the form y = mx + b, can be found using the slope formula as long as at least two points on the line are known. It can be written as follows:

Example

Given two points, (1, 3) and (4, 7), we can plug them into the formula to find the slope:

The slope is which means that for every increase of 4 units in y, there is an increase of 3 units in x. Change in y is sometimes referred to as "rise" while change in x is referred to as "run."

Note that even though we chose to use (4, 7) as x2 and y2, we could've also used it as x1 and y1 to achieve the same result:

This is because we are concerned only with the change in x and the change in y. As long as we are consistent, the result will be the same. Typically, we choose the larger ordered pair to avoid having to deal with negative values where possible, but it is not necessary.

Why does the formula work?

The slope of a straight line is constant. This means that regardless what point we are at on the line, it increases (or decreases) at the same rate; for every distance in x along the line, it moves a corresponding, constant, distance in y. We can visualize this using the following image.

The green line segment represents the change in x, and the red line segment represents the change in y. For any horizontal distance, x2 - x1, the line will gain a vertical distance of y2 - y1. This is what "m" in slope intercept form (y = mx + b) represents.