Skip to content

Piecewise Functions

Defining and evaluating functions with different rules on different intervals

Written and reviewed by the Study Mondo Education TeamLast updated
🎯⭐ INTERACTIVE LESSON

Try the Interactive Version!

Learn step-by-step with practice exercises built right in.

Start Interactive Lesson →

Piecewise Functions

What is a Piecewise Function?

A piecewise function is defined by different formulas on different parts of its domain.

General Form

\text{formula 1} & \text{if condition 1} \\ \text{formula 2} & \text{if condition 2} \\ \vdots & \vdots \end{cases}$$ ### Example $$f(x) = \begin{cases} x^2 & \text{if } x < 0 \\ 2x + 1 & \text{if } x \geq 0 \end{cases}$$ This means: - Use $f(x) = x^2$ when $x$ is negative - Use $f(x) = 2x + 1$ when $x$ is zero or positive ## Evaluating Piecewise Functions To evaluate $f(a)$ for a piecewise function: 1. Determine which condition $a$ satisfies 2. Use the formula for that piece 3. Calculate the value ### Example For the function above: - $f(-2) = (-2)^2 = 4$ (use first piece since $-2 < 0$) - $f(0) = 2(0) + 1 = 1$ (use second piece since $0 \geq 0$) - $f(3) = 2(3) + 1 = 7$ (use second piece since $3 \geq 0$) ## Continuity of Piecewise Functions A piecewise function is **continuous** at $x = a$ if: 1. $f(a)$ is defined 2. $\lim_{x \to a} f(x)$ exists 3. $\lim_{x \to a} f(x) = f(a)$ **Practical check:** The function is continuous if the pieces "connect" (no jump or gap). ### Checking Continuity at a Boundary For continuity at $x = c$ (a boundary point): - Evaluate the left piece at $x = c$: $\lim_{x \to c^-} f(x)$ - Evaluate the right piece at $x = c$: $\lim_{x \to c^+} f(x)$ - Check which piece includes $c$ to find $f(c)$ - If left limit = right limit = $f(c)$, the function is continuous ## Absolute Value as a Piecewise Function The absolute value function is a common piecewise function: $$|x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}$$ ## Domain and Range - **Domain**: Usually all real numbers, unless specified otherwise - **Range**: Combine the ranges from all pieces (may need to sketch or analyze) ## Graphing Piecewise Functions 1. Graph each piece on its specified interval 2. Use open circles ($\circ$) for excluded endpoints 3. Use closed circles ($\bullet$) for included endpoints 4. Check for continuity at boundary points

📚 Practice Problems

1Problem 1easy

❓ Question:

