Source codeVideos

Command Palette

Search for a command to run...

Functions and Their Modeling

Piecewise Function Modeling

Understanding Piecewise Functions

A piecewise function is a function that is defined by several different equations on certain intervals of its domain. Each "piece" of the function applies to a specific part of the domain.

Mathematical Definition

A piecewise function can be written in the form:

f(x)={f1(x),if xD1f2(x),if xD2f3(x),if xD3fn(x),if xDnf(x) = \begin{cases} f_1(x), & \text{if } x \in D_1 \\ f_2(x), & \text{if } x \in D_2 \\ f_3(x), & \text{if } x \in D_3 \\ \vdots \\ f_n(x), & \text{if } x \in D_n \end{cases}

where D1,D2,D3,,DnD_1, D_2, D_3, \ldots, D_n are intervals that form a partition of the function's domain.

Characteristics of piecewise functions:

  • Consists of several different equations
  • Each equation applies to a specific interval
  • Can be continuous or discontinuous
  • Intervals do not overlap

Types of Piecewise Functions

Linear Piecewise Functions

A linear piecewise function is a function where each piece is a linear function.

Linear Piecewise Function
Example of a linear piecewise function with three different pieces.

The function above can be written as:

f(x)={2x+3,if 2x<0x+3,if 0x<20.5x,if x2f(x) = \begin{cases} 2x + 3, & \text{if } -2 \leq x < 0 \\ -x + 3, & \text{if } 0 \leq x < 2 \\ 0.5x, & \text{if } x \geq 2 \end{cases}

Quadratic Piecewise Functions

Piecewise functions can also contain quadratic pieces or combinations of linear and quadratic functions.

Combined Piecewise Function
Combination of quadratic and linear functions in one piecewise function.

Continuity of Piecewise Functions

Continuous Piecewise Functions

A piecewise function is said to be continuous if there are no "jumps" at the connection points between pieces.

Condition for continuity at point x=cx = c:

limxcf(x)=limxc+f(x)=f(c)\lim_{x \to c^-} f(x) = \lim_{x \to c^+} f(x) = f(c)

Example of a continuous piecewise function:

f(x)={x+1,if x<23,if x=25x,if x>2f(x) = \begin{cases} x + 1, & \text{if } x < 2 \\ 3, & \text{if } x = 2 \\ 5 - x, & \text{if } x > 2 \end{cases}

For continuity at x=2x = 2:

  • limx2(x+1)=3\lim_{x \to 2^-} (x + 1) = 3
  • limx2+(5x)=3\lim_{x \to 2^+} (5 - x) = 3
  • f(2)=3f(2) = 3

Discontinuous Piecewise Functions

Discontinuous piecewise functions have "jumps" or "holes" at certain points.

Discontinuous Piecewise Function
Example of a function with jump discontinuity at x=1x = 1.

Modeling with Piecewise Functions

Progressive Rates

Many real-world situations can be modeled with piecewise functions, such as progressive tax rates or tiered parking fees.

Example: Electricity Rates

An electricity company applies tiered rates:

  • 0-50 kWh: Rp 1,000/kWh
  • 51-100 kWh: Rp 1,500/kWh
  • 100 kWh: Rp 2,000/kWh

The mathematical model:

C(x)={1000x,if 0x5050000+1500(x50),if 50<x100125000+2000(x100),if x>100C(x) = \begin{cases} 1000x, & \text{if } 0 \leq x \leq 50 \\ 50000 + 1500(x-50), & \text{if } 50 < x \leq 100 \\ 125000 + 2000(x-100), & \text{if } x > 100 \end{cases}

Electricity cost table:

Usage (kWh)305075100150
Cost (Rp)30,00050,00087,500125,000225,000

Staged Speed

Example: Multi-Modal Journey

Someone takes a journey with:

  • Walking: 5 km/h for 0.5 hours
  • Cycling: 15 km/h for 1 hour
  • Driving: 60 km/h for 0.5 hours

Distance function with respect to time:

s(t)={5t,if 0t0.52.5+15(t0.5),if 0.5<t1.517.5+60(t1.5),if 1.5<t2s(t) = \begin{cases} 5t, & \text{if } 0 \leq t \leq 0.5 \\ 2.5 + 15(t-0.5), & \text{if } 0.5 < t \leq 1.5 \\ 17.5 + 60(t-1.5), & \text{if } 1.5 < t \leq 2 \end{cases}

Determining Piecewise Function Equations

To determine piecewise function equations from graphs or situations:

  1. Identify the intervals of the domain
  2. Determine the equation for each interval
  3. Check continuity at connection points
  4. Write in piecewise notation

Example:

From a graph showing:

  • Line with slope 2 from x = -2 to x = 0
  • Horizontal line y = 4 from x = 0 to x = 2
  • Line with slope -1 from x = 2 to x = 4

Solution steps:

  1. Interval 1: [2,0)[-2, 0)

    • Passes through (-2, 0) with slope 2
    • Equation: y=2(x+2)=2x+4y = 2(x + 2) = 2x + 4
  2. Interval 2: [0,2)[0, 2)

    • Horizontal line
    • Equation: y=4y = 4
  3. Interval 3: [2,4][2, 4]

    • Passes through (2, 4) with slope -1
    • Equation: y=1(x2)+4=x+6y = -1(x - 2) + 4 = -x + 6

Piecewise function:

f(x)={2x+4,if 2x<04,if 0x<2x+6,if 2x4f(x) = \begin{cases} 2x + 4, & \text{if } -2 \leq x < 0 \\ 4, & \text{if } 0 \leq x < 2 \\ -x + 6, & \text{if } 2 \leq x \leq 4 \end{cases}

Practice Problems

  1. Determine the values of f(1)f(1), f(3)f(3), and f(5)f(5) for the function:

    f(x)={x2,if x<22x+1,if 2x<49,if x4f(x) = \begin{cases} x^2, & \text{if } x < 2 \\ 2x + 1, & \text{if } 2 \leq x < 4 \\ 9, & \text{if } x \geq 4 \end{cases}
  2. An online taxi company applies the following rates:

    • Base fare: Rp 10,000 (for the first 2 km)
    • Km 3-10: Rp 4,000/km
    • Above 10 km: Rp 3,000/km

    Create a piecewise function model for the total cost!

  3. Determine whether the following function is continuous at x=1x = 1:

    g(x)={3x1,if x<12,if x=1x+1,if x>1g(x) = \begin{cases} 3x - 1, & \text{if } x < 1 \\ 2, & \text{if } x = 1 \\ x + 1, & \text{if } x > 1 \end{cases}
  4. Sketch the graph of the function:

    h(x)={x+2,if x<0x2,if 0x<24,if x2h(x) = \begin{cases} -x + 2, & \text{if } x < 0 \\ x^2, & \text{if } 0 \leq x < 2 \\ 4, & \text{if } x \geq 2 \end{cases}
  5. A worker is paid with the following system:

    • First 8 hours: Rp 50,000/hour
    • Overtime (9th hour onwards): Rp 75,000/hour

    If the maximum work is 12 hours/day, create a daily wage function!

Answer Key

  1. Calculating function values:

    For f(1)f(1): since 1<21 < 2, use f(x)=x2f(x) = x^2

    f(1)=12=1f(1) = 1^2 = 1

    For f(3)f(3): since 23<42 \leq 3 < 4, use f(x)=2x+1f(x) = 2x + 1

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

    For f(5)f(5): since 545 \geq 4, use f(x)=9f(x) = 9

    f(5)=9f(5) = 9
  2. Taxi fare model:

    Let xx be the distance in km, then:

    C(x)={10000,if 0<x210000+4000(x2),if 2<x1010000+32000+3000(x10),if x>10C(x) = \begin{cases} 10000, & \text{if } 0 < x \leq 2 \\ 10000 + 4000(x-2), & \text{if } 2 < x \leq 10 \\ 10000 + 32000 + 3000(x-10), & \text{if } x > 10 \end{cases}

    Or simplified:

    C(x)={10000,if 0<x24000x+2000,if 2<x103000x+12000,if x>10C(x) = \begin{cases} 10000, & \text{if } 0 < x \leq 2 \\ 4000x + 2000, & \text{if } 2 < x \leq 10 \\ 3000x + 12000, & \text{if } x > 10 \end{cases}
  3. Checking continuity:

    At x=1x = 1:

    limx1g(x)=limx1(3x1)=3(1)1=2\lim_{x \to 1^-} g(x) = \lim_{x \to 1^-} (3x - 1) = 3(1) - 1 = 2
    limx1+g(x)=limx1+(x+1)=1+1=2\lim_{x \to 1^+} g(x) = \lim_{x \to 1^+} (x + 1) = 1 + 1 = 2
    g(1)=2g(1) = 2

    Since limx1g(x)=limx1+g(x)=g(1)=2\lim_{x \to 1^-} g(x) = \lim_{x \to 1^+} g(x) = g(1) = 2, the function is continuous at x=1x = 1.

  4. Sketch of graph h(x)h(x):

    Graph of Function h(x)h(x)
    Piecewise function with three parts: decreasing linear, quadratic, and constant
  5. Daily wage function:

    Let tt be the working hours, then:

    U(t)={50000t,if 0<t8400000+75000(t8),if 8<t12U(t) = \begin{cases} 50000t, & \text{if } 0 < t \leq 8 \\ 400000 + 75000(t-8), & \text{if } 8 < t \leq 12 \end{cases}

    Or simplified:

    U(t)={50000t,if 0<t875000t200000,if 8<t12U(t) = \begin{cases} 50000t, & \text{if } 0 < t \leq 8 \\ 75000t - 200000, & \text{if } 8 < t \leq 12 \end{cases}