Skip to content
IB Diploma ProgrammeSL & HL

Equations of straight lines

Mathematics: Analysis and Approaches 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.

~12 min read

1. Gradient and intercepts

The gradient of a line measures how steeply it rises. It is the vertical change divided by the horizontal change between any two points on the line. A line that goes up from left to right has a positive gradient. A line that goes down has a negative gradient.

For a road, bridge or mountain path, the gradient is the rise divided by the horizontal distance. Both lengths must be in the same unit before dividing.

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. Set the other coordinate to zero and solve.

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

y-intercept: x = 0 x-intercept: y = 0

Worked example 12 marks

A mountain road climbs from a point 340 m above sea level to a point 580 m above sea level. The horizontal distance between the two points is 1200 m. Calculate the gradient of the road.

  1. 1

    gradient = vertical change over horizontal change: (580 - 340)/1200 (M1) [1]

  2. 2

    = 240/1200 = 1/5 (A1) [1]

2. Gradient-intercept form

The gradient-intercept form is y = mx + c. The number m multiplying x is the gradient, with its sign. The constant c is the y-intercept, so the line passes through (0, c).

The form can be used backwards. A point on the line has coordinates that satisfy the equation, so substitute its x and y into y = mx + c. This gives one equation in the one unknown left over.

The command term 'determine' asks for one valid answer, with the working that reaches it. The markscheme below credits an attempt to substitute a known point.

y = mx + c

gradient m, y-intercept (0, c)

Worked example 13 marks

Consider the quadratic function f(x) = -(x + 2)(x - 4), for x ∈ R. The line y = mx + 4, where m ∈ R, intersects the graph of f at x = -2 and x = 2.(c) Determine the value of m.

  1. 1

    attempt to substitute x = -2 or x = 2 into f(x) = mx + 4 (M1) [1]

  2. 2

    -(-2 + 2)(-2 - 4) = -2m + 4 or -(2 + 2)(2 - 4) = 2m + 4, that is -2m + 4 = 0 or 2m + 4 = 8 (A1) [1]

  3. 3

    m = 2 A1 [1]

3. Point-gradient form

When you know the gradient and one point (x₁, y₁), write the point-gradient form straight down. It needs no c to be found first.

When you know two points, find the gradient first with the gradient formula. Then use either point in the point-gradient form. Both points give the same line.

Watch the signs when a coordinate is negative. For the point (-1, 4) the equation starts y - 4 = m(x - (-1)), which is y - 4 = m(x + 1).

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

Worked example 14 marks

A straight line passes through the points A(1, 2) and B(4, 11). Find the equation of the line in the form y = mx + c.

  1. 1

    attempt to find the gradient: m = (11 - 2)/(4 - 1) (M1) [1]

  2. 2

    m = 3 (A1) [1]

  3. 3

    point-gradient form with A: y - 2 = 3(x - 1) (M1) [1]

  4. 4

    y = 3x - 1 (A1) [1]

4. General form

The general form is ax + by + d = 0. Every straight line can be written this way, including a vertical line, which y = mx + c cannot show.

To find the gradient, rearrange to y = mx + c. Move ax and d to the right side, then divide by b. The gradient is -a/b and the y-intercept is -d/b.

When a question asks for the answer in general form, move every term to one side and clear fractions. Leave a, b and d as whole numbers if the question says so.

ax + by + d = 0

m = -a/b, c = -d/b

Worked example 14 marks

The line L has equation 3x + 4y - 12 = 0. Find the gradient of L and the coordinates of its x-intercept and y-intercept.

  1. 1

    rearrange to y = mx + c: 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, so (4, 0) (A1) [1]

5. Parallel lines

Parallel lines never meet. They have the same steepness, so they have equal gradients: m₁ = m₂. Their y-intercepts differ, or they would be the same line.

A question gives one line and a point, and asks for the parallel line through that point. Find the gradient of the first line. Keep that gradient. Use the new point in the point-gradient form.

If a line is in general form, rearrange it before reading off the gradient. The command term 'show that' needs every step, so state both gradients.

m₁ = m₂

Worked example 14 marks

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

  1. 1

    rearrange L₁: y = 2x + 3 (M1) [1]

  2. 2

    parallel lines have equal gradients, so the gradient of L₂ is 2 (A1) [1]

  3. 3

    point-gradient form: y - 6 = 2(x - 1) (M1) [1]

  4. 4

    y = 2x + 4 (A1) [1]

6. Perpendicular lines

Perpendicular lines meet at a right angle. Their gradients satisfy m₁ × m₂ = -1. So m₂ is the negative reciprocal of m₁: turn the fraction upside down and change the sign.

Two steps are needed, and both matter. A gradient of 3 becomes -1/3. A gradient of -2/5 becomes 5/2. Check by multiplying: the product must be -1.

