\documentclass[notes=show,10pt]{beamer}
\usepackage{mathpazo}			%% Beamer stuff
\usepackage{amsmath}			%% AMS math packages
\usepackage{amsfonts}			%%	-	special fonts
\usepackage{amssymb}			%%	-	special symbols
\usepackage{graphicx}			%% graphics
\usepackage{tcolorbox}			%% color boxes

\usepackage{hyperref}			%% for web links
\hypersetup{
%    bookmarks=true,         		% show bookmarks bar?
    unicode=false,          		% non-Latin characters in Acrobat’s bookmarks
    pdftoolbar=true,        		% show Acrobat’s toolbar?
    pdfmenubar=true,        	% show Acrobat’s menu?
    pdffitwindow=false,     		% window fit to page when opened
    pdfstartview={FitH},    		% fits the width of the page to the window
    pdfnewwindow=true,      	% links in new PDF window
    colorlinks=true,       			% false: boxed links; true: colored links
    linkcolor=blue,          		% color of internal links (change box color with linkbordercolor)
    citecolor=PineGreen,    		% color of links to bibliography
    filecolor=magenta,      		% color of file links
    urlcolor=cyan           		% color of external links
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		TiKZ Ploting Stuff
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{tikz}				%% TikZ -graphics

\usetikzlibrary{arrows, positioning, calc, intersections}
\usetikzlibrary{decorations.pathreplacing, decorations.markings}

\usepackage{pgfplots}			%% fancy plotting

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	For 3d plotting, using the tikz-3dplot package so
%	that (x,y,z) coordinates are specified in normal order
%	and one can change the perspective for 3-d plots
%
%	To invoke, use
%
%	\begin{tikzpicture}[tdplot_main_coords,{other options}]
%		...
%	\end{tikzpicture}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{tikz-3dplot}		%% Enhanced 3d plotting

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Package forest to draw tree diagrams for chain rule
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{forest}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	adjustbox package to force minipage alignment
%
%	Two-column structure is
%
%	\adjustbox{valign=t}
%		{
%			\begin{minipage}{0.45\textwidth}
%			...
%			\end{minipage}
%		}
%	\adjustbox{valign=t}
%		{
%		
%			\begin{minipage}{0.45\textwidth}
%			...
%			\end{minipage}
%		}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{adjustbox}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Set Beamer theme
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usetheme{Dresden}
\usecolortheme{dolphin}

%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Hack to remove subsection bar from our
%		friends at Tex.StackExchange.Com
%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\beamer@theme@subsectionfalse

\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%
%		
%		Hack to make the nice little circles appear
%		from Tex.stackexchange.com
%
%		Reference: 
%
%		https://tex.stackexchange.com/questions/2072/beamer-navigation-circles-without-subsections
%
%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{remreset}
\makeatletter
\@removefromreset{subsection}{section}
\makeatother
\setcounter{subsection}{1}

%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Get rid of triangles, put in circles for 
%		itemize items
%
%%%%%%%%%%%%%%%%%%%%%%%%%%
\setbeamertemplate{items}[circle]

%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Clean up fonts
%
%%%%%%%%%%%%%%%%%%%%%%%%%%

\usefonttheme{professionalfonts}
\usefonttheme{serif}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		tikz plotting options
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\pgfplotsset{my style/.append style={axis x line=middle, axis y line=
           middle, xlabel={}, ylabel={}, axis equal }}
           
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Math Operators
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\DeclareMathOperator{\comp}{comp}
\DeclareMathOperator{\proj}{proj}
\DeclareMathOperator{\Hess}{Hess}

\DeclareMathOperator{\curl}{curl}
\DeclareMathOperator{\diver}{div}
\DeclareMathOperator{\grad}{grad}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	Document begins here...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
           
\begin{document}

\input{213-Lecture-Macros}		%% 	macros, settings, et.c


\title{Math 213 - Maximum and Minimum Values, II}			%%	title page
\author{Peter A. Perry}
\institute{University of Kentucky}
\date{October 7, 2019}
\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%	
%	Due Date Reminders
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Reminders}

\begin{itemize}
\item	Homework B5 on 14.6 (Directional derivatives, gradient)  is due Wednesday
\item	Homework B6 on 14.7 (Maximum and minimum values) is due Friday
\item	Homework B7 on 14.8  (Lagrange multipliers)  is due Monday!
\item	Quiz \#5 on 14.4-14.5 is on Thursday
\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	Unit Outline
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Unit II: Functions of Several Variables}
\begin{itemize}

