Resources For Teachers For Tutors For Students & Parents AI New Books Pricing
Year 11 (2026) Maths Advanced (2026) Piecewise Functions, Continuity and Absolute Value

Continuity And Piecewise-Defined Functions

20 practice questions 2 video lessons Theory + worked examples
Practice 20 questions
Practice questions

Every question with a fully worked solution.

Start practising
Watch 2 video(s)
  • Continuity And Piecewise-Defined Functions - Video 1 Watch
  • Continuity And Piecewise-Defined Functions - Video 2 Watch
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A piecewise-defined function uses different rules on different parts of its domain. This Year 11 Mathematics Advanced page shows how to evaluate a piecewise function, decide whether it is continuous at a join, find unknown constants that make it continuous, find the zeroes and discontinuities of a rational function, sketch graphs with a hole, state the domain and range, and test a piecewise function for being even or odd.

A piecewise-defined function uses different rules, called branches, on different parts of its domain. For example

\[f(x)=\begin{cases}x+1 & \text{for } x<1\\ 4-x & \text{for } x\ge 1\end{cases}\]

To evaluate \(f\) at a number, first decide which inequality the number satisfies, then use that branch only: \(f(-2)=-2+1=-1\) and \(f(3)=4-3=1\). The value where the rule changes is the join (here \(x=1\)). The \(\le\) or \(\ge\) sign tells you which branch owns it: here \(f(1)=4-1=3\).

A function is continuous at \(x=a\) if its graph can be drawn through \(x=a\) without lifting the pen. For a piecewise function this means the branches meet at the join: the value the left branch approaches as \(x\to a^-\) (\(x\) approaches \(a\) from below) equals the value the right branch approaches as \(x\to a^+\) (from above), and both equal \(f(a)\). If the values are different, the graph has a jump and \(f\) is discontinuous at \(x=a\). In the example the left branch approaches \(2\) but \(f(1)=3\), so there is a jump at \(x=1\). A change of rule on its own does not make a function discontinuous; only a gap between the branches does.

Polynomials (lines, parabolas, cubics) are continuous everywhere, so a piecewise function built from polynomial branches can only break at a join.

A rational function such as \(f(x)=\dfrac{x+3}{(x-1)(x+2)}\) is not defined where its denominator is zero, so it is discontinuous at \(x=1\) and \(x=-2\). Its zeroes are the values of \(x\) that make the numerator zero (with the denominator non-zero): here \(x=-3\). If a factor cancels from the numerator and denominator, the graph is the graph of the simplified function with a hole (an open circle) at that \(x\)-value. If the denominator is still zero after cancelling, the graph has a vertical asymptote there.

A function is even if \(f(-x)=f(x)\) for every \(x\) in its domain (the graph is symmetric about the \(y\)-axis), and odd if \(f(-x)=-f(x)\) (the graph has point symmetry about the origin). For a piecewise function split at \(x=0\), if \(x\) is in one part then \(-x\) is in the other, so \(f(-x)\) comes from the other branch.

A jump discontinuity at x = 1The left branch y = x + 1 rises towards an open circle at (1, 2). The right branch y = 4 - x starts at a filled dot at (1, 3) and falls. The branches do not meet, so the graph jumps at x = 1. x y −2 −1 2 3 4 −1 1 2 3 4 (1, 2) f(1) = 3 y = x + 1 y = 4 − x 1
\(f(x)=\begin{cases}x+1 & \text{for } x<1\\ 4-x & \text{for } x\ge 1\end{cases}\): as \(x\to 1^-\), the left branch approaches \(2\), but \(f(1)=3\). The branches do not meet, so there is a jump and \(f\) is discontinuous at \(x=1\). An open circle marks a point that is not included; a filled dot marks a point that is.
The graph of y = (x^2 - x - 2)/(x - 2): a line with a holeThe graph is the line y = x + 1 with an open circle (a hole) at (2, 3), because the function is not defined at x = 2. x y −2 −1 1 2 3 4 −1 1 2 3 4 5 hole (2, 3) y = x + 1, x ≠ 2
\(y=\dfrac{x^2-x-2}{x-2}=\dfrac{(x-2)(x+1)}{x-2}=x+1\), \(x\neq 2\). The graph is the line \(y=x+1\) with a hole at \((2,3)\): the function is discontinuous at \(x=2\). Domain: all \(x\), \(x\neq 2\); range: all \(y\), \(y\neq 3\).

A piecewise-defined function with a join at \(x=a\):

\[f(x)=\begin{cases}g(x) & \text{for } x\lt a\\ h(x) & \text{for } x\ge a\end{cases}\]
f of x equals g of x for x less than a, and h of x for x at least a

