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

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

\begin{frame}
\frametitle{Reminders}

\begin{itemize}
\item	Homework B1 on 14.1 is due on \textbf{tonight}!
\item	You will have quiz \#3 on 13.1-13.4 on \textbf{Thursday}
\item	Homework B2 on 14.3 is due on \textbf{Friday}
\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
\begingroup
\color{red}
\item[{14.3}] Lecture 13: Partial Derivatives
\endgroup
\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	Learn how to compute partial derivatives and know various different notations for them
\item	Understand the geometric interpretation of partial derivatives
\item	Know how to compute higher partial derivatives
\item	Understand their connection with partial differential equations
\end{itemize}
\end{frame}

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


\section{Partial Derivatives, Geometric Interpretation}

\begin{frame}
\frametitle{Derivatives - One Variable}
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.5]
\draw[thick,->,>=stealth]	(-1,0)	--	(4,0);
\draw[thick,->,>=stealth]	(0,-1)	--	(0,6);
\node[above]	at	(0,6)		{\scriptsize{$y$}};
\node[right]	at	(4,0)		{\scriptsize{$x$}};
\draw[red,thick]	plot[domain=0:4] ({\x}, {1+0.5*(\x-1)*(\x-1)});
\node[right] at	(4,5.5)		{\scriptsize{$y=f(x)$}};
\uncover<2->
{
\node[below] at (2,0)	{\scriptsize{$a$}};
\draw[black,fill=black]	(2,1.5) circle(0.10cm);
}
\only<2>
{
\node[right]	at	(2,1.5)	{\scriptsize{$(a,f(a))$}};
\draw[black,fill=black]	(3,3)	circle(0.10cm);
\node[right] at (3,3)			{\scriptsize{$(a+h,f(a+h))$}};
\draw[dashed,blue]			(2,1.5)	--	(3,3);
}
\uncover<3->
{
\node[above]	at	(1.2,1.5)	{\scriptsize{$(a,f(a))$}};
\draw[dashed]	(2,0)	--	(2,1.5);
\draw[thick,blue]		plot[domain=0:4]	({\x},{1.5+(\x-2)});
}
\end{tikzpicture}

\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\footnotesize
\uncover<2->
{
The derivative of $f$ at $a$ is the limit
$$ f'(a) = \lim_{h \to 0} \frac{f(a+h)-f(a)}{h} $$
if it exists. 
}

\bigskip

\uncover<3->
{
$f'(a)$ is the slope of the tangent line to the graph of $f$ at the point $(a,f(a))$.
}

\bigskip

\uncover<4->
{
$f'(a)$ is also the instantaneous rate of change of $y=f(x)$ at $x=a$
}
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Partial Derivatives - Two Variables}
\footnotesize	

A function of two variables has two very natural rates of change:
\begin{itemize}
\item		The rate of change of $z=f(x,y)$ with respect to $x$ when $y$ is fixed
\item		The rate of change of $z=f(x,y)$ when respect to $y$ when $x$ is fixed
\end{itemize}

\bigskip

The first of these is called the \emph{partial derivative of $f$ with respect to $x$},
denoted $\dee f/\dee x$ or $f_x$

$$ f_x(a,b) = \lim_{h \to 0} \frac{f(a+h,b) - f(a,b)}{h} $$

\medskip


the second is called the \emph{partial derivative of $f$ with respect to $y$},
denoted $\dee f/\dee y$ or $f_y$

$$ f_y(a,b) = \lim_{h \to 0} \frac{f(a,b+h)-f(a,b)}{h} $$

\end{frame}

\begin{frame}
\frametitle{Geometric Interpretation}
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[title={$f(x,y)=x^2(4-y^2)$ },xlabel={$x$},ylabel={$y$},zlabel=$z$]
	\addplot3[view={60}{45},mesh,domain=-2:2.5,draw=blue,samples=21]
		{10+(x^2)*(4-y^2)};
	\addplot3 coordinates {(-1.5,-1.5,3.94+10)};
	\only<2>
		{
			\addplot3[red,very thick,domain=-2:2,samples=20,samples y=0]
				({x},{-1.55},{10+(x^2)*(4-(1.55)^2)});
			\addplot3[red,very thick,domain=-2:2.5,samples=20,samples y=0]
				({x},{-1.55},{0});
		}
	\only<3>
		{
			\addplot3[red,very thick,domain=-2:2,samples=20,samples y=0]
				({-1.55},{x},{10+(1.55)^2*(4-x^2)});
			\addplot3[red,very thick,domain=-2:2,samples=20,samples y=0]
				({-1.55},{x},{0});
		}
\end{axis}
\end{tikzpicture}



\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\footnotesize
Given a function $f(x,y) \ldots$

\bigskip
\uncover<2->
{
Compute  $f_x(a,b)$  by setting $y=b$ and varying $x$:
$$f_x(a,b) = \lim_{h \to 0} \frac{f(a+h,b) - f(a,b)}{h} $$
}

