We saw that the slope of a line is given by the formula –

Now finding the slope of a line involves the following three steps:

**Step 1**: Find the change in value of x when moving from left to right i.e. from the first point to the second point along the x-axis.

**Step 2**: Next find the change in value of y by moving from the bottom point to the top point along the y-axis.

*Remember* – if you move from right to left, the change in value of x is negative. Similarly, when you move from top to bottom, the change in value of y is negative. Otherwise they are both positive.

**Step 3**: Now finding the slope of a line is simply a matter of applying the above slope/gradient formula.

## Examples of finding the slope of a line

**Example 1**: In the diagram, the x-intercept is A (-2, 0), and moving from A to the point where the dotted line from y-axis point meets the x-axis i.e. from left to right, the change in value of x is 3.

Next, we move from point 1 on the x-axis up to point B (1, 3) i.e. from bottom to top, and calculate the change in value of y, which is 3 in this case.

=

= 1

We can also calculate the slope of the line using the gradient formula, viz.

m =

Here y_{1} = 0, y_{2} = 3, x_{1} = -2 and x_{2} = 1

So m =

=

= 1

**Example 2**: Here rise = 2 (as we move upwards), and run = -2 (moving two units to the left). Remember, since we’re moving from right to left, the change in value of x (or run) will be negative.

=

= -1

We can calculate the slope using the formula m =

=

Here y_{1} = 1, y_{2} = 3, x_{1} = 3 and x_{2} = 1

So m =

=

= -1

**Example 3**: We need to find the gradient of the line passing through points A (-1, 4) and B (2, -2)

Change in x = +3 (moving left to right i.e. from A to B)

Change in y = -6 (moving downwards from A to B)

m = slope or gradient =

=

= -2

Using the gradient formula –

A: x_{1} = 3 and y_{1} = 1

B: x_{2} = 1 and y_{2} = 3

m = gradient or slope =

=

=

= -2

**Example 4**: We need to find the gradient of the line passing through points A (2, 4) and B (-3, -3)

Change in x = -5 (moving right to left i.e. from A to B)

Change in y = -7 (moving downwards from A to B)

m = gradient or slope of line AB =

=

=

Using the gradient formula –

A: x_{1} = 2 and y_{1} = 4

B: x_{2} = -3 and y_{2} = -3

m = gradient or slope =

=

=

=

**Remember**:

- All horizontal lines having equations of form y = b have a slope of 0.
- All vertical lines having equations of form x = a have a slope undefined (or infinity)