\documentclass[12pt]{article}
\newcommand{\ds}{\displaystyle}
\parindent=0pt
\begin{document}

{\bf Constrained Critical Points}

\bigskip

Imagine an idealised mountain.  The summit will be a critical
point (a maximum) for the height function.  Consider a path on the
mountain which does not pass through the summit.  There will be a
highest point on this path, but this will not be a critical point
of the height function.  It is this latter type of point we are
concerned with.  Suppose the height function is given by
$z=f(x,y)$.  The projection of the path onto the $x-y$ plane will
be a curve with an equation of the form $g(x,y)=0$.  The path
itself will be specified by two equations,

\bigskip

Path $=\{(x,y,z):z=f(x,y)$ and $g(x,y)=0\}$.

\bigskip

To find the highest and lowest points (locally) on the path we are
looking for max/min of $f(x,y)$, subject to the constraint
$g(x,y)=0$.  The problem can be tackled in two ways.

\bigskip

\textbf{Method 1: Substitution}

Solve $g(x,y)=0$ for $y$, giving $y=y(x)$. Then
$\Phi(x)=f(x,y(x))$ is a function of one variable.



\textbf{Example}

Find the minimum distance of the line $lx+my+p=0$ from the origin.

Now distance $=\sqrt{x^2+y^2}$.  This is smallest when
$f(x,y)=x^2+y^2$ is smallest.

Now if $lx+my-p=0$ then if $m=0, \,\,\,\, x=\frac{p}{l}$ and the
minimum distance from the origin is $\left|\frac{p}{l}\right|$.

If $\ds m\not=0, \,\,\,\, y=\frac{(p-lx)}{m}$, so

$\ds \Phi(x)=f(x,y(x))=x^2+\frac{(p-lx)^2}{m^2}
=\frac{[(l^2+m^2)x^2-2plx+p^2]}{m^2}$

This is a quadratic with a minimum where $\ds
x=\frac{pl}{l^2+m^2}$.

So $\ds y=\frac{pm}{l^2+m^2} \hspace{0.5in} (x^2+y^2)_{\rm
min}=\frac{p^2}{l^2+m^2}$

So $\ds d_{\rm min}=\frac{|p|}{\sqrt{l^2+m^2}}$

\newpage
\textbf{Method 2: The Method Lagrange Multipliers}

It may not be possible to solve $g(x,y)=0$ for $y$ or $x$.  We
rely on the following geometrical ideas.


DIAGRAM



Geometrically it is clear that the tangent to the curve must
coincide with that of the contour at the constrained critical
point.  Where the curve crosses a contour it is usually climbing
or descending.  (There are exceptions which we shall not deal
with).  At $(x,y)$ the directional derivative of $f$ is given by
$f_x\cos\theta+f_y\sin\theta$.

This must be zero since a tangent to a contour is horizontal.
Assume that this is not in the $y$-direction, so
$\cos\theta\not=0$.  Thus

$f_x+f_y\tan\theta=0$.

Now from $g(x,y)=0$ we obtain $g_x+g_y\frac{dy}{dx}=0$

Now because the tangents coincide, $\frac{dy}{dx}=\tan\theta$,
giving $\frac{fx}{gx}=\frac{fy}{gy}=-\lambda$ say,

i.e. $f_x+\lambda g_x=0 \hspace{0.5in} f_y+\lambda g_y=0$

We have two equations in 3 unknowns.  But
$\tan\theta=\frac{dy}{dx}$ only says that the tangents are
parallel, not that they are identical.  That fact is given by
$g(x,y)=0$, giving a third equation.

Now we may not need to find $\lambda$ if we are only interested in
the location $(x,y)$ and $\lambda$ is sometimes called an
undetermined multiplier.  The problem of classifying such points
analytically is outside the scope of this course.  We shall look
at problems where max or min is obvious for geometrical reasons.

The above discussion gives the reasoning behind the method.  To
find critical points of $f(x,y)$ subject to $g(x,y)=0$, we solve
the three equations

\begin{eqnarray*}\frac{\partial f}{\partial
x}+\lambda\frac{\partial y}{\partial x}&=&0\\ \frac{\partial
f}{\partial y}+\lambda\frac{\partial g}{\partial y}&=&0\\
g(x,y)&=&0
\end{eqnarray*}

Applying this to the previous problem, we have

$f(x,y)=x^2+y^2 \hspace{0.5in} g(x,y)=lx+my-p$

We have to solve

\begin{eqnarray*} 2x+\lambda l&=&0\\ 2y+\lambda m&=&0\\
lx+my-p&=&0\end{eqnarray*}

This gives $\ds x=\frac{pl}{l^2+m^2} \hspace{0.5in}
y=\frac{pm}{l^2+m^2}$

\bigskip

We shall now consider an example where both $f$ and $g$ are
quadratic.

\bigskip

\textbf{Example}

Find the critical points of the function $f(x,y)=x^2+xy+y^2$
subject to the constraint $g(x,y)=x^2-xy+y^2-1=0$

\bigskip

Let $\phi=f+\lambda g$.  We require

$\phi_x=2x+y+\lambda(2x-y)=0$

$\phi_y=x+2y+\lambda(-x+2y)=0$

\bigskip

i.e. $\hspace{0.2in}x(2+2y)+y(1-\lambda)=0$

$\hspace{0.5in}x(1-\lambda)+y(2+2\lambda)=0 \hspace{0.5in} (A)$

\bigskip

Now $(x,y)=(0,0)$ is not a solution to $g=0$, so we must have

\bigskip

$\left|\begin{array}{cc} 2+2\lambda & 1-\lambda\\ 1-\lambda &
2+2\lambda\end{array}\right|=0$

\bigskip

i.e. $(2+2\lambda)^2-(1-\lambda)^2=0 \hspace{0.5in}
(3+\lambda)(1+3\lambda)=0$

$\lambda=-3$ or $\lambda=-\frac{1}{3}$

\bigskip

$\lambda=-3$

Substituting in (A) gives $-4x+4y=0$  i.e. $x=y$

substituting in $g=0$ gives $x^2=1$.  So the critical points are
$(1,1)$ and $(-1,-1)$.

$f-3g=-2(x-y)^2+3$  so when $x=y$ we have a maximum value of 3.

\bigskip

$\lambda=-\frac{1}{3}$

Substituting in (A) gives $x\frac{4}{3}+y\frac{4}{3}=0$  i.e.
$x=-y$

substituting in $g=0$ gives $3x^2=1$.  So the critical points are
$(\frac{1}{\sqrt3},-\frac{1}{\sqrt3})$ and
$(-\frac{1}{\sqrt3},\frac{1}{\sqrt3})$.

$f-\frac{1}{3}g=\frac{2}{3}(x+y)^2+\frac{1}{3}$  so when $x=-y$ we
have a minimum value of $\frac{1}{3}$.




\end{document}
