Linear Graphs
A straight-line graph shows how two quantities are connected. In this lesson, you will plot points, draw a line and understand what its slope tells you.
Build from plotting to equations of lines. Parallel lines and finding a line’s equation are Foundation and Higher skills. Perpendicular lines are introduced in a clearly labelled Higher extension.
What is a linear graph?
A linear graph is a straight line. The rule connecting the two quantities is called a linear relationship.
First, meet the axes: the two number lines on a graph. The x-axis goes across. The y-axis goes up and down. They meet at the origin, (0, 0).
A point has two coordinates, written (x, y). The letter x tells you the horizontal position; y tells you the vertical position.
For (2, 3), start at the origin. Go 2 units right. Then go 3 units up. Negative x values are to the left; negative y values are below the origin.
The dot above is (2, 3). The dashed path shows how to reach it.
For equal steps in x, a linear relationship has equal changes in y. For example, if y goes up by 2 every time x goes up by 1, the plotted points follow a straight line.
Example Question:
Draw the graph of y = 2x + 1.
This rule means: multiply x by 2, then add 1 to get y. The expression 2x means 2 × x.
We will build a table and draw the line in Example 1.
Exam Tip
Read the scale on each axis before plotting. One square does not always mean one unit.
Plot x across first, then y up or down. Use a ruler for the straight line.
Method — Understanding and Plotting a Line
What does y = mx + c mean?
This is a useful way to write the equation of a non-vertical straight line. An equation is a statement with an equals sign.
The letters x and y are the coordinates of any point on the line. The letters m and c are fixed numbers for that line. The expression mx means m × x.
m is the gradient: how much y changes when x increases by 1. It describes the slope of the line.
c is the y-intercept: the y value where the line crosses the y-axis. At this crossing, x = 0, so the point is (0, c).
For y = 2x + 1, m = 2 and c = 1. Go 1 right and 2 up. The line crosses the y-axis at (0, 1).
How to plot a line
1. Choose a few x values, or use the ones in the question.
2. Put each x value into the equation. Work out the matching y value. This is called substitution.
3. Write the results in a table. Each pair is one point.
4. Label the axes and choose even scales. Plot each point.
5. Check that the points line up. Use a ruler to draw a straight line through them. Extend it across the required part of the grid.
Worked Examples
Example 1 — Plot a line from a table
Draw y = 2x + 1 for x values from −2 to 2.
For x = −2, multiply first:
2 × (−2) = −4
Then add 1:
y = −4 + 1
y = −3
For x = 1:
y = 2 × 1 + 1
y = 2 + 1
y = 3
Repeat for each x value:
| x | 2 × x | y = 2x + 1 |
|---|---|---|
| -2 | -4 | -3 |
| -1 | -2 | -1 |
| 0 | 0 | 1 |
| 1 | 2 | 3 |
| 2 | 4 | 5 |
The points are (−2, −3), (−1, −1), (0, 1), (1, 3), (2, 5). Plot them and draw the line below.
Each time x increases by 1, y increases by 2. The gradient is 2. The line rises as you read it from left to right: this is a positive gradient.
At x = 0, y = 1. The y-intercept is 1.
Example 2 — Find the gradient from two points
Use the points (0, 1) and (2, 5) on the same line. The dashed step on the graph goes right, then up.
Gradient = vertical change ÷ horizontal change.
From the first point to the second, the horizontal change is:
2 − 0 = 2
The vertical change is:
5 − 1 = 4
Divide the vertical change by the horizontal change:
m = 4 ÷ 2
m = 2
You can use any two different points on this line. Use their coordinate values, even if the axes have different scales.
Example 3 — Read a negative gradient and intercept
Look at this graph. Read the marked points as (0, 3) and (3, 0).
The line crosses the y-axis at 3, so c = 3.
Going from (0, 3) to (3, 0), the horizontal change is:
3 − 0 = 3
The vertical change is:
0 − 3 = −3
So the gradient is:
m = −3 ÷ 3
m = −1
The negative sign means the line falls from left to right. For every 1 right, go 1 down.
Put m = −1 and c = 3 into y = mx + c:
y = −x + 3
Here, −x means −1 × x. The graph and equation describe the same line.
Example 4 — A zero gradient
The equation y = 2 means that y stays at 2, whatever x is.
From (0, 2) to (2, 2), the vertical change is 2 − 2 = 0. The horizontal change is 2 − 0 = 2.
m = 0 ÷ 2
m = 0
This horizontal line has zero gradient and y-intercept 2. You could write it as y = 0x + 2.
Example 5 — Interpret a straight-line rule
A taxi model uses y = 2x + 3. Here, x is the distance travelled in kilometres and y is the fare in pounds.
The y-intercept is 3. This means a £3 starting charge, before any distance is travelled.
The gradient is 2. This means the fare increases by £2 for each extra kilometre.
For a journey of 4 km, put x = 4 into the rule:
y = 2 × 4 + 3
y = 8 + 3
y = 11, so the fare is £11.
Only use non-negative distances in this situation. A negative distance would not describe a journey.
Example 6 — Parallel lines (Foundation & Higher)
Parallel lines stay the same distance apart and never meet. Non-vertical parallel lines have the same gradient and different y-intercepts.
For example, y = 2x + 1 and y = 2x − 3 both have gradient 2. Their y-intercepts are 1 and −3, so they are different, parallel lines.
Find the equation of a line parallel to y = 2x + 1 that passes through (1, 5).
Keep the same gradient, 2. The new intercept is not known yet:
y = 2x + c
At (1, 5), x = 1 and y = 5. Substitute these values:
5 = 2 × 1 + c
5 = 2 + c
Subtract 2 from both sides:
5 − 2 = c
3 = c
So the new line is y = 2x + 3.
It has gradient 2 and gives y = 5 when x = 1, as required.
Key results from Example 1
For y = 2x + 1:
Gradient = 2. Go 1 right and 2 up.
Y-intercept = 1. The line crosses the y-axis at (0, 1).
Check your graph
Choose a plotted point and check it in the equation. For (1, 3) on y = 2x + 1:
2 × 1 + 1 = 3
This matches the point’s y value.
Also check the other plotted points. They should lie on the same straight line. If one is out of line, recheck its calculation and coordinates.
Finding and using equations of lines
Worked example — A line through two points
Find the line through (1, 2) and (3, 8).
Gradient = (8 − 2) ÷ (3 − 1) = 6 ÷ 2 = 3.
Write y = 3x + c. Use (1, 2): 2 = 3 × 1 + c, so c = −1.
y = 3x − 1. Check the other point: 3 × 3 − 1 = 8.
If the gradient and one point are already given, start directly with y = mx + c and find c.
Worked example — An equation in another form
Find the gradient and y-intercept of 2x + y = 6.
Subtract 2x from both sides: y = −2x + 6.
The gradient is −2 and the y-intercept is 6. Do not read the coefficient +2 from the unrearranged equation as its gradient.
A vertical line such as x = −2 has every point’s x-coordinate equal to −2. Its gradient is undefined. A horizontal line y = −2 has gradient zero.
Worked example — Use a graph to solve an equation
To estimate the solution of 2x + 1 = 6, draw y = 2x + 1 and the horizontal line y = 6.
For the sloping line, points include (0, 1), (1, 3), (2, 5) and (3, 7). The horizontal line stays at height 6.
Read the x-coordinate of their crossing: x = 2.5. Check: 2 × 2.5 + 1 = 6.
A graph reading may be approximate. Algebra gives an exact check: subtract 1, then divide by 2.
Higher extension — Perpendicular lines
Perpendicular lines meet at a right angle. For two lines with defined, non-zero gradients, their gradients multiply to −1.
A line with gradient 2 is perpendicular to one with gradient −½, since 2 × (−½) = −1.
Find a line perpendicular to y = 2x + 3 through (2, 4). Use gradient −½.
y = −½x + c. Substitute the point: 4 = −1 + c, so c = 5.
y = −½x + 5. Check: −½ × 2 + 5 = 4.
Horizontal and vertical lines are also perpendicular, but the gradient-product test cannot use an undefined vertical gradient.
Coordinates, intercepts and two-line solutions
Worked example — All four quadrants
The axes divide the plane into four quadrants. A(2, 3) is upper right, B(−2, 3) upper left, C(−2, −3) lower left and D(2, −3) lower right. For D, move 2 right and 3 down. A point on an axis is not in a quadrant.
Worked example — Both intercepts
For y = 2x + 1, the y-intercept is (0, 1). At the x-axis, y = 0: solve 0 = 2x + 1 to get x = −½. Thus the x-intercept is (−½, 0). These agree with the plotted line earlier. Set the other coordinate to zero when finding an intercept.
Worked example — Solve two linear equations graphically
Solve y = 2x + 1 and y = 7 − x by drawing both on the same axes. For the first, plot (0, 1), (2, 5), (3, 7). For the second, plot (0, 7), (2, 5), (3, 4). Use the same scales and draw each straight line through its points.
Read their intersection as (2, 5): the simultaneous solution is x = 2, y = 5. Check both equations: 5 = 2 × 2 + 1 and 5 = 7 − 2. The x-coordinate alone solves 2x + 1 = 7 − x. A graph reading is approximate unless the coordinates are known exactly.
Shared practice — Describe the position of (−3, −2). Find both intercepts of y = 2x − 4.
Move 3 left and 2 down: the point is in the lower-left quadrant.
At x = 0, y = −4, giving (0, −4). At y = 0, 2x − 4 = 0 gives x = 2, so the other intercept is (2, 0).
Shared practice — Draw y = x + 1 and y = 5 − x on the same axes. Read the intersection and check it.
For y = x + 1 use (0, 1), (2, 3), (4, 5); for y = 5 − x use (0, 5), (2, 3), (4, 1).
The intersection is (2, 3), so x = 2 and y = 3. Checks: 3 = 2 + 1 and 3 = 5 − 2. Allow sensible reading tolerance for a hand-drawn graph.
Think Like a Mathematician
On y = 2x + 1, going 1 right takes you 2 up. What happens if you go 3 right?
You go 6 up. The gradient is still 6 ÷ 3 = 2. A bigger step gives the same ratio.
Now compare y = 2x + 1 and y = 2x + 4. At the same x value, the second line has a y value 3 greater. Their slopes are equal. This helps explain why they do not meet.
Common mistakes to avoid
Reversing coordinates: (2, 3) means 2 across, then 3 up.
Swapping gradient and intercept: in y = 3x − 2, m = 3 and c = −2.
Dividing the wrong way round: gradient is vertical change ÷ horizontal change.
Losing a minus sign: a fall in y gives a negative vertical change when you go right.
Counting squares without checking scales: use the actual coordinate values.
Joining points with a bent line: recheck any point that does not line up. A linear graph is straight.
Try it yourself
Try these on paper. Open each answer when you are ready to check your steps.
1. In y = 3x − 2, state the gradient and y-intercept.
Compare with y = mx + c.
The number multiplying x is 3, so m = 3.
The constant term is −2, so c = −2. The y-axis crossing is (0, −2).
2. Complete a table for y = 2x + 2 using x = −1, 0, 1 and 2.
Multiply each x by 2, then add 2.
| x | Calculation | y |
|---|---|---|
| −1 | −2 + 2 | 0 |
| 0 | 0 + 2 | 2 |
| 1 | 2 + 2 | 4 |
| 2 | 4 + 2 | 6 |
3. On squared paper, plot y = x + 2 using x = −1, 0, 1 and 2. Draw the line and state where it crosses the y-axis.
| x | y = x + 2 |
|---|---|
| −1 | 1 |
| 0 | 2 |
| 1 | 3 |
| 2 | 4 |
Add 2 to each x value. This gives (−1, 1), (0, 2), (1, 3) and (2, 4).
Plot these points, then use a ruler to draw a straight line through them.
It crosses the y-axis at (0, 2), so the y-intercept is 2.
4. Find the gradient of the line through (1, 7) and (4, 1).
Go from (1, 7) to (4, 1).
Horizontal change = 4 − 1 = 3
Vertical change = 1 − 7 = −6
Gradient = −6 ÷ 3
Gradient = −2. The line falls as you go right.
5. Use the graph below to find its gradient, y-intercept and equation.
The line crosses the y-axis at (0, 1), so c = 1.
Read another marked point: (2, 3).
Vertical change = 3 − 1 = 2
Horizontal change = 2 − 0 = 2
m = 2 ÷ 2 = 1
Put m = 1 and c = 1 into y = mx + c.
y = x + 1, because 1 × x is x.
6. Which gradient is positive, negative or zero: y = 4x + 1, y = −2x + 5, and y = 3?
y = 4x + 1: m = 4, so the gradient is positive. The line rises from left to right.
y = −2x + 5: m = −2, so the gradient is negative. The line falls from left to right.
y = 3: y stays at 3. There is no vertical change, so the gradient is zero.
7. A bike hire rule is y = 4x + 6. Here, x is the number of hours hired and y is the cost in pounds. Explain the 4 and the 6. Find the cost for 3 hours.
The gradient 4 means £4 for each hour.
The y-intercept 6 means a £6 fixed charge.
Put x = 3 into the rule:
y = 4 × 3 + 6
y = 12 + 6
y = 18, so the cost is £18.
8. Which line is parallel to y = −2x + 1: y = 2x + 1, y = −2x + 5, or y = −x + 1?
The original gradient is −2.
The three choices have gradients 2, −2 and −1.
y = −2x + 5 has the same gradient and a different y-intercept, so it is parallel.
9. Find the equation of the line parallel to y = 3x + 1 that passes through (2, 4).
Parallel lines have the same gradient, so m = 3.
y = 3x + c
Substitute x = 2 and y = 4:
4 = 3 × 2 + c
4 = 6 + c
Subtract 6 from both sides:
4 − 6 = c
−2 = c
y = 3x − 2
Check the point: 3 × 2 − 2 = 4. It also has the required gradient, 3.
Further practice — equations and intersections
10. Find the equation of the line through (0, −2) and (3, 4).
Gradient = (4 − (−2)) ÷ (3 − 0) = 6 ÷ 3 = 2.
The point (0, −2) gives intercept −2. The equation is y = 2x − 2.
Check: 2 × 3 − 2 = 4.
11. State the gradient and y-intercept of 3x + y = 8.
Subtract 3x: y = −3x + 8.
Gradient −3; y-intercept 8.
12. A line y = 3x − 1 crosses the horizontal line y = 5. Which equation does the crossing solve, and what is x?
At the crossing, both y-values are 5, so 3x − 1 = 5.
Add 1: 3x = 6. Divide by 3: x = 2.
The crossing is (2, 5); substitute to check 3 × 2 − 1 = 5.
13. Higher: find the line perpendicular to y = 4x + 1 through (4, 2).
Its gradient is −¼, because 4 × (−¼) = −1.
Use y = −¼x + c. At (4, 2), 2 = −1 + c, so c = 3.
y = −¼x + 3. Check: −¼ × 4 + 3 = 2.
Frequently Asked Questions
How do I recognise a straight-line relationship?
For equal increases in x, the change in y stays the same. When you plot points from the rule, they lie on a straight line. A short table can suggest this pattern; the rule tells you whether it continues.
What if there is no number written before x?
In y = x + 4, the gradient is 1. In y = −x + 4, it is −1.
What if there is no number added at the end?
In y = 3x, the y-intercept is 0. The line passes through the origin, (0, 0).
Do I always need a table?
Two different points determine a straight line. A table with three or more points gives you an extra check and is a helpful starting method. Follow the instructions in the question.
Can a gradient be a fraction?
Yes. If a line goes 2 right and 1 up, its gradient is 1 ÷ 2 = ½. The symbol ½ means one half.
Is a vertical line’s gradient zero?
No. A horizontal line has gradient zero. A vertical line, such as x = 2, has no horizontal change, so the gradient calculation would divide by zero. Its gradient is undefined, and it cannot be written as y = mx + c.
Continue Learning
Previous: Numerical Methods and Iteration
