Everything to learn better...

Home

Maths

Graphs

Finding the gradient of a straight line

Finding the gradient of a straight line

Select Lesson

Exam Board

Select an option

Explainer Video

Loading...
Tutor: Toby

Summary

Finding the gradient of a straight line

​​In a nutshell

The gradient of a line is a measure of its steepness. At a point, it is given by a constant 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 yy-coordinate with respect to the xx​-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 mm and it is calculated with the following formula:

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


where the changes in yy and xx are the differences between two points' coordinates. You can think of this as everytime you go to right by 11, your line has also gone mm vertically.



Equations of straight line graphs

The general equation of a straight line is 

y=mx+cy=mx+c


where mm​ is the gradient of the line and cc is the yy-intercept. If mm​ is not zero, then the line is diagonal. If mm is zero, then the line is horizontal: 

y=cy=c​​


A vertical line does not have this equation. Instead it has equation

x=dx=d


where dd is the xx-intercept. You do not refer to the gradient of a vertical line since it has no value.



Calculating the gradient of a line

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 its gradient. 


Suppose you have two points that sit on your straight line: (x1,y1)(x_{_1},y_{_1}) and (x2,y2)(x_{_2},y_{_2}). Use the formula from above: 

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


where

change in y=y2y1\text{change in }y=y_{_2}-y_{_1} and change in x=x2x1\text{change in }x=x_{_2}-x_{_1}​​

​​

Now you can use the formula

m=y2y1x2x1m=\frac{y_{_2}-y_{_1}}{x_{_2}-x_{_1}}​​


to find the gradient of the straight line. 


Note: It's very important to take x1x_{_1} and y1y_{_1} from the same point, and to take x2x_{_2} and y2y_{_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

Find the gradient of the line that passes through the points (5,2)(-5,2) and (1,10)(-1,10)


To begin, establish which is the (x1,y1)(x_{_1},y_{_1}) point and which is the (x2,y2)(x_{_2},y_{_2}) point. It doesn't matter which is which, so assign (5,2)(-5,2) as (x1,y1)(x_{_1},y_{_1}) and assign (1,10)(-1,10) as (x2,y2)(x_{_2},y_{_2}). Thus the gradient can be calculated:

m=y2y1x2x1=1021(5)=84=2m=\frac{y_{_2}-y_{_1}}{x_{_2}-x_{_1}}=\frac{10-2}{-1-(-5)}=\frac84=2​​


So the gradient of this line is 2\underline2.

Create an account to read the summary

Exercises

Create an account to complete the exercises

FAQs - Frequently Asked Questions

What is the equation of a straight line?

How do you calculate the gradient of a line?

What is a gradient?

Beta

I'm Vulpy, your AI study buddy! Let's study together.