When a perpendicular line, such as a normal to a curve, is needed, a markscheme credits recognizing the gradient is the negative reciprocal of (their) gradient. The word 'their' means the method mark is still given if the first gradient was wrong.

m₁ × m₂ = -1

m₂ = -1/m₁

Worked example 14 marks

The line L₁ has equation y = -2x + 5. The line L₂ is perpendicular to L₁ and passes through the point (4, 1). Find the equation of L₂ in the form y = mx + c.

  1. 1

    perpendicular: m₁ × m₂ = -1, so -2 × m₂ = -1 (M1) [1]

  2. 2

    m₂ = 1/2 (A1) [1]

  3. 3

    point-gradient form: y - 1 = 1/2(x - 4) (M1) [1]

  4. 4

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

Recap

  • Gradient: m = (y₂ - y₁)/(x₂ - x₁). Use the same unit for rise and run.
  • y-intercept: set x = 0. x-intercept: set y = 0.
  • Gradient-intercept form y = mx + c. Point-gradient form y - y₁ = m(x - x₁). General form ax + by + d = 0.
  • General form: gradient -a/b. Rearrange to check the sign.
  • Parallel lines: m₁ = m₂.
  • Perpendicular lines: m₁ × m₂ = -1, the negative reciprocal.
  • Give the final equation 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 = 3 - 2x.1 mark
    Answer
    1. -2 (A1)

    Trap: The 3 is the y-intercept. The gradient is the coefficient of x with its sign, so -2 and not 2 or 3.

  2. Do not use a calculator. The points A(-3, 4) and B(1, -2) lie on a line. Calculate the gradient of the line.2 marks
    Answer
    1. m = (-2 - 4)/(1 - (-3)) (M1)
    2. = (-6)/4 = -3/2 (A1)

    Trap: 1 - (-3) = 4, not -2. Subtract the coordinates in the same order on the top and the bottom.

  3. Do not use a calculator. The gradient of the line 2x + 5y - 10 = 0 is A. 2/5 B. -2/5 C. 2 D. -21 mark
    Answer
    1. B: 5y = -2x + 10, so y = -2/5x + 2.
    2. A drops the sign. C reads the coefficient of x in the general form. D forgets to divide by 5.

    Trap: In ax + by + d = 0 the gradient is -a/b, not a/b. Rearrange to y = mx + c to be sure.

  4. Do not use a calculator. A line has gradient 4 and passes through the point (-1, -3). Find the equation of the line in the form y = mx + c.2 marks
    Answer
    1. y - (-3) = 4(x - (-1)), so y + 3 = 4(x + 1) (M1)
    2. y = 4x + 1 (A1)

    Trap: Two negative coordinates give two plus signs. Writing y - 3 = 4(x - 1) uses the point (1, 3).

  5. A road climbs 156 m over a horizontal distance of 1.2 km. Calculate the gradient of the road. A second road has gradient 0.11. Determine which road is steeper.3 marks
    Answer
    1. 1.2 km = 1200 m (M1)
    2. gradient = 156/1200 = 0.13 (A1)
    3. 0.13 > 0.11, so the first road is steeper (A1)

    Trap: Dividing 156 by 1.2 gives 130, which mixes metres with kilometres. Convert before dividing.

  6. Do not use a calculator. A line passes through the points (2, 7) and (6, 3). Find the equation of the line in the form ax + by + d = 0, where a, b and d are integers.4 marks
    Answer
    1. m = (3 - 7)/(6 - 2) (M1)
    2. m = -1 (A1)
    3. y - 7 = -1(x - 2) (M1)
    4. x + y - 9 = 0 (A1)

    Trap: y = -x + 9 is correct but not in the form asked. Move every term to one side.

  7. Do not use a calculator. The line L₁ has equation 3x - 2y + 5 = 0 and the line L₂ has equation y = 1.5x - 4. Show that L₁ and L₂ are parallel.3 marks
    Answer
    1. -2y = -3x - 5, so y = 3/2x + 5/2 (M1)
    2. gradient of L₁ is 3/2 and gradient of L₂ is 1.5 = 3/2 (A1)
    3. equal gradients and different y-intercepts (5/2 and -4), so the lines are parallel and not the same line (R1)

    Trap: Here b = -2, so -a/b = -3/(-2) = 3/2. Reading the gradient as -3/2 loses the sign of b.

  8. Do not use a calculator. The line L₁ has equation 2x + 3y - 6 = 0. The line L₂ is perpendicular to L₁ and passes through the point (-4, 1). Find the equation of L₂ in the form y = mx + c.4 marks
    Answer
    1. 3y = -2x + 6
    2. y = -2/3x + 2, so m₁ = -2/3 (M1)
    3. m₂ = 3/2, since -2/3 × 3/2 = -1 (A1)
    4. y - 1 = 3/2(x + 4) (M1)
    5. y = 3/2x + 7 (A1)

    Trap: The negative reciprocal needs both changes: 2/3 changes only the sign, and -3/2 only turns the fraction over.

  9. Do not use a calculator. On a map with axes in kilometres, a straight pipeline passes through A(-2, 1) and B(6, 5). A well is at W(4, -4). A connecting pipe runs in a straight line from W and meets the pipeline at right angles at the point F. (a) Find the equation of the pipeline in the form y = mx + c. [2] (b) Find the coordinates of F. [5]7 marks
    Answer
    1. (a) m = (5 - 1)/(6 - (-2)) = 1/2 (M1)
    2. y - 1 = 1/2(x + 2), so y = 1/2x + 2 A1
    3. (b) gradient of WF is the negative reciprocal of 1/2, so -2 (M1)
    4. y + 4 = -2(x - 4), so y = -2x + 4 (A1)
    5. F is on both lines: 1/2x + 2 = -2x + 4 (M1)
    6. 5/2x = 2, so x = 4/5 (A1)
    7. y = -2 × 4/5 + 4 = 12/5, so F(4/5, 12/5) A1

    Trap: Stopping at x = 4/5 loses the final A1, because the markscheme withholds it when a point is not given as coordinates (x, y).

  10. Do not use a calculator. An architect draws the end of a roof on axes in metres. The two lower corners are P(-2, 1) and R(6, 1). The top of the roof is Q(2, k), above P and R. The two sloping edges PQ and QR meet at a right angle. (a) Determine the value of k. [5] (b) Find the equation of the edge QR in the form ax + by + d = 0, where a, b and d are integers. [2]7 marks
    Answer
    1. (a) gradient of PQ = (k - 1)/4 and gradient of QR = (1 - k)/4 (M1)
    2. (k - 1)/4 × (1 - k)/4 = -1 (M1)
    3. (k - 1)² = 16 (A1)
    4. k - 1 = ± 4, so k = 5 or k = -3 A1
    5. Q is above P and R, so k > 1 and k = 5 R1
    6. (b) gradient of QR = (1 - 5)/4 = -1, so y - 1 = -1(x - 6) (M1)
    7. x + y - 7 = 0 A1

    Trap: Taking only the positive square root, or keeping k = -3 without checking it against the roof, both lose marks: find both roots, then use the context to reject one.

