\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,z)=xy^2+yz^2$$

Over the ball $x^2+y^2+z^2 \le 1$.


\textbf{Answer}

For interior critical points
\begin{eqnarray*}
0 = f_1 & = & y^2\\
0 = f_2 & = & 2xy + z^2\\
0 = f_3 & = & 2yz
\end{eqnarray*}
This makes all points on the $x$-axis critical points with $f=0$

Consider the boundary of the ball, $z^2=1-x^2-y^2$.

On the boundary
\begin{eqnarray*}
f(x,y,z) & = & xy^2+y(1-x^2-y^2)\\
& = & xy^2+y-x^2y-y^3\\
& = & g(x,y)
\end{eqnarray*}
With $g$ defined for $x^2+y^2 \le 1$.

For internal CPs of $g$
\begin{eqnarray*}
0 = g_1 & = & y^2-2xy + y(y-2x)\\
0 = g_2 & = & 2xy+1-x^2-3y^2
\end{eqnarray*}

\begin{eqnarray*}
\textrm{If }y=0 & &\\ 
\Rightarrow g & = & 0\\
f & = & 0\\
& & \\
\textrm{If }y=2x & & \\
\Rightarrow 0 & = & 4x^2+1-x^2-12x^2\\
9x^2 & = & 1\\
x & = & \pm \frac{1}{3}
\end{eqnarray*}
This gives the critical points
\begin{eqnarray*}
\left ( \frac{1}{3}, \frac{2}{3} \pm \frac{2}{3} \right ) & &
f=\frac{12}{27}\\
\left ( -\frac{1}{3}, -\frac{2}{3} \pm \frac{2}{3} \right ) & &
f=-\frac{12}{27}
\end{eqnarray*}

Now consider $x^2+y^2=1$
\begin{eqnarray*}
g(x,y) & = & xy^2\\
& = & x(1-x^2)\\
& = & x-x^3\\
& = & h(x)
\end{eqnarray*}
For $-1\le x \le 1$

For the end points $x= \pm 1$, $ h=0$, $\Rightarrow g=0$ and $f=0$.

For the critical points of $h$
\begin{eqnarray*}
0=h'(x) & = & 1-3x^2\\
\Rightarrow x & = & \pm \frac{1}{\sqrt{3}}\\
y & = & \pm \sqrt{\frac{2}{3}}\\
\textrm{with }h & = & \pm \frac{2}{(3\sqrt{3})}
\end{eqnarray*}
But $2/(3\sqrt{3})<12/27$, this is not the maximum value for $f$
\begin{eqnarray*}
\Rightarrow \textrm{min}(f) & = & -\frac{12}{27}\\
\textrm{max}(f) & = & \frac{12}{27}
\end{eqnarray*}

\end{document}

