STEM-TutorLearn • Practice • ExcelBook Free DemoFree demo

Straight line graphs, explained with examples

Every straight line can be written as y = mx + c, where m is the gradient and c is where the line crosses the y-axis. Once you can read and use those two numbers, a whole family of GCSE questions becomes straightforward.

On this page
  1. Gradient: how steep a line is
  2. y = mx + c
  3. Worked examples
  4. Plotting a straight line
  5. Parallel and perpendicular lines (Higher)
  6. Midpoints and lengths
  7. Where two lines meet
  8. Gradients in real life
  9. Common mistakes
  10. Practice questions
  11. Frequently asked questions
  12. Key takeaways
  13. Related guides

Gradient: how steep a line is

The gradient measures steepness: how much y changes for each 1 unit increase in x.

gradient = change in y / change in x = (y2 − y1) / (x2 − x1), often remembered as “rise over run”.

y = mx + c

In y = mx + c, m is the gradient and c is the y-intercept, the value of y where the line crosses the y-axis (when x = 0). For y = 3x − 2, the gradient is 3 and the line crosses the y-axis at (0, −2). If an equation is not in this form, rearrange it to make y the subject before reading off m and c.

Worked examples

Example 1: gradient from two points

Find the gradient of the line through (1, 3) and (4, 12).

Example 2: a negative gradient

Find the gradient of the line through (−2, 5) and (2, −3).

Example 3: reading m and c

Find the gradient and y-intercept of 2y + 4x = 10.

Example 4: equation from a point and gradient

Find the equation of the line with gradient 4 through (2, 7).

Example 5: equation from two points

Find the equation of the line through (1, 5) and (3, 11).

Plotting a straight line

Make a table of values: choose three or more x-values, such as −2, 0 and 2, work out y for each, plot the points and join them with a ruler. If the points do not lie on a straight line, recheck your arithmetic; a line through only two points gives no check. Alternatively, plot the y-intercept and use the gradient to step along: for gradient 2, go 1 right and 2 up.

Parallel and perpendicular lines (Higher)

Example 6: a parallel line

Find the equation of the line parallel to y = 5x − 2 that passes through (1, 9).

Example 7: a perpendicular line

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

Midpoints and lengths

The midpoint of the segment joining (x1, y1) and (x2, y2) is the average of the coordinates: ((x1 + x2)/2, (y1 + y2)/2). Its length comes from Pythagoras: √((x2 − x1)² + (y2 − y1)²). For (2, 3) and (8, 11), the midpoint is (5, 7) and the length is √(36 + 64) = 10.

Where two lines meet

The point where two straight lines cross is the solution of their simultaneous equations. To find it, set the two expressions for y equal. For y = 2x + 1 and y = −x + 7: 2x + 1 = −x + 7, so 3x = 6 and x = 2, giving y = 5. The lines meet at (2, 5). Parallel lines have no intersection, which matches simultaneous equations with no solution.

Gradients in real life

On real-life graphs, the gradient is a rate of change, with units. On a distance-time graph, the gradient is speed. On a graph of cost against number of items, the gradient is the price per item and the y-intercept is a fixed charge. For example, a taxi fare graph with equation C = 1.5d + 3 means a £3 fixed charge plus £1.50 per mile. Interpreting m and c in context is a common exam question.

Common mistakes

Practice questions

Try each one before opening the answer.

Q1. Find the gradient through (0, 2) and (5, 17).

Show answer
3.

Q2. Write the gradient and y-intercept of y = 7 − 4x.

Show answer
Gradient −4, intercept 7.

Q3. Find the equation of the line through (2, 1) and (6, 9).

Show answer
Gradient 2, so y = 2x − 3.

Q4. What is the gradient of a line perpendicular to y = −⅓x + 2?

Show answer
3.

Q5. Find the midpoint of (−4, 6) and (2, −2).

Show answer
(−1, 2).

Frequently asked questions

Is y = mx + c on the Foundation paper?

Yes. Plotting lines, gradients and y = mx + c are on both tiers. Perpendicular lines are Higher tier.

How does this connect to A level?

A level Maths uses y − y1 = m(x − x1) to write equations quickly, and the same gradient rules for tangents, normals and coordinate geometry.

Key takeaways