Resources For Teachers For Tutors For Students & Parents Pricing
Year 12 Maths - Methods (Unit 3 & Unit 4) Functions, relations and graphs

Piecewise (hybrid) functions

20 practice questions 0 video lessons Theory + worked examples
Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

A piecewise (hybrid) function is defined by different rules over different parts of its domain, so you select the branch whose sub-domain contains \(x\) before substituting. Its graph uses open and closed endpoints at the joins, and the function is continuous at a join only when the two branch values agree there.

A piecewise function (also called a hybrid function) is a single function built from two or more rules, each applying only on its own stated sub-domain. The sub-domains do not overlap, and together they make up the full domain. A typical definition looks like \(f(x)=x+2\) for \(x\le 1\) and \(f(x)=4-x\) for \(x>1\).

To evaluate \(f(a)\), first decide which sub-domain contains \(a\), then substitute into that branch only. Watch the inequality signs at the boundary: a \(\le\) or \(\ge\) includes the endpoint (a closed dot), while a strict \(<\) or \(>\) excludes it (an open dot).

Where one rule changes to the next is a join. The function is continuous at a join \(x=a\) when the branches meet — the left rule and the right rule give the same value there. If they give different values the graph has a jump and is discontinuous. The domain is the union of the sub-domains, and the range is the union of the value sets of the branches.

Key idea. Choose the branch whose sub-domain contains \(x\), then substitute. At a join \(x=a\) the function is continuous exactly when the two branches agree: \(\,g(a)=h(a)\).
Continuous hybrid functionTwo straight branches meeting at the point (1,3); the left branch y=x+2 for x≤1 and the right branch y=4−x for x>1 join with equal values, so the graph is continuous. x y y=x+2 y=4-x (1,3)
Continuous: the branches meet at \((1,3)\), so the closed dot sits exactly where both rules agree
Hybrid function with a jumpThe left branch y=x+1 rises to an open circle at (2,3); the right branch y=x−2 starts at a closed circle at (2,0). The branch values disagree at x=2, so there is a jump and the function is discontinuous. x y y=x+1 y=x-2 (2,3) (2,0)
A jump: the left branch approaches \((2,3)\) (open) but the right branch value is \((2,0)\) (closed), so \(f\) is discontinuous at \(x=2\)

A two-branch hybrid function is written with a brace, one rule per sub-domain:

\[f(x)=\begin{cases} g(x), & x
f(x)={g(x)x<ah(x)xa

The function is continuous at the join \(x=a\) when the one-sided values match the value there:

\[\lim_{x\to a^{-}}f(x)=\lim_{x\to a^{+}}f(x)=f(a)\]
limxaf(x)=limxa+f(x)=f(a)

For two branches meeting at \(x=a\), this reduces to a single check — do the rules agree?

\[g(a)=h(a)\]
g(a)=h(a)
Endpoints. A weak inequality \(\le\) or \(\ge\) includes its endpoint (closed dot); a strict \(<\) or \(>\) excludes it (open dot). At a jump, the included branch gets the filled dot and the excluded branch gets the open dot.

How to work with a piecewise (hybrid) function

  1. Read the sub-domains. Note which rule applies where, and whether each boundary is \(<\)/\(>\) (open) or \(\le\)/\(\ge\) (closed).
  2. Evaluate. To find \(f(a)\), pick the branch whose sub-domain contains \(a\), then substitute into that rule only.
  3. Sketch each branch. Draw every rule over its own sub-domain, ending with an open circle where the endpoint is excluded and a filled circle where it is included.
  4. Test the join. Compare the two branch values at each boundary \(x=a\): if \(g(a)=h(a)\) the graph joins (continuous); if not, it jumps (discontinuous).
  5. State domain and range. Domain is the union of the sub-domains; read the range off the sketch as the union of the branch value sets, watching included vs excluded endpoints.
Continuity shortcut. For two branches meeting at \(x=a\), you do not need limits from first principles — just substitute \(a\) into each rule and check whether the two answers are equal.
Example 1 — selecting the right branch
For \(f(x)=\begin{cases} 2x+1, & x<0\\ x^{2}, & 0\le x\le 2\\ 5, & x>2 \end{cases}\) find \(f(-1)\), \(f(1)\) and \(f(4)\).
Solution
\(x=-1\) lies in \(x<0\) — use \(2x+1\):
\(f(-1)\)\(=\)\(2(-1)+1=-1\)
\(x=1\) lies in \(0\le x\le 2\) — use \(x^{2}\):
\(f(1)\)\(=\)\((1)^{2}=1\)
\(x=4\) lies in \(x>2\) — use the constant \(5\):
\(f(4)\)\(=\)\(5\)
\(\therefore\) \(f(-1)=-1,\ f(1)=1,\ f(4)=5\)
f(1)=1
Example 2 — sketch, domain and range
Sketch \(f(x)=\begin{cases} x+2, & -3\le x\le 0\\ x-1, & 0
Solution
Endpoints of each branch — use the inequalities:
left branch:\((-3,-1)\) to \((0,2)\), both closed
right branch:\((0,-1)\) open to \((3,2)\) closed
Sketch of a hybrid functionA closed branch y=x+2 for x≤0 ends with a filled dot at (0,2); a branch y=x−1 for x>0 starts with an open dot at (0,−1) and rises to (3,2). The graph shows a jump at x=0. x y y=x+2 y=x-1
Domain is the union of the sub-domains; range from the sketch:
domain\(=\)\([-3,3]\)
range\(=\)\([-1,2]\)
\(\therefore\) domain \([-3,3]\), range \([-1,2]\); a jump at \(x=0\)
range=[1,2]
Example 3 — make it continuous
Find the value of \(a\) that makes \(f(x)=\begin{cases} x^{2}+1, & x\le 2\\ ax-1, & x>2 \end{cases}\) continuous.
Solution
Continuity at the join \(x=2\) needs the branches to agree there:
left value\(=\)\((2)^{2}+1=5\)
right value\(=\)\(a(2)-1=2a-1\)
Set the values equal and solve for \(a\):
\(2a-1\)\(=\)\(5\)
\(2a\)\(=\)\(6\)
\(a\)\(=\)\(3\)
\(\therefore\) \(a=3\) makes \(f\) continuous at \(x=2\)
a=3
Example 4 — parabola and line branches
For \(f(x)=\begin{cases} 4-x^{2}, & -2\le x<1\\ x+1, & 1\le x\le 3 \end{cases}\) find \(f(0)\) and \(f(1)\), test continuity at \(x=1\), and state the domain and range.
Solution
Evaluate — choose the branch for each \(x\):
\(f(0)\)\(=\)\(4-(0)^{2}=4\)
\(f(1)\)\(=\)\((1)+1=2\)
Test the join \(x=1\) — compare the limit from the left with \(f(1)\):
left branch at \(1\)\(\to\)\(4-(1)^{2}=3\)
\(f(1)\)\(=\)\(2\)
Hybrid of a parabola and a lineThe branch y=4−x squared runs from a filled dot at (−2,0) up over the vertex (0,4) to an open circle at (1,3); the branch y=x+1 runs from a filled dot at (1,2) up to (3,4). The two branch values disagree at x=1, so the function is discontinuous there. x y y=4-x^2 y=x+1
The left branch approaches \(3\) but \(f(1)=2\), so the graph jumps. Domain and range from the sketch:
domain\(=\)\([-2,3]\)
range\(=\)\([0,4]\)
\(\therefore\) \(f(0)=4,\ f(1)=2\); discontinuous at \(x=1\); domain \([-2,3]\), range \([0,4]\)
f(0)=4,f(1)=2

Common pitfalls

Using the wrong branch. Always check which sub-domain contains \(x\) before substituting, and watch \(<\) versus \(\le\) at a boundary — for \(f(x)=x^{2}\) on \(0\le x\le 2\) and \(5\) on \(x>2\), the value \(f(2)=4\), not \(5\).
Filling both dots at a jump. An endpoint is included by \(\le\) or \(\ge\) (closed) and excluded by \(<\) or \(>\) (open). At a jump exactly one branch owns the \(x\)-value: draw one filled dot and one open dot, never two filled.
Assuming a join is continuous because it “looks” connected. Continuity is decided by the algebra: substitute the join value into each rule and confirm \(g(a)=h(a)\). If they differ, the function is discontinuous even if the picture is drawn carelessly.

Frequently asked questions

What is a piecewise (hybrid) function?

A single function built from two or more rules, each applying only on its own stated sub-domain. The sub-domains do not overlap and together they make the whole domain, e.g. \(x+2\) for \(x\le 1\) and \(4-x\) for \(x>1\).

How do you evaluate a piecewise function?

Find which sub-domain contains the \(x\)-value, then substitute into that branch only. If \(f\) is \(2x+1\) for \(x<0\) and \(x^{2}\) for \(x\ge 0\), then \(f(-1)=-1\) and \(f(3)=9\).

How do you know if a piecewise function is continuous?

Check each join \(x=a\). The function is continuous there when the two branches give the same value, i.e. \(g(a)=h(a)=f(a)\). If they disagree the graph jumps and is discontinuous.

When do you use an open or closed circle at a join?

A closed (filled) circle marks an included endpoint (\(\le\) or \(\ge\)); an open (hollow) circle marks an excluded endpoint (\(<\) or \(>\)). At a jump, the included value gets the filled dot and the excluded value gets the open dot.

How do you find the domain and range of a piecewise function?

The domain is the union of the sub-domains. For the range, find the value set of each branch over its sub-domain (watching included versus excluded endpoints), then take the union; a sketch makes the highest and lowest values clear.

Is a piecewise function always discontinuous at a join?

No. It is continuous at a join when the branches meet at the same point, so their values agree. It is discontinuous only when the branch values differ, producing a jump.