\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 - Green's Theorem}			%%	title page
\author{Peter A. Perry}
\institute{University of Kentucky}
\date{November 18, 2019}
\maketitle

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

\begin{frame}
\frametitle{Reminders}

\begin{itemize}

\item	Quiz \#9 on 16.1-16.2 (vector fields, line integrals) takes place on Thursday
\item	Homework D1 is due on Friday of this week
\item Thanksgiving is coming!

\end{itemize}

\end{frame}

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

\begin{frame}
\frametitle{Unit IV: Vector Calculus}
\begin{center}
\begin{itemize}
\item[{}]			Fundamental Theorem for Line Integrals
\begingroup
\color{red}
\item[{}]			Green's Theorem
\endgroup
\item[{}]			Curl and Divergence
\item[{}]			Parametric Surfaces and their Areas
\item[{}]			Surface Integrals
\item[{}]			Stokes' Theorem, I
\item[{}]			Stokes' Theorem, II 
\item[{}]			The Divergence Theorem
\item[{}]			
\item[{}]			Review
\item[{}]			Review
\item[{}]			Review
\end{itemize}
\end{center}
\end{frame}


\section{Learning Goals}

\begin{frame}
\frametitle{Goals of the Day}
\begin{itemize}
\item Understand positive and negative orientations of a simple, closed, plane curve
\item	Understand Green's Theorem 
\item	Use Green's Theorem  to compute line integrals and area
		integrals
\item	Understand how Green's Theorem connects with Conservative Vector Fields
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Who Was Green?}
\footnotesize

George Green (1793--1841) was a British mathematical physicist who studied electricity and magnetism. From Wikipedia (where else?):

\bigskip

\begin{quotation}
Green was the first person to create a mathematical theory of electricity and magnetism and his theory formed the foundation for the work of other scientists such as James Clerk Maxwell, William Thomson, and others. His work on potential theory ran parallel to that of Carl Friedrich Gauss.

\medskip

Green's life story is remarkable in that he was almost entirely self-taught. He received only about one year of formal schooling as a child, between the ages of 8 and 9.
\end{quotation}

This last word on Green comes from the \href{http://www-history.mcs.st-andrews.ac.uk/Biographies/Green.html}{Mactutor History of Mathematics' article} about him:

\begin{quotation}
Through Thomson [Lord Kelvin], [James Clerk] Maxwell, and others, the general mathematical theory of potential developed by an obscure, self-taught miller's son would lead to the mathematical theories of electricity underlying twentieth-century industry.
\end{quotation}
\end{frame}

\section{Vocabulary}

\begin{frame}
\frametitle{Closed Curves, Simple Curves, Oriented Curves}
\scriptsize
\begin{tabular}{ll}
\textbf{region}					&	An open subset of the $xy$ plane\\[5pt]
\textbf{closed curve}			&	A curve whose initial and terminal points are the same\\[5pt]
\textbf{simple curve}			&	A curve that doesn't intersect itself\\[5pt]
\textbf{simply connected}	&	A connected region so that every simple closed curve in $D$ \\
\textbf{region}					&	surrounds only points of $D$
\end{tabular}

\bigskip

A simple closed curve $C$ surrounding a region $D$ is \emph{positively oriented} (or has \emph{positive orientation}) if the curve $C$ traverses $D$ \emph{counterclockwise} with the enclosed region to the \emph{left}

\bigskip
\begin{minipage}{0.3\textwidth}
\begin{tikzpicture}[scale=0.8]
\draw[thick,->,>=stealth]	(-0.5,0)	--	(3,0);
\draw[thick,->,>=stealth]	(0,-0.5)	--	(0,3);
\draw[white,fill=orange!50,samples=30]
	plot[domain=0:360,variable=\theta]
		(
			{1.5+ cos(\theta)},
			{1+ 0.5*sin(\theta)}
		);
\draw[orange,thick,->-,samples=40]
	plot[domain=0:180,variable=\theta]
		(
			{1.5+ cos(\theta)},
			{1+ 0.5*sin(\theta)}
		);
\draw[orange,thick,->-,samples=40]
	plot[domain=180:360,variable=\theta]
		(
			{1.5+ cos(\theta)},
			{1+ 0.5*sin(\theta)}
		);
\node at (1.5,1)			{\tiny{$D$}};
\node[right] at (2.5,1)	{\tiny{$C$}};
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.6\textwidth}
\scriptsize
At left, the region $D$ is surrounded by the positively oriented curve $C$. Which of these parameterizations
gives $C$ the correct orientation?

\medskip
\begin{enumerate}
\item	$x(t) = 1 + 1.5 \cos(t), \quad y(t) = 0.5 \sin t$, \\ $0 \leq t \leq 2\pi$
\item	$x(t) = 1 + 1.5 \cos(2\pi -t) $ \\ $y(t) = 0.5 \sin(2\pi - t)$, \\ $ 0 \leq t \leq 2\pi$
\end{enumerate}
\end{minipage}

\end{frame}

\begin{frame}
\frametitle{Orientation Implies Parameterization}
\footnotesize
In what we do this week, it will be important to \emph{parameterize} curves so that you get the 
\emph{orientation} right. Can you give a correct parameterization for each of the following oriented curves?
Which is positively oriented, and which is negatively oriented?

\bigskip

\begin{center}
\begin{minipage}{0.25\textwidth}
\begin{tikzpicture}[scale=0.45]
\draw[thick,->,>=stealth]	(-3,0)	--	(3,0);
\draw[thick,->,>=stealth]	(0,-3)	--	(0,3);
\draw[thick,red,->-]	
	plot[domain=0:180,variable=\theta]
		(
			{2*cos(\theta)},
			{sin(\theta)}
		);
\draw[thick,red,->-]	
	plot[domain=180:360,variable=\theta]
		(
			{2*cos(\theta)},
			{sin(\theta)}
		);
\node[left]	at	(0,1.2)	{\tiny{$1$}};
\node[below]	at	(2.2,0)	{\tiny{$2$}};
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.25\textwidth}
\begin{tikzpicture}[scale=0.45]
\draw[thick,->,>=stealth]	(-3,0)	--	(3,0);
\draw[thick,->,>=stealth]	(0,-3)	--	(0,3);
\draw[thick,red,->-]	
	plot[domain=180:0,variable=\theta]
		(
			{2*cos(\theta)},
			{2*sin(\theta)}
		);
\draw[thick,red,->-]	
	plot[domain=360:180,variable=\theta]
		(
			{2*cos(\theta)},
			{2*sin(\theta)}
		);
%\node[left]	at	(0,2.2)	{\tiny{$1$}};
\node[below]	at	(2.2,0)	{\tiny{$2$}};
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.25\textwidth}
\begin{tikzpicture}[scale=0.45]
\draw[thick,->,>=stealth]	(-3,0)	--	(3,0);
\draw[thick,->,>=stealth]	(0,-3)	--	(0,3);
\draw[thick,red,->-]	(2,-2)		--	++(0,4);
\draw[thick,red,->-]	(2,2)		--	++(-4,0);
\draw[thick,red,->-]	(-2,2)		--	++(0,-4);
\draw[thick,red,->-]	(-2,-2)	--	++(4,0);
%%
\node[below]	at	(2.2,0)		{\tiny{$2$}};
\end{tikzpicture}
\end{minipage}
\end{center}



\end{frame}

\section{Green's Theorem}

\begin{frame}
\frametitle{Green's Theorem}
\footnotesize
\fcolorbox{cyan}{white}
{
	\begin{minipage}{0.85\textwidth}
	{\color{cyan} \textbf{Green's Theorem}} \hspace{5pt} Let $C$ be a positive oriented, piecewise smooth,
	simple closed curve in the plane and let $D$ be the region bounded by $C$. If $P(x,y)$ and $Q(x,y)$ have
	continuous partial derivatives in an open region that contains $D$, then
	$$  \iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA =  \int_C P \, dx + Q \, dy $$
	\end{minipage}
}

\bigskip
Compare this to the Fundamental Theorem of Calculus, Part 2 from Math 113:

\medskip

\begin{minipage}{0.85\textwidth}
If $F$ is continuous on $[a,b]$ and differentiable in $(a,b)$, then
$$ \int_a^b F'(x) \, dx = F(b) - F(a) $$
\end{minipage}

\end{frame}

\begin{frame}
\frametitle{Green's Theorem}
\footnotesize
Compare the formulas:

\medskip

\begin{align*}
\iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA 
	&=  \int_C P \, dx + Q \, dy 
	&& \text{(Green's Theorem)}\\
 \int_a^b F'(x) \, dx 
 	&= F(b) - F(a) 	
 	&&	\text{(FTC, Part II)}
\end{align*}

\bigskip

\begin{itemize}
\item		In Green's theorem, $C$ bounds the region $D$, sometimes written $C = \partial D$
\item		In FTC, the endpoints $a$ and $b$ bound the interval $[a,b]$

\bigskip

\item		In Green's theorem, the integral of a  `derivative' of the vector field $\bfF(x,y)  = P(x,y) \ii + Q(x,y) \jj$ 
			equals the line integral of the vector field $\bfF$ over the boundary

\item		In FTC, the integral of the derivative of $F$ equals a difference of values of $F$ over the boundary
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Green's Theorem}
\footnotesize
The integral around a \emph{closed} curve 
$C$ of $P(x,y) \, dx + Q(x,y) \, dy$  is sometimes denoted 
$$\oint_C P(x,y) \, dx + Q(x,y) \, dy$$

\vfill

With this notation, the main formula in Green's theorem says
$$
\iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA 
	=  \oint_C P \, dx + Q \, dy 
$$
where $C$ is a positively oriented curve that bounds $D$
\end{frame}

\begin{frame}
\frametitle{Green's Theorem in a Special Case}
\adjustbox{valign=t}
{
\begin{minipage}[t]{0.35\textwidth}
\begin{tikzpicture}[scale=0.6]
\draw[thick,->,>=stealth]	(-0.5,0)	--	(4,0)	
	node[anchor=west] 	{\footnotesize{$x$}};
\draw[thick,->,>=stealth]  (0,-0.5)	--	(0,4)	
	node[anchor=south] 	{\footnotesize{$y$}};
%% region
\draw[white,,fill=red!20,opacity=0.5]		
		(1,1) rectangle (3,3);
%% border
\draw[red,thick,->-]			(1,1)	--	(3,1);
\draw[red,thick,->-]			(3,1)	--	(3,3);
\draw[red,thick,->-]			(3,3)	--	(1,3);
\draw[red,thick,->-]			(1,3) 	--	(1,1);		
%% labels
\node[below]	at	(1,0)	{\scriptsize{$a$}};
\node[below]	at	(3,0)	{\scriptsize{$b$}};
\node[left]		at	(0,1)	{\scriptsize{$c$}};
\node[left]		at	(0,3)	{\scriptsize{$d$}};
\end{tikzpicture}
\end{minipage}
}
\quad
\adjustbox{valign=t}
{
\begin{minipage}[t]{0.55\textwidth}
\scriptsize

\bigskip

Suppose $D$ is the rectangle $[a,b] \times [c,d]$.

\medskip

The contour $C$ consists of the four line segments shown.

\end{minipage}
}
\scriptsize

\medskip

\begin{align*}
\iint_D &  \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y}\right) \, dA\\	
\uncover<2->
{
	&=	\int_c^d \left( \int_a^b \frac{\dee Q}{\dee x} \, dx \right) \, dy - 	
			\int_a^b \left( \int_c^d \frac{\dee P}{\dee y} \, dy \right) \, dx\\[5pt]
}
\uncover<3->
{
	&=	\int_c^d \left( Q(b,y) - Q(a,y) \right) \, dy 
				- \int_a^b \left(P(x,d) - P(x,c) \right) \, dx\\[5pt]
}
\uncover<4->
{
	&=	\int_a^b P(x,c) \, dx + \int_c^d Q(b,y) \, dy 		
			- \int_a^b P(x,d) \, dx - \int_c^d Q(a,y) \, dy
}
\end{align*}

\end{frame}


\begin{frame}
\frametitle{Using Green's Theorem}	
\footnotesize

$$
\iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA 
	=  \oint_C P \, dx + Q \, dy 
$$
where $C$ is a positively oriented curve that bounds $D$

\vfill


\begin{minipage}{0.35\textwidth}
\begin{tikzpicture}[scale=0.4]
\draw[thick,->,>=stealth]	(-0.5,0)	--	(6,0);
\draw[thick,->,>=stealth]	(0,-0.5)	--	(0,5.5);
\draw[help lines]	(0,0)	grid	(5,5);
%%
\draw[thick,red,->-,>=stealth]
	(0,0)	--	(5,0);
\draw[thick,red,->-,>=stealth]
	(5,0)	--	(5,4);
\draw[thick,red,->-,>=stealth]
	(5,4)	--	(0,4);
\draw[thick,red,->-,>=stealth]
	(0,4)	--	(0,0);	
%%
\node[below] at	(5,0)	{\tiny{$5$}};
\node[left]		at	(0,4)	{\tiny{$4$}};
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.55\textwidth}
Evaluate directly and then use Green's theorem to find
$$ \oint_C y^2 \, dx + x^2 y \, dy$$
if $C$ is the path shown at left
\end{minipage}

\end{frame}



\section{Using Green's Theorem}

\begin{frame}
\frametitle{Using Green's Theorem}
\footnotesize
$$
\iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA 
	=  \oint_C P \, dx + Q \, dy 
$$
where $C$ is a positively oriented curve that bounds $D$

\vfill

\begin{minipage}{0.40\textwidth}
\begin{tikzpicture}
\draw[thick,->,>=stealth]	(-2,0)	--	(2,0);
\draw[thick,->,>=stealth]	(0,-1.6)	--	(0,1.6);
\draw[help lines, step=0.2]	(-2,-1.6)	 grid (2,1.6);
\draw[red,thick,->-]	
	plot[domain=0:180,variable=\theta]
		({1.414)*cos(\theta)},
		 {sin(\theta)}
		);
\draw[red,thick,->-]	
	plot[domain=180:360,variable=\theta]
		({1.414)*cos(\theta)},
		 {sin(\theta)}
		);
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
\footnotesize
Use Green's theorem to find 
$$ \oint_C y^4 \, dx + 2xy^3 \, dy $$
if $C$ is the ellipse $x^2 + 2y^2 = 2 $
\end{minipage}
\end{frame}

\begin{frame}
\frametitle{Using Green's Theorem}
\footnotesize

$$
\iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA 
	=  \oint_C P \, dx + Q \, dy 
$$
where $C$ is a positively oriented curve that bounds $D$

\vfill


\medskip
Recall that if $D$ has area $A$,
\begin{align*}
\overline{x}	= \frac{1}{A} \int_D x \, dA	\\
\overline{y}	=	\frac{1}{A} \int_D y \, dA
\end{align*}

\medskip

Using Green's theorem, show that
\begin{align*}
\overline{x}	&=	\hphantom{-} \frac{1}{2A} \oint_C x^2 \, dy \\
\overline{y}	&=	- \frac{1}{2A} \oint_C y^2 \, dx
\end{align*}
\end{frame}

\begin{frame}
\frametitle{Using Green's Theorem}
\footnotesize

\begin{minipage}{0.4\textwidth}
\begin{tikzpicture}
\draw[thick,->,>=stealth]	(-0.5,0)	--	(3,0);
\draw[thick,->,>=stealth]	(0,-0.5)	--	(0,3);
\draw[help lines,step=0.5]	(0,0)	grid	(2.5,2.5);
\draw[red,thick]	(0,0)	--	(1.5,0)	--	(1.5,2.5)	--	(0,0);
\node[below]	at	(1.5,0)	{\tiny{$a$}};
\node[left]		at	(0,2.5)	{\tiny{$b$}};
\end{tikzpicture}
\end{minipage}
\quad
\begin{minipage}{0.5\textwidth}
Using the formulas 
\begin{align*}
\overline{x}	&=	\hphantom{-} \frac{1}{2A} \oint_C x^2 \, dy \\
\overline{y}	&=	- \frac{1}{2A} \oint_C y^2 \, dx
\end{align*}
find the centroid of the triangle shown at left.
\end{minipage}
\end{frame}

\section{Conservative Fields}


\begin{frame}
\frametitle{Green's Theorem and Conservative Vector Fields}
\footnotesize
We can now prove a Theorem from a previous lecture about conservative vector fields.

\bigskip

{\color{cyan} \textbf{Theorem}} \hspace{5pt}	Let $\bfF = P \ii + Q\jj $ be a vector field on an open, simply connected region $D$. Suppose that $P$ and $Q$ have continuous first-order partial derivatives and
$$ \frac{\dee P}{\dee y} = \frac{\dee Q}{\dee x} \text{  throughout $D$}. $$
Then $\bfF$ is conservative. 

\bigskip

\emph{Proof}. If $C$ is any closed path, and $D$ is the domain it encloses,
$$
\oint_C  \bfF \cdot \,  d \bfr 	=	\oint_C P \, dx + Q \, dy 
										=	\iint_D \left( \frac{\dee Q}{\dee x} - \frac{\dee P}{\dee y} \right) \, dA
										=	0.
$$
so the integral around \emph{any} closed path in $D$ is zero. This means we can pick a point $(a,b)$ in $D$ and define
$$ f(x,y) = \int_{(a,b)}^{(x,y)} P \, dx + Q \, dy. $$
The function $f(x,y)$ satisfies $\nabla f (x, y) = P(x,y) \ii + Q(x,y) \jj. $

\end{frame}

\end{document}