%\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[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{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]



\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 20 ]{\large{ Lecture 20} 
\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 \frac{dx}{x(x^{2}+1)^{2}}$$
\end{example}
The form of the partial fraction decomposition is $$\frac{1}{x(x^{2}+1)^{2}}=\frac{A}{x}+\frac{Bx+C}{x^{2}+1}+\frac{Dx+E}{(x^{2}+1)^{2}}$$
Add up the fractions:  $$\frac{1}{x(x^{2}+1)^{2}}=\frac{A}{x}+\frac{Bx+C}{x^{2}+1}+\frac{Dx+E}{(x^{2}+1)^{2}}$$ $$=\frac{A(x^{2}+1)^{2}+(Bx+C)x(x^{2}+1)+(Dx+E)x}{x(x^{2}+1)^{2}}$$
\end{frame}
\begin{frame}
So: $$1=A(x^{2}+1)^{2}+(Bx+C)x(x^{2}+1)+(Dx+E)x $$ $$\Rightarrow 1=A(x^{4}+2x^{2}+1)+B(x^{4}+x^{2})+C(x^{3}+x)+Dx^{2}+Ex $$ $$\Rightarrow 1=(A+B)x^{4}+Cx^{3}+(2A+B+D)x^{2}+(C+E)x+A$$ 
If we equate coefficients, we get the system
$$\left\{
  \begin{array}{rcr}
    A+B & = & 0 \\
    C & = & 0 \\
    2A+B+D & = & 0\\
    C+E & = & 0\\
    A & = & 1
  \end{array}
\right.$$ 

\end{frame}
\begin{frame}
Solving this system gives: $A=1, B=-1, C=0, D=-1, E=0$\\
Thus  $$\int \frac{dx}{x(x^{2}+1)^{2}}=\int \Big ( \frac{A}{x}+\frac{Bx+C}{x^{2}+1}+\frac{Dx+E}{(x^{2}+1)^{2}} \Big ) dx$$ $$=\int \Big ( \frac{1}{x}+\frac{-x+0}{x^{2}+1}+\frac{-x+0}{(x^{2}+1)^{2}} \Big ) dx$$ $$=\int \Big ( \frac{1}{x}+\frac{-x}{x^{2}+1}+\frac{-x}{(x^{2}+1)^{2}} \Big ) dx$$ $$=\underbrace{\int \frac{1}{x} dx }_{I_{1}}+ \underbrace{\int  \frac{-x}{x^{2}+1} dx }_{I_{2}}+\underbrace{ \int \frac{-x}{(x^{2}+1)^{2}} dx}_{I_{3}}$$
\end{frame}
\begin{frame}
$$I_{1}=\int \frac{1}{x} dx$$ Therefore $$I_{1}=\ln (x)+c_{1} $$
Also $$I_{2}=\int  \frac{-x}{x^{2}+1} dx $$
Let $u=x^{2}+1$ then $du=2x dx$, so $-\frac{du}{2}=-x dx$ $$\int  \frac{-x}{x^{2}+1} dx=\int \frac{-du}{2u}=\frac{-1}{2} \int \frac{du}{u}=\frac{-1}{2} \ln u+c_{2}=\frac{-1}{2}\ln (x^{2}+1)+c_{2}$$
\end{frame}
\begin{frame}
$$I_{3}=\int \frac{-x}{(x^{2}+1)^{2}} dx$$
Let $u=x^{2}+1$, then $du=2x dx$, so $\frac{-du}{2}=-x dx$, Therefore: 
$$I_{3}=\int \frac{-x}{(x^{2}+1)^{2}} dx=\int \frac{-du}{2(u)^{2}}=\frac{-1}{2}\int \frac{du}{u^{2}}=\frac{-1}{2}\int u^{-2} du$$ $$= \frac{-1}{2} \Big ( \frac{u^{-2+1}}{-2+1}\Big ) +c_{3}=\frac{-1}{2} \Big ( \frac{(x^{2}+1)^{-2+1}}{-2+1}\Big ) +c_{3}=\frac{-1}{2} \Big ( \frac{(x^{2}+1)^{-1}}{-1}\Big ) +c_{3} $$
\end{frame}
\begin{frame}{Definite Integral as area under the graph}
\begin{center}
			\includegraphics[scale=0.33]{Figures/lec501.pdf}
		\end{center}
\end{frame}
\begin{frame}
We choose $n-1$ points $\{ x_{1}, x_{2}, \cdots, x_{n-1} \}$ between $a$ and $b$ and satisfying $$a < x_{1} < x_{2} < \cdots < x_{n-1} < b$$
To make the notation consistent, we denote $a$ by $x_{0}$ and $b$ by $x_{n}$, so that : 
$$a=x_{0} < x_{1} < x_{2} < \cdots < x_{n-1} < x_{n}=b$$
The set $$P=\{x_{0}, x_{1}, x_{2}, \cdots, x_{n-1},x_{n} \}$$ is called a partition of $[a,b]$
\begin{center}
\includegraphics[scale=0.4,trim={0 0 0 6cm},clip]{Figures/lec500.pdf}
		\end{center}
\end{frame}
\begin{frame}
In each subinterval we select some point $c_{k}$. Then on each subinterval we stand a vertical rectangle that stretches
from the x-axis to touch the curve at $(c_{k},f(c_{k}))$:
\begin{center}
			\includegraphics[scale=0.36]{Figures/lec502.pdf}
		\end{center}
\end{frame}
\begin{frame}
We can also let all the the subintervals to have equal widths, $\Delta x_{k}=\frac{b-a}{n}$ Then the area of each rectangle is $$\Delta x_{k} \cdot f(c_{k})=\frac{b-a}{n} \cdot f(c_{k})$$
\begin{center}
			\includegraphics[scale=0.3]{Figures/lec503.pdf}
		\end{center}
\end{frame}
\begin{frame}
Finally we sum all these products to get $$S_{P}=\sum_{k=1}^{n} \frac{b-a}{n} \cdot f(c_{k}) = 
\frac{b-a}{n} \sum_{k=1}^{n} f(c_{k})
$$ 
$S_{P}$ is called a Riemann sum for $f$ on the interval $[a, b]$.
\end{frame}
\begin{frame}
We can also make the width of the subintervals smaller.
\begin{center}
			\includegraphics[scale=0.3]{Figures/lec504.pdf}
		\end{center}
\end{frame}
\begin{frame}
If we make $n$ larger (or make $\frac{1}{n}$ smaller), then $$\lim_{n \to \infty} \sum_{k=1}^{n} \frac{b-a}{n} \cdot f(c_{k})$$ will give us an accurate answer.\\
We say that the definite integral of $f$ from $a$ to $b$ is: $$\int_{a}^{b} f(x) dx=\lim_{n \to \infty} \sum_{k=1}^{n}\left( \frac{b-a}{n}\right)\cdot f(c_{k})$$   
\end{frame}
\begin{frame}
\begin{center}
			\includegraphics[scale=0.4]{Figures/lec505.pdf}
		\end{center}
\end{frame}
\begin{frame}
\begin{theorem}
 {\textcolor{red}{The Fundamental Theorem of Calculus (1):}}\\
 Suppose that $f$ is a continuous function on $[a,b]$, and $F$ is an anti-derivative of $f$. Then: $$\int_{a}^{b} f(x) dx=F(x)\Big |_{a}^{b}=F(b)-F(a)$$
\end{theorem}
\end{frame}
\begin{frame}
\begin{example}
Evaluate $$\int_{0}^{1} x^{3} dx$$
\end{example}
An anti-derivative can be obtained by evaluating the following integral:$$\int x^{3} dx = x^{4}/4$$ So $F(x)=x^{4}/4$, therefore: $$\int_{0}^{1} x^{3} dx=\Big[x^{4}/4 \Big]_{0}^{1}=(1^{4}/4) - (0^{4}/4)=1/4 $$
\end{frame}
\begin{frame}
\begin{theorem}
\begin{itemize}
\item Order of integration: $$\int_{a}^{b} f(x) dx=-\int_{b}^{a} f(x) dx$$
\item Zero width interval $$\int_{a}^{a} f(x) dx=0$$
\item if $a<c<b$, then $$\int_{a}^{b} f(x) dx=\int_{a}^{c} f(x) dx+\int_{c}^{b} f(x) dx$$
\end{itemize}
\end{theorem}
\end{frame}
\begin{frame}
\begin{example}
Suppose that $\int_{-1}^{1} f(x) dx=5$ , $\int_{1}^{4} f(x) dx=-2$ and $\int_{-1}^{1} h(x) dx=7$. Then find
\begin{itemize}
\item  $$\int_{4}^{1} f(x) dx$$
\item  $$\int_{-1}^{1} [2f(x)+3h(x)] dx$$ 
\item $$\int_{-1}^{4} f(x) dx$$ 


 \end{itemize}
\end{example}
\end{frame}
\begin{frame}
\begin{theorem}
 {\textcolor{red}{The Fundamental Theorem of Calculus (2):}}\\
 Suppose that $f$ is a continuous function on $[a,b]$, $$\frac{d}{dx} \int_{a}^{x} f(t) dt=f(x)$$
\end{theorem}
\begin{example}
Find $$\frac{d}{dx} \int_{0}^{x} \sqrt{1+2t} dt$$
\end{example}
Recall that $$\frac{d}{dx} \int_{a}^{x} f(t) dt=f(x)$$ so: $$\frac{d}{dx} \int_{0}^{x} \sqrt{1+2t} dt=\sqrt{1+2x}$$
\end{frame}
\begin{frame}
\begin{example}
Find $\frac{dy}{dx}$, if $$y=\int_{a}^{x} \cos (t) dt$$
\end{example}
By The fundamental theorem of calculus, we know that: $$\frac{d}{dx} \int_{a}^{x} f(t) dt=f(x)$$ So: $$\frac{d}{dx} \int_{a}^{x} \cos (t) dt=\cos (x)$$
\end{frame}






\end{document}