%\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 33 ]{\large{ Lecture 33} 
\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}

{\textcolor{red}{Average value of a function over a range:}}\\
The average of $n$ numbers is:
$$\frac{1}{n} \sum_{i=1}^{n}x_{i}$$
\begin{center}
			\includegraphics[scale=0.33]{Figures/lec8001.pdf}
		\end{center}
\end{frame}
\begin{frame}
We divide $[a,b]$ into $n$ subintervals of equal width $\Delta x=(b-a)/n$.\\
The average of the $n$ sampled values is: $$\frac{f(c_{1})+f(c_{2})+\cdots +f(c_{n})}{n}=\frac{1}{n}\sum_{k=1}^{n} f(c_{k})$$ $$=\frac{\Delta x}{b-a}\sum_{k=1}^{n}f(c_{k})=\frac{1}{b-a}\sum_{k=1}^{n} f(c_{k})\Delta x$$
The average is obtained by dividing a Riemann sum for $f$ on $[a,b]$ by $(b-a)$, so $n\to \infty$ or $\Delta x\to 0$, we get: $$av(f)=\frac{1}{b-a}\int_{a}^{b} f(x) dx$$
\end{frame}
\begin{frame}


\begin{example}
Find the average value of $f(x)=\sqrt{4-x^{2}}$ on $[-2,2]$
\end{example}
\begin{center}
			\includegraphics[scale=0.33]{Figures/lec8002.pdf}
		\end{center}
		\end{frame}
\begin{frame}
The average of the function is: $$av(f)=\frac{1}{b-a}\int_{a}^{b} f(x) dx=\frac{Area}{b-a}$$
The area between the semicircle and the $x-$axis from $-2$ to $2$ can be computed using the geometry formula:
$$Area=\frac{1}{2}\cdot \pi r^{2}=\frac{1}{2}\cdot \pi (2)^{2}=2\pi$$
So the average value of $f$ is $$av(f)=\frac{1}{4}(2\pi)=\frac{\pi}{2}$$		
\end{frame}
\begin{frame}
It is sometimes convenient to use an alternative kind of average for the values of a function, $f(x)$, between $x=a$ and $x=b$. \\
The Root Mean Square Value provides a measure of central tendency for the numerical values of $f(x)$ and is defined to be the square root of the Mean Value of $f^{2}(x)$ from $x=a$ to $x=b$. Hence:
$$R.M.S=\sqrt{\frac{1}{b-a} \int_{a}^{b} [f(x)]^{2} dx}$$
\end{frame}
\begin{frame}
\begin{example}
An electric current $i(\theta)$ is given by $i(\theta)=I\sin (\theta)$ where $I$ is a constant. Find R.M.S of $i(\theta)$ over $0\leq \theta \leq 2\pi$
\end{example}
$$R.M.S=\sqrt{\frac{1}{b-a} \int_{a}^{b} [f(x)]^{2} dx}$$ So 
$$R.M.S=\sqrt{\frac{1}{2\pi -0} \int_{0}^{2\pi } [I\sin \theta]^{2} d\theta}$$ Then:
$$[R.M.S]^{2}=\frac{1}{2\pi-0} \int_{0}^{2\pi} [I\sin \theta]^{2} d\theta=\frac{I^{2}}{2\pi} \int_{0}^{2\pi} \sin^{2} \theta d\theta$$
\end{frame}
\begin{frame}
Recall $\sin^{2} \theta=\frac{1}{2} (1-\cos 2\theta)$, so $$[R.M.S]^{2}=\frac{I^{2}}{2\pi} \int_{0}^{2\pi} \frac{1}{2} (1-\cos 2\theta)  d\theta$$ So: $$[R.M.S]^{2}=\frac{I^{2}}{2\pi}  \frac{1}{2} (\theta-\frac{1}{2}\sin 2\theta)\Big ]_{0}^{2\pi}$$ Therefore $$[R.M.S]^{2}=\frac{I^{2}}{4\pi}\Big [(2\pi-\frac{1}{2}\sin (4\pi))-(0-\frac{1}{2}\sin (0))\Big ]$$ Then:$$[R.M.S]^{2}=\frac{I^{2}}{4\pi}(2\pi)=\frac{I^{2}}{2}\Rightarrow R.M.S=\frac{I}{\sqrt{2}}$$
\end{frame}
\begin{frame}
\begin{example}
Find the centroid of the area under the curve $y=2x$ between the lines $x=0$ and $x=1$
\end{example}
\end{frame}
\end{document}