Linear Graphs
A rule like y = 2x + 1 turns every x into a y. Plot the pairs and they line up, literally, into a straight line. Two numbers describe the whole line: how steep it is (m, the gradient) and where it crosses the y-axis (c, the intercept).
National curriculum KS3: plot graphs of linear functions using a table of values; recognise, sketch and interpret graphs of linear functions; understand gradient and y-intercept in y = mx + c1 · From a rule to a line
Start with the rule y = 2x + 1. Pick some x-values, substitute each one (see the substitution page), and you get a table of values. Each column is a coordinate pair. Plot them. Step through and watch the line appear.
Three things to notice. The points are evenly spaced: every time x goes up by 1, y goes up by the same amount. That constant step is what makes the graph straight, and it's the number in front of x. And the point where x = 0 is where the line crosses the y-axis.
2 · Gradient: how steep
The gradient (la pendiente) measures steepness as rise over run: how far up for each step across. Draw a right-angled triangle anywhere on the line. Gradient = rise ÷ run. Because the line is straight, every triangle gives the same answer.
Sign of the gradient. Positive m: the line goes uphill left to right. Negative m: downhill. m = 0: flat, a horizontal line like y = 3. The bigger the size of m, the steeper. A gradient of 1 is 45°; a gradient of ½ is gentler; a gradient of 3 is steep. Measure rise and run in grid units, not centimetres.
3 · Intercept: where it starts
The y-intercept (la ordenada en el origen) is where the line crosses the y-axis. On the y-axis, x = 0, so put x = 0 into y = mx + c and the mx term vanishes: y = c. The intercept is simply the number on the end. The line "starts" at (0, c) and climbs from there at gradient m.
Play with the sliders until this is obvious: c slides the line up and down without tilting it; m tilts it around the intercept without moving the crossing point.
4 · Sketching without a table
Once you trust m and c, you can draw y = mx + c in two moves with no table at all. Mark (0, c). From there go 1 across and m up (or down if m is negative) to get a second point. Join and extend. Try it: the page gives you an equation, you place the two points.
5 · Reading the equation off a graph
The reverse skill, which exams love: a line is drawn, find its equation. Read c where it crosses the y-axis. Pick two clear grid points on the line, draw the triangle, work out rise ÷ run for m. Write y = mx + c.
6 · Special lines and parallel lines
| Equation | What it looks like | Why |
|---|---|---|
| y = 3 | Horizontal line through (0, 3) | Every point has y = 3 whatever x is. Gradient 0. |
| x = −2 | Vertical line through (−2, 0) | Every point has x = −2. Can't be written as y = mx + c; its gradient is undefined. |
| y = x | 45° line through the origin | m = 1, c = 0. The mirror line for swapping x and y. |
| y = −x | 45° downhill through the origin | m = −1. |
| y = 2x + 1 and y = 2x − 4 | Parallel | Same gradient, different intercepts. Parallel lines never meet because they climb at the same rate. |
| 2y = 4x + 6 | Looks unfamiliar | Divide by 2 first: y = 2x + 3. Always rearrange to y = … before reading m and c. |
7 · Where straight lines show up
Taxi fares and phone bills
£3 to start plus £2 per mile: cost = 2m + 3. The £3 is the intercept (cost before you move), the £2 is the gradient (cost per mile). Every "fixed charge plus rate" is y = mx + c.
Science: conversion graphs
°F = 1.8 °C + 32. Gradient 1.8, intercept 32. Hooke's law, Ohm's law and distance–time at constant speed are all straight lines through the origin: c = 0.
Distance–time graphs
Gradient = speed. A steep line is fast, flat is stopped, downhill is coming back. Reading gradients off a graph is reading speeds.
Computing
y = m*x + c is a one-line function. Drawing a line on screen means computing y for each pixel column x. Linear interpolation in animation and audio is this formula.
Statistics
A line of best fit on a scatter graph is y = mx + c chosen to pass as close as possible to all the points. Its gradient says how much y changes per unit of x.
Later maths
Simultaneous equations are two lines and their crossing point. Differentiation (the first page of this series) finds the gradient of a curve by borrowing the straight-line idea of rise over run.
Worked examples
Draw y = 3x − 2 for x from −2 to 2
Find the gradient of the line through (1, 2) and (4, 11)
Write the equation of the line with gradient −2 through (0, 5)
Exam-style: a line has gradient 3 and passes through (2, 1). Find its equation.
Quick check
What you've learned
A linear rule y = mx + c produces points that lie on a straight line. m is the gradient, rise over run, the amount y changes for each step of 1 in x: positive uphill, negative downhill, zero flat. c is the y-intercept, the value of y when x = 0, where the line crosses the y-axis. You can plot from a table of values, or sketch in two moves from (0, c) and the gradient; you can read an equation off a drawn line by finding those same two numbers. Parallel lines share m. Always rearrange to y = … before reading off.