GCSE Maths Algebra

Straight Line Graphs

Here we will learn about the gradient of a line, including how to calculate the gradient of a straight line from a graph, from two coordinates and state the equations of horizontal and vertical lines.

There are also worksheets based on Edexcel, AQA and OCR exam questions, along with further guidance on where to go next if you’re still stuck.

## What is the gradient of a line?

The gradient of a line is how steep the straight line is. In the general equation of straight line, y = mx + c, the gradient is denoted by the letter m.

Imagine walking up a set of stairs. Each step has the same height and you can only take one step forward each time you move. If the steps are taller, you will reach the top of the stairs quicker, if each step is shorter, you will reach the top of the stairs more slowly.

Let’s look at sets of stairs,

The blue steps are taller than the red steps and so the gradient is steeper (notice the blue arrow is steeper than the red arrow).

The green steps are not as tall as the red steps so the gradient is shallower (the green arrow is shallower than the red arrow).

Gradients can be positive or negative but are always observed from left to right.  The linear relationship between two variables can be drawn as a straight line graph and the gradient of the line calculates the rate of change between the two variables.

E.g.

When calculating the exchange rate of two currencies, we can calculate the gradient of the line to find the rate of change between them.

Here, the exchange rate between pounds ( £ ) and dollars (\$) is equal to \frac{3}{5}

### What is the gradient of a line? ### Diagonal lines

In order to calculate the gradient of a straight line given the two coordinates (x, y) and (x, y), we need to work out:

• The change in x is the difference between the x coordinates: x − x
• The change in y is the difference between the y coordinates: y − y

The formula to calculate the gradient is:

$\\m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\\$

‘Change in y divided by change in x

Or

‘Rise over run’

E.g.

Let’s have a closer look at the gradient of 4 lines

• When m = 1, for each unit square we move to the right, we move 1 unit square upwards.
• When m = 2, for each unit square we move to the right, we move 2 unit squares upwards.
• When m = −3, for each unit square we move to the right, we move 3 unit squares downwards.
• When m = ½, for each unit square we move to the right, we move ½ a unit square upwards.

How far apart do the coordinates we choose need to be?

Let us look at the example of m = 2.

• The first blue line has a gradient of
$\\m=\frac{2}{1}=2\\$
• The second blue line has a gradient of
$\\m=\frac{6}{3}=2\\$
• The third blue line has a gradient of
$\\m=\frac{10}{5}=2\\$

No matter how far apart the coordinates are on the line, the resultant value will always simplify to the same number, here m = 2.

Top tip: Use two coordinates that cross the corner of two grid squares so that you can accurately measure the horizontal and vertical distance between them. Use integers as much as possible!

Remember: the change in x is horizontal, the change in y is vertical.

### Horizontal and vertical lines

There is no relationship between x and y on horizontal or vertical lines and so they cannot be written in the form y = mx + c as the gradient cannot be measured.

Let us look at a couple of examples to further understand the equations of horizontal and vertical lines.

In the diagram above, all the coordinates share an x value of 4, regardless of the y value, so if we join the coordinates together to make a straight line, we get the vertical line with the equation x = 4.

Notice the line crosses the x-axis at (4,0) (the x-intercept is 4).

In the diagram above, all the coordinates share a y value of 2, regardless of the x value, so if we join the coordinates together to make a straight line, we get the horizontal line with the equation y = 2. Notice the line crosses the y-axis at (0,2) (the y-intercept is 2).

Top tip: All vertical lines are of the form x = a and all horizontal lines are of the form y = b where a and b can be any number.

We cannot calculate y for any given value of x for a horizontal or vertical line because nothing links the two variables together and we cannot calculate the gradient of the line because the direction of the line requires a change in x and y

Top tip: the equation y = 0 is where we draw the x-axis as the line y = 0 is horizontal and crosses the y-axis at 0. The y-axis is drawn using the equation x = 0 as this line is vertical and crosses the x-axis at 0.

Now that we have looked at horizontal and vertical lines, let us look at how to calculate the gradient of diagonal lines.

## How to calculate the gradient of a line

