Slope of a Line

How to find the slope of a line that passes through two points: formula, 4 examples, and their solutions.

Formula

Formula

The slope means the ratio of
[change of y]/[change of x].

If a line passes through (x1, y1) and (x2, y2),
then the change of x is x2 - x1
and the change of y is y2 - y1.

So the slope of the line, m, is
m = (y2 - y1)/(x2 - x1).

Example 1

Example

Solution

Draw a line that passes through (1, 1) and (3, 5).

The change of x is
3 - 1 = 2.

The change of y is
5 - 1 = 4.

So the change of x is 2.
And the change of y is 4.

Then the slope, m, is
m = 4/2.

4/2 = 2

So the slope of the line, m, is 2.

As you can see,
if a line goes upward as you move to the right,
then the slope of the line is plus.

Example 2

Example

Solution

Draw a line that passes through (-4, 1) and (1, -2).

The change of x is
1 - (-4) = 1 + 4 = 5.

The change of y is
-2 - 1 = -3.

So the change of x is 5.
And the change of y is -3.

Then the slope, m, is
m = (-3)/5.

(-3)/5 = -3/5

So the slope of the line, m, is -3/5.

As you can see,
if a line goes downward as you move to the right,
then the slope of the line is minus.

Example 3

Example

Solution

Draw a line that passes through (-1, 2) and (5, 2).

The change of x is
5 - (-1) = 5 + 1 = 6.

The change of y is
2 - 2 = 0.

Then the slope, m, is
m = 0/6.

If the numerator is 0,
then the fraction is 0.

So 0/6 = 0.

So the slope of the line, m, is 0.

As you can see,
if a line is horizontal,
then the slope of the line is 0.

Example 4

Example

Solution

Draw a line that passes through (1, 2) and (1, -3).

The change of x is
1 - 1 = 0.

The change of y is
-3 - 2 = -5.

Then the slope, m, is
m = (-5)/0.

The denominator of a fraction cannot be 0.
So (-5)/0 doesn't make sense.

So the line has no slope.

So the answer is [no slope].

As you can see,
if a line is vertical,
then the line has no slope.