\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)= \frac{x-y}{1+x^y+y^2}$$

On the upper half-plane $y \ge 0$.

\textbf{Answer}

For critical points
\begin{eqnarray*}
0 = f_1(x,y) & = & \frac{1-x^2+y^2+2xy}{(1+x^2+y^2)^2}\\
0 = f_2(x,y) & = & \frac{-1-x^2+y^2-2xy}{(1+x^2+y^2)^2}
\end{eqnarray*}
With any critical points having to satisfy
\begin{eqnarray*}
1 - x^2+y^2+2xy & = & 0\\
-1-x^2+y^2-2xy & = & 0\\
\Rightarrow x^2 & = & y^2\\
\textrm{and } 2xy & = & -1\\
\Rightarrow y = -x & = & \pm 1/\sqrt{2}
\end{eqnarray*}
And so the only critical point with $y \ge 0$ is
$(-\frac{1}{\sqrt{2}}, \frac{1}{\sqrt{2}})$, with
$f=-\frac{1}{\sqrt{2}}$.

On the boundary of the plane, $y=0$
$$f(x,0) = \frac{x}{1+x^2} = g(x),\ \ \ (-\infty < x < \infty)$$
This gives $g(x)\to 0$ as $x \to \pm \infty$.

$$\ds g'(x) = \frac{1-x^2}{(1+x^2)^2}$$
So the critical points of $g$ are $x=\pm1$, with $g(\pm 1)=\pm
\frac{1}{2}$.
So
\begin{eqnarray*}
\textrm{min}(f) & = & -\frac{1}{\sqrt{2}}\\
\textrm{max}(f) & = & \frac{1}{2}.
\end{eqnarray*}


\end{document}

