Practice Maths

Finding Equations of Lines

Key Ideas

Key Terms

gradient-intercept form
Of a line is y = mx + b, where m is the gradient and b is the y-intercept.
two points
(1) calculate m = (y2−y1)÷(x2−x1), (2) substitute one point and m into y = mx + b to find b.
Parallel lines
Have equal gradients (same m, different b). e.g. y = 2x + 1 and y = 2x − 5 are parallel.
Perpendicular lines
Have gradients whose product is −1: m1 × m2 = −1. The perpendicular gradient is the negative reciprocal: m2 = −1/m1.
x-intercept
Set y = 0 and solve for x.   y-intercept: set x = 0 and solve for y (or read off b directly).
Hot Tip For perpendicular gradients, flip the fraction and change the sign. If m = 3/4, the perpendicular gradient is −4/3. Always check: (3/4) × (−4/3) = −1. ✓

Parallel vs perpendicular lines

xy −2−11234 −4−22468 y=2x+1 y=2x−2 Same gradient m = 2 → parallel
xy −2−11234 −4−22468 y=2x+1 y=−½x+3 m₁×m₂=2×(−½)=−1 → perpendicular

Worked Example — Equation Through Two Points

Question: Find the equation of the line passing through (2, 1) and (4, 7).

Step 1 — Calculate the gradient.
m = (y2 − y1) ÷ (x2 − x1) = (7 − 1) ÷ (4 − 2) = 6 ÷ 2 = 3

Step 2 — Substitute into y = mx + b using point (2, 1).
1 = 3(2) + b  ⇒  1 = 6 + b  ⇒  b = −5

Step 3 — Write the equation.
y = 3x − 5

Check with (4, 7): y = 3(4) − 5 = 12 − 5 = 7. ✓

Worked Example — Parallel and Perpendicular Lines

Question: A line has equation y = 2x + 5. Find the equation of: (a) a parallel line through (1, 3); (b) a perpendicular line through (1, 3).

(a) Parallel: Same gradient m = 2. Substitute (1, 3):   3 = 2(1) + b  ⇒  b = 1.   Equation: y = 2x + 1

(b) Perpendicular: Gradient = −1/2. Substitute (1, 3):   3 = −(1/2)(1) + b  ⇒  b = 3.5.   Equation: y = −½x + 3.5

Given Gradient and One Point

When you know the gradient m and one point on the line, finding the equation is a two-step process. Step 1: write the equation as y = mx + b, substituting the known gradient for m. Step 2: substitute the coordinates of the known point for x and y, then solve for b. For example, gradient = 3 and the point is (2, 7): write y = 3x + b, substitute to get 7 = 3(2) + b, so 7 = 6 + b, meaning b = 1. The equation is y = 3x + 1.

Given Two Points

When you are given two points, you need an extra step first. Step 1: calculate the gradient using m = (y2 − y1) / (x2 − x1). Step 2: substitute m and one of the two points into y = mx + b to find b. For example, for the points (1, 2) and (3, 8): m = (8 − 2) / (3 − 1) = 6/2 = 3. Then use (1, 2): 2 = 3(1) + b, so b = −1. The equation is y = 3x − 1. Check: substituting (3, 8): y = 3(3) − 1 = 8. ✓

Checking Your Equation

Always verify that your final equation satisfies both given points (if two points were provided) or the given point (if only one was given). Substitute each point's x-value into your equation and check that you get the correct y-value. This takes only a few seconds and immediately catches sign errors or arithmetic mistakes. If a check fails, look first at your value of b — errors in solving for b are the most common mistake in this type of question.

Key tip: When finding b, be careful with negative signs. If m = −4 and the point is (3, 5): write 5 = −4(3) + b, so 5 = −12 + b, giving b = 17. Students often write −4 × 3 = −12 correctly but then incorrectly move it across. Use the layout "b = y − mx" as a formula: b = 5 − (−4)(3) = 5 + 12 = 17.

Multiple Approaches

The gradient-intercept method (finding b by substitution) is the most commonly used in Year 9. There is also the point-slope form: y − y1 = m(x − x1), which some students find quicker as it avoids solving for b separately. Both methods give identical results. For example, using point-slope with m = 3 and point (2, 7): y − 7 = 3(x − 2), which expands to y = 3x − 6 + 7 = 3x + 1. Either method is acceptable in an exam.

When b Has a Fractional or Negative Value

The y-intercept b is not always a neat whole number. For example, the line through (1, 1) and (4, 2): m = (2 − 1) / (4 − 1) = 1/3. Then 1 = (1/3)(1) + b, so b = 1 − 1/3 = 2/3. The equation is y = (1/3)x + 2/3. This is perfectly fine — always leave it as a fraction rather than rounding, unless told otherwise. Check both points to confirm.

