impera Open Impera

IB Diploma Mathematics AI · Functions

Straight lines

1Gradient

The gradient of a line measures how steep it is: how much $y$ changes when $x$ increases by 1.

$$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 gradient (it is undefined).
  • In a real context the gradient is a rate of change, with units, such as euros per hour or km per litre.

Rise over run: the gradient of the line through (1, 3) and (4, 9)

Worked example

A gradient from two points

  1. Find the gradient of the line through $(1, 3)$ and $(4, 9)$.
  2. $m = \frac{9 - 3}{4 - 1} = \frac{6}{3} = 2$.
  3. For every 1 unit across, the line rises 2 units.
Check yourself

What is the gradient of the line through (2, 8) and (6, 0)?

  • 2

  • 0.5

  • −0.5

  • −2

Show the answer

−2

(0 − 8) ÷ (6 − 2) = −8 ÷ 4 = −2.

2Equations of a line

A straight line can be written in three forms. All three describe the same line.

  • Gradient–intercept form: $y = mx + c$, where $c$ is the $y$-intercept.
  • Point–gradient form: $y - y_1 = m(x - x_1)$, through the point $(x_1, y_1)$.
  • General form: $ax + by + d = 0$, where $a$, $b$ and $d$ are usually integers.
Worked example

Finding the equation

  1. The line through $(1, 3)$ and $(4, 9)$ has $m = 2$.
  2. Point–gradient: $y - 3 = 2(x - 1)$.
  3. Expand: $y = 2x + 1$. The $y$-intercept is 1.
  4. General form: $2x - y + 1 = 0$.

To find where a line crosses the axes, set $x = 0$ for the $y$-intercept and $y = 0$ for the $x$-intercept. For $3x + 4y = 12$: the intercepts are $(4, 0)$ and $(0, 3)$.

Check yourself

What is the y-intercept of y = −3x + 7?

  • 7

  • 3

  • 7/3

  • −3

Show the answer

7

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

3Parallel and perpendicular lines

  • Parallel lines have equal gradients: $m_1 = m_2$.
  • Perpendicular lines meet at a right angle. Their gradients multiply to $-1$: $m_1 \times m_2 = -1$.
  • So the perpendicular gradient is the negative reciprocal: flip the fraction and change the sign. The perpendicular to a gradient of 2 has gradient $-\frac{1}{2}$.
Worked example

A perpendicular line

  1. Find the line through $(2, 5)$ perpendicular to $y = 2x + 1$.
  2. The perpendicular gradient is $-\frac{1}{2}$.
  3. $y - 5 = -\frac{1}{2}(x - 2)$, so $y = -0.5x + 6$.

Perpendicular bisectors are used for Voronoi diagrams later in the course. The perpendicular bisector of $AB$ passes through the midpoint of $AB$ at right angles to it.

Check yourself

A line has gradient 3/4. What is the gradient of a line perpendicular to it?

  • −4/3

  • 4/3

  • 3/4

  • −3/4

Show the answer

−4/3

Flip the fraction and change the sign.

4Linear models in context

Many real situations increase by a fixed amount for each unit: a linear model $y = mx + c$.

  • The gradient $m$ is the rate of change.
  • The intercept $c$ is the starting value, when $x = 0$.
Worked example

A taxi fare

  1. A taxi charges a fixed 3 euros plus 1.50 euros per km.
  2. Model: $F = 1.5d + 3$, where $F$ is the fare in euros and $d$ is the distance in km.
  3. The gradient, 1.5, is the cost per km. The intercept, 3, is the fixed charge.
  4. A 12 km trip costs $1.5 \times 12 + 3 = 21$ euros.

When interpreting, always give the meaning and units: "the fare increases by 1.50 euros for each extra kilometre."

Check yourself

In the model C = 40 + 25h for a plumber's charge, what does 25 represent?

  • The total cost

  • The call-out fee

  • The cost per hour

  • The number of hours

Show the answer

The cost per hour

The gradient is the rate: 25 euros for each hour worked.

5Interpreting gradient and intercept

