Paper Together: sit a paper in a room with your friends.See how it works
Equation of a line: worked examples and method
Foundation and Higher · Grade 5 · Non-calculator
This page sets out the method for equation of a line in the order you would use it, then walks through the full lesson explanation. For three complete worked examples with the slips that cost marks, see the Equation of a line topic page.
Key facts
y=mx+c: m is the gradient, c is the y-intercept (where x=0).
Every point on the line makes the equation true — use this to find c.
Parallel lines have the same m but different c.
To read m and c the equation must start 'y=' with nothing multiplying y.
Vertical lines are x=a; horizontal lines are y=b.
A gradient of 21 can be written as y=21x+3 or y=0.5x+3.
The method, step by step
Method: gradient and a point
When you know m and one point on the line (or can read them from the graph).
Write y=mx+c with the known gradient in place of m.
Substitute the x and y of the known point.
Solve for c.
Write the finished equation.
Check the point satisfies it.
Method: two points
When you only know two points on the line.
Find the gradient m=x2−x1y2−y1.
Use either point with y=mx+c to find c.
Write the equation.
Check with the other point — it must fit too.
How the lesson explains it
Gradient and intercept
The equation of the line with gradient 2 and intercept 1 is y=2x+1.
A negative intercept
A negative intercept is subtracted. The equation of the line with gradient 3 and intercept -4 is y=3x-4.
Through the axis
A line through (0, c) has intercept c. The equation of the line through (0, 1) with gradient 4 is y=4x+1.
Read the gradient
In y=mx+c the number in front of x is the gradient. The gradient of y=5x-1 is 5.
Read the intercept
The intercept is the constant term. The intercept of y=3x-4 is -4.
Do not swap
The gradient is the multiplier. The intercept is the number on its own.
Reading m and c
From a graph, c is the height where the line crosses the y-axis, and m is the gradient from a triangle. A line through (0, -2) that rises 3 units for each 1 unit across has equation y=3x-2. Swapping those numbers, y=-2x+3, is a different line. Say which number is the intercept before you write the equation.
An equation may need rearranging before you can read it. 2y=6x+8 is not yet y=mx+c. Divide every term by 2: y=3x+4. The gradient is 3, not 6. The intercept is 4, not 8. x+y=5 becomes y=-x+5, so the gradient is -1 and the intercept is 5. Divide or rearrange first. Reading the coefficient in front of a line that still has 2y on the left is the usual miss.
Method: 1. Read c where the line crosses the y-axis, and read m from a gradient triangle. 2. A line through (0, -2) that rises 3 units for each 1 unit across has equation y=3x-2. 3. The equation y=-2x+3 swaps those two numbers and is a different line.
Gradient and one point
A line of gradient 2 through (3, 11) has the shape y=2x+c. Substitute the point, and do not swap the coordinates. 11=2× 3+c, so 11=6+c and c=5. The equation is y=2x+5. Check: at x=3, y=6+5=11. A second point is even better. At x=0 the line should cross at 5, which is the c you just found.
You can also start from the point form y-11=2(x-3) and expand. y-11=2x-6, so y=2x+5. Both routes are valid. The expanded form is what you box if the question says y=mx+c. Leaving y-11=2(x-3) drops that instruction.
Method: 1. A line of gradient 2 through (3, 11) has the form y=2x+c. 2. Substitute the known point as (x, y). Do not swap the coordinates. 3. The substitution 11=2× 3+c gives c=5, so the line is y=2x+5.
Two points, and a parallel line
Through (1, 8) and (4, -1), the gradient is (-1-8)/(4-1)=(-9)/3=-3. Then y=-3x+c. Use (1, 8): 8=-3+c, so c=11. The equation is y=-3x+11. Check the other point: -3× 4+11=-12+11=-1, which matches. If the check fails, the gradient order or the substitution of x and y is wrong.
A line parallel to y=4x-1 has the same gradient, 4. Through (2, 3) it is y=4x+c with 3=8+c, so c=-5. The equation is y=4x-5. Only c was unknown. Changing the gradient would make a line that is not parallel. Perpendicular lines are a later idea: here, parallel means a copy of m and a new intercept.
After you have y=mx+c, read it back in words once. "Gradient -3, intercept 11" should match the numbers you calculated, not the coordinates of a point you used along the way. The point (1, 8) is on the line y=-3x+11. It is not the intercept. The intercept is the value at x=0, which you can find by covering the x term. If that reading disagrees with c, the substitution step is the one to redo.
Method: 1. Through (1, 8) and (4, -1), the gradient is (-1-8)/(4-1)=-3. 2. Substitute (1, 8) into y=-3x+c to get 8=-3+c, so c=11. 3. Write the finished equation y=-3x+11.
From a graph: gradient triangles and the scale
When the line is drawn on a grid, pick two points that sit exactly on grid crossings and as far apart as you can. Draw a right-angled triangle between them. The gradient is the vertical side divided by the horizontal side, and it is negative if the line falls as you move right. Read the scale on both axes first, because one square is not always one unit. A line through (0, -3) and (4, 5) rises 8 while going across 4, so m=2.
The intercept is the height where the line meets the y-axis, so here c=-3 and the equation is y=2x-3. A two-mark "write down the equation" question gives one mark for the gradient and one for the intercept. Test your answer on a third point, such as (2, 1): 2× 2-3=1, which matches. A quick third-point check catches a swapped gradient and intercept straight away.
Method: 1. Read the scale on both axes before you count anything. 2. Choose two points on exact grid crossings and draw a gradient triangle. 3. Gradient is rise divided by run, with a minus sign if the line goes down to the right. 4. Read c from the y-axis, write y=mx+c, then test a third point.
Tip: If the line crosses the y-axis between grid lines, find c by substituting a point you can read exactly, not by guessing the crossing.
Equations that are not written as y = mx + c
Many exam lines arrive as 3x+2y=24 or 5y-3x=4. You can answer questions about them without drawing anything. To find where 3x+2y=24 crosses the y-axis, put x=0: 2y=24, so y=12. To find where it crosses the x-axis, put y=0: 3x=24, so x=8. Write the answers as coordinates, (0, 12) and (8, 0). The point on the x-axis has y=0, not x=0.
To find the gradient, rearrange into y=mx+c. From 3x+2y=24 subtract 3x to get 2y=-3x+24, then divide every term by 2: y=-3/2x+12. The gradient is -3/2 and the intercept is 12, which agrees with the point found above. To show a point such as (4, 6) lies on the line, substitute both coordinates: 3× 4+2× 6=24, so it does.
Method: 1. To find the y-intercept, set x=0 and solve. To find the x-intercept, set y=0 and solve. 2. Write each intercept as a coordinate pair with the zero in the correct place. 3. To find the gradient, rearrange to y=mx+c and divide every term. 4. To test a point, substitute both coordinates and check the equation balances.
Lines in context: what m and c mean
Real exam lines often describe a cost or a quantity changing at a steady rate. In C=20h+30, the intercept 30 is the fixed charge paid before any hours are worked, and the gradient 20 is the extra cost for each extra hour. A negative gradient means the quantity is falling. In y=40-5x, a fuel tank starts with 40 litres and loses 5 litres each hour, so it is empty when y=0, that is when x=8.
When a question says "explain what the gradient represents" or "write down what the 30 means", answer in the words of the context and include the unit. "The cost goes up by £20 for each extra hour" earns the mark, while "the line goes up by 20" does not. If you are given two readings, such as 3 miles costing £8 and 8 miles costing £18, treat them as two points on a line and use the two-point method to build the equation.
Method: 1. Match the quantity on each axis to the letters in the equation. 2. Read c as the starting value and m as the change for each one unit of x. 3. Answer meaning questions in words from the context, with units. 4. For two readings, find the gradient first, then substitute one reading to find c.
Tip: A good test of a contextual equation is to put in a value you were given and see that it gives the stated result.
Horizontal, vertical and lines through the origin
A horizontal line has gradient 0 and an equation like y=-4. Every point on it has the same y-coordinate. A vertical line has an equation like x=2, because every point has the same x-coordinate, and it has no gradient at all. A line through (2, 5) and (2, 9) is vertical, so its equation is x=2, and trying to calculate a gradient would mean dividing by zero. The phrase "parallel to the x-axis" tells you it is of the form y=number.
A line through the origin has c=0, so it is just y=mx. A line through O and (3, 12) has m=12/3=4, so y=4x. The line y=x has gradient 1 and passes through (1, 1), (2, 2) and so on, while y=-x falls at the same steepness. Keep these shapes in your head, because multiple-choice questions often include them as options, and a quick substitution of the given point rules out the wrong ones.
Method: 1. For a horizontal line, write y= the common y-value. 2. For a vertical line, write x= the common x-value. 3. For a line through the origin, find m from any other point and write y=mx. 4. Check by substituting a given point into your answer.
Remember
y = mx + c has gradient m and y-intercept c.
A point (0, c) gives the intercept c.
Include negative signs when reading or writing equations.