AAAbdelkriem AcademyEducate Me Up

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

In the curriculum
  • 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 / phraseMeaning / 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.)

input x× 3− 2output yinput x÷ 3+ 2output yWorking backwards: inverse operations in reverse order5 → 15 → 13 and back: 22 → 24 → 8
The function y = 3x − 2 as a machine (top) and its inverse (bottom).
  • 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 wordsFunctionm means…c means…
A taxi charges $4 to start plus $2 per kilometre.C = 2d + 4$2 for each kmthe $4 starting charge
A tank holds 500 litres and drains at 20 litres per minute.W = −20t + 500loses 20 litres each minutethe 500 litres at the start
A plant is 6 cm tall and grows 3 cm each week.h = 3w + 6grows 3 cm per weekthe height at week 0
Each ticket costs $9 (no booking fee).C = 9n$9 per ticketc = 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

  1. Make a table with the x values you are given (for example from −2 to 3).
  2. Substitute each x into the function to find y. Take care with negative numbers.
  3. Write the coordinate pairs (x, y).
  4. Plot each point with a small, neat cross.
  5. 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.
  6. 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−10123
y = 2x + 1−3−11357
xyy = 2x + 1−3−2−11234−4−3−2−1123456780
The graph of y = 2x + 1, plotted from the table of values.

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.
xyrun 2rise 4y = 2x + 1y = 2x − 3y = −x + 4−3−2−112345−5−4−3−2−112345670
y = 2x + 1 (red) and y = 2x − 3 (orange) are parallel — both have gradient 2. y = −x + 4 (blue) slopes down — gradient −1. The dots show the y-intercepts 1, −3 and 4.

On y = 2x + 1 the green triangle goes 2 units right (run) and 4 units up (rise), so the gradient = 4 ÷ 2 = 2. ✓

EquationGradient my-intercept cNote
y = 4x − 74−7steep, upwards
y = −3x + 2−32downwards
y = 5 − 2x−25rewrite as y = −2x + 5 first
y = x10passes through the origin
y = 606horizontal 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.

افتكر y = mx + c
  • 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]

PartWorking 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]

PartWorking 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−10123
y = 3 − 2x531−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.

xyy = 3 − 2x−2−11234−4−3−2−11234560
Worked example 3: the graph of y = 3 − 2x.

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]

PartWorking 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]

xy(0, −2)(2, 4)−2−11234−6−5−4−3−2−1123456780
Worked example 5.
  1. The line crosses the y-axis at (0, −2), so c = −2.
  2. From (0, −2) to (2, 4): run = 2, rise = 4 − (−2) = 6. Gradient m = 6 ÷ 2 = 3.
  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]

PartWorking 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.
Common mistakes
  • 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.
How Checkpoint asks this
  • "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

Remember
  • 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

Algebra

Geometry and measure

Statistics and probability

Practice tests