In order to calculate the gradient of a line:

1. Select two points on the line that occur on the corners of two grid squares.
2. Sketch a right angle triangle and label the change in y and the change in x.
3. Divide the change in y by the change in x to find m.

### Explain how to calculate the gradient of a line ## Gradient of a line examples

### Example 1: using a straight line graph (positive gradient)

Calculate the gradient of the line:

1. Select two points on the line that occur on the corners of two grid squares.

2Sketch a right angle triangle and calculate the change in y and the change in x.

3Divide the change in y by the change in x to find m.

Here,

$\frac{4}{2}=2$

so m = 2.

### Example 2: using a straight line graph (negative gradient)

Calculate the gradient of the line:

Remember the height of the triangle represents the change in y, and the width of the triangle represents the change in x. Looking at the coordinate (1,2), to get to the coordinate (5,−4) we have to add 4 to the x coordinate, and subtract 6 from the y coordinate.

Although the height of a triangle is always positive, we are calculating the change in y, so we must write the change in y as −6.

Here,

$\\\frac{-6}{4}=-\frac{3}{2}\\$

so

$\\m=-\frac{3}{2}\\$

### Example 3: Using a straight line graph with two coordinates (positive gradient)

Calculate the gradient of the line:

Here we already have this information, so we can continue on with step 2.

Here,

$\\\frac{5}{5}=1\\$

so

$\\m=1\\$

### Example 4: using a straight line graph with two coordinates (negative gradient)

Calculate the gradient of the line:

Here we already have this information, so we can continue on with step 2.

Here we have to be careful because each grid square has a width of 1 unit but a height of 2 units. This means that the distance between the y coordinates (the change in y) is equal to −8 − 8 = −16.

Here,

$\\\frac{-16}{1}=-16\\$

so

$\\m=-16\\$

### Example 5: given two coordinates (positive gradient)

Calculate the gradient of the line with coordinates A(1,3) and B(7,12).

Here we have the two coordinates A(4,3) and B(7,12) without a graph to visualise the line. We therefore need to determine whether the line has a positive or negative gradient as well as the value for m.

As there is no right angle to sketch, we will solve algebraically by calculating the change in y and the change in x.

$\\y_{2}-y_{1}=12-3=9\\$

$\\x_{2}-x_{1}=7-4=3\\$

Top tip: make sure you always subtract one coordinate from the other. Here we subtracted the values from coordinate A from coordinate B. Do not mix up the order.

$\\m=\frac{9}{3}\\$

$\\m=3\\$

### Example 6: given two coordinates (negative gradient)

Calculate the gradient of the line with coordinates P(−10,−3) and Q(2,−7).

Here we have the two coordinates P(−10,−3) and Q(2,−7) without a graph to visualise the line. We therefore need to determine whether the line has a positive or negative gradient as well as the value for m .

As there is no right angle to sketch, we will solve algebraically by calculating the change in y and the change in x.

$\\y_{2}-y_{1}=-7–3=-7+3=-4\\$

$\\x_{2}-x_{1}=2–10=2+10=12\\$

$\\m=\frac{-4}{12}\\$

$\\m=-\frac{1}{3}\\$

### Common misconceptions

• Mix up the coordinates when calculating the change in y and the change in x

Two coordinates are subtracted from each other to find the change in y and the change in x. If we labelled each coordinate (x₁,y₁) and (x₂,y₂) we take the values from the first coordinate away from the second coordinate:

The change in x is x₂ − x₁

The change in y is y₂ − y₁

• Incorrect simplifying of m (negative number division)

When you subtract one coordinate from another, one or both of the numerator and the denominator can be negative. If one is negative, the gradient is negative.

If both are negative, remember a negative number divided by another negative number is a positive number, so the gradient is positive.

E.g.

$\frac{6}{-2}=\frac{-6}{2}=-3\quad \text{ or } \quad \frac{-8}{-4}=\frac{8}{4}=2$

• Change in x divided by the change in y

It is easy to mistake the calculation of m to be the change in x divided by the change in y. This would result in the reciprocal of the gradient which, most of the time (not always) is incorrect.

