%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                           %
%  One-sided Limits                         %
%                                           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\problemgrouptitle{One-sided Limits}

\item Find the one-sided limits of $f$ at the values $x=0$, $x=2$ and $x=4$.

\resizebox{7cm}{!}{\asycode{%
import graph;
size(200,0);
real f(real x) {return -0.5*x+4;}
pair F(real x) {return (x,f(x));}
real g(real x) {return tan(0.25*3.14159*(x-2))+2;}
pair G(real x) {return (x,g(x));}
real h(real x) {return -1/4*(x-4)^2+2;}
pair H(real x) {return (x,h(x));}
draw(graph(f,-2,2,operator ..),red+2);
draw(graph(g,2,3.65,operator ..),red+2);
draw(graph(h,4,6,operator ..),red+2);
dot(F(2),4+black);
dot(F(2),3+white);
dot(G(2),4+black);
dot(G(2),3+red);
dot(H(4),4+black);
dot(H(4),3+red);
xaxis(shift(-7,-10)*Label("$x$",align=E),Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitFormat(-2,6),OmitTick(-2,6)),above=true);
yaxis(ymax=6,shift(-8,-7)*Label("$y$",align=N),Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(0,6)),above=true);
}
}
\answer{$\displaystyle\lim_{x\to0^-}f=4$, $\displaystyle\lim_{x\to0^+}f=4$, $\displaystyle\lim_{x\to2^-}f=3$, $\displaystyle\lim_{x\to2^+}f=2$, $\displaystyle\lim_{x\to4^-}f=\infty$ (limit does not exist but approaches infinity), $\displaystyle\lim_{x\to4^+}f=2$}

\item Find the one-sided and two-sided limits of $f$ at the values $x=0$, $x=2$ and $x=4$.
	
\resizebox{7cm}{!}{\asycode{%
import graph;
size(200,0);
real f(real x) {return -1/2*(x-2)^2+1;}
pair F(real x) {return (x,f(x));}
real g(real x) {return -(x-4)^2+2;}
pair G(real x) {return (x,g(x));}
draw(graph(f,-.5,2,operator ..),red+2);
draw(graph(g,2,6,operator ..),red+2);
dot(F(2),4+black);
dot(F(2),3+white);
dot(G(2),4+black);
dot(G(2),3+white);
dot(G(4),4+black);
dot(G(4),3+white);
dot((4,-2),4+black);
dot((4,-2),3+red);
xaxis(shift(-7,-10)*Label("$x$",align=E),Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitFormat(-2,6),OmitTick(0,-2,6)),above=true);
yaxis(shift(-8,-7)*Label("$y$",align=N),ymax=3,Arrow(HookHead,size=4),ticks=Ticks(n=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(0,3)),above=true);
dot(F(0),4+black);
dot(F(0),3+white);
}}
\answer{$\displaystyle\lim_{x\to0^-}f=-1$, $\displaystyle\lim_{x\to0^+}f=-1$, $\displaystyle\lim_{x\to2^-}f=1$, $\displaystyle\lim_{x\to2^+}f=-2$, $\displaystyle\lim_{x\to4^-}f=2$, $\displaystyle\lim_{x\to4^+}f=2$, $\displaystyle\lim_{x\to0}f=-1$, $\displaystyle\lim_{x\to2}f$ does not exist, $\displaystyle\lim_{x\to4}f=2$}

\item Suppose $\displaystyle f(x)=\left\{
\begin{array}{cc}
\frac{4}{x+4} & \mbox{if}\ x<2 \\
x^2+1 & \mbox{if}\ x\ge2
\end{array}
\right.$\ .

Find $\displaystyle\lim_{x\to 2^-}f(x)$, $\displaystyle\lim_{x\to 2^+}f(x)$, and $\displaystyle\lim_{x\to 2}f(x)$, if they exist.

\answer{$\displaystyle\lim_{x\to 2^-}f(x)=\frac{2}{3}$, $\displaystyle\lim_{x\to 2^+}f(x)=5$, $\displaystyle\lim_{x\to 2}f(x)$ does not exist as the left and right-handed limits are not equal at $x=2$\,.}

\item Suppose $\displaystyle f(x)=\left\{
\begin{array}{cc}
x^2+2cx & \mbox{if}\ x\le-1 \\
x+5c & \mbox{if}\ x>-1
\end{array}
\right.$\ .

Find all values for the constant $c$ that make the two-sided limit exist at $x=-1$\,.
\answer{$\displaystyle c=\frac{2}{7}$}
