Piecewise Behavior Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Piecewise Behavior.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

Piecewise behavior refers to a function that exhibits qualitatively different characteristics in different regions of its domain, like having a different slope or curvature in each region.

Think of the behavior as shifting gears โ€” the function follows one rule until it hits a boundary, then switches to a different rule for the next region.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Analyzing piecewise behavior means treating each piece separately: find its own properties (intercepts, slope, extremes), then stitch the pieces together at boundaries.

Common stuck point: Always determine which piece applies before computing โ€” and check that adjacent pieces agree (or deliberately disagree) at their shared boundary points.

Sense of Study hint: Evaluate BOTH pieces at the boundary point. If they give different values, there is a jump discontinuity there.

Worked Examples

Example 1

easy
Write |x| as an explicit piecewise function, evaluate |-4|, |0|, and |7|, and sketch its graph.

Solution

  1. 1
    Definition: |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}.
  2. 2
    Evaluate: |-4| = -(-4) = 4; |0| = 0; |7| = 7.
  3. 3
    Graph: two rays meeting at the origin (0,0), slope -1 for x<0 and slope +1 for x\geq0, forming a 'V' shape.

Answer

|-4|=4, |0|=0, |7|=7; V-shaped graph with vertex at origin
The absolute value function is the simplest and most important piecewise function. It measures distance from zero, always returning a non-negative value. Its V-shape has slope \pm1 and vertex at the origin.

Example 2

medium
Solve the equation |2x - 5| = 7 and the inequality |2x - 5| < 7.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
Simplify |x-3| + |x+1| for x = -2, x = 1, and x = 5.

Example 2

hard
Express f(x) = |x^2 - 4| as a piecewise function (without absolute value bars) and identify where f(x) = 0.

Background Knowledge

These ideas may be useful before you work through the harder examples.

piecewise function