\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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	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 - Functions of Several Variables}			%%	title page
\author{Peter A. Perry}
\institute{University of Kentucky}
\date{September 23, 2019}
\maketitle

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

\begin{frame}
\frametitle{Reminders}

\begin{enumerate}
\item	Homework A6 on 13.3-13.4 is due  \textbf{tonight}!
\item	Homework B1 on 14.1 is due on \textbf{Wednesday}
\item	Homework B2 on 14.3 is due on \textbf{Friday}
\item	You will get Exam 1 back in recitation tomorrow. If you have any questions about grading, please return your papers to your TA with a note explaining your concern by \textbf{end of recitation on Tuesday}.
\end{enumerate}

\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

\begingroup
\color{red}
\item[{14.1}] Lecture 12: Functions of Several Variables
\endgroup
\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
\item[{14.7}] Lecture 18: Maximum and Minimum Values, II
\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	Know how to find the domain of a function of several variables
\item	Know how to graph a function of two variables in three-dimensional space
\item	Know how to find the level curves of a function of two variables and to match the graph of a function with its contour plot
\item	Know how to find level surfaces of a function of three variables 
\end{itemize}
\end{frame}

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


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%		Make font size on all slides small
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
\frametitle{One Variable versus Two Variables}
\footnotesize
\begin{minipage}{0.30\textwidth}
\begin{tikzpicture}[scale=0.4]
\drawxy{3}
\draw[red,thick]	plot[domain=-1:2.5,smooth,samples=50]	({\x}, {sqrt(1+\x)});
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.60\textwidth}
\footnotesize
A function of one variable is a map $f:I \to \R$
where the domain, $I$, is a subset of the real line

\medskip

Example:  	$f(x) = \sqrt{1+x}$, $I =[-1,\infty)$

\medskip

The \emph{graph} of $f$ is the set of points 
$(x,f(x))$ in the $xy$ plane, where $x \in I$

\end{minipage}

\vfill

\hrulefill

\vfill

\begin{minipage}{0.30\textwidth}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[
	title={$\sqrt{x-1}+\sqrt{y-2}$},
	xlabel=$x$, ylabel=$y$,
	small,
]
\addplot3[
		surf,
		domain=1:4,
		domain y=2:5,
]
	{sqrt(x-1) + sqrt(y-2)};
\end{axis}
\end{tikzpicture}


\end{minipage}
\qquad
\begin{minipage}{0.60\textwidth}
A function of two variables is a map
$ f: U \to \R $
where the domain $U$ is a subset of $\R^2$. 

\medskip

Example:	$f(x,y) = \sqrt{x-1} + \sqrt{y-2}$,

$$U = \{(x,y): x \geq 1, y \geq 2  \}$$

\medskip

The \emph{graph} of $f$ is the set of points $(x,y,f(x,z))$ in the $xyz$ plane
\end{minipage}

\end{frame}

\begin{frame}
\footnotesize
Match the following functions with the graphs of their domains in the $xy$-plane. 

\medskip

\begin{tabular}{ll}
$f(x,y) = \sqrt{9-x^2-y^2}$	&
$f(x,y) =	 \dfrac{x-y}{x+y}$	\\
$f(x,y) = \dfrac{\ln(2-x)}{4-x^2-y^2}$	&
$f(x,y) = \sqrt{x}+\sqrt{y}$
\end{tabular}

\bigskip

\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.3]
\draw[white,fill=yellow]	(0,0)	--	(0,3.5)	--	(3.5,3.5)	--	(3.5,0)	--	(0,0);
\drawxy{3.5}
\end{tikzpicture}

\vfill

\begin{tikzpicture}[scale=0.3]
\draw[yellow,thick,fill=yellow!70,opacity=0.8]	(0,0) circle(3cm);
\drawxy{3.5}
\draw[help lines]	(-3,-3)		grid	(3,3);
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.3]
\draw[yellow,fill=yellow]	(-3,-3)	rectangle	(3,3);
\draw[white,very thick]	(-3,3)	--	(3,-3);
\drawxy{3}
\end{tikzpicture}

\vfill

\begin{tikzpicture}[scale=0.2]
%\draw[yellow,fill=yellow]	(2,-3.64)	--	(2,3.64)	--	(2,3.64) arc(60:300:4);
\draw[yellow,fill=yellow]	(-5,-5)	rectangle (2,5);
\draw[white,thick]	(0,0)	circle(2cm);
\draw[help lines]  (-5,-5) grid (5,5);
\drawxy{5}
\end{tikzpicture}
\end{minipage}