\bigskip

\uncover<3->
{
Compute $f_y(a,b)$ by setting $x=a$ and varying $y$:
$$f_x(a,b) = \lim_{h \to 0} \frac{f(a,b+h) - f(a,b)}{h} $$
}
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Partial Derivatives}
\footnotesize
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.85\textwidth}
{\color{cyan} \textbf{Rules for Finding Partial Derivatives of $z=f(x,y)$}}

\medskip
\begin{enumerate}
\item	To find $f_x$, regard $y$ as a constant and differentiate $f(x,y)$ with respect to $x$
\item	To find $f_y$, regard $x$ as a constant and differentiate $f(x,y)$ with respect to $y$
\end{enumerate}
\end{minipage}
}

\bigskip

Find both partial derivatives of the following functions:

\medskip
\begin{tabular}{rllrl}
1.	&	$f(x,y)=x^4 +5xy^3$	&&	2.	&	$f(x,t) = t^2 e^{-x}$	\\
\\
3.	&	$g(u,v)=(u^2+v^2)^3$	&&	4.	&	$f(x,y) = \sin(xy)$	\\
\\
5.	&	$f(George,Fran) = (George)^5 + (Fran)^3$
\end{tabular}

\end{frame}



\begin{frame}
\frametitle{Tangent Planes - Sneak Preview}
\footnotesize
\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[scale=0.45]
\draw[thick,->,>=stealth]	(-1,0)	--	(4,0);
\draw[thick,->,>=stealth]	(0,-1)	--	(0,6);
\node[above]	at	(0,6)		{\scriptsize{$y$}};
\node[right]	at	(4,0)		{\scriptsize{$x$}};
\draw[red,thick]	plot[domain=0:4] ({\x}, {1+0.5*(\x-1)*(\x-1)});
\node[right] at	(4,5.5)		{\scriptsize{$y=f(x)$}};
\node[below] at (2,0)	{\scriptsize{$a$}};
\draw[black,fill=black]	(2,1.5) circle(0.10cm);
\node[above]	at	(1.2,1.5)	{\scriptsize{$(a,f(a))$}};
\draw[dashed]	(2,0)	--	(2,1.5);
\draw[thick,blue]		plot[domain=0:4]	({\x},{1.5+(\x-2)});
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
\footnotesize
In calculus of one variable, the derivative $f'(a)$ defines a \emph{tangent line} to the graph of $f$ at $(a,f(a))$ by the equation
$$ L(x) = f(a) + f'(a) (x-a)$$
\end{minipage}

\vfill

\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[scale=0.4]
\begin{axis}[title={ },xlabel={$x$},ylabel={$y$},zlabel={$z$}]
\addplot3[view={20}{70},surf,domain=-2:2]
		{ sqrt(9-x^2-y^2) };
%
%  add point on the graph at (1,-0.5,sqrt(31)/2) 
%
\addplot3[mark=*,color=black]  coordinates {(1,-0.5,2.783)};
%
%	add tangent plane at (1,-0.5, sqrt(31)/2))
%
\addplot3[view={20}{70},surf,domain=0.25:1.75,y domain=1:-2,color=blue!50!white]
		{ sqrt(31)/2+ 5/(2*sqrt(31)) + (1/sqrt(31))*(y-2*x) };
\end{axis}
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
In calculus of two variables, the partial derivatives $f_x(a,b)$ and $f_y(a,b)$ define a \emph{tangent plane} to the graph of $f$ at $(a,b,f(a,b))$ by
\begin{multline*}
L(x,y) =f(a,b) \\ \hphantom{belch} \, + \, f_x(a,b) (x-a)  \, +\,  f_y(a,b) (y-b) 
\end{multline*}
\end{minipage}

\end{frame}


\begin{frame}
\frametitle{More Partial Derivatives}
\footnotesize
Sometimes it's useful to remember that, to compute a partial derivative
like
$f_x(x,1)$, you can set $y=1$ before you start computing. 

\bigskip

Find the following partial derivatives.

