Hersi Maths WhatsApp me

Understand · explore · practise

Piecewise functions

Evaluate piecewise functions, sketch open and closed endpoints, find ranges and solve equations with branch restrictions. Explore a jump using a manual graph.

Before you startFunction notation, domain and range, straight lines and quadratics

01 / Choose the rule

Use the input to choose a branch before calculating.

A piecewise function uses different formulas on different parts of its domain. Together the branches must assign exactly one output to every allowed input. A change of rule does not stop the whole object being one function.

f(x) = 2x + 3 for −3 ≤ x < 0
f(x) = x² + 1 for 0 ≤ x ≤ 3

We will use this function throughout the exploration. Its domain is [−3, 3]. The input 0 belongs only to the second branch. Inputs outside [−3, 3] have no defined output here.

02 / Evaluate accurately

Check the inequality, then substitute.

Four inputs, two rulesWorked example

f(−2) = 2(−2) + 3 = −1

Since −2 < 0, use the linear rule.

f(0) = 0² + 1 = 1

The equality sign belongs to the quadratic branch.

f(2) = 2² + 1 = 5

A positive input uses the quadratic rule.

f(4) is undefined

Neither branch allows x = 4. Do not extend a formula beyond its given domain.

The sign of the input chooses the rule here, not the sign of the answer. For example, f(−1) = 1 uses the first branch even though its output is positive.

03 / Sketch and explore

Open and filled endpoints encode the definition.

Draw the line only from x = −3 up to, but not including, x = 0. Put a hollow point at (0, 3). Draw the quadratic from x = 0 to x = 3 inclusive, with a filled point at (0, 1).

As negative inputs approach zero, outputs approach 3. At zero the actual output is 1. This jump is allowed: each input still has exactly one output. Do not join the two boundary points with a vertical line.

One input, one active ruleExplore
Piecewise line and quadratic with a jump at zeroFor −3 ≤ x < 0, f(x) = 2x + 3. For 0 ≤ x ≤ 3, f(x) = x² + 1. At zero the value is 1, not 3.−303xy1031−3

Gold line: 2x + 3 for −3 ≤ x < 0.
Blue curve: x² + 1 for 0 ≤ x ≤ 3.

x = −1 belongs to the first branch. f(−1) = 1.

Hollow at (0, 3): excluded. Filled at (0, 1): included. The green point uses only the permitted branch.

Watch the active branch change at zero

Pause, replay or seek freely. The notes explain the same idea and stay in view.

04 / Combine branch ranges

Find each branch’s outputs, then take their union.

The range of our functionWorked example

First branch: −3 ≤ x < 0
Outputs: −3 ≤ y < 3

The line increases from the included value −3 towards the excluded value 3.

Second branch: 0 ≤ x ≤ 3
Outputs: 1 ≤ y ≤ 10

The quadratic increases from 1 to 10 on this restricted branch.

Total range: [−3, 3) ∪ [1, 10] = [−3, 10]

The intervals overlap. In particular, y = 3 occurs on the second branch at x = √2, despite the hollow point at (0, 3).

A jump in the graph does not necessarily leave a gap in the range. Check all branches before excluding an output.

05 / Solve on each branch

A root is valid only if its branch allows that input.

Solve f(x) = 4Worked example

First branch: 2x + 3 = 4 ⇒ x = 1/2

Reject: the first branch requires x < 0.

Second branch: x² + 1 = 4 ⇒ x = ±√3

Keep √3, since it lies in [0, 3]. Reject −√3 because it is outside this branch.

Answer: x = √3

Substitution into the appropriate branch confirms the output is 4.

For f(x) = 2, the first branch gives x = −1/2 and the second gives x = 1 (discarding −1). Both accepted inputs give output 2, so this function is many-to-one.

06 / Boundaries and fixed points

Check coverage, consistency and the requested equation.

