2. Functions

Piecewise Functions

Piecewise Functions

Introduction: Why one rule is not always enough

students, many real-life situations do not follow one smooth rule from start to finish. A taxi fare may have a fixed starting charge and then a different rate after a certain distance πŸš•. A school might charge one price for lunch under a certain weight and another price above it. In mathematics, we model these situations with piecewise functions.

A piecewise function uses different formulas on different parts of its domain. That means the rule changes depending on the input value $x$. This makes piecewise functions very useful in the study of functions because they show how a model can be built to match real conditions more accurately than a single formula.

Learning objectives

By the end of this lesson, students, you should be able to:

  • explain the main ideas and terminology of piecewise functions,
  • apply IB Mathematics: Applications and Interpretation SL reasoning to piecewise functions,
  • connect piecewise functions to the wider topic of functions,
  • summarize how piecewise functions fit into function modeling,
  • use examples and evidence to interpret piecewise functions in context.

Think of a piecewise function like a set of instructions with branches. If the value of $x$ falls in one interval, use one formula. If it falls in another interval, use a different formula. The function still has to behave like a function, which means each input must give exactly one output.

What a piecewise function is

A piecewise function is usually written with brackets or braces and several rules. For example:

$$

$f(x)=$

$\begin{cases}$

2x+1, & x<0 \\

$3, & 0\le x<4 \\$

$x^2-1, & x\ge 4$

$\end{cases}$

$$

This means:

  • use $2x+1$ when $x<0$,
  • use $3$ when $0\le x<4$,
  • use $x^2-1$ when $x\ge 4$.

The conditions matter just as much as the formulas. They tell us exactly where each rule applies.

Important vocabulary

  • Domain: all allowed input values $x$.
  • Range: all possible output values $f(x)$.
  • Interval: a set of values between two endpoints, such as $x<4$ or $0\le x<4$.
  • Boundary point: a value where the rule changes, such as $x=0$ or $x=4$.
  • Closed endpoint: shown with $\le$ or $\ge$, meaning the endpoint is included.
  • Open endpoint: shown with $<$ or $>$, meaning the endpoint is not included.

These terms are important in IB Mathematics because piecewise functions are often tested through interpretation. You need to read the conditions carefully and decide which formula applies at a given $x$.

Reading and evaluating a piecewise function

Suppose we want to find $f(-2)$, $f(2)$, and $f(4)$ for the function above.

For $x=-2$, the condition $x<0$ applies, so:

$$

$f(-2)=2(-2)+1=-3.$

$$

For $x=2$, the condition $0\le x<4$ applies, so:

$$

$f(2)=3.$

$$

For $x=4$, the condition $x\ge 4$ applies, so:

$$

$f(4)=4^2-1=15.$

$$

This process is called evaluating the function. The key is to check the condition first, then use the matching formula.

Common mistake to avoid

Students sometimes forget that boundary points belong only to one part of the rule. For example, in $0\le x<4$, the value $x=4$ is not included. The next rule must cover $x=4$ if the function is defined there.

This is one reason why piecewise functions are strongly connected to the idea of a function being well-defined. Every input in the domain should match exactly one rule.

Graphs of piecewise functions

A piecewise function graph is made by combining several smaller graphs, each drawn only on its own interval. The graph may include straight lines, curves, constants, or other shapes.

Let’s use a simple example:

$$

$f(x)=$

$\begin{cases}$

x+2, & x<1 \\

$4, & 1\le x<3 \\$

$-2x+10, & x\ge 3$

$\end{cases}$

$$

Here is how the graph behaves:

  • for $x<1$, draw the line $y=x+2$ only to the left of $x=1$,
  • for $1\le x<3$, draw a horizontal segment at $y=4$,
  • for $x\ge 3$, draw the line $y=-2x+10$ starting at $x=3$ and continuing right.

At the boundary points, we use filled and open circles to show whether a point is included.

  • A filled circle means the point is part of the graph.
  • An open circle means the point is not part of the graph.

For example, at $x=1$, the first rule does not include $x=1$, so the point from that branch is open. The second rule does include $x=1$, so the point there is filled.

Why graphs matter in context

Graphs help us see changes in real situations. A piecewise graph can show:

  • a constant price for a fixed range,
  • a sudden change in speed,
  • a different policy after a threshold,
  • a model that changes before and after a special event πŸ“ˆ.

