\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 241, Lecture 20}
\maketitle

\section{ Relative extrema}  

We see that if a function changes from increasing to decreasing at a stationary or singular point,
that function obtains some kind of maximum   (there is a similar statement of
minima, which you should think about).   We now formalize this.  

\begin{definition}
Let $P = (c, f(c))$ be a critical point of a function $f(x)$.  
\begin{itemize}
\item $P$ is a relative maximum if $f'(x) > 0$ for nearby $x<c$ and $f'(x) < 0$ for 
nearby $x> c$.  
\item $P$ is a relative minimum if $f'(x) < 0$ for nearby $x<c$ and $f'(x) > 0$ for nearby
$x> c$.  
\item $P$ is not a relative extremum if $f'(x)$ has the same sign on both sides of
$c$.  
\end{itemize}
\end{definition}


If we are looking for largest or smallest values of a function, it often depends on
where the function is defined.    In particular, a relative maximum or minimum can
also occur on an endpoint of the domain.    For example, you were shortest at the
moment you were born, so time $t=0$ is where your height function has a minimum.  

We now include endpoints of the domain whenever we refer to critical points   
(because it is critical to check for maxima and minima at those points!).  

\begin{definition}
If $f$ is defined only over an interval from $a$ to $b$, we say that $f$ has a relative
minimum at $a$ if $f'(x)$ is positive for values of $x$ close to $a$.    We say that ...
(you fill in the rest!).  
\end{definition}

\begin{example}
Classify the critical points (as relative maxima, relative minima, or neither)  
of $\frac{x^2 - 3}{e^x}$ over the interval from 
$-4$ to $4$.     Check the answer with the graph.  
\end{example}

\begin{example}
Classify the critical points of the function $\ln (|x^2 - 2| + 1)$ over the interval from $-e$
to $e$.  
\end{example}

\section{ Optimization} 

Optimization,   that is finding where a function takes on its largest or smallest values, 
is the most common application of calculus.  
The big theorem which we will use repeatedly is:  

\begin{theorem}[First Optimization Theorem]
A continuous function defined everywhere on some interval $I$ obtains its absolute
maxima and minima either at the end(s) of $I$ or at some
critical number(s) in $I$.  
\end{theorem}

Let's do an example and then come back and formalize.  

\begin{example}
Maximize profit when the price at
which $q$ units can be sold is $p(q) = 25 - q$ and it
costs \$10 to produce each unit.  
\end{example}

What we did was:  
\begin{itemize}
\item Found all stationary points   (by finding the derivative and setting it to zero).  
\item Found all singular points.  
\item Found the endpoints   (these are often given).  
\item Compared values at all of these points - the largest is the max and the smallest
is the min.  
\end{itemize}

\begin{example}
Find the maximum and minimum values of the function $\frac{x^2 + 3}{x+1}$ as $x$
can take values from $0$ to $5$.  
\end{example}

\section{ Applied optimization problems}  

In applied problems one usually 
has to work in order to find a single function to maximize.  
One needs to keep track of relationships and constraints.  

\begin{example}
Suppose advertising costs \$1000 per unit (say for magazine adds), and
product development costs \$20000 per unit.     Suppose that the profits
generated from $x$ units of advertising and $y$ units of product development are
$xy^2$ thousands of dollars.     If a company has \$10000 to spend on 
advertising and product development together, how should the money be
allocated in order to maximize profits?  
\end{example}

\begin{example}
Suppose the top of a can is made of a metal which costs 10 cents per square
centimeter and the sides are made of a metal which costs 12 cents per square centimeter. 
What is the largest volume can which can be made from two dollars of material?  
\end{example}

We will formalize our techniques next time.



\end{document}
 