\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 - Triple Integrals in Cylindrical Coordinates}			%%	title page
\author{Peter A. Perry}
\institute{University of Kentucky}
\date{October 28, 2019}
\maketitle

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

\begin{frame}
\frametitle{Reminders}

\begin{itemize}
\item Homework C2 on section 15.6 (triple integrals) is due \textbf{tonight}!
\item	Homework C3 on section 15.7 (triple integrals in cylindrical coordinates) is due Wednesday night
\item	Quiz \#7 on sections 15.3 and 15.6 is on Thursday of this week
\item	Homework C4 on section 15.8 (triple integrals in spherical coordinates) is due 
Friday night
\end{itemize}

\end{frame}

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

\begin{frame}
\frametitle{Unit III: Multiple Integrals, Vector Fields}
\begin{itemize}

\item[{}]			Double Integrals in Polar Coordinates
\item[{}]			Triple Integrals (Part I)
\item[{}]			Triple Integrals (Part II)
\begingroup
\color{red}
\item[{}]			Triple Integrals in Cylindrical Coordinates
\endgroup
\item[{}]			Triple Integrals in Spherical Coordinates
\item[{}]			Change of Variables, Part I
\item[{}]			Change of Variables, Part II

\medskip

\item[{}]			Vector Fields
\item[{}]			Line Integrals (Scalar functions)
\item[{}]			Line Integrals (Vector functions)

\medskip

\item[{}]			Exam III Review
\end{itemize}
\end{frame}

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

\section{Learning Goals}

\begin{frame}
\frametitle{Goals of the Day}
\begin{itemize}
\item	Understand how to describe regions in $xyz$ space with cylindrical coordinates
\medskip
\item	Understand how to set up triple integrals as iterated integrals in cylindrical coordinates

\end{itemize}
\end{frame}

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

\begin{frame}
\frametitle{Cylindrical Coordinates}
\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[scale=0.6]
\only<1-2,4>
{
\drawxyz{5}
%%		point
\draw[black,fill=white]	({2.5*sqrt(3)},0,2.5)						circle(0.05cm);
%%		radius
\draw[red]					(0,0,0)	--	({2.5*sqrt(3)},0,2.5);
\node[above]	at			({1.5*sqrt(3)},0,1.5)						{\color{red} \scriptsize{$r$}};
%%		angle
\node at 					(0.4,0,0.75)								{\color{red}\scriptsize{$\theta$}};
\draw[red,->,>=stealth]	
	plot[variable=\theta,domain=3:57]	({1.75*sin(\theta)},0,{1.75*cos(\theta)});
\only<2,4>
{
\draw[black,fill=black]	({2.5*sqrt(3)},4,2.5)	circle (0.05cm);
\node[right]	at			({2.5*sqrt(3)},4,2.5)		{\scriptsize{$P(r,\theta,z)$}};
\draw[red]					({2.5*sqrt(3)},0,2.5)	--	({2.5*sqrt(3)},4,2.5);
\node[right]	at			({2.5*sqrt(3)},2,2.5)		{\color{red} \scriptsize{$z$}};
}
}
\only<3>
{
\draw		(0,0)	--	(4,0)	--	(4,3)	--	(0,0);
\node[below] 	at (2,0)			{\scriptsize{$x$}};
\node[right]  	at (4,1.5)		{\scriptsize{$y$}};
\node[left] 		at	(2,1.7)		{\scriptsize{$r$}};
\node 			at	(1,0.375)	{\scriptsize{$\theta$}};
}
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
\footnotesize
\only<1-2>
{
Polar coordinates $(r,\theta)$ locate points in the $xy$ plane
}

\medskip

\only<2>
{
Add the $z$-coordinate to polar coordinates and you get \emph{cylindrical coordinates}
}

\uncover<3->
{
Recall conversions to and from polar coordinates:

$$ r = \sqrt{x^2+y^2}, \quad \tan \theta = y/x $$
$$ x= r\cos \theta, \quad y = r \sin \theta$$
}

\medskip

\uncover<4->
{

\begin{enumerate}
\item	Find the cylindrical coordinates of the point $(-1,1,1)$
\item	Find the cyindrical coordinates of the point $(-2, 2\sqrt{3},3)$
\item	Find the rectangular coordinates of the point $(4, \pi/3, -2)$
\end{enumerate}

}

\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Equations and Regions in Cylindrical Coordinates}
\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[scale=0.6]
\only<2>
{
\drawxy{3}
\draw[red,densely dashed]
	plot[variable=\theta,domain=0:360,samples=40,smooth]
		({2*sin(\theta)*sin(\theta)},{2*sin(\theta)*cos(\theta)});
}
\only<4>
{
\begin{axis}[colormap/cool,axis equal=true]
%% actually x is the angle, y is the z-coordinate
\addplot3[surf,z buffer=sort,domain=0:360,y domain=-2:2,samples=40]
	({2*sin(x)*sin(x)},{2*sin(x)*cos(x)},{y});;
\end{axis}
}
\only<5>
{
\begin{axis}[colormap/cool]
%% actually x is the angle, y is the z-coordinate
\addplot3[surf,domain=0:360,y domain=-8:8]
	({sqrt(2+y^2/2)*cos(x)},{sqrt(2+y^2/2)*sin(x)},{y} );
\end{axis}
}
\only<7>
{
\begin{axis}
%% plot cone surface. x=angle, y=radius
\addplot3[surf,domain=0:90,y domain=0:2,color=orange!80]
	({y*cos(x)},{y*sin(x)},{y});
%% plot cone top
\addplot3[surf,domain=0:90,y domain=0:2,color=orange!20]
	({y*cos(x)},{y*sin(x)},{2});
\end{axis}
}
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
\footnotesize
\begin{enumerate}
\uncover<1->
{
\item		Identify the polar curve $r=2\sin\theta$
}
\uncover<3->
{
\item		Identify the surface $r=2\sin\theta$ 
}
\uncover<5->
{
\item		Write the equation $$2x^2+2y^2-z^2=4$$ in cylindrical coordinates
}
\uncover<6->
{
\item		Sketch the solid described by the inequalities $0 \leq \theta \leq \pi/2$, $r \leq z \leq 2$
}
\end{enumerate}
\end{minipage}
\end{frame}


\section{Triple Integrals in Cylindrical Coordinates}
\begin{frame}
\frametitle{Triple Integrals in Cylindrical Coordinates}

\footnotesize
In polar coordinates
$$ dA = r \, dr \, d\theta $$
So, in cylindrical coordinates,
$$ dV = {\color{red} r} \, dr \, d\theta \, dz  = {\color{red} r} \, dz \, dr \, d\theta $$

\medskip

If $E$ is the region
$$ E = \{ (x,y,z): (x,y) \in D, \, u_1(x,y) \leq z \leq u_2(x,y) \} $$
then
$$ \iiint_E f(x,y,z) \, dV = \iint_D  \left( \int_{u_1(x,y)}^{u_2(x,y)} f(x,y,z) \, dz \right) \, dA $$

\medskip

If we can describe $D$ in polar coordinates:
$$ D = \{ (r,\theta): \alpha \leq \theta \leq \beta, \, h_1(\theta) \leq r \leq h_2(\theta) \} $$
then we can evaluate 
$$ \iiint_E f(x,y,z) \, dV = \int_\alpha^\beta \int_{h_1(\theta)}^{h_2(\theta)} \int_{u_1(r \cos\theta,r\sin\theta)}^{u_2(r \cos\theta,r\sin\theta)} f(r\cos\theta,r\sin\theta, z) \, {\color{red} r} \, dz\, dr \, d\theta $$
\end{frame}

\begin{frame}
\frametitle{Step by Step}
\footnotesize
$$ \iiint_E f(x,y,z) \, dV = \int_\alpha^\beta \int_{h_1(\theta)}^{h_2(\theta)} \int_{u_1(r \cos\theta,r\sin\theta)}^{u_2(r \cos\theta,r\sin\theta)} f(r\cos\theta,r\sin\theta, z) \, {\color{red} r} \, dz\, dr \, d\theta $$


\bigskip

This formula summarizes a multi-step process. If 
$$ E = \{ (x,y,z): (x,y) \in D, \, u_1(x,y) \leq z \leq u_2(x,y) \} $$
then, to use the formula:
\begin{enumerate}
\item	Substitute $x=r\cos\theta$, $y=r\sin\theta$ into $u_1$ and $u_2$ to find the limits of the inmost integral
\item	Substitute $x=r\cos\theta$, $y=r\sin\theta$ into the formula for $f(x,y,z)$ to rewrite
		$f$ as a function of $r$, $\theta$, and $z$
\item	After making these substitutions, evaluate the triple iterated integral
\end{enumerate}
\end{frame}

\begin{frame}
\frametitle{Triple Integrals in Cylindrical Coordinates}

\footnotesize
$$ \iiint_E f(x,y,z) \, dV = \int_\alpha^\beta \int_{h_1(\theta)}^{h_2(\theta)} \int_{u_1(r \cos\theta,r\sin\theta)}^{u_2(r \cos\theta,r\sin\theta)} f(r\cos\theta,r\sin\theta, z) \, {\color{red} r}  \, dz\, dr \, d\theta $$

\bigskip

\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}[scale=0.6]
\only<1>
{
\begin{axis}[colormap/cool,view={60}{30}]
\addplot3+[no markers,domain=0:360,samples=50,samples y=0,red,dashed]
    ({2*cos(x)},{2*sin(x)}, {0});
\addplot3[surf,z buffer=sort,samples=40,domain=0:2,y domain=0:360]
	({x*cos(y)}, {x*sin(y)},{x*x});
\addplot3[surf,domain=-3:3,opacity=0.5,color=red!50]
	({x},{y},{4});
\end{axis}
}
\only<2>
{
\begin{axis}[colormap/cool,view={60}{30}]
\addplot3[surf,z buffer=sort,domain=0:360,y domain=0:8,samples=30]
	({sin(x)},{cos(x)},{y});
\addplot3[surf,z buffer=sort,domain=0:360,y domain=0:8,opacity=0.5,samples=30]
	({4*sin(x)},{4*cos(x)},{y});
\addplot3[surf,domain=-6:6,opacity=0.25,samples=30]
	({x},{y},{y+4});
\addplot3+[no markers,domain=0:360,samples=50,samples y=0,red,dashed]
    ({4*cos(x)},{4*sin(x)}, {4*sin(x)+4});
\end{axis}
}
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
\footnotesize
\begin{enumerate}
\uncover<1->
{
\item	Find $\iiint_E z \, dV$ where $E$ is enclosed by the paraboloid $$z=x^2+y^2$$ and the plane $z=4$
}

\medskip

\uncover<2->
{
\item	Find $\iiint_E (x-y) \, dV$ if $E$ is the solid which lies between the cylinders 
$$x^2+y^2=1, \quad x^2+y^2=16,$$ 
above the $xy$ plane, and below the plane $z=y+4$.
}
\end{enumerate}
\end{minipage}

\end{frame}



\end{document}
