In algebra, functions give us powerful ways to describe relationships between quantities. Sometimes, however, a single rule isn't enough to capture all the behavior we need to model. Perhaps a phone plan charges one rate for the first 100 minutes and a different rate after that. Or maybe we need to describe distance without worrying about direction. This is where absolute value and piecewise functions become essential tools. These functions allow us to work with different rules on different parts of the domain, opening up new ways to model real-world situations mathematically.
The absolute value of a number is its distance from zero on the number line, without considering direction. We write the absolute value of a number \( x \) as \( |x| \). Since distance is always positive or zero, absolute value is never negative.
For example:
Think of absolute value like measuring how far you walked, without caring whether you went left or right from your starting point.
We can define absolute value more formally using a piecewise definition:
\[ |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0="" \end{cases}="" \]="">This tells us that when \( x \) is zero or positive, the absolute value equals \( x \) itself. When \( x \) is negative, the absolute value equals the opposite of \( x \), which makes it positive.
Example: Find the value of \( |-12| \).
What is \( |-12| \)?
Solution:
Since -12 is negative, we use the rule that \( |x| = -x \) when \( x < 0="">
\( |-12| = -(-12) = 12 \)
The absolute value of -12 is 12.
Absolute value has several important properties that help us solve equations and simplify expressions:
The parent absolute value function is \( f(x) = |x| \). To understand its graph, we can create a table of values:
| \( x \) | \( f(x) = |x| \) |
|---|---|
| -3 | 3 |
| -2 | 2 |
| -1 | 1 |
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
The graph of \( f(x) = |x| \) forms a V-shape with the vertex (the point of the V) at the origin (0, 0). The left side of the V has a slope of -1, and the right side has a slope of 1. This characteristic V-shape is the hallmark of absolute value functions.
Just like other functions, absolute value functions can be transformed. The general form is:
\[ f(x) = a|x - h| + k \]Where:
The vertex of this transformed function is at the point \( (h, k) \).
Note: If \( a > 0 \), the V opens upward. If \( a < 0="" \),="" the="" v="" opens="" downward="" (reflects="" over="" the="" x-axis).="" if="" \(="" |a|=""> 1 \), the graph is narrower (vertical stretch). If \( 0 < |a|="">< 1="" \),="" the="" graph="" is="" wider="" (vertical="">
Example: Graph the function \( g(x) = |x - 2| + 3 \) and identify the vertex.
What is the vertex and how does the graph look?
Solution:
Comparing \( g(x) = |x - 2| + 3 \) to the form \( f(x) = a|x - h| + k \):
\( a = 1 \), \( h = 2 \), and \( k = 3 \)
The vertex is at \( (h, k) = (2, 3) \).
Since \( a = 1 > 0 \), the V opens upward with no stretch or compression.
The graph is the basic V-shape shifted 2 units right and 3 units up, with vertex at (2, 3).
When solving equations involving absolute value, we must remember that absolute value measures distance. The equation \( |x| = 5 \) asks: "What numbers are 5 units from zero?" The answer is both 5 and -5.
To solve \( |x| = a \) where \( a > 0 \):
If \( a = 0 \), there is only one solution: \( x = 0 \). If \( a < 0="" \),="" there="" is="" no="" solution="" because="" absolute="" value="" cannot="" be="">
Example: Solve the equation \( |2x - 5| = 9 \).
What values of \( x \) satisfy this equation?
Solution:
Since the absolute value equals 9, the expression inside can equal 9 or -9.
Case 1: \( 2x - 5 = 9 \)
\( 2x = 14 \)
\( x = 7 \)Case 2: \( 2x - 5 = -9 \)
\( 2x = -4 \)
\( x = -2 \)The solutions are \( x = 7 \) and \( x = -2 \).
Absolute value inequalities require careful thinking about what the inequality means in terms of distance.
For \( |x| < a="" \)="" where="" \(="" a=""> 0 \): This means \( x \) is less than \( a \) units from zero, so \( -a < x="">< a="">
For \( |x| > a \) where \( a > 0 \): This means \( x \) is more than \( a \) units from zero, so \( x < -a="" \)="" or="" \(="" x=""> a \).
Example: Solve the inequality \( |x + 3| \leq 5 \).
What values of \( x \) make this true?
Solution:
The inequality \( |x + 3| \leq 5 \) means the distance from \( x + 3 \) to zero is at most 5.
This translates to: \( -5 \leq x + 3 \leq 5 \)
Subtract 3 from all parts:
\( -5 - 3 \leq x \leq 5 - 3 \)
\( -8 \leq x \leq 2 \)The solution is \( -8 \leq x \leq 2 \) or in interval notation [-8, 2].
A piecewise function is a function defined by different formulas on different parts of its domain. Each piece applies to a specific interval or condition. Piecewise functions are useful for modeling situations where rules change based on the input value.
Think of a piecewise function like a recipe that changes instructions based on what ingredient you're working with-one set of steps for vegetables, another for meat.
We write piecewise functions using a brace notation. Here's a general example:
\[ f(x) = \begin{cases} \text{formula}_1 & \text{if condition}_1 \\ \text{formula}_2 & \text{if condition}_2 \\ \text{formula}_3 & \text{if condition}_3 \end{cases} \]Each row tells us what formula to use when a specific condition is met. The conditions usually involve inequalities that divide the number line into intervals.
Example: Evaluate the piecewise function for the given values:
\[ f(x) = \begin{cases} x + 4 & \text{if } x < 1="" \\="" 2x="" -="" 1="" &="" \text{if="" }="" x="" \geq="" 1="" \end{cases}="">Find \( f(-2) \) and \( f(3) \).
Solution:
For \( f(-2) \):
Since -2 < 1,="" we="" use="" the="" first="" formula:="" \(="" f(x)="x" +="" 4="">
\( f(-2) = -2 + 4 = 2 \)For \( f(3) \):
Since 3 ≥ 1, we use the second formula: \( f(x) = 2x - 1 \)
\( f(3) = 2(3) - 1 = 6 - 1 = 5 \)Therefore, \( f(-2) = 2 \) and \( f(3) = 5 \).
To graph a piecewise function, we graph each piece separately on its specified domain, paying close attention to whether endpoints are included or excluded.
Example: Graph the piecewise function:
\[ g(x) = \begin{cases} -x + 2 & \text{if } x \leq 0 \\ x^2 & \text{if } x > 0 \end{cases} \]What does the graph look like?
Solution:
For \( x \leq 0 \): Graph the line \( y = -x + 2 \)
When \( x = 0 \): \( y = -0 + 2 = 2 \), so plot a closed dot at (0, 2)
When \( x = -1 \): \( y = -(-1) + 2 = 3 \), plot point (-1, 3)
When \( x = -2 \): \( y = -(-2) + 2 = 4 \), plot point (-2, 4)
Draw the line through these points for \( x \leq 0 \)For \( x > 0 \): Graph the parabola \( y = x^2 \)
When \( x = 0 \): not included (open dot would go at (0, 0))
When \( x = 1 \): \( y = 1 \), plot (1, 1)
When \( x = 2 \): \( y = 4 \), plot (2, 4)
Draw the parabola for \( x > 0 \) with an open dot at (0, 0)The graph shows a line with negative slope for \( x \leq 0 \) and a parabola opening upward for \( x > 0 \), with a closed dot at (0, 2) and an open dot at (0, 0).
Sometimes we need to create a piecewise function from a description or graph. The key is to identify where the function changes behavior and write appropriate formulas for each interval.
Example: A parking garage charges $3 for the first hour and $2 for each additional hour or part of an hour.
Write a piecewise function for the cost \( C(t) \) where \( t \) is time in hours, for \( 0 < t="" \leq="" 4="">What is the cost function?
Solution:
For the first hour (\( 0 < t="" \leq="" 1="" \)):="" cost="" is="">
\( C(t) = 3 \)For more than 1 hour but not more than 2 hours (\( 1 < t="" \leq="" 2="" \)):="" cost="" is="" $3="" +="" $2="">
\( C(t) = 5 \)For more than 2 hours but not more than 3 hours (\( 2 < t="" \leq="" 3="" \)):="" cost="" is="" $5="" +="" $2="">
\( C(t) = 7 \)For more than 3 hours but not more than 4 hours (\( 3 < t="" \leq="" 4="" \)):="" cost="" is="" $7="" +="" $2="">
\( C(t) = 9 \)The piecewise function is:
\[ C(t) = \begin{cases} 3 & \text{if } 0 < t="" \leq="" 1="" \\="" 5="" &="" \text{if="" }="" 1="">< t="" \leq="" 2="" \\="" 7="" &="" \text{if="" }="" 2="">< t="" \leq="" 3="" \\="" 9="" &="" \text{if="" }="" 3="">< t="" \leq="" 4="" \end{cases}="">This function represents the step-like pricing structure of the parking garage.
Several important functions are naturally piecewise:
The absolute value function can be written as:
\[ |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0="" \end{cases}="" \]="">The greatest integer function (or floor function), written \( \lfloor x \rfloor \), gives the greatest integer less than or equal to \( x \). For example, \( \lfloor 3.7 \rfloor = 3 \) and \( \lfloor -1.2 \rfloor = -2 \).
Step functions are piecewise functions that are constant on each interval, creating a staircase appearance when graphed. The parking garage example above is a step function.
Understanding that absolute value is fundamentally a piecewise function helps us analyze more complex absolute value expressions. When we have functions like \( f(x) = |2x - 3| + 1 \), we can rewrite them in piecewise form.
To convert an absolute value function to piecewise form:
Example: Write \( f(x) = |x - 4| + 2 \) as a piecewise function.
What is the piecewise form?
Solution:
Find where \( x - 4 = 0 \):
\( x = 4 \)For \( x \geq 4 \): The expression \( x - 4 \) is non-negative, so \( |x - 4| = x - 4 \)
\( f(x) = (x - 4) + 2 = x - 2 \)For \( x < 4="" \):="" the="" expression="" \(="" x="" -="" 4="" \)="" is="" negative,="" so="" \(="" |x="" -="" 4|="-(x" -="" 4)="-x" +="" 4="">
\( f(x) = (-x + 4) + 2 = -x + 6 \)The piecewise form is:
\[ f(x) = \begin{cases} -x + 6 & \text{if } x < 4="" \\="" x="" -="" 2="" &="" \text{if="" }="" x="" \geq="" 4="" \end{cases}="">This piecewise function is equivalent to the original absolute value function.
Both absolute value and piecewise functions appear frequently in real-world applications.
Absolute value is used whenever we measure:
Piecewise functions model situations with different rules for different cases:
Example: A company pays employees $15 per hour for up to 40 hours per week.
Any hours over 40 are paid at time-and-a-half ($22.50 per hour).
Write a function for weekly pay \( P(h) \) based on hours worked \( h \).What is the pay function?
Solution:
For \( 0 \leq h \leq 40 \): Pay is hourly rate times hours
\( P(h) = 15h \)For \( h > 40 \): First 40 hours at regular rate, additional hours at $22.50
Regular pay for 40 hours: \( 15 \times 40 = 600 \)
Overtime hours: \( h - 40 \)
Overtime pay: \( 22.50(h - 40) \)
\( P(h) = 600 + 22.50(h - 40) = 600 + 22.50h - 900 = 22.50h - 300 \)The piecewise function is:
\[ P(h) = \begin{cases} 15h & \text{if } 0 \leq h \leq 40 \\ 22.50h - 300 & \text{if } h > 40 \end{cases} \]This function correctly calculates weekly pay including overtime.
Mastering absolute value and piecewise functions expands your mathematical toolkit significantly. These functions allow you to model complex, real-world situations where simple linear or quadratic functions fall short. Whether calculating shipping costs, analyzing manufacturing tolerances, or understanding tax structures, these functions provide the precision and flexibility needed to describe how quantities relate under different conditions.