Cambridge Lower Secondary · Mathematics 0862 · Stage 8 · Algebra
Functions and Straight-line Graphs (y = mx + c)
Use function machines and inverse operations, write real situations as y = mx + c, plot straight-line graphs from tables of values, and read the gradient and y-intercept.
British & IGCSE › Checkpoint 8 › Checkpoint 8 Maths — Complete Course
- Understand that a function is a rule where each input gives exactly one output. Work out outputs from inputs, and work backwards with inverse operations to find the input from an output — including with fractions. [8As.03]
- Turn a situation described in words into a linear function y = mx + c, and describe a function y = mx + c as a real situation in words. [8As.04]
- Use coordinate pairs to make a table of values for a function such as y = 3x − 2, and plot its straight-line graph. [8As.05]
- Know that every equation y = mx + c gives a straight line, where m is the gradient (how steep the line is) and c is the y-intercept (where it crosses the y-axis), for whole-number values of m. [8As.06]
A function is a mathematical machine: you put a number in, it does the same operations every time, and one number comes out. When you write a function as y = mx + c and plot the input–output pairs as coordinates, you always get a straight line. This page takes you from function machines to tables of values, straight-line graphs, and the meaning of m and c.
1. Key words
| Word / phrase | Meaning / use |
|---|---|
| function | دالة — a rule that gives exactly one output for each input |
| input / output | المدخل / المخرج — the number you put in / the number you get out |
| function machine | آلة الدالة — a diagram showing the operations in order |
| inverse | العكسي — the operation that undoes another; used to work backwards |
| mapping, x → 2x + 1 | تحويل — another way to write a function: "x maps to 2x + 1" |
| table of values | جدول قيم — a table of x values and the y values they give |
| coordinates (x, y) | إحداثيات — a point: across first, then up or down |
| linear | خطي — makes a straight-line graph |
| gradient, m | الميل — how steep a line is: change in y ÷ change in x |
| y-intercept, c | الجزء المقطوع من محور y — where the line crosses the y-axis, the point (0, c) |
| parallel | متوازي — lines that never meet; they have the same gradient |
2. Functions and function machines
In a function, each input has exactly one output. Put 5 into the machine below and you always get 13 — never anything else. A rule like "output any number bigger than the input" is not a function, because one input could give many different outputs. (Two different inputs giving the same output is allowed: x → 4 sends every input to 4.)
- Finding an output: follow the arrows. Input 5: 5 × 3 = 15, 15 − 2 = 13.
- Finding an input: start at the output and go backwards, using the inverse of each operation in reverse order. Output 22: 22 + 2 = 24, 24 ÷ 3 = 8. So the input was 8.
- The same function can be written as a machine, as a mapping x → 3x − 2, or as an equation y = 3x − 2.
- Inputs can be negative or fractions: input −1 gives −3 − 2 = −5; input 1/2 gives 1 1/2 − 2 = −1/2.
Fractions in the machine. For the machine "× 3/4, then + 1": input 8 → 8 × 3/4 = 6 → 6 + 1 = 7. To find the input for output 4, go backwards: 4 − 1 = 3, then the inverse of × 3/4 is ÷ 3/4, which is the same as × 4/3: 3 × 4/3 = 4.
Finding the rule from a table. If the inputs 1, 2, 3, 4 give outputs 5, 8, 11, 14, the outputs go up by 3 when the input goes up by 1, so the rule starts "× 3". Then 1 × 3 = 3 and we need 5, so "+ 2". The function is y = 3x + 2. (This is the same method as finding the nth term of a sequence.)
3. From words to y = mx + c (and back)
Many real situations are linear: there is a starting amount and then a fixed amount for each unit. The fixed amount per unit is m; the starting amount is c.
| Situation in words | Function | m means… | c means… |
|---|---|---|---|
| A taxi charges $4 to start plus $2 per kilometre. | C = 2d + 4 | $2 for each km | the $4 starting charge |
| A tank holds 500 litres and drains at 20 litres per minute. | W = −20t + 500 | loses 20 litres each minute | the 500 litres at the start |
| A plant is 6 cm tall and grows 3 cm each week. | h = 3w + 6 | grows 3 cm per week | the height at week 0 |
| Each ticket costs $9 (no booking fee). | C = 9n | $9 per ticket | c = 0: no fixed charge |
Going back to words. For y = 5x + 30 you could write: "A gym charges a $30 joining fee and then $5 for each visit. y is the total cost in dollars for x visits." Explain what x and y stand for, and where the 5 and the 30 appear in your story.
4. Tables of values and plotting a straight line
- Make a table with the x values you are given (for example from −2 to 3).
- Substitute each x into the function to find y. Take care with negative numbers.
- Write the coordinate pairs (x, y).
- Plot each point with a small, neat cross.
- Join the points with a ruler — one straight line through all of them, going right to the edges of the x range. Label the line with its equation.
- If one point is not on the line, check that calculation again — the points of y = mx + c are always in a straight line.
| x | −2 | −1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|---|
| y = 2x + 1 | −3 | −1 | 1 | 3 | 5 | 7 |
5. Gradient and y-intercept
Every straight line (except a vertical one) has an equation y = mx + c.
- c is the y-intercept: the line crosses the y-axis at (0, c). Put x = 0: y = m × 0 + c = c.
- m is the gradient: for every 1 step to the right, the line goes up m steps. Gradient = change in y ÷ change in x (rise ÷ run).
- m positive → the line goes up from left to right. m negative → it goes down. m = 0 → it is horizontal (y = c).
- A bigger number for m (ignoring the sign) means a steeper line. y = 5x is steeper than y = 2x.
- Lines with the same gradient are parallel.
On y = 2x + 1 the green triangle goes 2 units right (run) and 4 units up (rise), so the gradient = 4 ÷ 2 = 2. ✓
| Equation | Gradient m | y-intercept c | Note |
|---|---|---|---|
| y = 4x − 7 | 4 | −7 | steep, upwards |
| y = −3x + 2 | −3 | 2 | downwards |
| y = 5 − 2x | −2 | 5 | rewrite as y = −2x + 5 first |
| y = x | 1 | 0 | passes through the origin |
| y = 6 | 0 | 6 | horizontal line |
| x = 3 | — | — | vertical line: not of the form y = mx + c |
Finding the equation from a graph: (1) read c where the line crosses the y-axis; (2) choose two points where the line crosses grid corners exactly; (3) gradient = change in y ÷ change in x (negative if the line goes down); (4) write y = mx + c.
Is a point on the line? Substitute the x-coordinate. Is (4, 9) on y = 2x + 1? 2 × 4 + 1 = 9 ✓ — yes. Is (4, 10)? No, because y would be 9, not 10.
- c = النقطة اللي الخط بيقطع فيها محور y (لما x = 0).
- m = الميل: كل ما تمشي خطوة واحدة يمين، الخط بيطلع m خطوات (ولو m سالبة بينزل).
- خطين ليهم نفس الـ m يبقوا متوازيين.
- الدالة: كل مدخل ليه مخرج واحد بس. ولو عايز ترجع من المخرج للمدخل، اعكس العمليات وابدأ من الآخر.
6. Worked examples
Worked example 1 — A function machine multiplies by 4 and then subtracts 5. (a) Find the output when the input is −2. [1] (b) Find the input when the output is 19. [1] (c) Find the input when the output is 0. [1]
| Part | Working and answer |
|---|---|
| (a) | −2 × 4 = −8; −8 − 5 = −13 |
| (b) | Backwards: 19 + 5 = 24; 24 ÷ 4 = 6 |
| (c) | 0 + 5 = 5; 5 ÷ 4 = 5/4 = 1 1/4 |
Common mistake: going backwards in the wrong order (19 ÷ 4 first, then + 5). Undo the LAST operation FIRST.
Worked example 2 — A function is x → (2/3)x + 1. (a) Find the output when x = 9. [1] (b) Find x when the output is 5. [2]
| Part | Working and answer |
|---|---|
| (a) | (2/3) × 9 = 6; 6 + 1 = 7 |
| (b) | 5 − 1 = 4. Undo × 2/3 by × 3/2: 4 × 3/2 = 6. Check: (2/3) × 6 + 1 = 4 + 1 = 5 ✓ |
Worked example 3 — (a) Complete the table of values for y = 3 − 2x. [2] (b) Draw the graph for x from −1 to 3. [2]
| x | −1 | 0 | 1 | 2 | 3 |
|---|---|---|---|---|---|
| y = 3 − 2x | 5 | 3 | 1 | −1 | −3 |
Working: x = −1: 3 − 2 × (−1) = 3 + 2 = 5. x = 3: 3 − 6 = −3. The line goes down because the gradient is −2, and it crosses the y-axis at 3.
Common mistake: 3 − 2 × (−1) = 1. Subtracting a negative is adding: 3 − (−2) = 5.
Worked example 4 — A candle is 30 cm tall when it is lit. It burns down 2 cm every hour. (a) Write a function for its height h cm after t hours. [1] (b) What do the gradient and the y-intercept mean? [2] (c) After how many hours is the candle 12 cm tall? [1]
| Part | Working and answer |
|---|---|
| (a) | Starts at 30, goes down 2 each hour: h = 30 − 2t (or h = −2t + 30) |
| (b) | Gradient −2: the height goes down by 2 cm each hour. y-intercept 30: the height at the start (t = 0) is 30 cm. |
| (c) | 30 − 2t = 12 → 2t = 18 → t = 9 hours |
Worked example 5 — Find the equation of this straight line. [2]
- The line crosses the y-axis at (0, −2), so c = −2.
- From (0, −2) to (2, 4): run = 2, rise = 4 − (−2) = 6. Gradient m = 6 ÷ 2 = 3.
- Equation: y = 3x − 2. Check with (2, 4): 3 × 2 − 2 = 4 ✓
Worked example 6 — Here are four equations: A: y = 4x − 1 B: y = x + 4 C: y = 4x + 3 D: y = −1 − 2x. (a) Which two lines are parallel? [1] (b) Which line has the same y-intercept as line A? [1] (c) Does the point (−3, −13) lie on line A? Show how you decide. [1]
| Part | Working and answer |
|---|---|
| (a) | A and C both have gradient 4, so A and C are parallel. |
| (b) | A crosses at −1. D = −2x − 1 also crosses at −1: D. |
| (c) | 4 × (−3) − 1 = −12 − 1 = −13 ✓ Yes, it lies on line A. |
- Working backwards through a machine in the wrong order. Undo the last operation first.
- Negative x values: 3 − 2 × (−1) = 5, not 1; 2 × (−2) + 1 = −3, not 5.
- Joining points by hand, with a wavy line, or stopping the line at the last point instead of the whole x range.
- Reading the gradient from y = 5 − 2x as 5. Rewrite as y = −2x + 5: m = −2, c = 5.
- Forgetting the sign of the gradient: a line going down from left to right has a negative gradient.
- Gradient as run ÷ rise. It is change in y ÷ change in x.
- Mixing up coordinates: (3, 1) means 3 across, 1 up — not 3 up.
- "Complete the table of values" then "Draw the graph of y = … on the grid": each correct value and a ruled line through correct points earn marks.
- "Find the input when the output is …" — show the inverse operations.
- "Write down the gradient / y-intercept of the line y = …" — 1 mark each; rearrange to y = mx + c first.
- "Draw a ring around the equation of the line that is parallel to …" or "Match each equation to its graph": compare m (steepness, up or down) and c (crossing point).
- "Does the point (…) lie on the line? Show how you decide" — substitute and state Yes or No.
- Word problems: "Write a formula/function for …", then "What does the number … represent?" — answer in the context (cost per km, starting height…).
Practice
- A function gives exactly one output for each input. To go backwards, use inverse operations in reverse order.
- In real situations y = mx + c: m is the amount per unit (rate), c is the starting amount.
- Table of values → coordinate pairs → neat crosses → one ruled straight line across the whole range.
- y = mx + c: m = gradient (rise ÷ run; negative means downhill), c = y-intercept (0, c).
- Same gradient → parallel lines. To test a point, substitute its x-coordinate.
All pages in this course
Start here
Number
- Order of Operations and Calculating with Integers
- Factors, Multiples, Primes, HCF and LCM
- Types of Number and Index Laws
- Squares, Cubes and Roots (Positive and Negative)
- Multiplying and Dividing by 0.1 and 0.01, and Significant Figures
- Fractions: Recurring Decimals, Mixed Numbers and Order of Operations
- Percentage Increase, Decrease and Absolute Change
- Ordering and Calculating with Decimals
- Ratio and Proportion
Algebra
- Algebraic Expressions: Simplifying, Expanding and Factorising
- Writing Expressions and Formulae, and Changing the Subject
- Equations and Inequalities
- Sequences and the nth Term
- Functions and Straight-line Graphs (y = mx + c)
- Reading and Interpreting Real-life Graphs
Geometry and measure
- Quadrilaterals and Regular Polygons
- Circumference of a Circle, and Miles and Kilometres
- Area of Parallelograms and Trapezia
- 3D Shapes: Euler's Formula and Plans and Elevations
- Volume of Prisms and Surface Area
- Angles in Triangles and on Parallel Lines
- Constructions with Ruler and Compasses
- Bearings and Midpoints
- Translation, Reflection, Rotation and Enlargement
Statistics and probability
- Data Collection and Sampling
- Representing Data
- Averages, Range and Comparing Distributions
- Probability: Complementary and Combined Events
Practice tests