Continuity And Piecewise-Defined Functions
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
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 piecewise-defined function with a join at \(x=a\):
Continuity at the join \(x=a\) (polynomial branches): substitute \(x=a\) into both rules.
Zeroes and discontinuities of \(f(x)=\dfrac{P(x)}{Q(x)}\):
Even and odd functions:
Evaluating a piecewise function
- Check which inequality the input satisfies, taking care with \(<\) and \(\le\) at a join.
- Substitute into that branch only.
Testing continuity at a join \(x=a\)
- Left: substitute \(a\) into the left branch to find the value it approaches as \(x\to a^-\).
- Right: substitute \(a\) into the right branch. One of these two values is \(f(a)\).
- 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\).
- Check every join. Polynomial branches cannot break anywhere else.
Finding unknown constants
- Set the two branch rules equal at the join and solve.
- Two unknowns: write one equation for each join. Start with the join that has only one unknown, then substitute into the other.
Rational functions
- Factorise the numerator and the denominator.
- Zeroes: numerator \(=0\) (denominator non-zero). Discontinuities: denominator \(=0\).
- Cancel any common factor. Find the hole by substituting its \(x\)-value into the simplified rule.
- Sketch the simplified graph, with an open circle at each hole and dashed asymptotes.
- 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
- Domain: combine the parts of the domain of every branch.
- Range: find the values each branch takes on its own part, then combine them. A sketch helps.
Even, odd or neither
- For \(x>0\): \(-x<0\), so find \(f(-x)\) with the branch for negative inputs and compare it with \(f(x)\) and \(-f(x)\).
- For \(x<0\): repeat with the other branch. Check \(f(0)\) too: an odd function defined at \(0\) has \(f(0)=0\).
- Neither: one pair of values is enough to show a function is not even and not odd.
(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)\).
(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)}\).
Find the values of \(a\) and \(b\).
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\) |
Continuity at \(x=-1\):
| \(2(-1)+a\) | \(=\) | \((-1)^2+3\) |
| \(-2+a\) | \(=\) | \(4\) |
| \(a\) | \(=\) | \(6\) |
\(\therefore\) \(\boldsymbol{a=6}\) and \(\boldsymbol{b=3}\).
Check: at \(x=-1\) both branches give \(4\); at \(x=2\) both give \(7\).
(ii) Sketch \(y=\dfrac{x+2}{x^2-4}\) and state its domain and range.
(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\) |
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}\).
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).
(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?
(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)\) |
For \(x<0\): \(-x>0\), so
| \(f(-x)\) | \(=\) | \((-x)^2-3(-x)\) |
| \(\) | \(=\) | \(x^2+3x\) |
| \(\) | \(=\) | \(-(-x^2-3x)=-f(x)\) |
At \(x=0\): \(f(0)=0\).
\(\therefore\) \(f(-x)=-f(x)\) for all \(x\): \(f\) is odd.
(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
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.