Back to homeMathematics · 4th ESO B · Change subject
Start for free
ESO Y4B · Mathematics
Functions · Elementary functions

Piecewise-defined functions

Until now, each function in this block has had a single algebraic expression valid across its whole domain. Many real situations — a tariff whose price changes after a certain consumption, a progressive tax — do not fit a single formula: they need a different expression on each part of the domain. These are piecewise-defined functions, and studying them requires special attention to the points where the expression changes.

Before you start, make sure you know: Linear and affine functions (3rd ESO)
Before you start, make sure you know: Characteristics of a function (3rd ESO)

Formal definition

Graph of a piecewise function with three pieces (two horizontal and one sloping) separated by vertical dashed lines piece 1 piece 2 piece 3

Each expression $f_i$ defines $f$ only within its interval $I_i$; outside it, that formula does not apply. The intervals must cover the whole domain without overlapping: each $x$ belongs to exactly one piece.

Practice★☆☆Not started
Given the following piecewise function: $f(x) = \begin{cases} 2x+1 & \text{if } x < 0 \\ x^2-3 & \text{if } x \ge 0 \end{cases}$ Calculate the value of the function at…

Given the following piecewise function:

$f(x) = \begin{cases} 2x+1 & \text{if } x < 0 \\ x^2-3 & \text{if } x \ge 0 \end{cases}$

Calculate the value of the function at the points $x = -2$, $x = 0$ and $x = 3$.

Solve
Practice★☆☆Not started
Look at the graph of the function $f(x)$ and determine its domain and its range.

Look at the graph of the function $f(x)$ and determine its domain and its range.

X Y 0 3 −3 3 −2 f(x)
Solve

Calculating images

To calculate $f(a)$, the procedure is always the same: first find which interval $I_i$ contains $a$, and only then substitute into $f_i$.

Graph of a piecewise function with open and closed endpoints illustrating the union of the intervals of the domain x < −1 −1 ≤ x ≤ 2 x > 2
Practice★☆☆Not started
Express the modulus function $f(x) = |3x - 6|$ as a piecewise function.

Express the modulus function $f(x) = |3x - 6|$ as a piecewise function.

Solve
Practice★☆☆Not started
A central car park charges a fee of $2$ € for the first hour of stay (or fraction thereof). After the first hour, it charges at a rate of $1,50$ € for each additional…

A central car park charges a fee of $2$ € for the first hour of stay (or fraction thereof). After the first hour, it charges at a rate of $1,50$ € for each additional hour, billing the extra time proportionally to the exact minutes of stay. Write the piecewise function $C(x)$ representing the total cost in terms of the hours $x$ that the car stays in the car park.

Solve
Practice★★☆Not started
A mobile phone company offers a data tariff that works as follows: a monthly fixed line rental of $15$ € is paid, which includes the first $5$ GB of downloads. If that…

A mobile phone company offers a data tariff that works as follows: a monthly fixed line rental of $15$ € is paid, which includes the first $5$ GB of downloads. If that limit is exceeded, each additional gigabyte (or proportional fraction) is charged at $2$ €.

Write the function $C(x)$ representing the monthly cost in terms of the gigabytes $x$ consumed, and calculate how much a customer who consumed $3$ GB and another who consumed $8,5$ GB will pay.

Solve

Graphing and continuity at the point where the rule changes

To graph a piecewise function, each piece is drawn only within its interval. The endpoint that belongs to the piece (where the inequality includes the equals sign) is marked with a filled dot; the one that does not belong, with an open dot.

Graph of a discontinuous function with a vertical jump at x=1 between a closed endpoint and an open one jump: discontinuous at x=1
Practice★☆☆Not started
Find the boundary point of the following function and determine whether it is continuous at that point:…

Find the boundary point of the following function and determine whether it is continuous at that point:

$f(x) = \begin{cases} 3x-2 & \text{if } x < 2 \\ 5-x & \text{if } x \ge 2 \end{cases}$

