\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 - The Chain Rule and Implicit Differentiation}			%%	title page
\author{Peter A. Perry}
\institute{University of Kentucky}
\date{September 30, 2019}
\maketitle

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

\begin{frame}
\frametitle{Reminders}

\begin{itemize}
\item	Homework B3 on 14.4 is due Wednesday night
\item	Quiz \# 4 on 14.1, 14.3  takes place on Thursday
\item	Homework B4 on 14.5 is due Friday night
\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
\begingroup
\color{red}
\item[{14.5}] Lecture 15: Chain Rule, Implicit Differentiation
\endgroup
\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	Review the chain rule for functions of one variable
\item	Learn how to differentiate $f(x,y)$ along a curve
$(x(t),y(t))$

\item	Learn how to differentiate $f(x,y)$ along 
$x(s,t), y(s,t)$

\item	Learn about the Chain Rule Tree

\item	Learn about Implicit Differentiation
\end{itemize}
\end{frame}

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



\section{Review}

\begin{frame}
\frametitle{Chain Rule for Functions of One Variable}
\footnotesize
\begin{center}
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.8\textwidth}
{\color{cyan} \textbf{The Chain Rule, 1 Variable}}
If $y=f(u)$ and $u=u(x)$, then
$$ \frac{dy}{dx} = \frac{dy}{du} \cdot \frac{du}{dx} $$
\end{minipage}
}
\end{center}
Remember that, at the end of the computation, you substitute for $u$ the formula for $u$ in terms of $x$!

\bigskip

\begin{enumerate}
\item	If $y=u^3$ and $u=\cos x$, find $dy/dx$
\item	Find the derivative of $g(x) = (x^2+1)^{3/2}$ 
\end{enumerate}
\end{frame}


\section{$f(x(t),y(t))$}


\begin{frame}
\frametitle{Case 1: $f(x(t),y(t))$}
\footnotesize
\begin{center}
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.8\textwidth}
{\color{cyan} \textbf{The Chain Rule, 2  Variables (Case 1)}}
If $z=f(x,y)$, $x=g(t)$, and $y=h(t)$, then
$$
\frac{dz}{dt} = \frac{\dee f}{\dee x} \frac{dx}{dt} +
					\frac{\dee f}{\dee y} \frac{dy}{dt}
$$
\end{minipage}
}
\end{center}

\bigskip

\begin{enumerate}
\item	Suppose that $z=\sin x \cos y$, $x=\sqrt{t}$, and $y=1/t$. Find $dz/dt$. 
\item	Suppose that $z=\sqrt{1+xy}$, $x=\tan t$, and $y=\arctan t$. Find $dz/dt$. 
\end{enumerate}

\end{frame}

\begin{frame}
\frametitle{Case 1: $f(x(t),y(t))$}
\footnotesize
\begin{center}
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.8\textwidth}
{\color{cyan} \textbf{The Chain Rule, 2  Variables (Case 1)}}
If $z=f(x,y)$, $x=g(t)$, and $y=h(t)$, then
$$
\frac{dz}{dt} = \frac{\dee f}{\dee x} \frac{dx}{dt} +
					\frac{\dee f}{\dee y} \frac{dy}{dt}
$$
\end{minipage}
}
\end{center}

\medskip

The differential of $z$ is
$$ dz = \frac{\dee f}{\dee x} \, dx + \frac{\dee z}{\dee y} \, dy $$

\medskip
If $x=x(t)$ and $y=y(t)$ then
$$ dx = \frac{dx}{dt} \, dt, \quad dy = \frac{dy}{dt} \, dt $$
Hence
$$ \frac{dz}{dt} = \frac{\dee f}{\dee x} \, \frac{dx}{dt} + \frac{\dee z}{\dee y} \, \frac{dy}{dt}
$$
\end{frame}

\section{$f(x(s,t),y(s,t))$}

\begin{frame}
\frametitle{Case 2: $f(x(s,t),y(s,t))$}
\footnotesize
\begin{center}
\fcolorbox{cyan}{white}
{
\begin{minipage}{0.8\textwidth}
{\color{cyan} \textbf{The Chain Rule, 2  Variables (Case 2)}}
If $$z=f(x,y), x=g(s,t), y=h(s,t),$$ 
then
$$
\frac{\dee z}{\dee s} =
\frac{\dee z}{\dee s} = 
	\frac{\dee f}{\dee x} \frac{\dee x}{\dee s} +
	\frac{\dee f}{\dee y} \frac{\dee y}{\dee s},
\qquad \qquad
\frac{\dee z}{\dee t} = 
	\frac{\dee f}{\dee x} \frac{\dee x}{\dee t} +
	\frac{\dee f}{\dee y} \frac{\dee y}{\dee t},
$$
\end{minipage}
}
\end{center}

\bigskip

\begin{enumerate}
\item  Find $\dee z/\dee s$ and $\dee z/\dee t$ if $z=\tan^{-1}(x^2+y^2)$,
$x=s \ln t$, $y=te^t$.
\item	Find $\dee z/\dee s$ and $\dee z/\dee t$ if $z=\sqrt{x}e^{xy}$, $x=1+st$, $y=s^2-t^2$
\end{enumerate}

\end{frame}

