Writing the equation of a line
What this lesson covers
- The form y − y₁ = m(x − x₁) needs one point and a gradient.
- Two points give the gradient first.
- Rearranging to y = mx + c shows the gradient and the y-intercept.
The point and gradient form
- For a line through (x₁, y₁) with gradient m, write y − y₁ = m(x − x₁).
- Expand and tidy to reach y = mx + c, where m is the gradient and c is the y-intercept.
Gradient 3 through (2, 5)
- Put the numbers straight into the form.
- y − 5 = 3(x − 2)
- y − 5 = 3x − 6expand
- y = 3x − 1add 5
Try it: gradient and intercept
Through (1, 4) and (3, 10)
- Two points give the gradient, then either point finishes it.
- m = (10 − 4) ÷ (3 − 1) = 3
- y − 4 = 3(x − 1)
- y = 3x + 1
Reading a line in general form
- Rearrange 2x + 3y = 12 to see its gradient.
- 3y = −2x + 12
- y = −(2/3)x + 4gradient −2/3, y-intercept 4
Reading the line
- In y = 3x − 1, the line crosses the y-axis at −1 and rises 3 for each 1 across.
Graphing calculator
General form
- Write y = x/2 + 2 in the form ax + by + c = 0.
- 2y = x + 4multiply by 2
- x − 2y + 4 = 0
Try it: lines through a point
Common mistakes
- Reading the gradient of 2x + 3y = 12 as 2.Make y the subject first; the gradient is −2/3.
- Forgetting to multiply the negative in y − 5 = −2(x − 3).The bracket expands to −2x + 6.
Your turn
State the gradient of y = −2x + 5.
Find the line with gradient 2 through (1, 3).
Find the gradient of 4x + 2y = 6.
Find the y-intercept of 3x − y = 6.
Show answer
1. −2 2. y = 2x + 1 3. y = −2x + 3, so −2 4. y = 3x − 6, so −6
Sample question: Achieved
Find the equation of the line through (−2, 7) and (4, −5) in the form y = mx + c.
Hint
Find the gradient from the two points, then put it and one point into y − y₁ = m(x − x₁).
Answer
y = −2x + 3
Step by step
- Two points give the gradient first: m = (y₂ − y₁) ÷ (x₂ − x₁).
- m = (−5 − 7) ÷ (4 − (−2)) = −12 ÷ 6 = −2.
- Use the point and gradient form with (−2, 7): y − 7 = −2(x − (−2)) = −2(x + 2).
- Expand: y − 7 = −2x − 4.
- Add 7 to both sides: y = −2x + 3.
- Classic mistake: x − (−2) written as x − 2. Two minus signs make a plus.
- Check with the other point: x = 4 gives y = −8 + 3 = −5. Correct.
Full working
- m = −5 − 74 + 2 = −2rise over run
- y − 7 = −2(x + 2)point and gradient form
- y − 7 = −2x − 4
- y = −2x + 3
Sample questions: Merit
Line L passes through (3, −1) and has the same y-intercept as the line 2x − 5y = 20. Find L in the form ax + by + c = 0.
Hint
Put x = 0 into 2x − 5y = 20 to find the shared y-intercept. That gives you a second point on L.
Answer
x − y − 4 = 0
Step by step
- The y-intercept is where x = 0. Put x = 0 into 2x − 5y = 20: −5y = 20, so y = −4.
- So L also goes through (0, −4). Now L has two points: (0, −4) and (3, −1).
- Gradient of L: (−1 − (−4)) ÷ (3 − 0) = 3 ÷ 3 = 1.
- The y-intercept is −4 and the gradient is 1, so y = x − 4.
- General form means everything on one side, equal to zero: x − y − 4 = 0.
- Classic mistake: taking the gradient of 2x − 5y = 20 as well. The question only shares the intercept, not the slope.
- Check: (3, −1) gives 3 − (−1) − 4 = 0, and (0, −4) gives 0 + 4 − 4 = 0. Both lie on L.
Full working
- x = 0: −5y = 20, so y = −4y-intercept of the given line
- m = −1 + 43 − 0 = 1through (0, −4) and (3, −1)
- y = x − 4y = mx + c with c = −4
- x − y − 4 = 0
The line through A(1, 5) and B(4, −1) crosses the x-axis at P and the y-axis at Q. Find the exact length PQ.
Hint
Find the equation of AB first. Then P has y = 0 and Q has x = 0.
Answer
PQ = √61.25 = 7√52 ≈ 7.83 units
Step by step
- To find where a line crosses the axes you need its equation, so start there.
- Gradient AB = (−1 − 5) ÷ (4 − 1) = −6 ÷ 3 = −2.
- Through A(1, 5): y − 5 = −2(x − 1), so y = −2x + 7.
- Q is on the y-axis, where x = 0: y = 7. So Q = (0, 7). That is just the y-intercept.
- P is on the x-axis, where y = 0: 0 = −2x + 7, so x = 3.5. So P = (3.5, 0).
- PQ by the distance formula: √(3.5² + 7²) = √(12.25 + 49) = √61.25.
- Exact form: 61.25 = 2454 = 49 × 5 ÷ 4, so √61.25 = 7√52 ≈ 7.83.
- Classic mistake: putting y = 0 in to find Q. The y-axis is where x = 0.
- Check: both A and B fit y = −2x + 7: 5 = −2 + 7 and −1 = −8 + 7.
Full working
- m = −1 − 54 − 1 = −2
- y = −2x + 7through A(1, 5)
- Q = (0, 7), P = (3.5, 0)x = 0, then y = 0
- PQ = √(3.5² + 7²) = √61.25
- PQ = 7√52 ≈ 7.83
Sample questions: Excellence
A line with negative gradient m passes through P(2, 3) and cuts the positive x-axis at A and the positive y-axis at B. Show that the area of triangle OAB is (3 − 2m)²−2m. Hence find the line that makes the area 12.
Hint
Write the line as y − 3 = m(x − 2), find both intercepts in terms of m, and use ½ × base × height.
Answer
Area = (3 − 2m)²−2m; area 12 gives m = −32, so the line is y = −(32)x + 6
Step by step
- Start with the point and gradient form: y − 3 = m(x − 2).
- B is on the y-axis, so put x = 0: y = 3 − 2m. That is the height of the triangle.
- A is on the x-axis, so put y = 0: −3 = m(x − 2), so x = 2 − 3m. That is the base.
- Tidy the base over one denominator: 2 − 3m = 2m − 3m.
- Area = ½ × base × height = ½ × 2m − 3m × (3 − 2m).
- Note 2m − 3 = −(3 − 2m), so the area is −(3 − 2m)²2m = (3 − 2m)²−2m. That is what we had to show.
- "Hence": set it equal to 12: (3 − 2m)² = −24m.
- Expand: 9 − 12m + 4m² = −24m, so 4m² + 12m + 9 = 0.
- This factorises as (2m + 3)² = 0, so m = −32. A repeated root means exactly one line gives area 12.
- The line: y − 3 = −(32)(x − 2), so y = −(32)x + 6.
- Check: it cuts the axes at A(4, 0) and B(0, 6), and ½ × 4 × 6 = 12. Correct.
Full working
- y − 3 = m(x − 2)point and gradient form
- x = 0: OB = 3 − 2mheight
- y = 0: OA = 2 − 3m = 2m − 3mbase
- area = ½ × 2m − 3m × (3 − 2m) = (3 − 2m)²−2mshown
- (3 − 2m)² = −24m, so 4m² + 12m + 9 = 0set the area to 12
- (2m + 3)² = 0, so m = −32one repeated root
- y = −(32)x + 6
Triangle ABC has A(0, 0), B(8, 0) and C(2, 6). A median joins a corner to the midpoint of the opposite side. Find the equations of the medians from C and from A, find where they meet, and prove that the third median also passes through that point.
Hint
Find each midpoint, then each line. Solve two of the lines together, then substitute the point into the third.
Answer
Medians y = −3x + 12 and y = (35)x meet at (103, 2); the median from B, y = −(37)(x − 8), also passes through (103, 2)
Step by step
- A median needs a corner and the midpoint of the opposite side. So find the midpoints first.
- Midpoint of AB is (4, 0). Midpoint of BC is (5, 3). Midpoint of AC is (1, 3).
- Median from C(2, 6) to (4, 0): gradient (0 − 6) ÷ (4 − 2) = −3, so y − 0 = −3(x − 4), which is y = −3x + 12.
- Median from A(0, 0) to (5, 3): gradient 35 through the origin, so y = (35)x.
- They meet where the y values agree: (35)x = −3x + 12. Multiply by 5: 3x = −15x + 60, so 18x = 60 and x = 103.
- Then y = (35) × (103) = 2. They meet at (103, 2).
- Median from B(8, 0) to (1, 3): gradient (3 − 0) ÷ (1 − 8) = −37, so y = −(37)(x − 8).
- Test the point: x = 103 gives x − 8 = −143, and −(37) × (−143) = 2. So y = 2, and the third median passes through (103, 2) too.
- All three medians meet at one point. Notice it is the average of the corners: ((0 + 8 + 2) ÷ 3, (0 + 0 + 6) ÷ 3) = (103, 2).
- Classic mistake: drawing the median to a corner instead of to a midpoint. A median always ends at a midpoint.
Full working
- midpoints: AB (4, 0), BC (5, 3), AC (1, 3)
- median from C: m = −3, y = −3x + 12
- median from A: y = (35)x
- (35)x = −3x + 12, so x = 103, y = 2solve together
- median from B: y = −(37)(x − 8)through (8, 0) and (1, 3)
- x = 103: y = −(37) × (−143) = 2the point fits
- all three medians meet at (103, 2)
What to take away
- One point and a gradient fix a line.
- Make y the subject before reading the gradient.
Practise this
Report a mistake
More in AS 91256
Is your child on track?
Take the free placement test