impera Open Impera

IB Diploma Mathematics AA · Functions

Straight lines

1Gradient

The gradient of a line measures how steep it is: the change in $y$ for each unit increase in $x$.

For the line through $(x_1, y_1)$ and $(x_2, y_2)$:

$$m = \frac{y_2 - y_1}{x_2 - x_1}$$

  • A positive gradient slopes up from left to right. A negative gradient slopes down.
  • A horizontal line has gradient 0. A vertical line has no defined gradient.
Worked example

Gradient, midpoint and distance

  1. For the points $A(1, 2)$ and $B(5, 10)$: $m = \dfrac{10 - 2}{5 - 1} = \dfrac{8}{4} = 2$.
  2. Midpoint $= \left(\dfrac{1 + 5}{2}, \dfrac{2 + 10}{2}\right) = (3, 6)$.
  3. Distance $AB = \sqrt{(5-1)^2 + (10-2)^2} = \sqrt{16 + 64} = \sqrt{80} = 8.94$.
Check yourself

What is the gradient of the line through (0, 1) and (2, 7)?

  • 3

  • 4

  • 6

  • 1/3

Show the answer

3

(7 − 1) ÷ (2 − 0) = 3.

2Equations of a line

A straight line can be written in three forms.

  • Gradient–intercept form: $y = mx + c$. Here $m$ is the gradient and $c$ is the $y$-intercept.
  • Point–gradient form: $y - y_1 = m(x - x_1)$. Use this when you know the gradient and one point.
  • General form: $ax + by + d = 0$.

To find where a line crosses the axes: put $x = 0$ for the $y$-intercept, and $y = 0$ for the $x$-intercept.

The line y = 2x + 1: gradient and y-intercept

Worked example

The line through two points

  1. Find the equation of the line through $(1, 2)$ and $(5, 10)$.
  2. The gradient is 2.
  3. $y - 2 = 2(x - 1)$, so $y = 2x$.
  4. Check with the other point: $2 \times 5 = 10$. Correct.
Check yourself

What is the y-intercept of the line y = 3x − 5?

  • 3

  • −3

  • 5

  • −5

Show the answer

−5

In y = mx + c, the y-intercept is c.

3Parallel and perpendicular lines

  • Parallel lines have the same gradient: $m_1 = m_2$.
  • Perpendicular lines have gradients that multiply to give $-1$: $m_1 m_2 = -1$. Each is the negative reciprocal of the other.
Worked example

A perpendicular line

  1. Find the line perpendicular to $y = 2x + 1$ that passes through $(4, 3)$.
  2. The gradient of the given line is 2, so the perpendicular gradient is $-\dfrac{1}{2}$.
  3. $y - 3 = -\dfrac{1}{2}(x - 4)$.
  4. $y = -\dfrac{1}{2}x + 5$.

To find where two lines intersect, solve their equations simultaneously, or use your calculator's graph.

Check yourself

Line L has gradient 2 and passes through (0, 1). Which line is parallel to L?

  • y = 2x + 5

  • y = −½x + 5

  • y = −2x + 1

  • y = ½x + 1

Show the answer

y = 2x + 5

Parallel lines have equal gradients.

4Distance and midpoint

For points $(x_1, y_1)$ and $(x_2, y_2)$:

  • Midpoint: $\left(\frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2}\right)$.
  • Distance: $d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}$, from Pythagoras.
Worked example

$A(1, 2)$ and $B(7, 10)$

  1. Midpoint: $(4, 6)$.
  2. Distance: $\sqrt{6^2 + 8^2} = \sqrt{100} = 10$.
  3. Gradient: $\frac{8}{6} = \frac{4}{3}$.
Check yourself

What is the distance between $(0, 0)$ and $(3, 4)$?

  • 7

  • 5

  • 25

  • 12

Show the answer

5

$\sqrt{9 + 16}$.

5Perpendicular bisectors

