Equation of a linear (straight line) graph

Equation of a linear (straight line) graph
Interactive linear graphs worksheet

The equation of a linear graph helps you understand how two variables are related, often appearing as straight lines on a graph. This is commonly used in real-life situations like calculating the cost of a taxi ride (where the total cost depends on a base fare plus a rate per mile) or tracking distance over time at a constant speed. Jump to the questions

Practise now

The values in your answers may include positive or negative integers and multiples of 0.5 - write your answers in decimal format where appropriate.


Topic guide

What this worksheet practises

This worksheet provides practice on finding the equation of a straight line directly from a drawn graph. This visual skill requires you to identify the two key features of any straight line: its steepness (gradient) and where it crosses the vertical axis (y-intercept).

Key method

The equation of a straight line is always written in the format y = mx + c.

  • First, find 'c', the y-intercept. Look at the y-axis (the vertical line). Find the exact number where the graph line crosses it.
  • Second, find 'm', the gradient. Pick two clear points on the line where it perfectly crosses the grid intersections.
  • Draw a right-angled triangle between these two points.
  • Calculate the gradient: m = vertical height (rise) ÷ horizontal width (run).
  • If the line goes downhill (from left to right), the gradient must be negative.

Worked example

A drawn line crosses the y-axis at 4. By drawing a triangle between (0, 4) and (2, 10), find the equation of the line.

Step 1: Find 'c'. The line crosses the y-axis at 4.

So, c = 4. The equation is y = mx + 4.

Step 2: Find 'm' using the triangle.

The vertical height goes from 4 up to 10, which is a rise of 6.

The horizontal width goes from 0 across to 2, which is a run of 2.

m = 6 ÷ 2 = 3.

Step 3: Write the final equation.

y = 3x + 4.

Common mistakes to avoid

A frequent mistake is ignoring the scale on the axes when counting the "rise" and "run". Students often count the physical number of grid squares rather than reading the actual numbers on the axis. If one square represents 2 units, you must count in 2s, not 1s.

Things to remember

A line that goes uphill from left to right has a positive gradient (like y = 2x). A line that goes downhill has a negative gradient (like y = −2x). A completely flat horizontal line has a gradient of zero (like y = 4).