Piecewise and Absolute Value Functions
Piecewise and Absolute Value Functions
What is a Piecewise Function?
A piecewise function is a function made up of different rules (or "pieces") applied to different parts of its domain. Instead of a single equation, the function looks at the input value (x) to decide which rule to use.
Example: Evaluate the following function at x=−3 and x=2. f(x)={2xx2if x<0if x≥0
- For x=−3: Since −3<0, we fall into the first interval. We use the top rule: 2x. f(−3)=2(−3)=−6
- For x=2: Since 2≥0, we fall into the second interval. We use the bottom rule: x2. f(2)=(2)2=4
The Absolute Value Function
The absolute value function, written as y=∣x∣, represents the distance of a number from zero on the number line. Because distance is always positive (or zero), the graph of y=∣x∣ forms a sharp "V" shape with its vertex at the origin (0,0).
Interestingly, the absolute value function is just a specific piecewise function: f(x)={−xxif x<0if x≥0
Transforming Absolute Value Functions
You can shift, stretch, or flip the V-shaped graph using the general transformation formula: y=a∣x−h∣+k
- h (Horizontal Shift): Moves the graph left or right. The vertex's x-coordinate is h. (Note the minus sign: ∣x−2∣ moves right, ∣x+2∣ moves left).
- k (Vertical Shift): Moves the graph up or down. The vertex's y-coordinate is k.
- a (Stretch/Compression): Makes the "V" narrower or wider. If a is negative, the "V" flips upside down.
Example: Graph f(x)=∣x−2∣+1.
- Find the vertex: Based on y=a∣x−h∣+k, we have h=2 and k=1. The vertex is at (2,1).
- Determine the shape: Since a=1 (positive), the graph opens upwards with a standard slope of 1 on the right side of the vertex and −1 on the left.
- Plot points: Starting from the vertex (2,1), go right 1 and up 1 to the point (3,2). Go left 1 and up 1 to the point (1,2). Connect them to form the V-shape.