A8, A9, A10AlgebraFoundation & HigherGrades 3–7

Straight Line Graphs

Every straight line on a coordinate grid has an equation that can be written as y=mx+cy = mx + c. The number mm is the gradient — how steep the line is — and cc is where it crosses the yy-axis. With those two facts you can sketch any line, find its equation from two points, and spot parallel and perpendicular lines instantly.

50 min Video by Maths Genie AQA GCSE Maths

The big picture

An equation such as y=2x+1y = 2x + 1 is a rule connecting the coordinates of every point on the line. Pick any xx, apply the rule, and the point (x,y)(x, y) is on the line. That is why a table of values works.

Gradient is a rate: how much yy changes for each 1 that xx increases. This idea returns in real-life graphs, where a gradient might be a speed in m/s or a cost per minute.

Drawing Straight Line GraphsCurated by Kepler, not produced by us. Watch it, then read the notes below.
Open on YouTube

What you'll learn

  • Plot straight line graphs from a table of values
  • Find the gradient and yy-intercept of a line from its graph or equation
  • Find the equation of a line through two points
  • Identify parallel and perpendicular lines (perpendicular: Higher)
1

Plotting from a table

Choose some xx values, substitute each into the equation to find yy, plot the points and join them with a ruler. Three points are enough — if they do not line up, one is wrong.

Lines of the form x=ax = a are vertical and y=by = b are horizontal.

Example 1Complete a table of values for y=3x−2y = 3x - 2 from x=−1x = -1 to x=2x = 2.
1x=−1x = -1: y=−5y = -5. x=0x = 0: y=−2y = -2.
2x=1x = 1: y=1y = 1. x=2x = 2: y=4y = 4.
Answer
Points (−1,−5)(-1, -5), (0,−2)(0, -2), (1,1)(1, 1), (2,4)(2, 4)
Your turnSame method, new numbers — try it before moving on.

For y=5−2xy = 5 - 2x, what is yy when x=−3x = -3?

Show worked solution
Solution
  1. 1y=5−2(−3)=5+6=11y = 5 - 2(-3) = 5 + 6 = 11.

Answer: y=11y = 11

2

Gradient and intercept

Gradient =change in ychange in x= \dfrac{\text{change in } y}{\text{change in } x}, often remembered as "rise over run". Lines going up from left to right have a positive gradient; lines going down have a negative gradient.

In y=mx+cy = mx + c, mm is the gradient and cc is the yy-intercept. The equation must have yy on its own first: rearrange 2y=6x+42y = 6x + 4 to y=3x+2y = 3x + 2 before reading off.

Gradient =riserun=34= \dfrac{\text{rise}}{\text{run}} = \dfrac{3}{4} and the line crosses the yy-axis at 1, so y=34x+1y = \frac{3}{4}x + 1.
Example 1Find the gradient of the line through (2,7)(2, 7) and (6,−1)(6, -1).
1Change in yy: −1−7=−8-1 - 7 = -8.
2Change in xx: 6−2=46 - 2 = 4.
3Gradient =−84= \frac{-8}{4}.
Answer
−2-2
Your turnSame method, new numbers — try it before moving on.

Find the gradient of the line through (−1,3)(-1, 3) and (3,11)(3, 11).

Show worked solution
Solution
  1. 1Change in yy: 11−3=811 - 3 = 8. Change in xx: 3−(−1)=43 - (-1) = 4.
  2. 2Gradient =84=2= \frac{8}{4} = 2.

Answer: 22

Example 2Find the gradient and yy-intercept of 4x+2y=104x + 2y = 10.
1Make yy the subject: 2y=−4x+102y = -4x + 10.
2Divide by 2: y=−2x+5y = -2x + 5.
Answer
Gradient −2-2, yy-intercept 55
Your turnSame method, new numbers — try it before moving on.

What is the gradient of the line 3y−6x=123y - 6x = 12?

Show hint

Rearrange to y=mx+cy = mx + c first.

Show worked solution
Solution
  1. 13y=6x+123y = 6x + 12.
  2. 2y=2x+4y = 2x + 4, so the gradient is 2.

Answer: 22

Tip — Subtract the coordinates in the same order on top and bottom: (y2−y1)(y_2 - y_1) over (x2−x1)(x_2 - x_1).

3

Equation of a line through two points

Find the gradient mm from the two points. Substitute mm and one point into y=mx+cy = mx + c and solve for cc.

Example 1Find the equation of the line through (1,4)(1, 4) and (3,10)(3, 10).
1Gradient =10−43−1=3= \frac{10 - 4}{3 - 1} = 3.
2Substitute (1,4)(1, 4) into y=3x+cy = 3x + c: 4=3+c4 = 3 + c, so c=1c = 1.
Answer
y=3x+1y = 3x + 1
Your turnSame method, new numbers — try it before moving on.

