✦ScienexySCIENCE KNOWLEDGE LIBRARY
reference · SCI-MAT-007-016

Piecewise-Defined Functions

A piecewise-defined function uses different mathematical expressions or rules on different parts of its domain. It is useful for representing systems whose behavior changes across intervals, conditions, or thresholds.

  • f(x) = {g(x), if x ∈ A; h(x), if x ∈ B}

  • lim_{x → c⁻} f(x) = lim_{x → c⁺} f(x) = f(c) (continuity at c)

  • f'(c) = lim_{h → 0} [f(c + h) − f(c)]/h

Explanation

A piecewise-defined function is a function whose rule depends on the input value or on a condition satisfied by that input. Instead of using one formula across the entire domain, it uses separate expressions on different intervals or subsets. For example, a function may use one expression when x is negative and another when x is nonnegative. Piecewise functions are useful for modelling situations involving thresholds, stages, boundaries, taxes, tariffs, physical constraints, and changing operating conditions. Each piece must be defined on its specified part of the domain, and the complete function must assign exactly one output to every permitted input. The behavior at boundary points requires particular attention. A piecewise function may be continuous at a boundary if the relevant one-sided limits agree with the function value, but it may also have a jump, removable, or other discontinuity. Differentiability requires additional conditions beyond continuity. A function may be continuous at a boundary but fail to be differentiable there, as occurs with an absolute-value function at zero. Piecewise functions are important in calculus because limits, continuity, derivatives, and integrals must often be analysed separately across the intervals where the defining rules apply.

Variables

  • f(x): the piecewise-defined function.

  • x: the independent variable.

  • g(x) and h(x): different expressions defining separate pieces.

  • A and B: subsets or intervals of the domain.

  • c: a boundary point between pieces.

  • lim: the limit operation.

  • f(c): the function value at the boundary.

  • f'(c): the derivative at the boundary, if it exists.

Example or application

Consider f(x) = |x|. It can be represented as f(x) = −x when x < 0 and f(x) = x when x ≥ 0. The function uses different expressions on either side of zero but produces a single output for every real input. It is continuous at zero, but it is not differentiable there because the left-hand and right-hand derivatives are different.

Definition

A piecewise-defined function is a function whose output is determined by different expressions or rules on specified parts of its domain, with each permitted input assigned exactly one output.

Purpose

The purpose of piecewise functions is to model relationships that follow different rules under different conditions. They allow mathematical descriptions to represent thresholds, changing behavior, restrictions, and systems that cannot be accurately described by one formula over the entire domain.

Importance

Piecewise functions are essential in calculus because they provide realistic models for systems with different operating regimes. They also help learners understand one-sided limits, continuity, differentiability, and integration across boundaries. Many practical systems involve thresholds or conditional rules, making piecewise modelling a common mathematical technique.

Learning Objectives

  • Define piecewise-defined functions.

  • Interpret the conditions associated with each piece.

  • Evaluate a piecewise function at specified inputs.

  • Represent absolute-value functions piecewise.

  • Determine boundary values and intervals.

  • Analyse one-sided limits at piecewise boundaries.

  • Test continuity at boundary points.

  • Understand why continuity does not always guarantee differentiability.

  • Recognize real-world applications of piecewise modelling.

Key Concepts

  • Piecewise function: a function defined by different rules on different parts of its domain.

  • Piece: one expression and its associated domain condition.

  • Boundary point: an input separating two or more pieces.

  • One-sided limit: a limit approached from only the left or right side.

  • Continuity: a property requiring the function value and two-sided limit to agree at a point.

  • Differentiability: the existence of a finite derivative at a point.

  • Jump discontinuity: a discontinuity in which finite left-hand and right-hand limits differ.

  • Removable discontinuity: a discontinuity that can be removed by redefining the function at a point.

  • Absolute-value function: a function giving the nonnegative magnitude of a real number.

  • Conditional rule: a rule applied only when a specified condition is satisfied.

Working Principle

A piecewise function first checks the input against its specified conditions. It then applies the corresponding expression to calculate the output. At a boundary between pieces, the left-hand and right-hand behavior must be examined separately. Continuity requires the two one-sided limits to agree with the function value. Differentiability requires the corresponding difference-quotient behavior to approach a common finite limit.

