Straight-line graphs
Plotting a straight line
An equation like y = 2x − 1 gives a straight line: a graph.
- Make a table of values for the x-values you're given.
- Work out y for each x.
- Plot the points and join them with a ruler, right to the ends.
Example: draw y = 2x − 1 for −2 ≤ x ≤ 3.
| x | −2 | −1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|---|
| y | −5 | −3 | −1 | 1 | 3 | 5 |
- x = −2: y = 2 × −2 − 1 = −5
- Work out each y the same way, then plot the points.
- They lie in a straight line
If one point doesn't line up with the others, recheck its y-value.
Key terms
Gradient
The is how steep a line is: how far it goes up for every 1 across.
Gradient = change in y ÷ change in x (rise over run). Learn this.
A positive gradient slopes up from left to right; a negative one slopes down.
Example: find the gradient of the line through (1, 3) and (4, 12).
- Change in y: 12 − 3 = 9
- Change in x: 4 − 1 = 3
- Gradient = 9 ÷ 3 = 3
Example: find the gradient of the line through (−2, 5) and (2, −3).
- Change in y: −3 − 5 = −8
- Change in x: 2 − (−2) = 4
- Gradient = −8 ÷ 4 = −2
Common mistake
Subtract in the same order on the top and bottom. Mixing them up gives the wrong sign.
Key terms
y = mx + c
Every straight line (except a vertical one) has an equation y = mx + c:
- m is the gradient
- c is the , where the line crosses the y-axis.
To read m and c, the equation must start "y =".
Example: give the gradient and y-intercept of y = 3x − 2.
- m = 3 and c = −2
Example: find the gradient and y-intercept of 3x + 4y = 12.
- Subtract 3x: 4y = −3x + 12
- Divide by 4: y = −¾x + 3
- Gradient −¾, y-intercept 3
Key terms
Finding the equation of a line
To find y = mx + c, you need m, then a point on the line to work out c.
- Find the gradient m.
- Substitute m and one point into y = mx + c, and solve for c.
Example: find the equation of the line with gradient 4 through (2, 5).
- 5 = 4 × 2 + c, so 5 = 8 + c
- c = −3, so y = 4x − 3
Example: find the equation of the line through (2, 1) and (5, 10).
- m = (10 − 1) ÷ (5 − 2) = 9 ÷ 3 = 3
- Using (2, 1): 1 = 3 × 2 + c, so c = −5
- y = 3x − 5
Check with the other point: 3 × 5 − 5 = 10.
Horizontal and vertical lines
- A horizontal line has the same y-value everywhere: its equation is y = b. Its gradient is 0.
- A vertical line has the same x-value everywhere: its equation is x = a.
The x-axis is y = 0, and the y-axis is x = 0.
Example: find the equation of the line through (4, −1) and (4, 6).
- Both points have x = 4.
- The line is vertical.
- x = 4
Remember
y = 3 is a horizontal line, even though it has y in it: every point on it has y-coordinate 3.