Find the equation of the line through (2,1)(2, 1) and (5,13)(5, 13).

Type it like y = 3x - 2.

Show worked solution
Solution
  1. 1Gradient =13−15−2=4= \frac{13 - 1}{5 - 2} = 4.
  2. 21=4(2)+c1 = 4(2) + c, so c=−7c = -7.
  3. 3y=4x−7y = 4x - 7

Answer: y=4x−7y = 4x - 7

4

Parallel and perpendicular lines

Parallel lines have the same gradient\textbf{same gradient}. y=2x+5y = 2x + 5 and y=2x−3y = 2x - 3 are parallel.

Perpendicular lines (Higher) have gradients that multiply to −1-1. If one gradient is mm, the other is −1m-\frac{1}{m} — the negative reciprocal. So y=2x+5y = 2x + 5 is perpendicular to y=−12x+1y = -\frac{1}{2}x + 1.

Example 1Find the equation of the line parallel to y=−3x+2y = -3x + 2 that passes through (2,5)(2, 5).
1Parallel, so the gradient is −3-3.
25=−3(2)+c5 = -3(2) + c, so c=11c = 11.
Answer
y=−3x+11y = -3x + 11
Example 2Find the equation of the line perpendicular to y=23x−1y = \frac{2}{3}x - 1 through (4,1)(4, 1).
1The perpendicular gradient is −32-\frac{3}{2}.
21=−32(4)+c1 = -\frac{3}{2}(4) + c, so 1=−6+c1 = -6 + c and c=7c = 7.
Answer
y=−32x+7y = -\frac{3}{2}x + 7
Your turnSame method, new numbers — try it before moving on.

Find the equation of the line perpendicular to y=4x+3y = 4x + 3 that passes through (8,2)(8, 2).

Type it like y = -1/4x + 4 or y = -x/4 + 4.

Show worked solution
Solution
  1. 1Perpendicular gradient: −14-\frac{1}{4}.
  2. 22=−14(8)+c2 = -\frac{1}{4}(8) + c, so c=4c = 4.

Answer: y=−14x+4y = -\frac{1}{4}x + 4

Why negative reciprocals

Rotating a line through 90∘90^\circ swaps its "rise" and "run" and turns one of them negative. A rise of 2 per run of 1 (gradient 2) becomes a rise of −1-1 per run of 2 (gradient −12-\frac{1}{2}). That is where the negative reciprocal comes from.

Think like an examiner

  • Always rearrange to y=mx+cy = mx + c before stating a gradient — 2y=6x+42y = 6x + 4 has gradient 3, not 6.
  • When plotting, a point that does not line up with the others is a signal to recheck its calculation.
  • Give equations in full: "y=3x+1y = 3x + 1", not "m=3m = 3, c=1c = 1".

Straight lines

y=mx+cy = mx + c
mm = gradient, cc = yy-intercept.
m=y2−y1x2−x1m = \dfrac{y_2 - y_1}{x_2 - x_1}
Gradient from two points.
m1×m2=−1m_1 \times m_2 = -1
Perpendicular lines.

Watch out for these

Gradient of (2,7)(2, 7) to (6,−1)(6, -1): 6−2−1−7\frac{6 - 2}{-1 - 7}.
Change in yy goes on top: −1−76−2=−2\frac{-1 - 7}{6 - 2} = -2.
The gradient of y=5−2xy = 5 - 2x is 5.
Rewrite as y=−2x+5y = -2x + 5: the gradient is −2-2.
The perpendicular gradient to 4 is −4-4.
It is the negative reciprocal: −14-\frac{1}{4}.
Thinking y=3y = 3 is a vertical line.
y=3y = 3 is horizontal; x=3x = 3 is vertical.

Stretch yourself

The points A(1,2)A(1, 2), B(5,4)B(5, 4) and C(3,k)C(3, k) form a triangle with a right angle at AA. Find kk.

Hint — A right angle at AA means ABAB and ACAC are perpendicular.

Reveal solution
SolutionGradient of AB=4−25−1=12AB = \frac{4 - 2}{5 - 1} = \frac{1}{2}. So the gradient of ACAC must be −2-2: k−23−1=−2\frac{k - 2}{3 - 1} = -2, giving k−2=−4k - 2 = -4 and k=−2k = -2. ■\blacksquare

Questions students ask