\end{frame}

\section{Graphing Functions of Two Variables}

\begin{frame}
\frametitle{Linear Functions}
\footnotesize
A function of the form
$f(x,y) = ax + bx +c $
for numbers $a$, $b$, and $c$ is a \emph{linear function}. Its graph is a plane:
$$ z = ax+ by +c  \Rightarrow  ax+by-z = c $$
You already know how to graph this!

\vfill

\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[scale=0.75]
{\drawxyz{2.5}}
\uncover<3->
{
\fill[cyan!50,opacity=0.5]	(2,0,0)	--	(0,2,0)	--	(0,0,2)	--	(2,0,0);
\draw[black,fill=black]	(2,0,0) 	circle(0.05cm);
\draw[black,fill=black]	(0,2,0)	circle(0.05cm);
\draw[black,fill=black]	(0,0,2)	circle(0.05cm);

}
\uncover<4>
{
\draw[red,fill=red]	(0.66,0.66,0.66)	circle(0.05cm);
\draw[red,thick,->,>=stealth]
	(0.66,0.66,0.66)	--	++(1,1,1);
}

\end{tikzpicture}

\end{minipage}
\qquad
\begin{minipage}{0.5\textwidth}
\uncover<2->
{
Find the graph of $f(x,y) = 2-x-y$
}

\medskip

\uncover<3->
{
$$ x+y+z=2$$
$(2,0,0)$, $(0,2,0)$, and $(0,0,2)$ all lie on this plane
}

\medskip

\uncover<4->
{
The normal vector is $\langle 1,1,1 \rangle$
}
\end{minipage}

\end{frame}

\begin{frame}
\frametitle{Quadratic Functions}
\footnotesize
Everything you know about cylinders and quadric surfaces $z=f(x,y)$ tells you something about graphs. Can you match these functions to their graphs?

\medskip

\begin{center}
\begin{tabular}{llll}
$f(x,y) = y^2$			&&	$f(x,y) =x^2-y^2$	\\
\\
$f(x,y) = \sqrt{4-x^2-y^2}$	&&	$f(x,y)= x^2+y^2$	 
\end{tabular}
\end{center}

\vfill

\begin{center}
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	domain=-2:2,
	domain y = -2:2,
]
	{x^2+y^2};
\end{axis}
\end{tikzpicture}

\vfill

\begin{tikzpicture}[scale=0.4]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	domain=-2:2,
	domain y = -2:2,
]
	{y^2};
\end{axis}
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.4]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	domain=-2:2,
	domain y = -2:2,
]
	{x^2-y^2};
\end{axis}
\end{tikzpicture}

\vfill

\begin{tikzpicture}[scale=0.4]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	domain=-1:1,
	domain y = -1:1,
]
	{sqrt(4-x^2-y^2)};
\end{axis}
\end{tikzpicture}
\end{minipage}
\end{center}
\end{frame}

\begin{frame}
\frametitle{Common Sense and Connection}
\footnotesize
Can you match these functions with their graphs?


\begin{center}
\begin{tabular}{llll}
$f(x,y) = \sin(x) \cos(y)$			&&	$f(x,y) = \exp(-x^2-y^2)$	\\
\\
$f(x,y) = (x^2+y^2)e^{-(x^2+y^2)}$	&&	$f(x,y)= (x^2+3y^2)e^{-(x^2+y^2)}$	 
\end{tabular}
\end{center}

\vfill

\begin{center}
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.55]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	samples=50,
	domain=-9:9,
	domain y = -9:9,
]
	{sin(57.29*x)*sin(57.29*y)};
\end{axis}
\end{tikzpicture}

\vfill

\begin{tikzpicture}[scale=0.55]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	samples=50,
	domain=-4:4,
	domain y = -4:4,
]
	{exp(-(x^2+y^2))};
\end{axis}
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.55]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	samples=50,
	domain=-4:4,
	domain y = -4:4,
]
	{(x^2+y^2)*exp(-(x^2+y^2))};
\end{axis}
\end{tikzpicture}

\vfill

