A piecewise function is defined by using different formulas on different parts of its domain.
$$ f(x) = \begin{cases}
\text{formula 1} & \text{interval 1}\\
\text{formula 2} & \text{interval 2} \\
\vdots & \vdots \\
\text{formula $n$}&\text{interval $n$}
\end{cases}$$
Evaluating Piecewise Functions
To evaluate a piecewise function at $x=a$, first look on the right hand side to determine which interval contains $x=a$. Then substitute $x=a$ into the corresponding formula.
Evaluating piecewise functions.