\section{The Chain Rule Tree}

\begin{frame}
\frametitle{The Chain Rule Tree}
\footnotesize
\begin{minipage}{0.4\textwidth}
\begin{forest}
for tree={l sep=30pt, s sep=20pt}
[z
	[x, edge label={node[midway,left] {$\frac{\dee z}{\dee x}$}},
		[s, edge label={node[midway,left] {$\frac{\dee x}{\dee s}$}} ]
		[t, edge label={node[midway,right] {$\frac{\dee x}{\dee t}$}} ]
	]
	[y, edge label={node[midway,right] {$\frac{\dee z}{\dee y}$}},
		[s, edge label={node[midway,left] {$\frac{\dee y}{\dee s}$}}]
		[t, edge label={node[midway,right] {$\frac{\dee y}{\dee t}$}}]]
	]
]
\end{forest}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
You can visualize the chain rule by a tree diagram:
If $$z=f(x,y)$$ and
$$x=g(s,t),  \quad y=h(s,t),$$ then:
\begin{itemize}
\item	 You can find $\dee z/\dee s$ by 
adding contributions for all paths from $z$ to $s$
\item	 You can find $\dee z/\dee t$ by adding contributinos 
for all paths from $z$ to $t$
\end{itemize}
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{The Chain Rule Tree}
\footnotesize
Use the following diagram to find formulas for $\dee w/ \dee s$  and $\dee w / \dee t$ if $w$ is a function of $x$, $y$, and $z$, and $x,y,z$ are each functions of $s$ and $t$

\medskip
\begin{center}
\begin{forest}
for tree={l sep=35pt, s sep=15pt}
[w
	[x, edge label={node[midway,left] {$\frac{\dee w}{\dee x}$}},
		[s, edge label={node[midway,left] {$\frac{\dee x}{\dee s}$}} ]
		[t, edge label={node[midway,right] {$\frac{\dee x}{\dee t}$}} ]
	]
	[y, edge label={node[midway,left] {$\frac{\dee w}{\dee y}$}},
		[s, edge label={node[midway,left] {$\frac{\dee y}{\dee s}$}}]
		[t, edge label={node[midway,right] {$\frac{\dee y}{\dee t}$}}]
	]
	[z,
		edge label={node[midway,left] {$\frac{\dee w}{\dee z}$}},
		[s, edge label={node[midway,left] {$\frac{\dee z}{\dee s}$}}]
		[t, edge label={node[midway,right] {$\frac{\dee z}{\dee t}$}}]]
	]
]
\end{forest}
\end{center}
\end{frame}

\begin{frame}
\frametitle{More Fun with the Chain Rule}
\footnotesize
\begin{enumerate}
\item	Find $\dee z/\dee t$ if $w=\ln \sqrt{x^2+y^2+z^2}$, 
$x=\sin t$, $y=\cos t$, and $z=\tan t$

\item	Find $\dee w/\dee r$ if $w=xy+yz+xz$, $x=r\cos\theta$, $y=r\sin\theta$, $z=r\theta$.

\item	Suppose $g(u,v) = f(e^u + \sin v, e^u + \cos v)$. Use the following table to find $g_u(0,0)$ and $g_v(0,0)$.

\smallskip
{
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{|l|l|l|l|l|}
\hline
	&	$f$	&	$g$	&	$f_x$		&	$f_y$		\\
\hline
$(0,0)$	&	$3$	&	$6$	&	$4$	&	$8$	\\
\hline
$(1,2)$	&	$6$	&	$3$	&	$2$	&	$5$	\\
\hline
\end{tabular}
}
\end{enumerate}
\end{frame}

\section{Implicit Differentiation}

\begin{frame}
\frametitle{Implicit Differentiation}
\footnotesize
If $y$ is defined implicitly as a function of $x$ by the equation
$F(x,y)=0$, we can use the differential
$$ dF = \frac{\dee F}{\dee x} \, dx + \frac{\dee F}{\dee y} \, dy $$
to find $dy/dx$. 

\medskip
If $F(x,y)$ is constant, then
$$ dF = 0 = \frac{\dee F}{\dee x} \, dx + \frac{\dee F}{\dee y} \, dy $$
and we can solve for $dy/dx$

\medskip
We can use a similar technique for $z$ defined implicitly as a function of $x,y$ by an equation of the form $G(x,y,z)=0$. 

\bigskip
 
\begin{enumerate}
\item  Find $dy/dx$ if $\cos(xy) = 1 + \sin y$
\item	Find $\dee z/\dee x$ and $\dee z/\dee y$ if $x^2-y^2 + z^2 - 2z = 4$
\item	Find $\dee z/\dee x$ and $\dee z/\dee y$ if $e^z = xyz$
\end{enumerate}
\end{frame}




\begin{frame}
\frametitle{Summary}
\footnotesize
\begin{itemize}
\item We reviewed the chain rule for functions of one variable
\item	We studied several cases of the chain rule for functions
		of several variables, beginning with $z=f(x,y)$, $x=g(t)$, $y=h(t)$
\item	We learned how to use the ``chain rule tree'' to apply the chain rule
\item	We learned how to compute partial derivatives of implicitly defined functions
\end{itemize}
\end{frame}


\end{document}