Say this, not that

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

Loses the markGets the mark
f(1) = 9 for the coordinates of a point(1, 9). The markscheme gives A1(M1)A0 for an answer in function form without coordinates for x and y
Gradient found from one point onlycorrect use of the gradient formula with two of the points, such as (-2, 0) and (2, 8)
Perpendicular lines: m₁ = -m₂the negative reciprocal of (their) gradient: m₂ = -1/m₁, so m₁ × m₂ = -1. Both the sign and the reciprocal change

Frequently asked questions

How do you find the gradient of a line from two points?
Use the gradient formula, m = (y₂ - y₁)/(x₂ - x₁), which is the vertical change over the horizontal change. Put both lengths in the same unit before dividing. For a road that climbs from 340 m to 580 m over a horizontal distance of 1200 m, the gradient is 240/1200 = 1/5.
How do you find the x-intercept and y-intercept of a straight line?
The y-intercept is where x = 0, and the x-intercept is where y = 0. Set the other coordinate to zero and solve. For 3x + 4y - 12 = 0, x = 0 gives y = 3, so the y-intercept is (0, 3). For y = 0, 3x = 12, so the x-intercept is (4, 0).
How do you find the gradient of a line given in general form?
Rearrange ax + by + d = 0 into y = mx + c. The gradient is -a/b and the y-intercept is -d/b. For 3x + 4y - 12 = 0, rearranging gives y = -3/4x + 3, so the gradient is -3/4. Rearrange to check the sign.
How do you write the equation of a line through a point with a given gradient?
Use the point-gradient form y - y₁ = m(x - x₁). A line with gradient 4 through (-1, -3) gives y - (-3) = 4(x - (-1)), so y + 3 = 4(x + 1). Rearranging gives y = 4x + 1. If you know two points, find the gradient with the gradient formula first.
How do you find the equation of a line perpendicular to another line?
Perpendicular lines satisfy m₁ × m₂ = -1, so take the negative reciprocal of the first gradient: turn the fraction over and change its sign. For y = -2x + 5 the perpendicular gradient is 1/2. Through (4, 1) the perpendicular line is y = 1/2x - 1.
What mistake do students make with units when finding a gradient?
Dividing 156 by 1.2 gives 130, which mixes metres with kilometres. Convert both lengths to the same unit first: 1.2 km is 1200 m, so the gradient is 156/1200 = 0.13. Subtract the coordinates in the same order on the top and the bottom, so 1 - (-3) = 4.

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