Piecewise Functions Explained | IB Maths AA
Revise IB Maths AA piecewise functions with interval rules, endpoint notation, graphs, evaluation steps, common mistakes and practice.

Piecewise functions can feel confusing because the function has more than one rule. The key is simple: first identify the interval containing the input, then use only the rule attached to that interval. This guide is written for IB Maths AA students and focuses on notation, graphs, evaluation and exam mistakes.
Quick Answer
- A piecewise function uses different formulas on different intervals.
- The condition beside each formula tells you when to use it.
- Check the endpoint carefully:
<means open, while≤means included. - To evaluate a value, choose the correct branch before substituting.
- To graph the function, draw each rule only on its stated interval.

What Is a Piecewise Function?
A piecewise function is defined by two or more rules. For example:
f(x) = x + 2 when x < 0, and f(x) = x^2 when x ≥ 0.
The first rule applies only when x < 0. The second rule applies when x ≥ 0. The formulas are not interchangeable: the condition is part of the definition.
How to Read the Conditions
| Symbol | Meaning | Graph cue |
|---|---|---|
x < a |
values below a |
open endpoint at a |
x ≤ a |
values below or equal to a |
closed endpoint at a |
x > a |
values above a |
open endpoint at a |
x ≥ a |
values above or equal to a |
closed endpoint at a |
The endpoint belongs to a branch only when the inequality includes equality.
How to Evaluate a Piecewise Function
- Write down the input value.
- Compare it with every condition and select the correct branch.
- Substitute into that formula and simplify.
For example, if f(x) = 2x + 1 for x < 3 and f(x) = x^2 - 4 for x ≥ 3, then f(4) uses the second rule because 4 ≥ 3.
f(4) = 4^2 - 4 = 12
Do not choose a rule because it looks easier. Choose it because the input satisfies its condition.

How to Graph Piecewise Functions
Graph each formula as if it were a normal function, but stop it at the boundaries given by the conditions. Then mark the endpoint correctly.
- Use an open circle when the boundary is excluded.
- Use a closed circle when the boundary is included.
- Draw no values outside the branch's interval.
- Check whether the two branches meet, jump or leave a hole.
Continuity at a Boundary
At a boundary such as x = a, compare the left-hand value, the right-hand value and the defined value f(a). The function is continuous there only when the approaching values and the actual value agree.
Common Exam Mistakes
| Mistake | Why it loses marks | Better habit |
|---|---|---|
| Using the first formula for every input | The conditions are ignored | Check the interval before substitution |
Treating < as ≤ |
The endpoint is assigned to the wrong branch | Look for equality in the condition |
| Drawing both rules across the whole graph | The graph no longer represents the domain | Restrict each rule to its interval |
| Forgetting open or closed circles | Endpoint inclusion is part of the graph | Mark the boundary after plotting |
| Giving only a number | The method may be unclear | State the chosen condition and substitution |
Mini Practice
For g(x) = 3x - 2 when x < 1 and g(x) = x^2 + 1 when x ≥ 1, find g(0), g(2), and g(1).
Answer guide: g(0) = -2; g(2) = 5; and g(1) uses the second rule because the condition is x ≥ 1, giving g(1) = 2.
Practice This Topic
Try this exam-style question: Given a two-branch piecewise function, evaluate a value on each side of the boundary and explain whether the endpoint is open or closed.
Answer guide:
- Compare the input with the branch conditions.
- Choose the matching formula before substituting.
- Use an open circle for an excluded endpoint and a closed circle for an included endpoint.
- Show the substitution so the branch choice is visible.
Practise IB Maths AA SL functions and graph questions.
FAQ
What is the easiest way to evaluate a piecewise function?
Check the input against the conditions first, choose the matching rule, and only then substitute. Most errors happen when students substitute before deciding which interval applies.
What do open and closed circles mean?
An open circle means the endpoint is not included in that branch. A closed circle means the endpoint is included. The inequality tells you which symbol to use.
Can a piecewise function be continuous?
Yes. It is continuous at a boundary when the left-hand value, right-hand value and defined function value all agree. If they do not agree, the graph has a jump or a hole.
Related Study Links
- Explore the subject Study Hub
- IB Maths AA SL Question Bank
- IB Maths AA SL Notes
- Unit Circle Explained for IB Maths AA
- Trigonometry Basics for IB Maths AA
Final Takeaway
Piecewise functions become manageable when you separate the decision from the calculation: identify the interval, choose the rule, substitute, and check the endpoint.
Practise IB Mathematics AA SL IB maths AA exam questions.
Open the matching EduNinja workspace, question bank and syllabus-linked study tools.
Related articles
More course notes, updates and study resources from the EduNinja blog.

Trigonometry Basics for Exams | IB Maths AA
Learn IB Maths AA trigonometry basics with SOH CAH TOA, sine and cosine rules, area, unit-circle signs, exact values and exam practice.

Unit Circle Explained | IB Maths AA
Learn the unit circle for IB Maths AA with exact trigonometric values, radians, quadrants, signs and exam methods.

IGCSE Maths Similar Shapes: Scale Factors, Area, and Volume
A source-backed CAIE Mathematics guide for IGCSE Maths similar shapes, using EduNinja PDF notes, worked examples, and markscheme-style answers.