%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                       %
%  Extreme Values: The First Derivative Test            %
%                                                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\problemgrouptitle{Extreme Values: The First Derivative Test}

\begin{problemblock}[2]{Find the open intervals upon which the following functions are increasing or decreasing.  Also find any \relative minima and maxima and their locations.}

\item $f(x)=x^2+2x+1$
\answer{Decreasing on: $(-\infty,-1)$; Increasing on: $(-1,\infty)$; No \relative maxima; \Relative minimum: $f(-1)=0$}

\item $f(x)=\displaystyle\frac{x^2-3x+1}{x-1}$
\answer{Increasing on: $(-\infty,1)\cup(1,\infty)$; No \relative maxima or minima}

\item $f(x)=4\cos x-2x$ on $[0,2\pi]$
\answer{Decreasing on: $\left(0,\displaystyle\frac{7\pi}{6}\right)\cup\left(\displaystyle\frac{11\pi}{6},2\pi\right)$; Increasing on: $\left(\displaystyle\frac{7\pi}{6},\frac{11\pi}{6}\right)$;\newline \Relative maximum: $\displaystyle f\left(\frac{11\pi}{6}\right)=2\sqrt{3}-\frac{11\pi}{3}$; \Relative minimum: $\displaystyle f\left(\frac{7\pi}{6}\right)=-2\sqrt{3}-\frac{7\pi}{3}$}

\item $f(x)=|x|$
\answer{Decreasing on: $(-\infty,0)$; Increasing on: $(0,\infty)$; \Relative minimum: $f(0)=0$}
\item $\displaystyle f(x)=\left\{\begin{array}{cl}
|x| & \mbox{if}\ x\neq 0 \\[1em]
2 & \mbox{if}\ x=0
\end{array}\right.$
\answer{Decreasing on: $(-\infty,0)$; Increasing on: $(0,\infty)$; \Relative maximum: $f(0)=2$.  Note that the First Derivative Test cannot be applied here because $f(x)$ is discontinuous at $x=0$.  One must return to the definition of \relative maximum to evaluate the critical number $x=0$\,.}

\end{problemblock}

\textbook{\addtoanswerkey{\clearpage}}
\begin{problemblock}[2]{Each graph below is a graph of the derivative $f'$ of a function $f$.  In each case use the graph of $f'$ to sketch a possible graph of $f$.}

\addtoanswerkey{\begin{multicols}{2}}
\item ~

\resizebox{0.80\columnwidth}{!}{
\asycode{%
import graph;
size(200,200,IgnoreAspect);
real f(real x) {return -(x+2)*x*(x-2);}
pair F(real x) {return (x,f(x));}
draw(graph(f,-2.25,2.25,operator ..),red+2);
xaxis(shift(-7,-10)*Label("$x$",align=E),Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(0)),above=true);
yaxis(shift(-8,-7)*Label("$y$",align=N),ymin=-3.5,ymax=4,Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(0,4)),above=true);
}
}
\answer{~

\resizebox{0.55\columnwidth}{!}{
\asycode{%
import graph;
size(200,200,IgnoreAspect);
real f(real x) {return -1/4*x^4+2*x^2-2;}
pair F(real x) {return (x,f(x));}
draw(graph(f,-2.85,2.85,operator ..),red+2);
xaxis(shift(-7,-10)*Label("$x$",align=E),Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(-3,3)),above=true);
yaxis(shift(-8,-7)*Label("$y$",align=N),ymax=2.5,Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitFormat(0),OmitTick(0)),above=true);
}
}
}

\item ~

\resizebox{0.80\columnwidth}{!}{
\asycode{%
import graph;
size(200,200,IgnoreAspect);
real f(real x) {return -(x-1)^2*(x-3);}
pair F(real x) {return (x,f(x));}
draw(graph(f,0,3.5,operator ..),red+2);
xaxis(shift(-7,-10)*Label("$x$",align=E),xmax=3.5,Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitTick(0)),above=true);
yaxis(shift(-8,-7)*Label("$y$",align=N), ymax=3.5, Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10))),above=true);
dot(F(0),4+black);
dot(F(0),3+white);
}
}
\answer{~

\resizebox{0.55\columnwidth}{!}{
\asycode{%
import graph;
size(200,200,IgnoreAspect);
real f(real x) {return -1/4*x^4+5/3*x^3-7/2*x^2+3*x;}
pair F(real x) {return (x,f(x));}
draw(graph(f,0,3.5,operator ..),red+2);
xaxis(shift(-7,-10)*Label("$x$",align=E),Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitTick(0)),above=true);
yaxis(shift(-8,-7)*Label("$y$",align=N),Arrow(HookHead,size=4),ticks=Ticks(n=1,Step=1,Size=3,Label(fontsize(10)),OmitTick(0)),above=true);
}
}
}

\end{problemblock}

\addtoanswerkey{\end{multicols}Note that your graphs should be equivalent up to vertical shift by a constant.}
