%\documentclass[c]{beamer}

%\usecolortheme{whale}


\documentclass[xcolor=dvipsnames,envcountsect]{beamer} 
%\documentclass{beamer}
\beamertemplatenavigationsymbolsempty 
\usecolortheme[named=Blue]{structure} %change
%\usecolortheme{seahorse}
%\usecolortheme{rose}
 %default blue to brown
%\usetheme{Warsaw}
%\usetheme{CambridgeUS}
\useoutertheme{infolines}
%\usecolortheme{dolphin}
%\usefonttheme{serif}
\usetheme{Madrid}

%\addtocounter{framenumber}{-5} 
%\setbeamertemplate{footline}[default] 
\usefonttheme{professionalfonts} % using non standard fonts for beamer
%\usefonttheme{serif} % default family is serif


\usepackage{multicol}
%\usepackage[compatibility=false]{caption}
%\usepackage{subfig}
\usepackage{algcompatible}
\usepackage[section]{algorithm}
\usepackage{algorithmicx}
%\usepackage{algorithmic}
\usepackage{algpseudocode}

%\usepackage[caption=false]{subfig}
\usepackage{amsmath}
\DeclareMathOperator{\sech}{sech}
\DeclareMathOperator{\csch}{csch}

%\usetheme{Frankfurt}
%\usetheme{AnnArbor}
% % % % % % % % % % %
%\usepackage{fancyhdr}
%\usepackage{graphicx}
%\usepackage{caption}
%\usepackage{tikz,siunitx}
%
%\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri}
%
%\usetikzlibrary{automata,arrows}
%\usepackage{subcaption}
%\usepackage{enumitem}
%\setlist{nolistsep}
%\usepackage{float}
% % % % % % % % % % %


\usepackage{extarrows}
\usepackage{verbatim}
\usepackage{bm}
\usepackage[all,cmtip]{xy}
\usepackage[framemethod=default]{mdframed}
\def\Ker{\textrm {Ker\,}}
\def\Im{\textrm{Im\,}}
\def\Z{\mathbb{Z}}
\def\N{\mathcal{N}}
\def\Z{\mathbb{Z}}
\def\F{\mathbb{F}}
\def\Aut{\mathrm{Aut}}
\def\rightiso{\xrightarrow{\simeq}}
\def\B{B}
\def\H{H}
\def\A{\mathcal{A}}
\def\Bb{\overline{B}}
\def\Rb{\overline{R}}
%\def\p{} 
\def\p{\pause}
\def\cl{\color{blue}}
\def\clg{\color{red}}
%\usefonttheme{structuresmallcapsserif}
\def\cl{\color{blue}}
\def\clg{\color{red}}



\setbeamertemplate{theorems}[numbered]



\newtheorem{proposition}{Proposition}[section]
\newtheorem*{conjecture}{Conjecture}
%\theoremstyle{definition} \newtheorem{algorithm}{Algorithm}[section]
\theoremstyle{definition} \newtheorem{remark}{Remark}[section]


\renewcommand{\algorithmicrequire}{\textbf{Input:}}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\renewcommand{\algorithmicprocedure}{\textbf{Procedure:}}
\renewcommand{\Procedure}{\textbf{Function:}}
\renewcommand{\EndProcedure}{\textbf{EndFunction:}}

\usepackage{ifthen}

% This is the file main.tex


\newcommand\uleft[2]{\,{}^{#1}\hspace*{-.1em}{#2}}
\def\idgroup{\mathbf{1}}
\newcommand\rdef[1]{\textit{\textcolor{blue}{#1}}}
\newcommand\mdef[1]{\textcolor{Brown}{#1}}

\newcommand\link[2]{\hyperlink{#2}{\beamergotobutton{#1}}}

\def\GAP{{\sf GAP} }
\def\HAP{{\sf HAP} }
\def\XMod{{\sf XMod}}
\def\C{\mathcal{C}}
\def\ZG{\mathbb{Z}G}
\input{rbg}
\def\minusvspace{\vspace*{-18pt}}
\def\xyscale{\xymatrixrowsep{0.25in} \xymatrixcolsep{0.25in}}

\def\xysmall{\xymatrixrowsep{0.15in} \xymatrixcolsep{0.15in}} 
\def\Ne{\mathcal{N}}
\def\CW{\textrm{CW}}
\parskip 0.1in

\input{def}

\def\xd{\vspace*{10pt}}
\def\ixd{\vspace*{3pt}}



 




\title[]{MA140-Engineering Calculus}
\author[ Lecture 21]{\large{ Lecture 21} 
\and %\\ \small{Supervisor: Dr. John Burns}
\\ 
 \includegraphics[scale=0.0]{Figures/lec14.jpg}}
%\date[June 2-4, 2016]{June 2-4, 2016}
%\institute[Uppsala University]{ }


\begin{document}
\begin{frame}
\titlepage
\end{frame}


\section{MA140}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{frame}
\begin{example}
Find $\frac{dy}{dx}$, if $$y=\int_{1}^{x^{2}} \cos (t) dt$$
\end{example}
The upper limit of integration is not $x$ but $x^{2}$. This makes $y$ a composite of the two functions, $$y=\int_{1}^{u} \cos(t) dt \quad and \quad u=x^{2}$$
We must therefore apply the chain rule when finding $\frac{dy}{dx}$.
$$\frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}=\Big ( \frac{d}{du}\int_{1}^{u} \cos (t) dt \Big )\cdot \frac{du}{dx}$$ $$=\cos (u)\cdot \frac{du}{dx}=\cos (x^{2})\cdot 2x=2x\cdot \cos(x^{2})$$
\end{frame}
\begin{frame}
\begin{example}
Find $\frac{dy}{dx}$, if $$y=\int_{3}^{\sqrt{x}} \frac{\cos (t)}{t} dt$$
\end{example}
By the chain rule: $$\frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}=\Big ( \frac{d}{du}\int_{3}^{u} \frac{\cos (t)}{t} dt \Big )\cdot \frac{du}{dx}$$ $$=\frac{\cos (u)}{u}\cdot \frac{du}{dx}=\frac{\cos (\sqrt{x})}{\sqrt{x}}\cdot \frac{1}{2\sqrt{x}}$$
\end{frame}
\begin{frame}
Integration by parts is a technique for simplifying integrals of the form:
$$\int f(x)\cdot g(x) dx$$
It is useful when $f$ can be differentiated repeatedly and $g$ can be integrated repeatedly
without difficulty. The integral $$\int xe^{x} dx$$
is such an integral because $f(x)=x$ can be differentiated twice to become zero and $g(x)=e^{x} $ can be integrated repeatedly without difficulty.  
\end{frame}
\begin{frame}
\begin{theorem}
{\textcolor{red}{Integration by Parts Formula:}}
$$\int u dv=uv-\int v du$$
\end{theorem}
\begin{example}
Find $$\int x\cos (x) dx$$
\end{example}
We use the formula $\int u dv=uv-\int v du$ with $$u=x, \quad dv=\cos(x)dx, $$
$$du=dx, \quad v=\sin(x)$$
Then $$\int x\cos(x) dx=x\sin(x)-\int \sin(x) dx=x\sin(x)+\cos(x)+c$$
\end{frame}
\begin{frame}
\begin{example}
Find $$\int \ln(x) dx$$
\end{example}
Since $$\int \ln(x) dx$$ can be written as $$\int \ln(x)\cdot 1 dx$$, we use integration by parts: $$u=\ln(x) \quad dv=dx$$
$$du=\frac{1}{x} dx, \quad v=x$$
Then: $$\int \ln(x) dx=x\ln(x)-\int dx=x\ln(x)-x+c$$ 
\end{frame}

\end{document}