Solve
Practice★★☆Not started
Determine the value of the parameter $k$ so that the following piecewise function is continuous throughout its domain:…

Determine the value of the parameter $k$ so that the following piecewise function is continuous throughout its domain:

$f(x) = \begin{cases} x^2 - 1 & \text{if } x \le 2 \\ kx + 3 & \text{if } x > 2 \end{cases}$

Solve
Practice★★☆Not started
Express the function $f(x) = |x - 2| + 3x$ as a piecewise function without using modulus signs, and calculate the values of $f(0)$ and $f(5)$.

Express the function $f(x) = |x - 2| + 3x$ as a piecewise function without using modulus signs, and calculate the values of $f(0)$ and $f(5)$.

Solve

The absolute value as a piecewise function

Practice★★☆Not started
A commuter train starts from a station and accelerates at a constant rate until it reaches a speed of $20$ m/s in $10$ seconds. It maintains that cruising speed for $30$…

A commuter train starts from a station and accelerates at a constant rate until it reaches a speed of $20$ m/s in $10$ seconds. It maintains that cruising speed for $30$ seconds and, finally, brakes uniformly until coming to a complete stop at the next station in $5$ seconds. Write the piecewise function $v(t)$ describing the speed of the train in terms of the time elapsed since starting.

Solve
Practice★★☆Not started
From the graph of the function $h(x)$, which is made up of a parabolic arc and a half-line, find its analytical expression.

From the graph of the function $h(x)$, which is made up of a parabolic arc and a half-line, find its analytical expression.

X Y 0 2 −3 h(x)
Solve
Practice★★★Not started
Determine the values of the parameters $a$ and $b$ so that the function $f(x)$ is continuous at $x=1$ and passes through the point $(4, 9)$.…

Determine the values of the parameters $a$ and $b$ so that the function $f(x)$ is continuous at $x=1$ and passes through the point $(4, 9)$.

$f(x) = \begin{cases} ax^2 + b & \text{if } x < 1 \\ 3x - 2 & \text{if } 1 \le x \le 3 \\ ax - b & \text{if } x > 3 \end{cases}$

Once $a$ and $b$ are found, check mathematically whether the function is also continuous at $x=3$.

Solve

Modelling: tariffs and discounts by bands

Piecewise functions naturally model any tariff, tax or discount that changes beyond a certain threshold. The real-life domain (hours, consumption, quantity) also requires us to specify the interval of validity of each piece.

Graph of the car park tariff: constant piece of 2 € up to t=1 and line C=t+1 up to t=3, joined without a jump at t=1 2 € C(t) = t+1 t (hours)
Practice★★★Not started
Express the function $f(x) = |x + 3| - |2x - 4|$ as a piecewise function, removing the modulus signs, and simplify the expression for each of the resulting sections.

Express the function $f(x) = |x + 3| - |2x - 4|$ as a piecewise function, removing the modulus signs, and simplify the expression for each of the resulting sections.

Solve
Practice★★★Not started
A theatre offers a ticket price of $10$ € if up to a maximum of $50$ people attend. To encourage attendance by large groups, for each person exceeding $50$, the ticket…

A theatre offers a ticket price of $10$ € if up to a maximum of $50$ people attend. To encourage attendance by large groups, for each person exceeding $50$, the ticket price for all attendees is reduced by $0,10$ €.

Write the total revenue function of the theatre $I(x)$ in terms of the number of attendees $x$ (as a piecewise function) and determine how many people must attend for the theatre to obtain the maximum possible revenue.

Solve
Practice★★★Not started
Look at the following graph of the function $p(x)$ and determine its complete analytical expression. From it, state its domain, its range and classify any…

Look at the following graph of the function $p(x)$ and determine its complete analytical expression. From it, state its domain, its range and classify any discontinuities it exhibits.

X Y 0 −3 3 4 p(x)
Solve

Summary

See all the exercises in this section