In IB Applications and Interpretation SL, interpretation is very important. The graph is not just a picture; it is evidence about how the relationship changes.

Piecewise functions in real-world modeling

Piecewise functions are useful because many systems behave differently in different regions.

Example 1: delivery fee

A delivery company charges $5$ for short distances and then adds $2$ per kilometer after $3$ km. The cost function may be written as:

$$

$C(d)=$

$\begin{cases}$

$5, & 0\le d\le 3 \\$

5+2(d-3), & d>3

$\end{cases}$

$$

This model says that for distances up to $3$ km, the price stays at $5$. After that, the cost increases linearly.

Example 2: tax or wages

A worker may earn one hourly rate up to a certain number of hours and a higher overtime rate after that. Piecewise functions can model that change clearly. This is common in finance, business, and economics.

Example 3: temperature rules

Some systems turn on heating when temperature drops below a threshold and turn it off above another threshold. A piecewise model can describe the control rule mathematically.

These examples show why piecewise functions are part of functional modeling. They allow mathematics to match actual situations more closely than a single formula would.

Continuity, jumps, and interpretation

A piecewise function may be continuous or discontinuous at a boundary point.

A function is continuous at a point if the graph connects without a break there. If the graph has a jump, hole, or mismatch, it is discontinuous.

For example, consider:

$$

$f(x)=$

$\begin{cases}$

x+1, & x<2 \\

$5, & x\ge 2$

$\end{cases}$

$$

At $x=2$, the left side gives $2+1=3$, while the right side gives $5$. Because the values do not meet, there is a jump at $x=2$.

Sometimes IB questions ask whether a piecewise function is continuous at the boundary. To check this, compare the value from the left branch, the value from the right branch, and the actual function value at the point.

A useful reasoning step

If a question asks you to make a piecewise function continuous, you may need to solve for an unknown parameter. For example, if

$$

$f(x)=$

$\begin{cases}$

x+4, & x<1 \\

$a, & x\ge 1$

$\end{cases}$

$$

the function is continuous at $x=1$ when the two parts meet at the same output value. The left-hand value is $1+4=5$, so choose $a=5$.

This kind of reasoning shows how piecewise functions connect algebra with graph interpretation.

How piecewise functions fit into the broader topic of functions

Piecewise functions are not a separate idea floating by themselves. They fit directly into the wider study of functions because they still involve:

  • inputs and outputs,
  • domain and range,
  • graphing,
  • transformations,
  • interpretation in context.

In the Functions topic, you study how formulas represent relationships. Piecewise functions expand that idea by showing that one relationship may need several formulas. This is important in IB Mathematics: Applications and Interpretation SL, where many exam tasks involve interpreting models in real-world contexts rather than only manipulating abstract symbols.

You may also compare piecewise functions with transformations. A graph can be shifted or stretched, but a piecewise model changes its rule across intervals. That makes the structure more flexible and more realistic in many situations.

Conclusion

Piecewise functions are a powerful way to model situations where the rule changes depending on the input. students, the main skill is to read the conditions carefully, choose the correct formula, and interpret the result in context. You should also understand how boundary points, open and closed intervals, and graph behavior work together.

In IB Mathematics: Applications and Interpretation SL, piecewise functions are important because they connect algebra, graphs, and real-world modeling. They help show that mathematics can describe changing situations clearly and accurately. Once you understand piecewise functions, you are better prepared to analyze functions that behave differently in different parts of their domain.

Study Notes

  • A piecewise function uses different formulas on different parts of its domain.
  • The conditions tell you which formula to use for a given input $x$.
  • Each input must match exactly one rule for the function to be well-defined.
  • Open endpoints use $<$ or $>$, and closed endpoints use $\le$ or $\ge$.
  • To evaluate a piecewise function, first find the correct interval, then use the matching formula.
  • Graphs of piecewise functions are drawn in sections, with open or filled circles at boundary points.
  • Piecewise functions are useful for modeling fares, wages, taxes, temperatures, and other real situations.
  • A piecewise function may be continuous or discontinuous at a boundary point.
  • To test continuity at a boundary, compare the left-hand rule, the right-hand rule, and the function value.
  • Piecewise functions fit into the topic of functions because they still involve input-output relationships, graphs, domain, range, and interpretation.

Practice Quiz

5 questions to test your understanding

Piecewise Functions β€” IB Mathematics Applications And Interpretation SL | A-Warded