The perpendicular bisector of $AB$ passes through the midpoint and is perpendicular to $AB$.

Worked example

Perpendicular bisector of $A(1, 2)$ and $B(7, 10)$

  1. Midpoint: $(4, 6)$.
  2. Gradient of $AB$: $\frac{4}{3}$, so perpendicular gradient: $-\frac{3}{4}$.
  3. Equation: $y - 6 = -\frac{3}{4}(x - 4)$.
  4. Simplify: $y = -\frac{3}{4}x + 9$, or $3x + 4y - 36 = 0$.

Every point on the perpendicular bisector is the same distance from $A$ and $B$.

Check yourself

What is true of every point on the perpendicular bisector of AB?

  • It has gradient equal to AB

  • It is closer to A

  • It lies on AB

  • It is equidistant from A and B

Show the answer

It is equidistant from A and B

Equal distances.

6Going deeper: exam-style problems that combine several ideas

Paper questions on lines rarely test one skill. They chain gradient, midpoint, distance and perpendicularity, so set your working out in clear steps.

Worked example

$A(1, 2)$ and $B(7, 10)$. Find the perpendicular bisector of $[AB]$ and the area of the triangle it makes with the axes.

  1. Gradient of $AB$: $\frac{10 - 2}{7 - 1} = \frac{8}{6} = \frac{4}{3}$.
  2. Midpoint: $\left(\frac{1+7}{2}, \frac{2+10}{2}\right) = (4, 6)$.
  3. Length: $\sqrt{6^2 + 8^2} = 10$.
  4. Perpendicular gradient: $-\frac{3}{4}$ (the negative reciprocal).
  5. Equation: $y - 6 = -\frac{3}{4}(x - 4)$, which gives $3x + 4y = 36$.
  6. Intercepts: $x = 12$ when $y = 0$; $y = 9$ when $x = 0$.
  7. Area of the triangle with the axes: $\frac{1}{2} \times 12 \times 9 = 54$.
Worked example

$L_1$ passes through $(0, 5)$ and $(4, -3)$. $L_2$ is perpendicular to $L_1$ at $(4, -3)$. Find the area of the triangle formed by $L_1$, $L_2$ and the $y$-axis.

  1. Gradient of $L_1$: $\frac{-3 - 5}{4 - 0} = -2$, so $L_1$: $y = -2x + 5$.
  2. Gradient of $L_2$: $\frac{1}{2}$, so $y + 3 = \frac{1}{2}(x - 4)$, giving $y = \frac{1}{2}x - 5$.
  3. The lines meet the $y$-axis at $(0, 5)$ and $(0, -5)$: a base of 10.
  4. The height is the $x$-coordinate of the third vertex: 4.
  5. Area $= \frac{1}{2} \times 10 \times 4 = 20$.
  6. Check with the right angle at $(4, -3)$: the two shorter sides are $\sqrt{80}$ and $\sqrt{20}$, and $\frac{1}{2}\sqrt{80}\sqrt{20} = \frac{1}{2}(40) = 20$.

Three forms and when to use each

  • $y = mx + c$: reading the gradient and intercept.
  • $y - y_1 = m(x - x_1)$: writing an equation quickly from a point and a gradient.
  • $ax + by + d = 0$: the form usually asked for in the final answer, with integer coefficients.

Common mistakes

  • Using the reciprocal without changing the sign for a perpendicular gradient.
  • Putting the perpendicular bisector through an endpoint when it must pass through the midpoint.
  • Subtracting coordinates in different orders in the numerator and denominator of the gradient.
  • Vertical lines have the form $x = k$ and no defined gradient; horizontal lines have gradient 0.
Check yourself

A line is perpendicular to y = 3x + 4 and passes through (6, 1). What is its y-intercept?

  • −17

  • 3

  • 1

  • −1

Show the answer

3

The gradient is −1/3, so y − 1 = −(1/3)(x − 6), which gives y = −x/3 + 3.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera