Skip to content
IB Diploma ProgrammeSL & HL

Equations of straight lines

Mathematics: Applications and Interpretation SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Equations of straight lines notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Equations of straight lines notes as text: skim, search, and jump between subtopics.

~13 min read

1. Gradient and intercepts

The gradient of a line is the change in y divided by the change in x between any two of its points.

A positive gradient rises from left to right. A negative gradient falls. A horizontal line has gradient 0. Real gradients, such as a mountain road or a bridge, are the vertical rise divided by the horizontal distance.

The y-intercept is where the line crosses the y-axis, so x = 0. The x-intercept is where it crosses the x-axis, so y = 0. The command term “show that” needs every step and ends at the value given in the question.

m = (y₂ - y₁)/(x₂ - x₁)

m = (vertical rise)/(horizontal distance)

Worked example 12 marks

A swimming pool has a shallow end where the depth of the water is 1.2 m and a deep end where the depth of the water is 2.0 m. In a cross-section of the water, the pool is 7.5 m long. The floor is horizontal for 3.0 m at the deep end and for 1.8 m at the shallow end, with a straight sloped floor between them.

A safety regulation states that the gradient of the sloped floor of the swimming pool must not be greater than 1/3.

Show that the swimming pool satisfies the safety regulation.

  1. 1

    rise = 2.0 - 1.2 = 0.8 m, horizontal distance = 7.5 - 3.0 - 1.8 = 2.7 m, so gradient = 0.8/2.7 = 0.296 (0.296296…) or 8/27 A1 [1]

  2. 2

    0.296 < 1/3 (0.333333) or 8/27 < 9/27 R1 [1]

  3. 3

    the gradient of the pool is less than the gradient in the regulation, so the swimming pool satisfies the safety regulation AG

2. Gradient-intercept and general form

A line can be written as y = mx + c, the gradient-intercept form. Here m is the gradient and c is the y-intercept.

The general form is ax + by + d = 0. To read its gradient, rearrange it to make y the subject. Then compare it with y = mx + c. For the x-intercept, put y = 0 and solve for x.

y = mx + c

ax + by + d = 0 ⇒ y = -a/bx - d/b

Worked example 14 marks

A line has equation 3x - 4y + 12 = 0. Find the gradient of the line and the coordinates of the points where the line crosses the x-axis and the y-axis.

  1. 1

    rearrange: 4y = 3x + 12, so y = 3/4x + 3 (M1) [1]

  2. 2

    gradient = 3/4 (A1) [1]

  3. 3

    y-intercept: x = 0 gives y = 3, so (0, 3) (A1) [1]

  4. 4

    x-intercept: y = 0 gives 3x + 12 = 0, so (-4, 0) (A1) [1]

3. Point-gradient form

If you know the gradient m and one point (x₁, y₁) on the line, write the point-gradient form. Substitute the numbers, then rearrange to the form the question asks for.

If you know two points, find the gradient first. Then use either point in y - y₁ = m(x - x₁).

In the hat question below, C(n) = np - 5n + 75 = (p - 5)n + 75 is a straight line in n. Each hat after the first 15 adds p - 5 to the cost, so p - 5 is the gradient.

y - y₁ = m(x - x₁)

m = (y₂ - y₁)/(x₂ - x₁)

Worked example 13 marks

A manufacturer designs hats that businesses can order.

For an order of 15 hats or fewer, the price per hat is p euros (EUR). For larger orders, the price of each hat after the first 15 ordered is reduced by 5 EUR.

C(n) represents the total cost of purchasing n hats from the manufacturer.

Write down an equation for C(n), in terms of p and n, for the total cost of ordering n hats when n > 15.

  1. 1

    (p - 5) or (n - 15) seen A1 [1]

  2. 2

    adding a cost expression (multiplying a p term and an n term) to their 15p (M1) [1]

  3. 3

    C(n) = 15p + (p - 5)(n - 15) or C(n) = np - 5n + 75 (or equivalent) A1 [1]

4. Parallel lines

Two lines are parallel when they have the same gradient. They never meet.

So if line l₁ has gradient m₁ and line l₂ has gradient m₂, then m₁ = m₂.

To find a line parallel to a given line, first find the given gradient. Rearrange a general-form equation if you need to. Then use the point-gradient form with the new point.

m₁ = m₂

Worked example 14 marks

The line l₁ has equation 4x - 2y + 7 = 0. The line l₂ is parallel to l₁ and passes through the point (3, -1). Find the equation of l₂ in the form y = mx + c.

  1. 1

    rearrange l₁: 2y = 4x + 7, so y = 2x + 7/2 (M1) [1]

  2. 2

    gradient of l₁ = 2, so the gradient of l₂ = 2 (A1) [1]

  3. 3

    y - (-1) = 2(x - 3) (M1) [1]

  4. 4

    y = 2x - 7 (A1) [1]

5. Perpendicular lines and bisectors

Two lines are perpendicular when they meet at a right angle. Their gradients multiply to -1.

To find the perpendicular gradient, turn the gradient upside down and change its sign. A gradient of -1/8 becomes 8.

The perpendicular bisector of a segment passes through its midpoint. It is perpendicular to the segment, so its gradient is the negative reciprocal of the segment's gradient. Use the midpoint formula first, then the point-gradient form.

m₁ × m₂ = -1

midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2)

Worked example 16 marks

The edge between fire stations B and C of a Voronoi diagram is the perpendicular bisector of [BC]. Fire station B has coordinates (16, 12) and fire station C has coordinates (8, 13).

(i) Find the midpoint of [BC].

(ii) Find the gradient of the perpendicular bisector of [BC].

(iii) Hence find the equation of the edge between sites B and C.

  1. 1

    (i) attempt to substitute any given coordinates into the midpoint formula (M1) [1]

  2. 2

    ((16 + 8)/2, (12 + 13)/2) = (12, 12.5), with the parentheses written A1 [1]

  3. 3

    (ii) attempt to find the gradient of BC using the coordinates of B and C (M1) [1]

  4. 4

    gradient of BC = (12 - 13)/(16 - 8) = -1/8 = -0.125 (A1) [1]

  5. 5

    gradient of the perpendicular = 8 A1 [1]

  6. 6

    (iii) 8(x - 12) = y - 12.5, or y = 8x - 83.5 A1 [1]