What does a gradient of 0 mean?
The line is horizontal — yy does not change as xx increases. Its equation is y=cy = c.
What is the gradient of a vertical line?
It is undefined, because the change in xx is zero and you cannot divide by zero. Vertical lines have equations x=ax = a.
Do I need to plot three points?
Two points define a line, but a third acts as a check. Examiners expect a table with several points for "draw the graph" questions.

Key takeaways

  • Substitute xx values to make a table, then plot and join with a ruler.
  • Gradient = change in yy ÷ change in xx.
  • In y=mx+cy = mx + c, mm is the gradient and cc the yy-intercept.
  • Through two points: find mm, then substitute a point to find cc.
  • Parallel lines share a gradient; perpendicular gradients multiply to −1-1.

Exam-style questions

Practise it the way it is examined

3 original questions · 10 marks, written to match the style and mark allocation of the real papers. Work on paper, then open the mark scheme and tick the marks you earned — method marks count even if the final answer slips.

Question 1Grade 43 marks
  1. (a)Write down the gradient and the yy-intercept of the line y=7−4xy = 7 - 4x.[2]
    Show mark scheme (a)
  2. (b)Write down the equation of a line parallel to y=7−4xy = 7 - 4x.[1]
    Show mark scheme (b)
Answer on paper first, then mark it.
Question 2Grade 54 marks
  1. A line passes through (−2,9)(-2, 9) and (4,−3)(4, -3). Find its equation in the form y=mx+cy = mx + c.[4]
    Show mark scheme

    Answer: y=−2x+5y = -2x + 5

Answer on paper first, then mark it.
Question 3Grade 73 marks
  1. Line LL has equation 2y=x+62y = x + 6. Find the equation of the line perpendicular to LL that passes through the point (3,1)(3, 1).[3]
    Show mark scheme

    Answer: y=−2x+7y = -2x + 7

Answer on paper first, then mark it.

Unlimited practice

Skill drill

A new question every time, marked instantly, with a full worked solution. Aim for a streak of five, then move up a level.

0 / 0 first-time correct Streak 0Best at this level: 0

Generating a question…

Test yourself

Answer a few questions, then review anything you missed.

Prefer paper? Open the written self-check

Answer each question before opening its answer. This self-check does not record a quiz score.

  1. What is the gradient of y=5x−3y = 5x - 3?

    • 55
    • −3-3
    • 33
    • 53\frac{5}{3}
    Show answer and explanation

    Answer: 55

    The coefficient of xx.

  2. Where does y=2x+7y = 2x + 7 cross the yy-axis?

    • (0,7)(0, 7)
    • (7,0)(7, 0)
    • (0,2)(0, 2)
    • (−3.5,0)(-3.5, 0)
    Show answer and explanation

    Answer: (0,7)(0, 7)

    The intercept c=7c = 7.

  3. Which point lies on y=4x−1y = 4x - 1?

    • (2,7)(2, 7)
    • (7,2)(7, 2)
    • (1,5)(1, 5)
    • (0,1)(0, 1)
    Show answer and explanation

    Answer: (2,7)(2, 7)

    4(2)−1=74(2) - 1 = 7.

  4. Gradient of the line through (1,2)(1, 2) and (4,11)(4, 11)?

    • 33
    • 13\frac{1}{3}
    • 99
    • −3-3
    Show answer and explanation

    Answer: 33

    93=3\frac{9}{3} = 3.

  5. Gradient of 3y=12x−63y = 12x - 6?

    • 44
    • 1212
    • −2-2
    • 33
    Show answer and explanation

    Answer: 44

    y=4x−2y = 4x - 2.

  6. Which line is parallel to y=−x+4y = -x + 4?

    • y=3−xy = 3 - x
    • y=x+4y = x + 4
    • y=−4xy = -4x
    • y=4y = 4
    Show answer and explanation

    Answer: y=3−xy = 3 - x

    Both have gradient −1-1.

  7. A line perpendicular to y=−13x+2y = -\frac{1}{3}x + 2 has gradient…

    • 33
    • −3-3
    • 13\frac{1}{3}
    • −13-\frac{1}{3}
    Show answer and explanation

    Answer: 33

    −13×3=−1-\frac{1}{3} \times 3 = -1.

  8. Equation of the line through (0,−2)(0, -2) and (4,6)(4, 6)?

    • y=2x−2y = 2x - 2
    • y=2x+6y = 2x + 6
    • y=12x−2y = \frac{1}{2}x - 2
    • y=4x−2y = 4x - 2
    Show answer and explanation

    Answer: y=2x−2y = 2x - 2

    Gradient 84=2\frac{8}{4} = 2, intercept −2-2.

Next step

Keep practising

Start with the quiz above to check the key ideas. You can also choose another topic from the practice library.

Browse practice topics

Related lessons

All 19 lessons