\medskip
\begin{enumerate}
\item		$f_x(x,1)$ if $f(x,y)=x^{y^{y^{y^y}}}\sin(x)$
\item		$f_y(3,y)$ if $f(x,y)=(x-3)\sin(\cos(\log(y)) + xy$
\end{enumerate}

\end{frame}



\section{Higher Partials, More Variables}

\begin{frame}
\frametitle{Higher Partials}
\footnotesize	
We can compute higher-order partial derivatives just by repeating operations. We'll find out what these partials actually mean later on!

\bigskip

\textbf{Example} Find the second partial derivatives of $f(x,y) = x^2 y^2$

$$ \frac{\dee f}{\dee x} = f_x(x,y) = 2xy^2, \quad \frac{\dee f}{\dee y} = 2x^2 y $$

\begin{align*}
\frac{\dee^2 f}{\dee x^2}			&= 	&&
\frac{\dee^2 f}{\dee x \dee y}	&=	\\[5pt]
\frac{\dee^2 f}{\dee y \dee x}	&=	&&
\frac{\dee^2 f}{\dee y^2}			&=	
\end{align*}

\medskip

Notations: 
$$ \frac{\dee^2 f}{\dee y \dee x} = f_{xy} = \left( f_x \right)_y, \quad 
 \frac{\dee^2 f}{\dee x \dee y}  = f_{yx} =\left( f_y \right)_x $$
\end{frame}

\begin{frame}
\footnotesize
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.85\textwidth}
{\color{cyan} \textbf{Clairaut's Theorem}}

\medskip

Suppose $f$ is defined on a disk $D$ that contains the point $(a,b)$. If the functions $f_{xy}$ and $f_{yx}$ are both continuous on $D$, then 
$$ f_{xy}(a,b) = f_{yx}(a,b) $$
\end{minipage}
}


\bigskip

Check Clairaut's theorem for the function $f(x,y)= x^3 y^2 - \sin(xy)$


\end{frame}

\begin{frame}
\frametitle{Implicit Differentiation}
\footnotesize
You can find partial derivatives by implicit differentiation.

\medskip

\begin{enumerate}
\item		Find $\dee z/\dee x$ and $\dee z/\dee y$ if $x^2+y^2+z^2 = 1$
\item		Find $\dee z/\dee x$ and $\dee z/\dee y$ if $ e^z = xyz$
\end{enumerate}

\end{frame}


\section{PDEs}

\begin{frame}
\frametitle{Partial Differential Equations}
\footnotesize

\emph{Partial Differential Equations} describe many physical phenomena. The unknown function is a function of two or more variables.



\medskip

The \emph{wave equation} for $u(x,t)$, a function which, for each $t$ gives a `snapshot' of a one-dimensional traveling wave:
$$ \frac{\dee^2 u }{\dee t^2} = \frac{1}{c^2} \frac{\dee^2 u}{\dee x^2} $$

\medskip

The \emph{heat equation} for $u(x,y,t)$, the temperature of a thin sheet at position $(x,y)$ at time $t$:
$$ \frac{\dee u}{\dee t}(x,y,t) = K \left(\frac{\dee^2 }{\dee x^2} + \frac{\dee^2}{\dee y^2} \right)u(x,y,t) $$

\medskip

\emph{Laplace's Equation} for the electrostatic potential of a charge distribution $\rho$:
$$ 
\left( \frac{\dee^2}{\dee x^2} + \frac{\dee^2}{\dee y^2} + \frac{\dee^2}{\dee z^2}\right) u(x,y,z) = 
4\pi \rho(x,y,z) 
$$



\end{frame}

\begin{frame}
\frametitle{The Wave Equation}
\footnotesize
$$ \frac{\dee^2 u }{\dee t^2} = \frac{1}{c^2} \frac{\dee^2 u}{\dee x^2} $$

\vfill

\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.5]
\begin{axis}[title={$u(x,t)=\sin(x-0.2*t)$ },xlabel={$x$},ylabel={$t$},zlabel=$u$]
	\addplot3[view={60}{45},mesh,domain=0:6,y domain=0:3,draw=blue,samples=21]
		{sin(57*(x-0.2*y))};
\end{axis}
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
$u(x,t)$ gives the height of a wave moving down a channel as a function of distance $x$ and time $t$

\bigskip
For each fixed $t$, we get a ``snapshot'' of the wave

\bigskip
For each fixed $x$, we get the height of the wave, at that point, as a function of time
\end{minipage}


\end{frame}

\begin{frame}
\frametitle{The Heat Equation}
\footnotesize
$$ \frac{\dee u}{\dee t}(x,t) =  K \frac{\dee^2 }{\dee x^2}u(x,t) $$
\vfill
\begin{minipage}{0.45\textwidth}
\begin{tikzpicture}[scale=0.6]
\begin{axis}[title={$u(x,t) = (4\pi t)^{-1/2} e^{-x^2/4t}$},xlabel={$x$},ylabel={$t$}]
	\addplot3[view={60}{45},surf,domain=-2:2,y domain=0.1:2,samples=40]
		{ exp(-(x^2/y))/(sqrt(y)) };
\end{axis}
\end{tikzpicture}
\end{minipage}
\qquad
\begin{minipage}{0.45\textwidth}
\footnotesize
For each $t$ we get a ``snapshot'' of the distribution of heat--at first heat concentrates near $x=0$, but then diffuses and cools as time moves forward
\end{minipage}
\end{frame}


\begin{frame}
\frametitle{Summary}
\footnotesize
\begin{itemize}
\item We learned how to compute partial derviatives of functions of several variables and the various notations for them
\item	We interpreted partial derivatives geometrically
\item	We learned how to compute higher derivatives
\item	We saw how partial derivatives arise in equations that describe heat flow and wave propagation
\end{itemize}
\end{frame}


\end{document}