Using x < 0 and x > 0 leaves zero out of the domain. That is fine if zero is deliberately excluded; it is incomplete if the stated domain includes zero. Using x ≤ 0 and x ≥ 0 overlaps at zero: the two rules must agree there to define one output.

For example, rules x + 2 for x < 1 and ax for x ≥ 1 meet continuously if a = 3: both sides meet at height 3. Other values of a still give a function, but with a jump.

A fixed point satisfies f(x) = xWorked example

2x + 3 = x ⇒ x = −3

This is permitted by the first branch, so (−3, −3) lies on y = x.

x² + 1 = x ⇒ x² − x + 1 = 0

The discriminant is −3, so the second branch has no real fixed point.

Only x = −3

A fixed point is an input that equals its output, not a turning point.

07 / Your turn

Keep the branch restrictions beside every equation.

Questions 1–5 use f(x) = 2x + 3 for −3 ≤ x < 0, and f(x) = x² + 1 for 0 ≤ x ≤ 3.

01 · Which branch?

Find f(−3), f(−1/2), f(0) and f(3).

Hint

The boundary zero belongs to the second branch.

Worked solution

They are −3, 2, 1 and 10 respectively. Each input uses exactly one of the specified rules.

02 · Zero output

Solve f(x) = 0.

Hint

Solve separately and check each candidate.

Worked solution

The line gives x = −3/2, which is allowed. The quadratic gives x² = −1, with no real solution. Answer: x = −3/2.

03 · A hollow point

Is 3 in the range? Find every x for which f(x) = 3.

Hint

A hollow point only excludes that coordinate pair.

Worked solution

The line gives x = 0, rejected from the first branch. The quadratic gives ±√2, of which only √2 is allowed. Thus 3 is in the range and the only input producing it is √2.

04 · Count solutions

Solve f(x) = 1.

Hint

Both branches may produce the same output.

Worked solution

The line gives x = −1, allowed. The quadratic gives x = 0, allowed. The solutions are −1 and 0.

05 · Fixed point

Find all fixed points of f.

Hint

Set each formula equal to x.

Worked solution

The first equation gives x = −3, which is allowed. The second gives x² − x + 1 = 0, with negative discriminant. The only fixed point is x = −3, represented by (−3, −3).

06 · A gap in the range

g(x) = x for −2 ≤ x < 0, and g(x) = x + 3 for 0 ≤ x ≤ 2. Find the domain and range.

Hint

Find the two output intervals before combining them.

Worked solution

The domain is [−2, 2]. The ranges are [−2, 0) and [3, 5], so the range is [−2, 0) ∪ [3, 5]. No output in [0, 3) is reached.

07 · Overlapping rules

A proposed function uses 2x + 1 for x ≤ 0 and x + 4 for x ≥ 0. Explain the problem and give one correction that keeps all real inputs.

Hint

What outputs are assigned to zero?

Worked solution

Zero is assigned both 1 and 4, so this is not a function as stated. Change the first restriction to x < 0, retaining the second as x ≥ 0. Then zero has the single output 4 and all real inputs remain covered.

08 · Make the pieces meet

h(x) = 3x − 1 for x < 2 and h(x) = x + c for x ≥ 2. Find c so the graph has no jump at x = 2. Does another c stop h being a function?

Hint

Match the boundary heights, then consider output uniqueness.

Worked solution

The left height approaches 5. The right height at 2 is 2 + c, so c = 3 makes them meet. Any other real c still defines a function: the branches do not overlap and every real input has one output. It simply has a jump at 2.

08 / Recap

A formula never overrides its branch restriction.

  • Choose the branch using the input.
  • Mark excluded endpoints hollow and included endpoints filled.
  • Unite the branch ranges; a hollow point need not exclude its output everywhere.
  • Solve equations on each branch and reject inputs outside that branch.
  • A jump is compatible with being a function.

Back to functions and graphs →

Section 1 of 8 · Choose the rule