Evaluate the piecewise function f(x)={x2+1if x≤−13xif −1<x<25if x≥2f(x) = \begin{cases} x^2 + 1 & \text{if } x \leq -1 \\ 3x & \text{if } -1 < x < 2 \\ 5 & \text{if } x \geq 2 \end{cases} at x=−1x = -1, x=0x = 0, and x=3x = 3.

💡 Show Solution

Evaluate at each point:

For x=−1x = -1: Check which condition: −1≤−1-1 \leq -1 ✓ (first piece) f(−1)=(−1)2+1=1+1=2f(-1) = (-1)^2 + 1 = 1 + 1 = 2

For x=0x = 0: Check which condition: −1<0<2-1 < 0 < 2 ✓ (second piece) f(0)=3(0)=0f(0) = 3(0) = 0

For x=3x = 3: Check which condition: 3≥23 \geq 2 ✓ (third piece) f(3)=5f(3) = 5

Answers:

  • f(−1)=2f(-1) = 2
  • f(0)=0f(0) = 0
  • f(3)=5f(3) = 5

2Problem 2medium

❓ Question:

Determine whether the piecewise function g(x)={x+3if x<1x2+1if x≥1g(x) = \begin{cases} x + 3 & \text{if } x < 1 \\ x^2 + 1 & \text{if } x \geq 1 \end{cases} is continuous at x=1x = 1.

💡 Show Solution

Check continuity at x=1x = 1:

Step 1: Find g(1)g(1) (which piece includes x=1x = 1?) Since x≥1x \geq 1 includes 1, use second piece: g(1)=12+1=2g(1) = 1^2 + 1 = 2

Step 2: Find left-hand limit as x→1−x \to 1^- (use first piece): lim⁡x→1−g(x)=lim⁡x→1−(x+3)=1+3=4\lim_{x \to 1^-} g(x) = \lim_{x \to 1^-} (x + 3) = 1 + 3 = 4

Step 3: Find right-hand limit as x→1+x \to 1^+ (use second piece): lim⁡x→1+g(x)=lim⁡x→1+(x2+1)=12+1=2\lim_{x \to 1^+} g(x) = \lim_{x \to 1^+} (x^2 + 1) = 1^2 + 1 = 2

Step 4: Compare

  • Left limit: 4
  • Right limit: 2
  • g(1)=2g(1) = 2

Since the left limit (44) ≠\neq right limit (22), the overall limit does not exist.

Answer: The function is NOT continuous at x=1x = 1 because there is a jump discontinuity (the two pieces don't connect).

3Problem 3hard

❓ Question:

Find the value of aa that makes h(x)={2x+aif x<3x2−4if x≥3h(x) = \begin{cases} 2x + a & \text{if } x < 3 \\ x^2 - 4 & \text{if } x \geq 3 \end{cases} continuous at x=3x = 3.

💡 Show Solution

For continuity at x=3x = 3, we need: lim⁡x→3−h(x)=lim⁡x→3+h(x)=h(3)\lim_{x \to 3^-} h(x) = \lim_{x \to 3^+} h(x) = h(3)

Step 1: Find h(3)h(3) (use second piece since 3≥33 \geq 3): h(3)=32−4=9−4=5h(3) = 3^2 - 4 = 9 - 4 = 5

Step 2: Find right-hand limit (use second piece): lim⁡x→3+h(x)=lim⁡x→3+(x2−4)=32−4=5\lim_{x \to 3^+} h(x) = \lim_{x \to 3^+} (x^2 - 4) = 3^2 - 4 = 5

Step 3: Find left-hand limit (use first piece with unknown aa): lim⁡x→3−h(x)=lim⁡x→3−(2x+a)=2(3)+a=6+a\lim_{x \to 3^-} h(x) = \lim_{x \to 3^-} (2x + a) = 2(3) + a = 6 + a

Step 4: Set left limit equal to right limit: 6+a=56 + a = 5 a=−1a = -1

Verify: With a=−1a = -1:

  • Left limit: 6+(−1)=56 + (-1) = 5 ✓
  • Right limit: 55 ✓
  • h(3)=5h(3) = 5 ✓

Answer: a=−1a = -1 makes the function continuous at x=3x = 3.

4Problem 4medium

❓ Question:

A function is defined as f(x) = { x² + 1, if x < 0; 2x + 1, if x ≥ 0 }. Evaluate f(-2), f(0), and f(3).

💡 Show Solution

Step 1: Evaluate f(-2): Is -2 < 0? Yes Use f(x) = x² + 1 f(-2) = (-2)² + 1 = 4 + 1 = 5

Step 2: Evaluate f(0): Is 0 < 0? No Is 0 ≥ 0? Yes Use f(x) = 2x + 1 f(0) = 2(0) + 1 = 1

Step 3: Evaluate f(3): Is 3 < 0? No Is 3 ≥ 0? Yes Use f(x) = 2x + 1 f(3) = 2(3) + 1 = 7

Answer: f(-2) = 5, f(0) = 1, f(3) = 7

5Problem 5hard

❓ Question:

For f(x) = { -x + 2, if x ≤ 1; x² - 2, if x > 1 }, determine if f is continuous at x = 1.

💡 Show Solution

Step 1: Find f(1) using the appropriate piece: Since 1 ≤ 1, use f(x) = -x + 2 f(1) = -1 + 2 = 1

Step 2: Find the left-hand limit as x approaches 1: lim(x→1⁻) f(x) = lim(x→1⁻) (-x + 2) = -1 + 2 = 1

Step 3: Find the right-hand limit as x approaches 1: lim(x→1⁺) f(x) = lim(x→1⁺) (x² - 2) = 1² - 2 = -1

Step 4: Check continuity conditions: For continuity at x = 1: • lim(x→1⁻) f(x) = 1 • lim(x→1⁺) f(x) = -1 • f(1) = 1

Step 5: Conclusion: Since lim(x→1⁻) f(x) ≠ lim(x→1⁺) f(x), the function is NOT continuous at x = 1. There is a jump discontinuity at x = 1.

Answer: Not continuous (jump discontinuity at x = 1)

Explain using:

⚠️ Common Mistakes: Piecewise Functions

Avoid these 4 frequent errors

🌍 Real-World Applications: Piecewise Functions

See how this math is used in the real world

📝 Worked Example: Related Rates — Expanding Circle

Problem:

A stone is dropped into a still pond, creating a circular ripple. The radius of the ripple is increasing at a rate of 22 cm/s. How fast is the area of the circle increasing when the radius is 1010 cm?

2Write the relationship between variables
3Differentiate both sides with respect to time
4Substitute known values

📌 Related Topics in Function Fundamentals

❓ Frequently Asked Questions

What is Piecewise Functions?▾
Defining and evaluating functions with different rules on different intervals
How can I study Piecewise Functions effectively?▾
Start by reading the study notes and working through the examples on this page. Then use the flashcards to test your recall. Practice with the 5 problems provided, checking solutions as you go. Regular review and active practice are key to retention.
Is this Piecewise Functions study guide free?▾
Yes — all study notes, flashcards, and practice problems for Piecewise Functions on Study Mondo are free to access. No account is needed.
What course covers Piecewise Functions?▾
Piecewise Functions is part of the AP Precalculus course on Study Mondo, specifically in the Function Fundamentals section. You can explore the full course for more related topics and practice resources.
Are there practice problems for Piecewise Functions?▾
Yes, this page includes 5 practice problems with detailed solutions. Each problem includes a step-by-step explanation to help you understand the approach.