IB MYP Mathematics · Algebra
Linear functions and graphs
1Coordinates and plotting a line
A point is located by coordinates $(x, y)$: across first, then up. The axes cross at the origin $(0, 0)$ and divide the plane into four quadrants.
A linear function has a graph that is a straight line. To draw one from its equation, make a table of values.
Draw y = 2x − 1 for x from −2 to 3
- Choose $x$ values: −2, −1, 0, 1, 2, 3.
- Calculate $y$: −5, −3, −1, 1, 3, 5.
- Plot the points (−2, −5), (−1, −3), (0, −1), (1, 1), (2, 3), (3, 5).
- Join them with a ruler and extend the line.
- If a point is off the line, a calculation is wrong: recheck it.
Two points are enough to fix a line, but plot at least three so that a mistake shows up.
- Lines of the form $y = c$ are horizontal: $y = 3$ passes through every point with height 3.
- Lines of the form $x = c$ are vertical: $x = -2$.
Check yourself
Which point lies on the line y = 3x + 1?
Show the answer
(2, 7)
When x = 2, y = 3 × 2 + 1 = 7.
2Gradient
The gradient measures the steepness of a line: how far it rises for each unit across.
$\text{gradient} = \dfrac{\text{rise}}{\text{run}} = \dfrac{y_2 - y_1}{x_2 - x_1}$
- A line sloping up from left to right has a positive gradient.
- A line sloping down has a negative gradient.
- A horizontal line has gradient 0. A vertical line has no defined gradient.
The gradient through (1, 2) and (5, 10)
- Rise: 10 − 2 = 8.
- Run: 5 − 1 = 4.
- Gradient: 8 ÷ 4 = 2.
Through (−2, 7) and (4, −5)
- Rise: −5 − 7 = −12.
- Run: 4 − (−2) = 6.
- Gradient: −12 ÷ 6 = −2. The line slopes down.
Subtract the coordinates in the same order top and bottom, or the sign will be wrong.
Gradient = rise ÷ run; c is where the line crosses the y-axis
Check yourself
What is the gradient of the line through (0, 3) and (4, 11)?
Show the answer
2
The rise is 8 and the run is 4.
3The equation y = mx + c
Every straight line that is not vertical can be written $y = mx + c$.
- $m$ is the gradient.
- $c$ is the y-intercept: where the line crosses the $y$-axis.
So you can read a line's features from its equation: $y = 3x - 4$ has gradient 3 and crosses the $y$-axis at −4.
If the equation is in another form, rearrange it first. $2y = 6x + 8$ becomes $y = 3x + 4$. And $3x + y = 5$ becomes $y = -3x + 5$, with gradient −3.
Find the equation of the line through (2, 5) with gradient 3
- $y = 3x + c$.
- Substitute the point: $5 = 3(2) + c$.
- $c = -1$.
- Equation: $y = 3x - 1$.
Through two points, (1, 4) and (3, 10)
- Gradient: $(10 - 4) \div (3 - 1) = 3$.
- $y = 3x + c$; substitute (1, 4): $4 = 3 + c$, so $c = 1$.
- Equation: $y = 3x + 1$. Check with (3, 10): 3 × 3 + 1 = 10.
Check yourself
What are the gradient and y-intercept of y = −2x + 7?
Show the answer
Gradient −2, intercept 7
In y = mx + c, m is the gradient and c the intercept.
4Parallel and perpendicular lines
- Parallel lines have the same gradient. $y = 2x + 1$ and $y = 2x - 5$ never meet.
- Perpendicular lines meet at right angles. Their gradients multiply to give −1, so each is the negative reciprocal of the other.
If one line has gradient 2, a perpendicular line has gradient $-\frac{1}{2}$. If one has gradient $-\frac{3}{4}$, the perpendicular has gradient $\frac{4}{3}$.
A parallel line
- Find the line parallel to $y = 4x - 3$ through (1, 9).
- Same gradient: $y = 4x + c$.
- $9 = 4 + c$, so $c = 5$.
- $y = 4x + 5$.
A perpendicular line
- Find the line perpendicular to $y = 2x + 1$ through (4, 3).
- Gradient: $-\frac{1}{2}$.
- $3 = -\frac{1}{2}(4) + c$, so $c = 5$.
- $y = -\frac{1}{2}x + 5$.
Check yourself
Which line is parallel to y = 5x − 2?
Show the answer
y = 5x + 9
Parallel lines have the same gradient, 5.
5Linear graphs in real life
Many real situations are linear: a fixed charge plus a constant rate. The gradient and intercept then have meanings.
A taxi fare
- A taxi charges $3 plus $2 per kilometre. Cost $C$ for $d$ km: $C = 2d + 3$.
- Gradient 2: the cost rises by $2 for each extra kilometre. It is a rate of change.
- Intercept 3: the cost when no distance has been travelled, the fixed charge.
- A 7 km journey costs 2 × 7 + 3 = $17.
- If a fare was $25, then 2d + 3 = 25, so d = 11 km.
Distance–time graphs: the gradient is the speed. A steeper line means faster; a horizontal line means stationary; a line going down means returning.
Conversion graphs pass through the origin and show direct proportion, such as kilometres against miles.
When you interpret a graph, give the meaning in context with units: "the gradient shows the water level rises 4 cm every minute".
Check yourself
A plumber charges according to C = 40h + 25, where h is hours worked. What does the 25 represent?
Show the answer
A fixed call-out charge
It is the cost when h = 0, before any work is done.
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