Continuity at the join \(x=a\) (polynomial branches): substitute \(x=a\) into both rules.

\[g(a)=h(a)\quad\Longrightarrow\quad \text{continuous at } x=a\qquad\qquad g(a)\neq h(a)\quad\Longrightarrow\quad\text{jump}\]
if g of a equals h of a the function is continuous at a; otherwise there is a jump

Zeroes and discontinuities of \(f(x)=\dfrac{P(x)}{Q(x)}\):

\[\text{zeroes: } P(x)=0,\ Q(x)\neq 0\qquad\qquad \text{discontinuities: } Q(x)=0\]
zeroes where the numerator is zero and the denominator is not; discontinuities where the denominator is zero

Even and odd functions:

\[\text{even: } f(-x)=f(x)\qquad\qquad \text{odd: } f(-x)=-f(x)\]
even means f of negative x equals f of x; odd means f of negative x equals negative f of x
Finding an unknown. For \(f(x)=\begin{cases}2x+k & \text{for } x<3\\ x^2-1 & \text{for } x\ge 3\end{cases}\) to be continuous at \(x=3\), the branches must meet: \(2(3)+k=3^2-1\), so \(6+k=8\) and \(k=2\).
Filling a hole. For \(h(x)=\begin{cases}\dfrac{a\left(x^2-1\right)}{x+1} & \text{for } x\neq -1\\ 6 & \text{for } x=-1\end{cases}\) to be continuous, simplify the first branch: \(\dfrac{a(x-1)(x+1)}{x+1}=a(x-1)\), \(x\neq -1\). As \(x\to -1\), \(h(x)\to a(-1-1)=-2a\). This must equal \(h(-1)=6\), so \(-2a=6\) and \(a=-3\).
Hole or asymptote? Factorise and cancel. A factor that cancels completely leaves a hole; a factor still in the denominator gives a vertical asymptote. Both values are excluded from the domain.

Evaluating a piecewise function

  1. Check which inequality the input satisfies, taking care with \(<\) and \(\le\) at a join.
  2. Substitute into that branch only.

Testing continuity at a join \(x=a\)

  1. Left: substitute \(a\) into the left branch to find the value it approaches as \(x\to a^-\).
  2. Right: substitute \(a\) into the right branch. One of these two values is \(f(a)\).
  3. Compare: equal values mean the branches meet, so \(f\) is continuous at \(x=a\); different values mean a jump, so \(f\) is discontinuous at \(x=a\).
  4. Check every join. Polynomial branches cannot break anywhere else.

Finding unknown constants

  1. Set the two branch rules equal at the join and solve.
  2. Two unknowns: write one equation for each join. Start with the join that has only one unknown, then substitute into the other.

Rational functions

  1. Factorise the numerator and the denominator.
  2. Zeroes: numerator \(=0\) (denominator non-zero). Discontinuities: denominator \(=0\).
  3. Cancel any common factor. Find the hole by substituting its \(x\)-value into the simplified rule.
  4. Sketch the simplified graph, with an open circle at each hole and dashed asymptotes.
  5. State the domain (all \(x\) except the discontinuities) and the range (leave out the \(y\)-value of a hole, unless the graph reaches it elsewhere, and the value of any horizontal asymptote).

Domain and range of a piecewise function

  1. Domain: combine the parts of the domain of every branch.
  2. Range: find the values each branch takes on its own part, then combine them. A sketch helps.

Even, odd or neither

  1. For \(x>0\): \(-x<0\), so find \(f(-x)\) with the branch for negative inputs and compare it with \(f(x)\) and \(-f(x)\).
  2. For \(x<0\): repeat with the other branch. Check \(f(0)\) too: an odd function defined at \(0\) has \(f(0)=0\).
  3. Neither: one pair of values is enough to show a function is not even and not odd.
Example 1 — Evaluating and testing a join
Consider \(f(x)=\begin{cases}3-x & \text{for } x<1\\ x^2+3 & \text{for } 1\le x\le 3\end{cases}\)
(i) Find \(f(-2)\), \(f(1)\) and \(f(3)\).
(ii) Is \(f(x)\) continuous at \(x=1\)?
(iii) State the domain and range of \(f(x)\).
Solution

(i) Select the branch for each input:

\(-2<1\): \(f(-2)=3-(-2)=\boldsymbol{5}\)
\(1\le 1\le 3\): \(f(1)=1^2+3=\boldsymbol{4}\)
\(1\le 3\le 3\): \(f(3)=3^2+3=\boldsymbol{12}\)

(ii) Compare the two branches at \(x=1\):

