A piecewise function has different definitions depending on the interval. Its definition might be different when x > 0 compared to when x < 0, or it might have specific definitions for different ranges like 1 to 5 versus 5 to 10.
1When x < 0 (negative side): Use the equation f(x) = x + 2
2When x ≥ 0 (positive side and zero): Use the equation f(x) = x
To understand this function, imagine a strict teacher who said: "I won't accept any fractions. Any student who gets a grade will have the fraction removed."
Since we're being strict, instead of rounding up, we round down to the lower number.
1For all numbers from 0 to 1: f(x) = 0
2For all numbers from 1 to 2: f(x) = 1
3For all numbers from 2 to 3: f(x) = 2
4And so on...
The absolute value function is written as f(x) = |x|. Its job is to eliminate negative signs and always give a non-negative result.
1On the positive side (x ≥ 0): f(x) = x (nothing changes)
2On the negative side (x < 0): The absolute value removes the negative sign
3Result: We get a V-shaped graph that mirrors the positive side