In a linear model $y = mx + c$:

  • Gradient $m$: the change in $y$ for each unit increase in $x$.
  • Intercept $c$: the value of $y$ when $x = 0$.
Worked example

Taxi fares

  1. Fare: $F = 1.8d + 3.5$ euros for $d$ kilometres.
  2. Gradient: 1.80 euros per kilometre.
  3. Intercept: a fixed charge of 3.50 euros.
  4. A 12 km trip costs $1.8 \times 12 + 3.5 = 25.10$ euros.
Check yourself

In $F = 1.8d + 3.5$, what does 3.5 represent?

  • The maximum fare for any trip

  • The total distance of the trip

  • The cost per kilometre driven

  • A fixed charge of 3.50 euros

Show the answer

A fixed charge of 3.50 euros

Value when $d = 0$.

6Lines in general form

A line can be written as $ax + by + d = 0$ with integer coefficients.

Worked example

Convert $y = \frac{2}{3}x - 4$

  1. Multiply by 3: $3y = 2x - 12$.
  2. Rearrange: $2x - 3y - 12 = 0$.
  3. Intercepts: $x = 6$ (when $y = 0$) and $y = -4$ (when $x = 0$).
Check yourself

What is the gradient of $2x - 3y - 12 = 0$?

  • 2

  • $-3$

  • $-\frac{2}{3}$

  • $\frac{2}{3}$

Show the answer

$\frac{2}{3}$

$y = \frac{2}{3}x - 4$.

7Going deeper: comparing two linear models, and a perpendicular bisector

Worked example (comparing tariffs): phone plan A costs 20 a month plus 0.10 per minute. Plan B costs 35 a month plus 0.04 per minute.

  1. Models: $A = 20 + 0.10m$ and $B = 35 + 0.04m$.
  2. Equal cost: $20 + 0.10m = 35 + 0.04m$, so $0.06m = 15$ and $m = 250$ minutes.
  3. At 250 minutes both cost 45.
  4. Below 250 minutes plan A is cheaper (lower fixed charge). Above 250 minutes plan B is cheaper (lower gradient).
  5. On a GDC, graph both lines and use the intersection tool.

Interpreting the parts of a linear model

  • The gradient is the rate of change: the cost per extra minute.
  • The $y$-intercept is the starting value: the fixed monthly charge.
  • The $x$-intercept is where the quantity reaches zero, which may or may not make sense in context.

Worked example (perpendicular bisector): two towns are at $A(2, 1)$ and $B(8, 5)$. Find the line of points equally distant from both.

  1. Midpoint: $(5, 3)$.
  2. Gradient of $AB$: $\frac{5 - 1}{8 - 2} = \frac{2}{3}$.
  3. Perpendicular gradient: $-\frac{3}{2}$.
  4. Equation: $y - 3 = -\frac{3}{2}(x - 5)$, so $y = -1.5x + 10.5$.
  5. In general form: $3x + 2y - 21 = 0$.
  6. This line is an edge in a Voronoi diagram: everything on one side is closer to $A$, and everything on the other is closer to $B$.

Worked example (a model from two data points): a candle is 18 cm tall after 1 hour and 12 cm after 4 hours.

  1. Gradient: $\frac{12 - 18}{4 - 1} = -2$ cm per hour.
  2. $h - 18 = -2(t - 1)$, so $h = -2t + 20$.
  3. Initial height: 20 cm. It burns out when $h = 0$, at $t = 10$ hours.
  4. Sensible domain: $0 \le t \le 10$.

Three forms

  • Gradient-intercept: $y = mx + c$.
  • Point-gradient: $y - y_1 = m(x - x_1)$.
  • General: $ax + by + d = 0$ with integers $a$, $b$, $d$.

Common mistakes

  • Reading the intercept as the gradient when describing a model.
  • Extending a linear model beyond where it makes sense (negative height, negative time).
  • Forgetting the negative reciprocal for perpendicular lines.
Check yourself

A plumber charges a call-out fee of 40 and 30 per hour. What is the cost of a job lasting 2.5 hours?

  • 75

  • 115

  • 175

  • 100

Show the answer

115

40 + 30 × 2.5 = 40 + 75.

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