SL AI · Functions

Piecewise functions and modelling (IB Math AI SL)

Updated October 2026

Quick answer: A piecewise function uses a different rule on different parts of the domain, such as one price per unit up to a limit and another price above it. To evaluate it, first decide which interval x is in, then use that rule. At a boundary, the inequality sign (≤ or <) tells you which rule applies.

Utility bills, postage rates, and tax bands — all piecewise functions. SL AI Paper 2 loves testing the value at a boundary.

Practise Piecewise functions and modelling with AI marking

Open the full SL AI engine — every question in this unit is worked through with instant AI-graded feedback on your handwritten workings.

Practise SL AI Functions →

Examiner Insights: what the International Baccalaureate examiner reports say IB Maths AI SL students get wrong →

Key ideas

Worked example

An electricity bill is €12 a month plus €0.30 per kWh for the first 100 kWh, and €0.20 per kWh for every kWh above 100. Write the monthly cost C(x) for x kWh as a piecewise function, and find how much electricity was used if a bill is €70.

  1. Up to 100 kWh: C(x) = 12 + 0.30x, for 0 ≤ x ≤ 100.
  2. At 100 kWh the cost is 12 + 30 = €42, so above 100 kWh: C(x) = 42 + 0.20(x − 100), for x > 100.
  3. €70 is more than €42, so use the second piece: 42 + 0.20(x − 100) = 70.
  4. 0.20(x − 100) = 28, so x − 100 = 140 and x = 240.

Answer: C(x) = 12 + 0.30x for 0 ≤ x ≤ 100 and C(x) = 42 + 0.20(x − 100) for x > 100; 240 kWh.

Exam-style SL AI questions

Try it now

1 of 5

  1. Question 1 of 5
  2. Question 2 of 5
  3. Question 3 of 5
  4. Question 4 of 5
  5. Question 5 of 5

5 quick questions on piecewise functions. No sign-in needed.

\(f(x) = \begin{cases} 3 x + 1, & x \lt 2 \\ 10 - 2 x, & x \geq 2 \end{cases}\). Find \(f(1) + f(2)\).
Choose your answer · keys 1–4

Do it on your GDC

A GDC is allowed on every AI paper. Keystrokes for the TI-84 Plus CE, TI-Nspire CX II and Casio fx-CG50, with a checked worked example:

See it on a graph

Maths IA ideas that use piecewise functions and modelling

Related in Functions

Revise Piecewise functions and modelling for the exam

Stretch yourself: original algebra problems at Senior level (ages 16 to 18), with hints and full solutions: Problem S24 · Problem S88 · Problem S23 · Problem S87. All 22 →

More on this topic

FAQ

How do you evaluate a piecewise function at a boundary?

Look at the inequality signs. If one piece says x ≤ 100 and the other x > 100, then x = 100 belongs to the first piece, so use that rule. If both pieces give the same value there, the function is continuous and either rule gives the same answer.

Can I use my calculator for piecewise functions and modelling?

Yes: a GDC is allowed on every SL AI paper, so practise the calculator method as well as the working. The Graphs: intersections, zeros, max and min guide gives the keystrokes for the TI-84 Plus CE, TI-Nspire CX II and Casio fx-CG50.

What else is free here

Save your progress as you reviseA free account remembers the questions you have done on every topic and brings you back to this page.

Join free

Already have an account? Sign in