Piecewise Functions

Functions defined by different formulas on different intervals

Piecewise Functions

Definition

A piecewise function uses different formulas for different parts of the domain.

Example: f(x)={x+1if x<0x2if x0f(x) = \begin{cases} x + 1 & \text{if } x < 0 \\ x^2 & \text{if } x \geq 0 \end{cases}

Evaluating

To find f(a)f(a):

  1. Determine which condition aa satisfies
  2. Use the corresponding formula

Example: For the function above:

  • f(2)=2+1=1f(-2) = -2 + 1 = -1 (use x+1x + 1 since 2<0-2 < 0)
  • f(3)=32=9f(3) = 3^2 = 9 (use x2x^2 since 303 \geq 0)

Graphing

  1. Graph each piece on its domain
  2. Use open circles for endpoints NOT included (< or >)
  3. Use closed circles for endpoints included (≤ or ≥)

Common Types

Absolute Value: x={xif x0xif x<0|x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}

Step Functions: Different constant values on intervals

Continuity

Check if pieces "connect" at boundary points.

Continuous if: limxaf(x)=limxa+f(x)=f(a)\lim_{x \to a^-} f(x) = \lim_{x \to a^+} f(x) = f(a)

📚 Practice Problems

1Problem 1easy

Question:

Evaluate f(3)f(-3) and f(2)f(2) for f(x)={2xif x<0x+5if x0f(x) = \begin{cases} 2x & \text{if } x < 0 \\ x + 5 & \text{if } x \geq 0 \end{cases}

💡 Show Solution

For f(3)f(-3):

Since 3<0-3 < 0, use the first formula: f(3)=2(3)=6f(-3) = 2(-3) = -6

For f(2)f(2):

Since 202 \geq 0, use the second formula: f(2)=2+5=7f(2) = 2 + 5 = 7

Answer: f(3)=6f(-3) = -6, f(2)=7f(2) = 7

2Problem 2medium

Question:

Write the absolute value function f(x)=x3f(x) = |x - 3| as a piecewise function.

💡 Show Solution

The absolute value changes behavior at the point where the inside equals zero.

x3=0x - 3 = 0 when x=3x = 3

When x3x \geq 3: the inside is positive or zero x3=x3|x - 3| = x - 3

When x<3x < 3: the inside is negative x3=(x3)=x+3|x - 3| = -(x - 3) = -x + 3

Answer: f(x)={x+3if x<3x3if x3f(x) = \begin{cases} -x + 3 & \text{if } x < 3 \\ x - 3 & \text{if } x \geq 3 \end{cases}

3Problem 3hard

Question:

Is the function continuous at x=1x = 1? f(x)={x2+1if x13x1if x>1f(x) = \begin{cases} x^2 + 1 & \text{if } x \leq 1 \\ 3x - 1 & \text{if } x > 1 \end{cases}

💡 Show Solution

Check if the function value and limits match at x=1x = 1.

From left: (use x2+1x^2 + 1) limx1f(x)=12+1=2\lim_{x \to 1^-} f(x) = 1^2 + 1 = 2

From right: (use 3x13x - 1) limx1+f(x)=3(1)1=2\lim_{x \to 1^+} f(x) = 3(1) - 1 = 2

Function value: (use x2+1x^2 + 1 since 111 \leq 1) f(1)=12+1=2f(1) = 1^2 + 1 = 2

Since all three equal 2, the function is continuous at x=1x = 1.

Answer: Yes, continuous at x=1x = 1