# Finding the gradient

## In a nutshell

The gradient of a line is a measure of its steepness. It is given by a number and can be calculated in a few different ways, in particular, by using the coordinates of two points on the line.

### Definition

The technical definition of a line's "gradient" is the rate of change of the $y$-coordinate with respect to the $x$-coordinate. In simpler terms, it is how quickly the line goes up (or down) as it moves in the rightward direction. You can denote the gradient with $m$ and it is calculated with the following formula:

m=change in ychange in xm=\frac{\text{change in }y}{\text{change in }x}m=change in xchange in y

where the changes in $y$ and $x$ are the differences between two points' coordinates. You can think of this as everytime you go to right by $1$, your line has also gone $m$ vertically.

## Calculating the gradient

Given that a straight line can be described with only two points (any two points on the line), you can use the coordinates of those points to tell you everything you need to know about the line, in particular, its gradient! This is where the formula from above comes in:

$m=change inxchange iny $

Suppose you have two points that sit on your straight line: $(x_{_{1}},y_{_{1}})$ and $(x_{_{2}},y_{_{2}})$. Then

$change iny=y_{_{2}}−y_{_{1}}$

and

$change inx=x_{_{2}}−x_{_{1}}$

So now you can use the formula:

$m=x_{_{2}}−x_{_{1}}y_{_{2}}−y_{_{1}} $

to find the gradient of the straight line.

**Note:** *It's very important that you take *$x_{_{1}}$* and *$y_{_{1}}$* from the same point, and take *$x_{_{2}}$* and *$y_{_{2}}$* from the other point. If you mix this up, you will calculate the gradient to be the negative of what it should be!*

##### Example

*You have a line and find that the two points $(3,6)$ and $(5,10)$ sit on it. Use this to calculate the gradient of the line.*

*First of all, assign the *$x_1, y_1,x_2$* and *$y_2$*. Suppose you decide that $(3,6)$ is point $1$ and $(5,10)$ is point $2$. Hence:*

*$x_{1}y_{1}x_{2}y_{2} =3=6=5=10 $*

*Using the formula for the gradient, you can calculate that:*

**

*$m=x_{_{2}}−x_{_{1}}y_{_{2}}−y_{_{1}} =5−310−6 =24 =2$*

*So the gradient of the line is $2 $. *