Sometimes the scale of the axis can change, e.g. 1 square can be a half unit, or 2 units etc. For this reason it is important to use the coordinates and the axes to make sure these values are correct. Example 4 highlights this fact as each square on the y-axis is 2 units.

### Practice gradient of a line questions

1. Calculate the gradient of the line: \\m = \frac{2}{5}\\ \\m = \frac{5}{2}\\ \\m = \frac{4}{10}\\ m=\frac{10}{4}  \\m=\frac{2}{5}\\

2. Calculate the gradient of the line: \\m=\frac{9}{14}\\ \\m=\frac{14}{9}\\ \\m=-\frac{9}{14}\\ m=-\frac{14}{9}  \\m=\frac{-9}{14}\\

3. Calculate the gradient of the line given the coordinates: \\m=\frac{4}{3}\\ \\m=\frac{14}{4}\\ \\m=\frac{3}{4}\\ \\m=\frac{8}{3}\\  \\m=\frac{8}{6}=\frac{4}{3}\\

(each square on the x-axis is 2 units)

4. Calculate the gradient of the line given the coordinates: m=-2 \\m=\frac{1}{2}\\ m=-4 \\m=-\frac{1}{4}\\  \\m=\frac{-3}{6}\\

(each square on the x-axis is \frac{1}{2} unit)

5. Calculate the gradient of the line given the coordinates A(2,6) and B(8,24)

m=3 m=4 m=\frac{1}{3} m=-3 \\m=\frac{24-6}{8-2}=\frac{18}{6}=3\\

6. Calculate the gradient of the line given the coordinates A(-3,-8)) and B(-5,10)

m=9 \\m=\frac{10-8}{-5-3}=\frac{2}{-8}=\frac{-1}{4}\\ \\m=\frac{10-5}{-8–3}=\frac{5}{-5}=-1\\ m=-9 \\m=\frac{10–8}{-5–3}=\frac{10+8}{-5+3}=\frac{18}{-2}=-9\\

### Gradient of a line GCSE questions

1. Two straight line graphs A and B are shown on a set of axes. The equation of line A is y=2(x+1).

Use this information to calculate the gradient of the line B. (4 marks)

The y -intercept of line A = 2 or (0,2) labelled

(1)

Each square on the x-axis is 1 unit, on the y -axis is 2 units: (1)

Two coordinates selected on line B with correct change in y and change in x , e.g: The change in y is -8 , and the change in x is 4

(1)

\\m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}=\frac{-8}{4}=-2\\

(1)

2.  (a)  Write an equation in the form y=mx+c that has the same gradient as the line  3y+9=12x.

(b)  Tick all of the statements that are true for the equation 3y+9=12x and your solution for part a).

They are parallel

They intersect at the coordinate (0,-3)

They are perpendicular to one another

They share two lines of symmetry

(5 marks)

(a) (1)

m=4

(1)

Any equation of the form y=4x+c

e.g. y=4x, y=4x+7, y=4x-8.

(1)

(b)

They are parallel                                             ✔

They intersect at the coordinate (0,-3)

They are perpendicular to one another

They share two lines of symmetry               ✔

(2)

3.  Craig is calculating the gradient of the straight line shown below. Here is Craig’s working: (3 marks)

No (with reasoning)

(1)

The change in x is equal to:

-6–2=-6+2=-4

whereas Craig has stated the height of the triangle as 4

(1)

\\m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}=\frac{-4}{8}=-\frac{1}{2}\\

whereas Craig has calculated

\\m=\frac{x_{2}-x_{1}}{y_{2}-y_{1}}\\

(1)

## Learning checklist

You have now learned how to:

• Calculate and interpret gradients of graphs of such linear equations numerically, graphically and algebraically
• Interpret the gradient of a straight line graph as a rate of change

## The next lessons are

• Parallel and perpendicular lines
• y = mx+c
• Straight line graphs

## Still stuck?

Prepare your KS4 students for maths GCSEs success with Third Space Learning. Weekly online one to one GCSE maths revision lessons delivered by expert maths tutors.

Find out more about our GCSE maths revision programme.