Recap

  • Gradient: m = (y₂ - y₁)/(x₂ - x₁). Use the same order for the top and the bottom.
  • Gradient-intercept form: y = mx + c. The gradient is m and the y-intercept is c.
  • General form: ax + by + d = 0. Rearrange it to y = mx + c to read the gradient, which is -a/b.
  • Point-gradient form: y - y₁ = m(x - x₁). Use it when you know one point and the gradient.
  • Intercepts: set x = 0 for the y-intercept and y = 0 for the x-intercept.
  • Parallel lines have equal gradients: m₁ = m₂.
  • Perpendicular lines have gradients that multiply to -1: m₁ × m₂ = -1. Flip the fraction and change the sign.
  • Keep units the same when finding a gradient from a real situation, and give the answer in the form the question asks for.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State the gradient of the line y = 4 - 3x. A. -3 B. 3 C. 4 D. -41 mark
    Answer
    1. The gradient is the coefficient of x, so the answer is A, -3.

    Trap: The constant 4 is the y-intercept, not the gradient, and writing the x term second does not change its sign.

  2. Calculate the gradient of the line through (-2, 7) and (4, -5).2 marks
    Answer
    1. m = (-5 - 7)/(4 - (-2)).
    2. m = (-12)/6 = -2.

    Trap: Writing 4 - 2 for 4 - (-2) gives (-12)/2 = -6: take care with the double negative.

  3. A mountain road climbs 150 m over a horizontal distance of 2.5 km. Calculate the gradient of the road.2 marks
    Answer
    1. 2.5 km = 2500 m.
    2. gradient = 150/2500 = 0.06.

    Trap: Dividing 150 by 2.5 mixes metres with kilometres and gives 60.

  4. A line has equation 5x + 2y - 10 = 0. Find its gradient and the coordinates of the points where it crosses the y-axis and the x-axis.4 marks
    Answer
    1. 2y = -5x + 10, so y = -5/2x + 5.
    2. Gradient = -5/2.
    3. y-intercept: x = 0 gives (0, 5).
    4. x-intercept: y = 0 gives 5x = 10, so (2, 0).

    Trap: Reading the gradient as 5 or 5/2 straight from the general form loses the minus sign: moving 5x across changes its sign.

  5. Find the equation of the line with gradient -2 that passes through (3, 5). Give your answer in the form y = mx + c.3 marks
    Answer
    1. y - 5 = -2(x - 3).
    2. y - 5 = -2x + 6.
    3. y = -2x + 11.

    Trap: Writing y - 5 = -2(x + 3) changes the sign of x₁ and gives c = -1.

  6. The line l passes through (1, 4) and is parallel to the line 6x - 3y + 5 = 0. Find the equation of l in the form ax + by + d = 0, where a, b and d are integers.3 marks
    Answer
    1. 3y = 6x + 5, so y = 2x + 5/3 and the gradient is 2.
    2. y - 4 = 2(x - 1), so y = 2x + 2.
    3. 2x - y + 2 = 0.

    Trap: Taking the gradient as 6 from the coefficient of x, or stopping at y = 2x + 2 when general form is asked.

  7. Show that the lines y = 3x - 2 and x + 3y - 9 = 0 are perpendicular.3 marks
    Answer
    1. The gradient of y = 3x - 2 is 3.
    2. 3y = -x + 9, so y = -1/3x + 3 and the gradient is -1/3.
    3. 3 × (-1/3) = -1, so the lines are perpendicular.

    Trap: A product of 1 (the reciprocal only) or only a change of sign does not prove perpendicular: the product must be -1.

  8. A taxi charges a fixed fee plus a charge for each kilometre. The cost C dollars of a journey of d km is modelled by a straight line. Two journeys are recorded. (a) Find an equation for C in terms of d. [2] (b) Interpret, in context, the gradient and the C-intercept. [2] (c) Calculate the cost of a 15 km journey. [1] | Distance, d (km) | Cost, C (dollars) | | --- | --- | | 4 | 11 | | 10 | 23 |5 marks
    Answer
    1. (a)
    2. m = (23 - 11) ÷ (10 - 4) = 12 ÷ 6 = 2.
    3. 11 = 2 × 4 + c, so c = 3 and C = 2d + 3.
    4. (b)
    5. The gradient 2 is the charge of 2 dollars for each kilometre.
    6. The C-intercept 3 is the fixed fee of 3 dollars.
    7. (c)
    8. C = 2 × 15 + 3 = 33 dollars.

    Trap: Dividing the change in distance by the change in cost gives 0.5, and reading c as the cost per kilometre swaps the two ideas.

  9. On a plan of a park, coordinates are in metres. A straight path joins gate A(-1, 2) to gate B(5, 6). A hedge is planted along the perpendicular bisector of [AB]. (a) Find the equation of the hedge. Give your answer in the form ax + by + d = 0, where a, b and d are integers. [5] (b) The hedge meets a wall along the x-axis at W. Find the coordinates of W. [2]7 marks
    Answer
    1. (a)
    2. Midpoint of [AB] = ((-1 + 5)/2, (2 + 6)/2) = (2, 4).
    3. Gradient of AB = (6 - 2)/(5 - (-1)) = 4/6 = 2/3.
    4. Gradient of the hedge = -3/2, since 2/3 × (-3/2) = -1.
    5. y - 4 = -3/2(x - 2).
    6. Multiply both sides by 2: 2y - 8 = -3x + 6, so 3x + 2y - 14 = 0.
    7. (b)
    8. Put y = 0: 3x - 14 = 0, so x = 14/3.
    9. W is (14/3, 0), or (4.67, 0) to three significant figures.

    Trap: Using the gradient of AB, 2/3, for the hedge, or multiplying only one side by 2 when clearing the fraction, gives a wrong general form and a wrong W.

  10. In a cross-section of a hill road, x is the horizontal distance in kilometres and h is the height above sea level in metres. The road is the line 60x - h + 150 = 0 for 0 ≤ x ≤ 3. (a) Write down the height of the road at x = 0. [1] (b) Show that the gradient of the road, as an incline, is 0.06. [3] (c) A cycle path is parallel to the road and passes through the point x = 0.5, h = 100. Find its equation in the form h = mx + c, with x in km and h in m. [2] (d) The gradient of a cycle path, as an incline, must not be greater than 0.1. Determine whether this cycle path meets the rule. Justify your answer. [2]8 marks
    Answer
    1. (a)
    2. Put x = 0: -h + 150 = 0, so h = 150 m.
    3. (b)
    4. Rearrange: h = 60x + 150, so the height rises 60 m for each 1 km travelled horizontally.
    5. 1 km = 1000 m, so gradient = 60/1000 = 0.06.
    6. (c)
    7. Parallel, so in these units m = 60: h - 100 = 60(x - 0.5).
    8. h = 60x + 70.
    9. (d)
    10. The cycle path is parallel to the road, so its gradient as an incline is 0.06.
    11. 0.06 < 0.1, so the cycle path meets the rule.

    Trap: The gradient 60 is in metres per kilometre: comparing 60 with 0.1 gives the wrong verdict, and using 0.06 in part (c), where x is in kilometres, gives the wrong equation.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