\begin{tikzpicture}[scale=0.55]
\begin{axis}[
	title={ },
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	samples=50,
	domain=-2:2,
	domain y = -2:2,
]
	{(x^2+3*y^2)*exp(-(x^2+y^2))};
\end{axis}
\end{tikzpicture}
\end{minipage}
\end{center}
\end{frame}

\section{Contour Plots}


\begin{frame}
\frametitle{Level Curves}
\footnotesize
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.85\textwidth}
{\color{cyan}\textbf{Definition}}  The \textbf{level curves} of a function $f$ of two variables are the curves with equations $f(x,y) = k$, where $k$ is a constant in the range of $f$.
\end{minipage}
}


\vfill

\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[
	title={ },
	plot box ratio = 2 2 8,
	xlabel=$x$,
	ylabel=$y$,
	small,
]
\addplot3[
	surf,
	samples=50,
	domain=-3:3,
	domain y = -3:3,
]
	{4*(x^2+y^2)};
\end{axis}
\end{tikzpicture}

\medskip

\uncover<3->
{
\begin{tikzpicture}[scale=0.45]
\drawxy{3}
\foreach	\r	in	{0.25,0.49,0.81,1.21,1.69}
{
	\draw[red]	plot[domain=0:360]		({\r*cos(\x)},{\r*sin(\x)});
}
}
\end{tikzpicture}

\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\begin{itemize}
\uncover<2->
{
\item	What is the range of the function $f(x,y) = x^2 + y^2$?
}
\uncover<3->
{
\item	Describe the level curves of this function
}
\end{itemize}
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Contour Plots}
\footnotesize
A \textbf{contour plot} of a function shows a number of level curves.
Can you match these functions with their graphs and contour plots?

\medskip

\begin{tabular}{lll}
$f(x,y) = \sin(xy)$	&	$f(x,y) = (1-x^2)(1-y^2)$	&	$f(x,y) = \sin(x-y)$		
\end{tabular}

\medskip

\begin{center}
\begin{minipage}{0.25\textwidth}
\includegraphics[scale=0.2]{Images/Lec11-sin(x-y)-contour-plot.pdf}
\end{minipage}
\qquad
\begin{minipage}{0.25\textwidth}
\includegraphics[scale=0.2]{Images/Lec11-sin(xy)-contour-plot.pdf}
\end{minipage}
\qquad
\begin{minipage}{0.25\textwidth}
\includegraphics[scale=0.2]{Images/Lec11-polynomial-contour-plot}
\end{minipage}
\end{center}
\end{frame}

\begin{frame}
\frametitle{You Already Know About Contour Plots}

Let's examine a \href{http://www.math.uky.edu/~perry/213-f18-perry/_assets/images/Mt_LeConte.pdf}{ topo map} from the Great Smoky Mountains National Park courtesy of the United States Geological Survey (USGS)


\end{frame}

\section{Level Surfaces}

\begin{frame}
\frametitle{Functions of Three Variables}
\footnotesize
A function of three variables is a map $f:V \to \R$ where the domain $V$ is a subset of $\R^3$

\medskip

Find the domain and range of these functions of three variables
\begin{enumerate}
\item	$f(x,y,z) = x^2 + y^2 + z^2$
\item	$f(x,y,z) = \sqrt{9-x^2- y^2 -z^2}$
\item	$f(x,y,z) = x+y+z$
\end{enumerate}

\end{frame}

\begin{frame}
\footnotesize
\fcolorbox{cyan}{white}
{
	\begin{minipage}{0.85\textwidth}
	{\color{cyan} \textbf{Definition}} The \textbf{level surfaces} of a function $f$ of three variables are the surfaces with equation $f(x,y,z) =k$ where $k$ is a constant in the range of $f$.
	\end{minipage}
}

\bigskip
Determine the level surfaces of the the following functions:
\begin{enumerate}
\item	$f(x,y,z) = x^2 + y^2 + z^2$
\item	$f(x,y,z) = \sqrt{9-x^2- y^2 -z^2}$
\item	$f(x,y,z) = x+y+z$
\end{enumerate}

\end{frame}

\begin{frame}
\frametitle{Summary}
\begin{itemize}
\item	We learned how to find the domain of a function of two variables and find its graph in three dimensional space
\item	We learned how to find level curves for a function of two variables and level surfaces for a function of three variables
\end{itemize}
\end{frame}

\end{document}