From the left: \(3-x\to 3-1=2\).
At \(x=1\): \(f(1)=4\).
\(2\neq 4\), so there is a jump at \(x=1\).

\(\therefore\) \(f\) is discontinuous at \(x=1\).

(iii) Domain: \(x<1\) together with \(1\le x\le 3\) gives \(x\le 3\), i.e. \(\boldsymbol{(-\infty,3]}\).

Range: for \(x<1\), \(3-x\) takes all values \(>2\). For \(1\le x\le 3\), \(x^2+3\) takes values from \(4\) to \(12\). Together: \(\boldsymbol{y>2}\), i.e. \(\boldsymbol{(2,\infty)}\).

Graph of the function in Example 1For x less than 1 the line y = 3 - x falls towards an open circle at (1, 2). For x from 1 to 3 the parabola y = x squared + 3 rises from a filled dot at (1, 4) to a filled dot at (3, 12). There is a jump at x = 1. x y −2 −1 1 2 3 2 4 6 8 10 12 (1, 2) (1, 4) (3, 12)
Example 2 — Two unknown constants
The function \(f(x)=\begin{cases}2x+a & \text{for } x<-1\\ x^2+b & \text{for } -1\le x<2\\ 3x+1 & \text{for } x\ge 2\end{cases}\) is continuous for all \(x\).
Find the values of \(a\) and \(b\).
Solution

For continuity the branches must meet at each join. The join \(x=2\) has only one unknown, so start there.

Continuity at \(x=2\):

\(2^2+b\)\(=\)\(3(2)+1\)
\(4+b\)\(=\)\(7\)
\(b\)\(=\)\(3\)
2 squared plus b equals 3 times 2 plus 1, so 4 plus b equals 7 and b equals 3

Continuity at \(x=-1\):

\(2(-1)+a\)\(=\)\((-1)^2+3\)
\(-2+a\)\(=\)\(4\)
\(a\)\(=\)\(6\)
2 times negative 1 plus a equals negative 1 squared plus 3, so negative 2 plus a equals 4 and a equals 6

\(\therefore\) \(\boldsymbol{a=6}\) and \(\boldsymbol{b=3}\).

Check: at \(x=-1\) both branches give \(4\); at \(x=2\) both give \(7\).

Graph of the continuous function in Example 2The line y = 2x + 6 for x less than -1 meets the parabola y = x squared + 3 at (-1, 4). The parabola meets the line y = 3x + 1 at (2, 7). The graph has no breaks. x y −3 −2 −1 1 2 3 2 4 6 8 10 12 (−1, 4) (2, 7)
Example 3 — Zeroes, discontinuities and a hole
(i) State the zeroes and the discontinuities of \(g(x)=\dfrac{x^2-9}{x^2+5x+4}\).
(ii) Sketch \(y=\dfrac{x+2}{x^2-4}\) and state its domain and range.
Solution

(i) Factorise numerator and denominator:

\(g(x)=\dfrac{(x-3)(x+3)}{(x+1)(x+4)}\)

Zeroes: \((x-3)(x+3)=0\), so \(x=3\) or \(x=-3\).
Discontinuities: \((x+1)(x+4)=0\), so \(x=-1\) or \(x=-4\).

\(\therefore\) zeroes \(\boldsymbol{x=3,\ -3}\); discontinuous at \(\boldsymbol{x=-1}\) and \(\boldsymbol{x=-4}\).

(ii) Factorise and simplify:

\(y\)\(=\)\(\dfrac{x+2}{(x-2)(x+2)}\)
\(\)\(=\)\(\dfrac{1}{x-2},\quad x\neq 2,\ x\neq -2\)
y equals x plus 2 over x minus 2 times x plus 2, which is 1 over x minus 2, for x not equal to 2 or negative 2

Asymptotes \(x=2\) and \(y=0\). The factor \(x+2\) cancels, so there is a hole at \(x=-2\): \(y=\dfrac{1}{-2-2}=-\dfrac{1}{4}\), giving \(\left(-2,-\dfrac{1}{4}\right)\). The \(y\)-intercept is \(-\dfrac{1}{2}\).

Graph of y = (x + 2)/(x^2 - 4)The hyperbola y = 1/(x - 2) with a vertical asymptote x = 2 and horizontal asymptote y = 0 (the x-axis). There is an open circle (a hole) at (-2, -1/4). The graph crosses the y-axis at (0, -1/2). x y −4 −3 1 3 4 5 −3 −2 −1 1 2 3 (−2, −¼) x = 2 (0, −½)

Domain: all \(x\), \(\boldsymbol{x\neq 2,\ x\neq -2}\).
Range: all \(y\), \(\boldsymbol{y\neq 0}\) (asymptote) and \(\boldsymbol{y\neq -\dfrac{1}{4}}\) (hole).

