M4.8.4 Chapter 4
Equations of straight lines
A straight line goes through (1, 3) and (4, 9). How do I find its equation?
Your guess
Pick one before you read on. It is fine to be wrong.
By the end you can
- Find the equation of a line through two points
- Spot parallel and perpendicular lines from their gradients
A path goes from the point A (1, 3) to the point B (4, 9). Going across, it climbs. How steep is it? Count the steps across, and count how far it goes up.
Draw it first
Rise over run
1 Draw the line through A and B.
2 From A go across to the right until you are below B. This is the run: 4 − 1 = 3.
3 Then go up to B. This is the rise: 9 − 3 = 6.
The gradient is how steep the line is. It is the rise divided by the run: 6 ÷ 3 = 2. For the points (x₁, y₁) and (x₂, y₂), the gradient is m = (y₂ − y₁)/(x₂ − x₁). Take the points in the same order on the top and the bottom.
The equation of a straight line is y = mx + c. The number m is the gradient. The number c is where the line crosses the y axis. For our line m = 2, so y = 2x + c. To find c, put in the coordinates of any point on the line.
Worked example
Find the equation of the line through (1, 3) and (4, 9).
- Gradient: m = (9 − 3)/(4 − 1) = 6/3 = 2.
- The line is y = 2x + c.
- Put in the point (1, 3): 3 = 2 × 1 + c, so c = 1.
- The equation is y = 2x + 1.
- Check with the other point (4, 9): 2 × 4 + 1 = 9.
Answer: y = 2x + 1
A line that goes down as you move right has a negative rise. Its gradient is negative. From J (2, 7) to K (5, 1) the run is 3 and the rise is −6, so the gradient is −2.
Worked example
Find the equation of the line through (2, 7) and (5, 1).
- Rise: 1 − 7 = −6. Run: 5 − 2 = 3.
- Gradient: m = −6/3 = −2. The line falls, so the gradient is negative.
- The line is y = −2x + c. Put in the point (2, 7): 7 = −2 × 2 + c, so c = 11.
- The equation is y = −2x + 11.
- Check with (5, 1): −2 × 5 + 11 = 1.
Answer: y = −2x + 11
Two lines are parallel when they never meet. Parallel lines go up at the same rate, so they have the same gradient. Lines with the same gradient and different values of c are parallel.
Two lines are perpendicular when they cross at a right angle. Their gradients multiply to give −1. To see why, take a step "across 2, up 1" along a line through the origin. A quarter turn about the origin sends it to "across −1, up 2". The first line has gradient 1/2 and the turned line has gradient −2.
In general, a step "across a, up b" turns into "across −b, up a". The gradients are b/a and −a/b, and their product is −1. This works when neither line is upright. An upright line has no gradient, and it is perpendicular to a flat line.
Worked example
A line has the equation y = −2x + 5. Find the line perpendicular to it through (4, 5).
- The first line has gradient −2. For perpendicular lines the gradients multiply to give −1.
- So −2 × m = −1, which gives m = 0.5.
- The new line is y = 0.5x + c. It passes through (4, 5).
- Put in x = 4 and y = 5: 5 = 0.5 × 4 + c, so 5 = 2 + c.
- So c = 5 − 2 = 3, and the line is y = 0.5x + 3.
- Check: the point (4, 5) gives 0.5 × 4 + 3 = 5. And −2 × 0.5 = −1.
Answer: y = 0.5x + 3
See it three ways
With things
A ramp starts 2 metres up a wall and reaches 8 metres at 2 metres across. How steep is it, and what is its rule?
As a picture
In words
The line starts at 2 on the y axis. For every 2 across it goes up 6, so for every 1 across it goes up 3.
In symbols
m = (8 − 2)/(2 − 0) = 3 and c = 2, so y = 3x + 2.
Try it
Find a line from two points
You need: squared paper, a ruler, a pencil.
- Plot the points (2, 2) and (6, 5) and draw the line through them.
- Mark the run from the first point across to the right. Count it: 4.
- Mark the rise up to the second point. Count it: 3. Write the gradient, 3 ÷ 4.
What you will see: The gradient is 0.75. Where the line meets the y axis you can read c = 0.5, so the equation is y = 0.75x + 0.5.
A wrong idea many people have
A line perpendicular to a line with gradient 2 has gradient −2.
Why it feels right: Perpendicular lines point in opposite directions, so the opposite number feels right.
The test that breaks it: Take y = 2x and y = −2x. Their gradients multiply to 2 × (−2) = −4, not −1. Drawn on squared paper, the two lines do not meet at a right angle. The line y = −0.5x does.
What is true: Perpendicular gradients multiply to −1. Turn the number upside down and change its sign: 2 becomes −1/2, which is −0.5.
A wrong idea many people have
The gradient is the run divided by the rise.
Why it feels right: Both numbers are on the picture, so the order feels like a choice.
The test that breaks it: The line y = 2x goes up 2 for every 1 across. Run ÷ rise gives 1 ÷ 2 = 0.5, but the steep line has gradient 2.
What is true: The gradient is the rise divided by the run. A steeper line has a bigger gradient.
Key words
- gradient
- how steep a line is: the rise divided by the run, m = (y₂ − y₁)/(x₂ − x₁).
- parallel
- lines that never meet. They have the same gradient.
- perpendicular
- lines that cross at a right angle. Their gradients multiply to give −1.
Back to your guess
The answer is C: y = 2x + 1, because it goes up 2 for every 1 across.
The line rises 6 while it runs 3 across, so the gradient is 6 ÷ 3 = 2. Putting the point (1, 3) into y = 2x + c gives c = 1. The equation is y = 2x + 1.
Check yourself
Try each one before you look. A wrong answer tells you where to go next.
What is the gradient of the line through C and D?
See the answer
−2
The rise is 1 − 7 = −6 and the run is 4 − 1 = 3. The gradient is −6 ÷ 3 = −2.
- If you chose A: The line goes down as you move right, so the gradient is negative. Check the sign of the rise. Go to M4.8.4.
- If you chose B: You divided the run by the rise. The gradient is the rise divided by the run: −6 ÷ 3. Go to M4.8.4.
- If you chose C: That is the rise alone. Divide it by the run, 3, to get the steepness for each 1 across. Go to M4.8.4.
Find the equation of the line through (1, 4) and (3, 10).
See the answer
y = 3x + 1
The gradient is (10 − 4)/(3 − 1) = 6/2 = 3. Put in (1, 4): 4 = 3 × 1 + c, so c = 1. Check (3, 10): 3 × 3 + 1 = 10.
- If you chose A: You used 4, the y of the first point, as c. The number c is where the line crosses the y axis. Put x = 1 and y = 4 into y = 3x + c to find it. Go to M4.8.4.
- If you chose C: The rise is 6, but the gradient is the rise divided by the run, 6 ÷ 2 = 3. Go to M4.8.4.
- If you chose D: From 4 = 3 + c you took 4 from 3. Take 3 from 4 instead: c = 1. Check (1, 4): 3 × 1 − 1 = 2, not 4. Go to M4.8.4.
Which line is parallel to y = 4x − 5?
See the answer
y = 4x + 7
Parallel lines have the same gradient. Only y = 4x + 7 has gradient 4. Its c is different, so the lines never meet.
- If you chose B: This line has the same c, so it meets the first line on the y axis. Parallel lines need the same gradient, 4. Go to M4.8.4.
- If you chose C: Its gradient times 4 is −1, so this line is perpendicular, not parallel. Go to M4.8.4.
- If you chose D: The numbers are swapped. The gradient is now 5, not 4, so the lines are not parallel. Go to M4.8.4.
Which line is perpendicular to y = 2x + 3?
See the answer
y = −0.5x + 1
Perpendicular gradients multiply to −1. 2 × (−0.5) = −1, so y = −0.5x + 1 is perpendicular. The c can be any number.
- If you chose A: The gradients 2 and −2 multiply to −4. For perpendicular lines the product must be −1. Go to M4.8.4.
- If you chose B: You turned the gradient upside down but kept the sign. 2 × 0.5 = 1, not −1. Go to M4.8.4.
- If you chose D: The gradients 2 and −3 multiply to −6. The product must be −1. Go to M4.8.4.
Line P has gradient 2. Line Q is perpendicular to P. What is the gradient of Q?
See the answer
−0.5
The gradients multiply to −1, so 2 × m = −1 and m = −1 ÷ 2 = −0.5.
- If you chose A: That is the gradient of a parallel line. Perpendicular lines have gradients that multiply to −1. Go to M4.8.4.
- If you chose B: 2 × (−2) = −4, not −1. Turn 2 upside down as well as changing its sign. Go to M4.8.4.
- If you chose C: 2 × 0.5 = 1, not −1. You turned the number upside down but kept the sign. Go to M4.8.4.
The graph shows a line through A and B. Which is its equation?
See the answer
y = −2x + 5
The line crosses the y axis at A, so c = 5. The gradient is (1 − 5)/(2 − 0) = −4/2 = −2. So y = −2x + 5.
- If you chose A: The line goes down as you move right, so its gradient is negative. Go to M4.8.4.
- If you chose C: The number c is where the line crosses the y axis. That is at A, where y is 5, not 1. Go to M4.8.4.
- If you chose D: You divided the run by the rise. The gradient is the rise divided by the run: −4 ÷ 2. Go to M4.8.4.
Find the gradient of the line through (2, 3) and (6, 11).
See the answer
2
The rise is 11 − 3 = 8 and the run is 6 − 2 = 4. The gradient is 8 ÷ 4 = 2.
The line y = 3x + c passes through (2, 11). What is c?
See the answer
c = 5
Put x = 2 and y = 11 in y = 3x + c: 11 = 3 × 2 + c, so 11 = 6 + c and c = 5.
From an earlier chapter
Solve 4x − 3 < 13.
See the answer
x < 4
Add 3 to both sides: 4x < 16. Divide both sides by 4. The sign stays, because 4 is positive: x < 4.
- If you chose B: The sign flips only when you multiply or divide both sides by a negative number. Dividing by 4 keeps the sign. Go to M4.8.3.
- If you chose C: Adding 3 to both sides gives 4x < 16, which is right. But 4 still multiplies x, so divide both sides by 4 as well. Go to M4.8.3.
- If you chose D: You took 3 from the 13. The 3 is taken away on the left, so add 3 to both sides: 4x < 16. Go to M4.8.3.
Keep it
Copy this into your exercise book.
Gradient m = rise ÷ run. Put one point in y = mx + c to find c. Parallel: same m. Perpendicular: the m values multiply to −1.
Draw: A line through two points with a dashed run and rise, and y = 2x + 1 written beside it.