Skip to main content

Linear functions for Year 8 — an explanation with a graph

MathsUK · 24 May 2026 · 10 min read

A linear function is a relationship between two variables whose graph is a straight line. In Year 8 pupils learn the form y = mx + c, understand the role of the gradient and the role of the y-intercept, and practise moving freely between an equation, a table and a graph. This guide explains step by step how to read the formula, how to draw a graph from it, how to find the equation from two given points, and how to recognise a positive, negative or zero gradient.

A linear function is a relationship between two variables, x and y, in which every value of x corresponds to exactly one value of y according to the formula y = mx + c, where m and c are fixed numbers. Its graph is always a straight line on the coordinate grid. In Year 8 pupils meet this topic in an organised way for the first time, and use it as the foundation for everything that follows in algebra and coordinate geometry at GCSE. This guide goes over the definition, the meaning of the gradient and the y-intercept, drawing a graph from the equation, finding the equation from two points, and the uses in real life.

What is a linear function?

A linear function is a function of the form y = mx + c, where m and c are given numbers and x is the variable. The number m is called the gradient, and the number c is called the y-intercept. The name 'linear' comes from the Latin word linea, meaning line — because the graph is always a straight line, with no bends and no breaks.

For example, y = 2x + 3 is a linear function. Here m = 2 and c = 3. If we substitute x = 0, we get y = 3. If we substitute x = 1, we get y = 5. If we substitute x = 2, we get y = 7. Every time x increases by 1, y increases by 2 — and that is exactly what the number 2 (the gradient) tells us.

It is important to distinguish a linear function from one that is not linear. y = x² is not linear because it has x squared. y = 1/x is not linear because x is in the denominator. Only functions in which x appears to the first power only, with no denominator and no root, are linear.

An important special case is when c = 0. Then the function is y = mx, and its graph passes through the origin (0, 0). A function like this is called a direct proportion: y is directly proportional to x. For example, y = 3x passes through (0, 0), (1, 3), (2, 6) and so on.

The parts of the formula: gradient and intercept

To understand a linear function properly, you need to understand what each of the two numbers in the formula says.

The gradient m describes how steep the line is. It answers the question: 'By how much does y change every time x increases by 1?'. If m = 2, then every move of one unit to the right along the x-axis takes us up two units on the y-axis. If m = 0.5, every unit to the right takes us up only half a unit. If m = −3, every unit to the right takes us down three units.

A positive gradient (m > 0): the line goes up from left to right. Example: y = x + 1. A negative gradient (m < 0): the line goes down from left to right. Example: y = −2x + 4. A zero gradient (m = 0): the line is completely horizontal, parallel to the x-axis. Example: y = 5 — for every x the value of y is 5.

The y-intercept, c, is the value of y when x = 0. Geometrically, it is the point where the graph crosses the y-axis. In the formula y = 2x + 3, when x = 0 we get y = 3, so the graph crosses the y-axis at the point (0, 3). If c is negative, the line crosses the y-axis below the origin. If c = 0, the line passes through the origin itself.

Want to work out a gradient quickly from two given points? You can use the line gradient calculator and get m without opening an exercise book.

How do you draw the graph from the equation? — 3 examples

To draw the graph of a linear function, it is enough to find two points, plot them on the grid and join them with a straight line. That is the whole story — two points define one and only one straight line. In practice it is best to find three points, to catch calculation errors.

Example 1: y = 2x + 3. Substitute x = 0 and get y = 3, so we have the point (0, 3). Substitute x = 1 and get y = 5, so we have (1, 5). Substitute x = 2 and get y = 7, so we have (2, 7). Plot the three points on the grid and draw a straight line through them. The line goes up — a positive gradient — and crosses the y-axis at a height of 3.

Example 2: y = −x + 4. Substitute x = 0 and get y = 4, the point (0, 4). Substitute x = 1 and get y = 3, the point (1, 3). Substitute x = 4 and get y = 0, the point (4, 0). The graph goes down from left to right because the gradient −1 is negative. Notice that the point (4, 0) is the x-intercept.

Example 3: y = 0.5x − 1. Substitute x = 0 and get y = −1, the point (0, −1). Substitute x = 2 and get y = 0, the point (2, 0). Substitute x = 4 and get y = 1, the point (4, 1). The graph rises slowly (gradient a half), and crosses the y-axis below the origin.

A practical tip: to get 'nice' points with whole numbers, choose values of x that cancel the fraction in the formula. If the gradient is 1/3, choose x = 0, 3, 6, 9. If it is 2/5, choose x = 0, 5, 10. You can check the drawing itself with an interactive function grapher — type in the equation and see the graph straight away.

How do you find the equation from 2 points?

The reverse of drawing a graph is finding the equation. You are given two points, and you want to write the y = mx + c that passes through them.

Step 1 — work out the gradient. The formula is m = (y₂ − y₁) / (x₂ − x₁). That means: the difference in the heights divided by the difference in the horizontal positions.

Step 2 — work out c. Substitute the gradient and one of the points into the formula y = mx + c and solve for c.

Example: you are given the points (1, 5) and (3, 11). Work out the gradient: m = (11 − 5) / (3 − 1) = 6 / 2 = 3. Substitute m = 3 and the point (1, 5): 5 = 3 × 1 + c, so c = 2. The equation is y = 3x + 2. Check with the second point: 3 × 3 + 2 = 11. ✓

A second example: you are given (0, 4) and (2, 0). Gradient: m = (0 − 4) / (2 − 0) = −4 / 2 = −2. From the point (0, 4) you can see straight away that c = 4. The equation is y = −2x + 4.