Example 4 — Continuity at 0, even or odd
(i) For \(f(x)=\begin{cases}-x^2-3x & \text{for } x<0\\ x^2-3x & \text{for } x\ge 0\end{cases}\), is \(f(x)\) continuous at \(x=0\)?
(ii) Is \(f(x)\) even, odd or neither?
(iii) Is \(g(x)=\begin{cases}x^2+1 & \text{for } x<0\\ 1-x & \text{for } x\ge 0\end{cases}\) even, odd or neither?
Solution

(i) As \(x\to 0^-\): \(-x^2-3x\to 0\). Also \(f(0)=0^2-3(0)=0\).

Both agree, so \(f\) is continuous at \(x=0\).

(ii) Find \(f(-x)\) on each part of the domain.

For \(x>0\): \(-x<0\), so

\(f(-x)\)\(=\)\(-(-x)^2-3(-x)\)
\(\)\(=\)\(-x^2+3x\)
\(\)\(=\)\(-(x^2-3x)=-f(x)\)
f of negative x equals negative x squared plus 3x, which is negative f of x

For \(x<0\): \(-x>0\), so

\(f(-x)\)\(=\)\((-x)^2-3(-x)\)
\(\)\(=\)\(x^2+3x\)
\(\)\(=\)\(-(-x^2-3x)=-f(x)\)
f of negative x equals x squared plus 3x, which is negative f of x

At \(x=0\): \(f(0)=0\).

\(\therefore\) \(f(-x)=-f(x)\) for all \(x\): \(f\) is odd.

Graph of the odd function in Example 4For x less than 0 the curve y = -x squared - 3x is an upside-down parabola piece with a maximum near (-1.5, 2.25). For x at least 0 the curve y = x squared - 3x has a minimum near (1.5, -2.25). The two pieces meet at the origin, and the graph has point symmetry about the origin. x y −3 −2 −1 1 2 3 −4 −2 2 4 y = −x² − 3x y = x² − 3x

(iii) Test with a pair of values:

\(g(2)=1-2=-1\) and \(g(-2)=(-2)^2+1=5\).
\(g(-2)\neq g(2)\), so \(g\) is not even.
\(g(-2)\neq -g(2)=1\), so \(g\) is not odd.

\(\therefore\) \(g(x)\) is neither even nor odd.

Common pitfalls

Use the branch the input belongs to. Check the inequality before substituting, and read the \(<\) or \(\le\) at a join carefully: for \(x<1\) and \(x\ge 1\), the value \(f(1)\) comes from the second branch.
A change of rule is not a break. Two different rules can still join smoothly. Test the join by substituting it into both rules: equal values mean continuous, different values mean a jump.
A zero needs a non-zero denominator. For \(f(x)=\dfrac{(x-1)(x+2)}{(x-1)(x-4)}\), \(x=1\) makes the numerator zero but also the denominator, so it is a hole, not a zero. The only zero is \(x=-2\).
Cancelling does not remove the gap. \(\dfrac{x^2-x-2}{x-2}\) simplifies to \(x+1\), but it is still undefined at \(x=2\). Draw an open circle at \((2,3)\), leave \(x=2\) out of the domain and \(y=3\) out of the range.
For even or odd, \(f(-x)\) uses the other branch. If \(x>0\) then \(-x<0\), so substitute \(-x\) into the rule for negative inputs. One pair of values can prove a function is not even or not odd, but it cannot prove that it is.

Frequently asked questions

What is a piecewise function?

A function that uses different rules (branches) on different parts of its domain. To evaluate it, find which part the input belongs to and use that rule only.

How do you check if a piecewise function is continuous?

At each join, substitute the join value into both rules. If the two values are equal the branches meet and the function is continuous there. If they are different there is a jump, so the function is discontinuous there.

How do you find k to make a piecewise function continuous?

Set the two rules equal at the join and solve for \(k\). For \(2x+k\) when \(x<3\) and \(x^2-1\) when \(x\ge 3\): \(2(3)+k=3^2-1\), so \(6+k=8\) and \(k=2\).

What is the difference between a hole and an asymptote?

Both are discontinuities where the denominator is zero. If the factor cancels from the numerator and denominator, the graph has a hole (an open circle). If the denominator is still zero after cancelling, the graph has a vertical asymptote.

How do you tell if a piecewise function is even or odd?

Find \(f(-x)\) using the branch that \(-x\) belongs to. If \(f(-x)=f(x)\) for every \(x\), the function is even; if \(f(-x)=-f(x)\), it is odd. If one pair of values fails both tests, it is neither.