Process

Read all piecewise conditions carefully and identify the domain of each expression. Select the condition that contains the given input and evaluate only the corresponding formula. For graphing, plot each expression on its specified interval and use open or closed endpoints according to the boundary conditions. At a boundary, calculate the left-hand limit, right-hand limit, and function value. Compare them to test continuity. If continuity holds, examine the left-hand and right-hand derivatives to determine differentiability.

Applications

  • Economics: progressive tax systems and pricing rules that change at thresholds.

  • Physics: motion models involving different phases or operating conditions.

  • Engineering: control systems with different responses under different input ranges.

  • Computer science: conditional functions and algorithmic decision rules.

  • Statistics: probability density functions defined over separate intervals.

  • Biology: models with different growth behavior before and after a threshold.

  • Environmental science: piecewise models for changing conditions across seasons or environmental states.

  • Mathematical modelling: representing saturation, threshold effects, and constrained behavior.

Worked Example

Problem: Let f(x) = x + 2 for x < 1 and f(x) = 3x for x ≥ 1. Find f(0), f(1), and determine whether the function is continuous at x = 1. Step 1: Since 0 < 1, use the first rule: f(0) = 0 + 2 = 2. Step 2: Since 1 ≥ 1, use the second rule: f(1) = 3(1) = 3. Step 3: Calculate the left-hand limit: limₓ→₁⁻ f(x) = 1 + 2 = 3. Step 4: Calculate the right-hand limit: limₓ→₁⁺ f(x) = 3(1) = 3. Step 5: Compare both limits with the function value. Both limits equal 3, and f(1) = 3. Therefore, the function is continuous at x = 1. Continuity at this boundary does not by itself establish differentiability; the one-sided derivatives must also be compared.

Common Misconceptions

  • A piecewise function is not a true function. It is a valid function if each permitted input has exactly one output.

  • Every piecewise function is discontinuous. Different pieces can join continuously.

  • A function that is continuous at a boundary must be differentiable there. Continuity is necessary but not sufficient for differentiability.

  • The equality sign in a boundary condition can be ignored. It determines which rule defines the function value at that point.

  • Every piece must use a different formula. Two pieces may use identical expressions over different intervals.

  • The graph should connect every piece automatically. Open and closed endpoints and discontinuities must be respected.

  • The derivative can be calculated using only one side of a boundary. A two-sided derivative requires compatible behavior from both sides.

Practice Questions

  • Define a piecewise-defined function.

  • Write |x| as a piecewise function.

  • Evaluate f(−2), f(0), and f(3) for a piecewise function with specified intervals.

  • What is a boundary point in a piecewise function?

  • Explain the role of one-sided limits in testing continuity.

  • Can a piecewise function be continuous at a boundary? Explain.

  • Why does continuity not guarantee differentiability?

  • Construct a piecewise function that represents a fixed charge followed by a variable charge.

  • Explain why open and closed endpoints matter when graphing piecewise functions.

  • Give two practical situations that can be represented using piecewise functions.

Key Takeaway

Piecewise functions use different rules on different parts of a domain. They are useful for modelling conditional behavior and are important in calculus because their boundary points require careful analysis of limits, continuity, and differentiability.

Prerequisites

  • Functions and function notation.

  • Domain and range.

  • Intervals and inequalities.

  • Graphs of functions.

  • Limits and one-sided limits.

  • Basic understanding of continuity.

Reference

  • James Stewart, Calculus: Early Transcendentals, Cengage Learning.

  • OpenStax, Precalculus 2e, Rice University.

  • OpenStax, Calculus Volume 1, Rice University.

Related Topics

  • Functions and Their Representations

  • Domain and Range of Functions

  • Graphs of Functions

  • Composite and Inverse Functions

  • Average Rate of Change

  • Instantaneous Rate of Change

  • The Fundamental Idea of Limits

Sources and verification

Sources are shown as provided in the project data. Not every source has yet been independently verified. Please report errors or missing citations.

  • Source verification pending; check an authoritative textbook, university, standards body, or peer-reviewed source.

Suggest a correction or source · More in Calculus