\item[{13.3-4}] 	Lecture 11: Velocity and Acceleration

\medskip

\item[{14.1}] Lecture 12: Functions of Several Variables

\item[{14.3}] Lecture 13: Partial Derivatives
\item[{14.4}] Lecture 14: Linear Approximation
\item[{14.5}] Lecture 15: Chain Rule, Implicit Differentiation

\item[{14.6}] Lecture 16: Directional Derivatives and the Gradient


\medskip

\item[{14.7}] Lecture 17: Maximum and Minimum Values, I
\begingroup
\color{red}
\item[{14.7}] Lecture 18: Maximum and Minimum Values, II
\endgroup
\item[{14.8}] Lecture 19: Lagrange Multipliers


\medskip

\item[{15.1}]	Double Integrals
\item[{15.2}]	Double Integrals over General Regions
\item[{}]			Exam II Review
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	Learning Goals
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{Learning Goals}
\begin{itemize}
\item	Understand how to find absolute maxima and minima of functions of two variables on a bounded, closed set
\end{itemize}
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		New material begins here...
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{The Closed Set Method}

\begin{frame}
\frametitle{Review of Calculus I}
\footnotesize
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.85\textwidth}
{\color{cyan} \textbf{The Closed Interval Method}}
To find the \emph{absolute} maximum and minimum values of a continuous function on a closed interval $[a,b]$:
\begin{enumerate}
\item	Find the values of $f$ at the critical numbers of $f$ in $[a,b]$
\item	Find the values of $f$ at the endpoints of the interval
\item	The largest of the values from steps 1 and 2 is the absolute maximum of $f$ on $[a,b]$; the smallest of these values is the absolute minimum of $f$ on $[a,b]$.
\end{enumerate}
\end{minipage}
}

\bigskip
For functions of two variables:

\smallskip
\begin{enumerate}
\item	The ``closed interval'' on the line is replaced by a ``closed set'' in the plane
\item	The boundary of a closed set is a \emph{curve} rather than just two points
\end{enumerate}
Otherwise, the idea is much the same!
\end{frame}

\begin{frame}
\frametitle{Bounded Sets, Closed Sets, Boundaries}
\footnotesize
\begin{minipage}{0.3\textwidth}
\begin{tikzpicture}[scale=0.5]
\fill[yellow]	(-1.5,-1.5)	rectangle (1.5,1.5);
\drawxy{3}
\only<1>
{
\draw[dashed,red,thick]	(0,0)	circle(3cm);
}
\only<2>
{
\draw[cyan,fill=cyan]	(1.5,0.5)	circle(0.05cm);
}
\only<3>
{
\draw[cyan]	(-1.5,-1.5) rectangle (1.5,1.5);
}
\end{tikzpicture}


\end{minipage}
\qquad
\begin{minipage}{0.6\textwidth}
A \emph{bounded set} $D$ in $\R^2$ is a set that can be enclosed inside a large enough circle

\medskip

\uncover<2->
{
A \emph{boundary point} is a point $(a,b)$ that has points that belong to  $D$ \emph{and} points that don't belong to $D$ arbitrarily close to it
}

\medskip

\uncover<3->
{
The \emph{boundary} of a set $D$ is the set consisting of all the boundary points
}

\medskip

\uncover<4->
{
A \emph{closed} set $D$ is one that contains all of its boundary points. 
}
\end{minipage}


\end{frame}

\begin{frame}
\frametitle{Bounded Sets, Closed Sets, Boundaries}
\footnotesize
Classify each of the following sets as bounded or not bounded, and closed or not closed

\bigskip
\begin{enumerate}
\item	$D = \{ (x,y): x^2 + y^2 < 1 \}$
\item	$D = \{ (x,y,): x^2 + y^2 \leq 1 \}$
\item	$D = \{ (x,y): x^2 + y^2 \geq 1 \}$
\item $D = \{ (x,y): x^2 + y^2 > 1\}$ 
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{The Extreme Value Theorem}
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.85\textwidth}
{\color{cyan} \textbf{Extreme Value Theorem}} If $f$ is continuous on a closed, bounded set $D$ in $\R^2$, then $f$ attains an absolute maximum value $f(x_1,y_1)$ and an absolute minimum value $f(x_2,y_2)$ at some points $(x_1,y_1)$ and $(x_2,y_2)$ in $D$.
\end{minipage}
}