Mastery Practice

  1. Find the equation of the line passing through each pair of points. Write your answer in the form y = mx + b. Fluency

    1. (1, 5) and (3, 9)
    2. (0, 2) and (4, 10)
    3. (2, 7) and (6, 3)
    4. (−1, 1) and (3, 9)
    5. (0, −3) and (5, 7)
    6. (−2, 6) and (2, −2)
    7. (1, −4) and (4, 5)
    8. (3, 3) and (7, 7)
  2. Find the equation of the line with the given gradient passing through the given point. Give your answer in y = mx + b form. Fluency

    1. m = 3, through (1, 4)
    2. m = −2, through (3, 1)
    3. m = 5, through (0, −4)
    4. m = ½, through (2, 6)
    5. m = −¾, through (4, 0)
    6. m = 4, through (−1, −5)
  3. Find the x-intercept and y-intercept for each line equation. Fluency

    1. y = 2x − 6
    2. y = −3x + 9
    3. y = 4x + 8
    4. y = ½x − 2
    5. y = −x + 5
    6. y = 3x − 12
  4. Parallel and perpendicular lines. Understanding

    1. State the gradient of a line parallel to y = 4x − 3.
    2. State the gradient of a line perpendicular to y = 4x − 3.
    3. Find the equation of a line parallel to y = 3x + 1 passing through (2, 8).
    4. Find the equation of a line perpendicular to y = 3x + 1 passing through (3, 4).
    5. Find the equation of a line perpendicular to y = −2x + 5 passing through (−2, 1).
    6. Two lines are y = ⅔x + 4 and y = −&frac32;x − 1. Are they parallel, perpendicular, or neither? Explain.
  5. For each pair of lines defined by four points, find both equations and determine whether the lines are parallel, perpendicular, or neither. Understanding

    1. Line 1: (0, 1) and (2, 5).   Line 2: (1, 3) and (3, 7).
    2. Line 1: (0, 0) and (3, 6).   Line 2: (0, 4) and (6, 1).
    3. Line 1: (1, 2) and (4, 8).   Line 2: (0, 5) and (6, 3).
  6. Problem solving with equations of lines. Problem Solving

    1. A line passes through A(1, −2) and B(5, 6).
      1. Find the equation of line AB.
      2. Find the x-intercept of line AB.
      3. Find the equation of the line through B that is perpendicular to AB.
    2. A rectangle has one side along the line y = 2x − 1. An adjacent side passes through the point (3, 5). Find the equation of the adjacent side.
    3. Point P(k, 7) lies on the line through (1, 1) and (4, 7). Find the value of k.
    4. Two delivery routes are modelled by lines. Route A passes through depots at (0, 10) and (5, 0). Route B passes through (2, 3) and is parallel to Route A. Find the equation of each route. Do they ever meet? Explain.
  7. Lines through the origin and special lines. Problem Solving

    Recall. A line through the origin has equation y = mx (the y-intercept b = 0). Horizontal lines have equation y = k; vertical lines have equation x = c.
    1. Find the equation of the line through the origin and the point (4, 10).
    2. Find the equation of the line through the origin perpendicular to y = 3x.
    3. A line is horizontal and passes through (5, −2). Write its equation.
    4. A line is vertical and passes through (−3, 7). Write its equation.
    5. Do the three points (0, 0), (2, 5) and (6, 15) lie on the same line? Justify your answer by finding the equation of the line through (0, 0) and (2, 5), then checking whether (6, 15) satisfies it.
  8. Using geometric conditions to find line equations. Problem Solving

    1. Triangle ABC has vertices A(0, 0), B(6, 0) and C(3, 6).
      1. Find the equation of side AB.
      2. Find the equation of side AC.
      3. Find the equation of the line from B to the midpoint of AC.
    2. A line L1 passes through (1, 4) and (3, 8). A second line L2 is perpendicular to L1 and passes through (3, 8).
      1. Find the equation of L1.
      2. Find the equation of L2.
      3. Find the coordinates of the point where L2 crosses the y-axis.
  9. Finding intersection points. Problem Solving

    Method. To find where two lines intersect, set the two equations equal (since y is the same at the intersection) and solve for x, then substitute to find y.
    xy −112345 −2012345678 y=2x+1 y=−x+7 (2, 5)
    1. Find the point where y = 2x + 1 and y = −x + 7 intersect.
    2. Find the point where y = 3x − 5 and y = x + 3 intersect.
    3. Two lines have equations y = ½x + 4 and y = −2x − 1. Find their intersection point and verify it lies on both lines.
    4. Line A passes through (0, 6) and (3, 0). Line B passes through (0, 0) and (2, 4). Find the equations of both lines and determine their intersection point.
  10. Extended modelling problems. Problem Solving

    1. A road runs straight from town P(2, 3) to town Q(10, 11), where coordinates are in kilometres.
      1. Find the equation of this road.
      2. A water pipe runs perpendicular to the road and passes through the point R(8, 4). Find the equation of the pipe.
      3. Find the point where the pipe meets the road.
    2. Three points are A(0, 2), B(4, 10) and C(6, k).
      1. Find the equation of the line through A and B.
      2. Find the value of k such that C lies on this line.
      3. Find the value of k such that BC is perpendicular to AB.