Parallel lines are lines with the same gradient but a different c. For example y = 2x + 1 and y = 2x − 5 are parallel. Perpendicular lines (which meet at 90°) have gradients whose product is −1. For example y = 2x + 3 is perpendicular to y = −0.5x + 1, because 2 × (−0.5) = −1. (Perpendicular gradients are GCSE Higher content, but it is worth seeing now.)

If the points are awkward numbers, you can get the answer straight away with the line through two points calculator.

Linear functions in real life

Linear functions describe any situation where there is a fixed charge plus a variable charge that depends on quantity.

A taxi fare: a flag-fall of £3 plus £2 for every mile. The total cost as a function of the number of miles: y = 2x + 3. Here c = 3 is the flag-fall (even without driving a single yard), and m = 2 is the cost per mile.

An electricity bill: a standing charge of £25 a month plus 30p per kWh: y = 0.3x + 25.

Constant speed: a car travelling at 50 mph from a point 20 miles from its destination. The distance from the destination as a function of time in hours: y = −50x + 20. The gradient is negative because the distance decreases with time.

The x-intercept — where y = 0 — is a standard exercise. Solve the equation mx + c = 0 and get x = −c/m. In the case of the car, the destination is reached when −50x + 20 = 0, that is x = 0.4 hours, or 24 minutes. Want to solve equations like these quickly? There is a linear equation solver that shows every step.

Common mistakes

Mixing up m and c. Many pupils remember the formula y = mx + c but get confused about which is the gradient and which is the intercept. A memory exercise: m stands next to x and is therefore responsible for the change per unit of x — that is the gradient. c on its own — that is the starting value.

A minus sign that disappears. In the equation y = −2x + 5, when you substitute x = 3, you should get y = −2 × 3 + 5 = −1. Many pupils forget the minus and get 11. Always put brackets around a negative number when substituting.

Working out the gradient upside down. The formula is (y₂ − y₁) / (x₂ − x₁) — the difference in y divided by the difference in x, not the other way round. Dividing by the difference in y instead of the difference in x is a classic mistake.

Confusing a zero gradient with an undefined gradient. y = 5 is a horizontal line with gradient 0. x = 5 is a vertical line that is not a function at all and whose gradient is undefined. The two cases look similar in the equation but are completely different.

Forgetting to check. After finding an equation, you must substitute both original points and make sure they both satisfy it. A 30-second check saves a mistake in the whole question.

5 tips for practising

1. Always start with a table of values. Before drawing, write a table of at least three rows with x and y. That prevents 80% of drawing mistakes and gives you accurate points.

2. Draw the x-axis and y-axis with an even scale. Many children draw the axes freehand and get an uneven scale, which makes the line look bent. Use squared paper and choose a clear unit (one square = one unit).

3. Learn the small identities by heart. y = x passes through (0, 0), (1, 1), (2, 2) — gradient 1. y = −x passes through (0, 0), (1, −1), (2, −2) — gradient −1. y = 2x passes through (0, 0), (1, 2), (2, 4). Recognising the basic shapes instantly saves time.

4. Practise both directions. From equation to graph, and from graph to equation. In Year 8 half the questions go each way, and pupils tend to specialise in only one.

5. Work with practice sheets that have full solutions. The MathsUK Year 8 algebra worksheet includes exercises graded from easy to hard with step-by-step solutions — it is worth printing and working on paper.

Frequently asked questions

What is the difference between a linear function and a linear equation?

A linear equation is a question like 2x + 3 = 11 that has one solution (x = 4). A linear function is a continuous relationship between x and y like y = 2x + 3, which has infinitely many solution pairs and whose graph is a straight line. Both use the same expression 2x + 3 but in different contexts.

How do you know whether a point is on the graph?

Substitute its coordinates into the equation. If the equation balances — the point is on the line. If not — it is off the line. For example, is (3, 9) on y = 2x + 3? Check: 2 × 3 + 3 = 9. Yes, it balances. The point is on the line.

What is the domain of a linear function?

The domain of an ordinary linear function is all real numbers — you can substitute any x and get a y. In real-life problems there is sometimes a restriction (for example time ≥ 0), and then the domain is only part of the real numbers.

How do you read the gradient from the graph?

Choose two clear points on the graph (ideally with whole-number coordinates), count how many squares you go up vertically and how many you move horizontally, and divide: gradient = rise / run. If you go up 4 and move 2 to the right, the gradient is 2.

What happens if the gradient is a fraction?

A fraction is completely legitimate. y = 0.5x + 1 or y = (1/3)x + 2 are linear functions in every respect. The gradient simply describes a slow rise — half a unit up for every unit to the right.

How do you draw the graph of y = 5 or y = −2?

These are horizontal lines. y = 5 is a straight line parallel to the x-axis, at a height of 5 at every point. y = −2 is a horizontal line at a height of −2. Their gradient is 0. They have no x-intercept.

How can you check an answer with a calculator?

After finding an equation, substitute several values of x into it and compare with the y values given in the question. You can also use a function grapher to see whether the graph you get matches the one in your book.

How does this topic connect with what was learnt in Year 7?

In Year 7 pupils learn to solve linear equations in one variable, like 3x + 5 = 14. In Year 8 this is extended to two variables and pupils start to think graphically. Anyone who wants to revise the basics should read our Year 7 algebra and equations guide before diving into graphs.

An interactive grapher that shows the graph in seconds

Draw a linear function now

Links that might help

Line gradient calculatorLine through two points calculatorLinear equation solverAlgebra practice sheet for Year 8Algebra and equations for Year 7

← Back to all articles

We keep your progress and preferences in your browser only (local storage), and use analytics cookies to improve the site. Read the privacy notice.

More information