Section 11.4 Limits and Piecewise Functions
A piecewise function is a good opportunity to practice plotting discontinuities and investigating one- and two-sided limits.
> P(x) := piecewise(x <= -1, x^2, x <= 1, -x, 1 < x , x-4);
\begin{equation*}
\displaystyle P\, := \,x\mapsto \begin{cases}{x}^{2}\amp x\leq -1 \\ -x\amp x\leq 1 \\ x-4\amp 1\lt x \end{cases}
\end{equation*}
> P(x);
\begin{equation*}
\displaystyle \begin{cases}{x}^{2}\amp x\leq -1 \\ -x\amp x\leq 1 \\ x-4\amp 1\lt x \end{cases}
\end{equation*}
It is necessary to include the
discont=true parameter in the plot( ) command here so that the jump discontinuity is properly displayed in the graph of this piecewise function. Unfortunately, even with the discont=true option, Maple does not include an open dot at \((1,-3)\text{.}\)
> plot(P(x), x=-4..4, y=-5..5, discont=true);
A piecewise function such as this can provide some interesting results when looking at one- and two-sided limits.
> limit(P(x), x=1);
\begin{equation*}
\displaystyle \textit{undefined}
\end{equation*}
> limit(P(x), x=1, left);
\begin{equation*}
\displaystyle -1
\end{equation*}
> limit(P(x), x=1, right);
\begin{equation*}
\displaystyle -3
\end{equation*}