\vfill

\emph{Practical fact:} These extreme values occur either in the interior of $D$, where the second derivative test works, or on the boundary of $D$, where the search for maxima and minima  can be reduced to a Calculus I problem.
\end{frame}

\begin{frame}
\frametitle{The Closed Set Method}
\footnotesize
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.85\textwidth}
{\color{cyan} \textbf{The Closed Set Method}} 
To find the absolute minimum and maximum values of a continuous function $f$ on a closed, bounded set $D$:
\begin{enumerate}
\item	Find the values of $f$ at critical points of $f$ in $D$
\item	Find the extreme values of $f$ on the boundary of $D$
\item	The largest of the values from steps 1 and 2 is the absolute maximum value; 
the smallest of these values is the absolute minimum value.
\end{enumerate}
\end{minipage}
}

\vfill

The tricky bit is step 2. 
\end{frame}

\begin{frame}
\frametitle{Warm-Up: Finding Extreme Values on a Boundary}
\begin{minipage}{0.35\textwidth}
\begin{tikzpicture}[scale=0.6]
\drawxy{2}
\draw[red,thick,smooth]	plot[domain=0:360]	({cos(\x)}, {sin(\x)});
\end{tikzpicture}

\bigskip

\bigskip

\begin{tikzpicture}[scale=0.35]
\draw[help lines]		(-3,-3)	grid  (3,3);
\drawxy{3.5}
\draw[thick,cyan]		(2,0)	--	(0,2)	--	(0,-2)		--	(2,0);
\draw[cyan,fill=cyan]	(2,0)		circle(0.10cm);
\draw[cyan,fill=cyan]	(0,2)		circle(0.10cm);
\draw[cyan,fill=cyan]	(0,-2)		circle(0.10cm);
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.55\textwidth}
\footnotesize
\begin{enumerate}
\item
Find the extreme values of $$f(x,y) = x^2 - y^2$$ on the boundary of the disc
$x^2+y^2=1$

\bigskip

\item

Find the extreme values of $$f(x,y) = x^2+y^2-2x$$ on the boundary of the 
rectangular region with vertices $(2,0)$, $(0,2)$ and $(0,-2)$.

\end{enumerate}
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Finding Extreme Values}

\begin{minipage}{0.35\textwidth}
\begin{tikzpicture}[scale=0.6]
\fill[red!10]	plot[domain=0:360]	({cos(\x)}, {sin(\x)});
\draw[red,thick,smooth]	plot[domain=0:360]	({cos(\x)}, {sin(\x)});
\drawxy{2}
\end{tikzpicture}

\bigskip

\bigskip

\begin{tikzpicture}[scale=0.35]
\fill[cyan!10]	(2,0)	--	(0,2)	--	(0,-2)		--	(2,0);
\draw[help lines]		(-3,-3)	grid  (3,3);
\drawxy{3.5}
\draw[thick,cyan]		(2,0)	--	(0,2)	--	(0,-2)		--	(2,0);
\draw[cyan,fill=cyan]	(2,0)		circle(0.10cm);
\draw[cyan,fill=cyan]	(0,2)		circle(0.10cm);
\draw[cyan,fill=cyan]	(0,-2)		circle(0.10cm);
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.55\textwidth}
\footnotesize
\begin{enumerate}
\item
Find the extreme values of $$f(x,y) = x^2 - y^2$$ on the disc
$$ \{ (x,y): x^2+y^2 \leq 1 \}. $$

\bigskip

\item

Find the extreme values of $$f(x,y) = x^2+y^2-2x$$ on the 
rectangular region with vertices $(2,0)$, $(0,2)$ and $(0,-2)$.

\end{enumerate}
\end{minipage}
\end{frame}


\begin{frame}
\frametitle{More Extreme Values}
\footnotesize
\begin{minipage}{0.35\textwidth}
\begin{tikzpicture}[scale=1.2]
\fill[red!10]	plot[domain=0:90]	({1.73*cos(\x)}, {1.73*sin(\x)}) -- (0,0)	--	(1.73,0);
\draw[thick,->,>=stealth]	(-0.5,0)	--	(2.5,0);
\draw[thick,->,>=stealth]	(0,-0.5)	--	(0,2.5);
\draw[help lines]	(0,0)	grid	(2,2);
\draw[red,thick]	(0,0)	--	plot[domain=0:90]	({1.73*cos(\x)}, {1.73*sin(\x)})	-- (0,0);
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.55\textwidth}
Find the absolute maximum and absolute minimum of 
$$ f(x,y) = xy^2 $$
on the region
$$ D = \{ (x,y): x \geq0, y \geq 0, x^2+y^2 \leq 3 \} $$

\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Yet More Extreme Values}
\begin{minipage}{0.35\textwidth}
\begin{tikzpicture}[scale=0.4]
\fill[cyan!10]	(-2,3)	--	(2,3)	--	(2,2)	--	(-2,-2)	--	(-2,3);
\drawxy{4}
%%
\draw[help lines]	(-4,-4)	grid	(4,4);
\draw[cyan,fill=cyan]	(-2,3)		circle(0.1cm);
\draw[cyan,fill=cyan]	(2,3)		circle(0.1cm);
\draw[cyan,fill=cyan]	(2,2)		circle(0.1cm);
\draw[cyan,fill=cyan]	(-2,-2)	circle(0.1cm);
%%
\draw[cyan,thick]	(-2,3)	--	(2,3)	--	(2,2)	--	(-2,-2)	--	(-2,3);
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.55\textwidth}
\footnotesize
Find the absolute maximum and absolute minimum of 
$$ f(x,y) = x^3 - 3x - y^3 + 12y $$
if $D$ is the quadrilateral whose vertices are $(-2,3)$, $(2,3)$, $(2,2)$, and $(-2,-2)$.

\end{minipage}
\end{frame}

\begin{frame}
\frametitle{A Word Problem with Extreme Values}
\begin{minipage}{0.35\textwidth}
\begin{tikzpicture}[scale=0.4]
\draw[thick,->,>=stealth]	(0,0,0)	--	(6,0,0);
\draw[thick,->,>=stealth]	(0,0,0)	--	(0,6,0);
\draw[thick,->,>=stealth]	(0,0,0)	--	(0,0,9);
%%
\node[above]	at	(0,6,0)	{\footnotesize{$z$}};
\node[right]	at (6,0,0)	{\footnotesize{$y$}};
\node[below]	at	(0,0,9)	{\footnotesize{$x$}};
%
\draw[red]	(0,0,0)	--	(0,0,1)	--	(1,0,1)	--	(1,0,0)	--	(0,0,0);
\draw[red]	(0,1,0)	--	(0,1,1)	--	(1,1,1)	--	(1,1,0)	--	(0,1,0);
\draw[red]	(0,0,0)	--	(0,1,0);
\draw[red]	(0,0,1)	--	(0,1,1);
\draw[red]	(1,0,1)	--	(1,1,1);
\draw[red]	(1,0,0)	--	(1,1,0);
%%
\draw[red,fill=red]	(1,1,1)	circle(0.1cm);
%%
\draw[cyan,thick,fill=cyan!20,opacity=0.3]	(0,0,6)	--	(3,0,0)	--	(0,2,0)	-- (0,0,6);
%%
\draw[cyan,fill=cyan]	(0,0,6)	circle(0.10cm);
\draw[cyan,fill=cyan]	(3,0,0)	circle(0.10cm);
\draw[cyan,fill=cyan]	(0,2,0)	circle(0.10cm);
%%
\node[left]		at	(0,0,6)	{\tiny{$(6,0,0)$}};
\node[below]	at	(3,0,0)	{\tiny{$\, \, (0,3,0)$}};
\node[right]	at	(0,2,0)	{\tiny{$\, \, (0,0,2)$}};
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.55\textwidth}
\footnotesize
Find the volume of the largest rectangular box in the first octant with three faces in the coordinate planes and one vertex in the plane $$x+2y+3z=6. $$

\vfill

\begin{enumerate}
\item		What is the volume of the box in terms of $(x,y)$ only?
\item		What values of $(x,y)$ are allowed?
\item		Do we need to check the boundary?
\end{enumerate}
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Summary}
\begin{itemize}
\item	We reviewed what it means for a subset of $\R^2$ to be bounded and closed, and what a boundary point of a  set is 
\item	We learned about the Extreme Value Theorem for functions of two variables: maxima and minima of functions in a closed bounded set occur either at interior critical points or along the boundary
\item	We learned about the closed set method for finding maxima and minima of functions on a closed set
\end{itemize}
\end{frame}




\end{document}