\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\usepackage{epsfig}
\begin{document}
\parindent=0pt

\begin{center}
\textbf{Applications of Partial Differentiation}

\textit{\textbf{Extremes within restricted domains}}
\end{center}

\textbf{Question}

Find the maximum and minimum values of

$$f(x,y)=xy-2x$$

On the rectangle $-1 \le x \le 1$, $0 \le y \le 1$.


\textbf{Answer}

For critical points
\begin{eqnarray*}
0 & = & f_1(x,y)=y-2\\
0 & = & f_2(x,y)=x
\end{eqnarray*}
So the only critical point is $(0,2)$, this lies outside of the rectangle.

This implies that the minimum and maximum values of $f$ lie on the
four boundary segments of the rectangle.

On $x=-1$
\begin{eqnarray*}
f(-1,y) & = & 2-y\\
\textrm{for }0\le y \le 1 & & 
\end{eqnarray*}
This has min=1 and max=2.

On $x=1$
\begin{eqnarray*}
f(1,y) & = & y-2\\
\textrm{for }0 \le y \le 1 & & 
\end{eqnarray*}
This has min=-2 and max=-1.

On $y=0$
\begin{eqnarray*}
f(x,0) & = & -2x\\
\textrm{for }-1 \le x \le 1 & & 
\end{eqnarray*}
This has min=-2 and max=2.

On $y=1$
\begin{eqnarray*}
f(x,1) & = & -x\\
\textrm{for }-1 \le x \le 1 & & 
\end{eqnarray*}
This has min=-1 and max=1.

So for $f$ on the rectangle,
\begin{eqnarray*}
\textrm{max}(f) & = & -2\\
\textrm{max}(f) & = & 2
\end{eqnarray*}


\end{document}

