\documentclass{amsart}[11pt]
\usepackage{graphicx}

\addtolength{\textwidth}{1.4in}                          
\oddsidemargin=0in                          
\evensidemargin=0in       

\newtheorem{example}{Example} 
\newtheorem{question}[example]{Question}
\newtheorem{definition}[example]{Definition}
\newtheorem{theorem}[example]{Theorem}
\newtheorem{notation}[example]{Notation}
\newtheorem{fact}[example]{Fact}

\begin{document}

\title{Math 242, Lecture 23}
\maketitle

\section{ Constrained optimization and Lagrange multipliers} 

\subsection{ Motivation: the need for additional tools in constrained optimization}  

In multivariable optimization, it is often the case that there is some
equation which imposes relations among the variables under consideration.  
Such constraint equations arise naturally in at least two distinct ways:  
\begin{itemize}
\item The equation represents a relation intrinsic to the problem, as for 
example when the variables represent money spent and there is one
fixed limited source for the funds.    We saw such problems at the end
of last term.  
\item When optimizing a multivariable function over a region, one
must check not only relative maxima and minima but values
on the boundary of the region (as we did in linear programming).  
The boundary of a region is a curve defined by some equation, and 
we must focus our attention on that curve.  
\end{itemize}

Before continuing general discussion, we clarify what we mean
by constraint equations by looking at examples
which are manageable with techniques developed last term.  
 
\begin{example}
Minimize the function $f(x,y) = x^2 + y^2 + xy$ subject to the constraint
$y = -3$.     Minimize it subject to the constraint $x + y = 5$.  
\end{example}

What we see in these examples is that (in these cases) we can use
a constraint equation to solve for one variable in terms of the
other, substitute that expression into our function, and thus
obtain a one-variable function to optimize.    We were able
to do such problems last term because we ultimately had
a one-variable function to optimize.   

But what if I wanted to minimize the $f(x,y)$ from the example subject to
the constraint $x^5y^7 - 3xy^2 = 2$?    I could not just solve for one variable
in terms of the other, so a new method is needed.  

\subsection{ Tangencies of level curves and the Lagrange multiplier equations}  

In order to understand the fundamental idea behind the Lagrange equations,
we investigate simple examples, paying close attention to the level curves at
and near the optimum point.  

\begin{example}
Find the minimum, and graph the level curves and the constraint curve near
that minimum for the function $f(x,y) = x^2 + y^2$, constrained by
$x + y = 2$   and $y = x^2 - 2$. 
\end{example}

What we see is that at the optimum point, the level curve for  the
function and the constraint curve are tangent!    This makes 
sense geometrically, as we can see with graphical illustrations.  

This observation leads to a way to find optimum points because of
the following theorem (which we will not be able to justify).  

\begin{theorem}
The slope of the level curve $f(x,y) = c$ for the function $f$ at any
point $(x,y)$ is given by $m = -\frac{f_x}{f_y}$.  
\end{theorem}

Therefore, the level curve of $f(x,y)$ is tangent to the constraint curve
$g(x,y) = c$ when $-\frac{f_x}{f_y} = -\frac{g_x}{g_y}$  
or $\frac{f_x}{g_x} = \frac{f_y}{g_y}$.    If we call the number that
they are both equal to $\lambda$ (pronounced ``lamb-duh''), 
then we have that $f_x = \lambda g_x$ and $f_y = \lambda g_y$.  
These are known as the first two Lagrange equations.  

\begin{theorem}
The maximum and minimum values for the function $f(x,y)$
subject to the constraint $g(x,y) = k$ occur at points
$(x,y)$ for which the following three equations hold:  
\begin{enumerate}
\item $f_x(x,y) = \lambda g_x(x,y)$.  
\item $f_y(x,y) = \lambda g_y(x,y)$.  
\item $g(x,y) = k$.  
\end{enumerate}
\end{theorem}

We first apply this theorem to see that it gives the same results we found
in our previous, simple, examples. 

\end{document}
 