midpoint = 12, 12.5 (parentheses left out, awarded A0)midpoint = (12, 12.5), written as a coordinate pair in parentheses
gradient = 0.296, with no comparison made0.296 < 1/3, so the pool satisfies the safety regulation
total cost = 2570 EUR, when the question asks for the exact costtotal cost = 2573 EUR, the exact value
p = 30, when the question asks for two decimal placesp = 29.98 EUR, written to 2 decimal places

Frequently asked questions

How do I find the gradient of a line through two points?
Use m = (y₂ - y₁)/(x₂ - x₁), with the same order of points on the top and the bottom. For (-2, 7) and (4, -5), m = (-5 - 7)/(4 - (-2)) = -2. A positive gradient rises from left to right, and a horizontal line has gradient 0. The gradient is the vertical rise divided by the horizontal distance.
How do I find the gradient and intercepts from the general form ax + by + d = 0?
Rearrange the equation to y = mx + c. The gradient is -a/b. For 3x - 4y + 12 = 0, y = 3/4x + 3, so the gradient is 3/4. Set x = 0 to find the y-intercept, (0, 3), and set y = 0 to find the x-intercept, (-4, 0).
How do I find the equation of a line through a point with a given gradient?
Use the point-gradient form y - y₁ = m(x - x₁), then rearrange to the form the question asks for. For gradient -2 through (3, 5), y - 5 = -2(x - 3), so y = -2x + 11. If you know two points instead, find the gradient first, using m = (y₂ - y₁)/(x₂ - x₁).
How do I tell whether two lines are parallel or perpendicular?
Parallel lines have equal gradients, so m₁ = m₂. Perpendicular lines have gradients that multiply to -1. For y = 3x - 2 and x + 3y - 9 = 0, the gradients are 3 and -1/3, and 3 × (-1/3) = -1, so the lines are perpendicular. A product of 1 alone does not prove perpendicular.
How do I find the perpendicular bisector of a line segment?
Find the midpoint with ((x₁ + x₂)/2, (y₁ + y₂)/2), then find the gradient of the segment and take the negative reciprocal. For A(-1, 2) and B(5, 6), the midpoint is (2, 4) and the gradient of AB is 2/3. The bisector has gradient -3/2, which gives 3x + 2y - 14 = 0.
What mistakes do students make with gradients and units?
Units are a common trap. A road climbing 150 m over 2.5 km has gradient 150/2500 = 0.06, because kilometres must become metres first. Dividing 150 by 2.5 mixes the two units and gives 60. Also, the constant in y = mx + c is the intercept, not the gradient. In y = 4 - 3x the gradient is -3, and the sign is kept.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters