%\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 22 ]{\large{ Lecture 22} 
\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}
Evaluate $$\int x^{2}e^{x} dx$$
\end{example}
With $$u=x^{2}, \quad dv=e^{x}dx$$
$$du=2xdx, \quad v=e^{x}$$
Using integration by parts,
$$\int u dv=uv-\int v du$$
We get: $$\int x^{2}e^{x} dx=x^{2}e^{x}-2\int xe^{x} dx$$
\end{frame}
\begin{frame}
$$\int xe^{x} dx=?$$
we have to use integration by parts more than once. We integrate by parts again with
$$u=x, \quad dv=e^{x}dx$$
$$du=dx, \quad v=e^{x}$$
So $$\int xe^{x} dx=xe^{x}-\int e^{x} dx=xe^{x}-e^{x}+c$$
Hence: 
$$\int x^{2}e^{x} dx=x^{2}e^{x}-2\int xe^{x} dx=x^{2}e^{x}-2xe^{x}+2e^{x}+c$$


\end{frame}
\begin{frame}
\begin{example}
Evaluate: $$\int e^{x} \cos(x) dx$$
\end{example}
Let $$u=e^{x}, \quad dv=\cos(x) dx$$
Then: $$du=e^{x}dx, \quad v=\sin(x) $$
Using integration by parts,
$$\int u dv=uv-\int v du$$
We get: $$\int e^{x}\cos(x) dx=e^{x}\sin(x)-\int e^{x}\sin(x)dx$$

\end{frame}
\begin{frame}
The second integral is like the first except that it has $\sin x$ in place of $\cos x$. To evaluate it, we use integration by parts with:$$u=e^{x}, \quad dv=\sin (x)dx$$
$$v=-\cos (x), \quad du=e^{x}dx$$
Then: $$\int e^{x}\cos(x) dx=e^{x}\sin(x)-\Big ( -e^{x}\cos (x)-\int (-\cos(x))(e^{x}dx) \Big )$$
$$=e^{x}\sin(x)+e^{x}\cos (x)-\int e^{x}\cos (x)dx$$
\end{frame}
\begin{frame}
The unknown integral now appears on both sides of the equation. Adding the integral to
both sides and adding the constant of integration gives:
$$2\int e^{x}\cos(x) dx=e^{x}\sin(x)+e^{x}\cos (x)+c$$
Dividing by $2$ and renaming the constant of integration gives: 
$$\int e^{x}\cos(x) dx=\frac{e^{x}\sin(x)+e^{x}\cos (x)}{2}+c$$ 
\end{frame}
\begin{frame}

{\textcolor{red}{Infinite Limits of Integration:}}
\begin{example}
Evaluate: $$\int_{0}^{\infty} \frac{1}{e^{\frac{x}{2}}} dx$$
\end{example}
\begin{center}
			\includegraphics[scale=0.28]{Figures/lec607.pdf}
		\end{center}
\end{frame}
\begin{frame}
First find the area $A(b)$ of the portion of the region that is bounded on the right by $x=b$.
$$A(b)=\int_{0}^{b} \frac{1}{e^{\frac{x}{2}}} dx=\int_{0}^{b} e^{-x/2} dx=-2e^{-x/2} \Big ]_{0}^{b}=-2e^{-b/2}+2 $$
Then find the limit of $A(b)$ as $b\to \infty$: 
$$\lim_{b\to \infty} A(b)=\lim_{b\to \infty} (-2e^{-b/2}+2)=2$$
\end{frame}
\begin{frame}

{\textcolor{red}{Inverse Trigonometric Functions:}}
\begin{itemize}
\item $$\int \frac{dx}{\sqrt{1-x^{2}}}=\sin^{-1} (x)+c$$
\item $$\int \frac{dx}{1+x^{2}}=\tan^{-1} (x)+c$$
\item $$\int \frac{dx}{\sqrt{x^{2}-1}}=\sec^{-1} (x)+c$$
\end{itemize}
\end{frame}

\end{document}