%\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 10 ]{\large{ Lecture 10} 
\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}{Exercises}
Prove that 
\begin{itemize}
\item $\frac{d}{dx}(\cos x)=-\sin x$
\item $\frac{d}{dx}(e^{x})=e^{x}$
\end{itemize}
\end{frame}
\begin{frame}{Basic Rules of Differentiation }
\begin{itemize}
\item[(1)] {\textcolor {red} {\textit{Derivative of a Constant Function:}}} If $f$ has the constant value $f(x)=c,$ then: $$\frac{df}{dx}=\frac{d}{dx}(c)=0$$
\item[(2)] {\textcolor {red} {\textit{Power Rule for Positive Integers:}}} If $n$ is a positive integer, then $$\frac{d}{dx}(x^{n})=nx^{n-1}$$
\item[(3)] {\textcolor {red} {\textit{Constant Multiple Rule:}}} If $u$ is a differentiable function of $x$, and $c$ is a constant, then $$\frac{d}{dx}(cu)=c\frac{du}{dx}$$ 
\end{itemize}

\end{frame}
\begin{frame}
\begin{itemize}
\item[(4)] {\textcolor {red} {\textit{Derivative Sum Rule:}}} If $u$ and $v$ are differentiable functions of $x$, then their sum $u+v$ is differentiable at every point where $u$ and $v$ are both differentiable. At such points,$$\frac{d}{dx}(u+v)=\frac{du}{dx}+\frac{dv}{dx}$$ 
\item[(5)] {\textcolor {red} {\textit{Derivative Product Rule:}}} If $u$ and $v$ are differentiable at $x$, then so is their product $uv$, and $$\frac{d}{dx}(uv)=u\frac{dv}{dx}+v\frac{du}{dx}$$
\item[(6)] {\textcolor {red} {\textit{Derivative Quotient Rule:}}} If $u$ and $v$ are differentiable at $x$ and if $v(x)\neq 0$, then the quotient $u/v$ is differentiable at $x$, and $$\frac{d}{dx}(\frac{u}{v})=\frac{v\frac{du}{dx}-u\frac{dv}{dx}}{v^{2}}$$      
\end{itemize}
\end{frame}
\begin{frame}
\begin{example}
Suppose that $f(x)=-5x^{3}+3x^{2}-9x+7$, then find:
\begin{itemize}
\item[(a)] The derivative of $f(x)$
\item[(b)] The slope of the tangent line at $x=2$
\item[(c)] The equation of the tangent at $x=2$
\end{itemize}
\end{example}
{\textcolor {red} {Note:}} The equation of a line with slope $m$ and a point $(x_{1},y_{1})$ on the line is: $$y-y_{1}=m(x-x_{1})$$
(a): $$f'(x)=-15x^{2}+6x-9$$
(b): The slope of the tangent line at $x=2$ is $f'(2)$ $$f'(2)=-15(2)^{2}+6(2)-9=-15(4)+12-9=-60+12-9=-57$$

\end{frame}
\begin{frame}
(c): The $y$ coordinate at $x=2$ is $$f(2)=-5(2)^{3}+3(2)^{2}-9(2)+7=-5(8)+3(4)-18+7$$ $$\hspace{-3.2cm} =-40+12-18+7=-39$$
So $(2,-39)$ is a point on the tangent line and the slope of the line is $-57$ so the equation of the line is: $$y-y_{1}=m(x-x_{1})=y+39=-57(x-2)$$

\end{frame}
\begin{frame}
\begin{example}
Use the rules to show that $$\frac{d}{dx}(\tan x)=\sec ^{2} x$$
\end{example}
$$\frac{d}{dx}(\tan x)=\frac{d}{dx}(\frac{\sin x}{\cos x})$$
Using the quotient rule, we will get $$\frac{d}{dx}(\frac{\sin x}{\cos x})=\frac{(\cos x)[\frac{d}{dx}(\sin x)]-(\sin x)[\frac{d}{dx}(\cos x)]}{(\cos^{2} x)}$$ 
\end{frame}
\begin{frame}{Exercises}
Use the rules to show that:
\begin{itemize}
\item $$\frac{d}{dx}(\sec x)=\sec (x) \cdot \tan (x)$$
\item $$\frac{d}{dx}(\csc (x))=-\csc (x) \cdot \cot (x)$$
{\textcolor {red} {\textit{Hint:}}} $\csc (x)=1/\sin (x) \quad and \quad \cot (x)=1/\tan (x)$
\item $$\frac{d}{dx}(\cot (x))=-\csc ^{2}(x)$$
\end{itemize}
\end{frame}
\begin{frame}
\begin{definition}
If $f(u)$ is differentiable at the point $u=g(x)$ and $g(x)$ is differentiable at $x$, then the composite function $(f\circ g)(x)=f(g(x))$ is differentiable at $x$, and $$(f \circ g)'(x)=f'(g(x))\cdot g'(x)$$
In another notation, if $y=f(u)$ and $u=g(x)$, then $$\frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}$$   
\end{definition}

\end{frame}
\begin{frame}
\begin{example}
If $y=(x^{3}+4x^{4}+7)^{99}$, find $\frac{dy}{dx}$
\end{example}
Let $u=x^{3}+4x^{4}+7$, we can write $y$ as $y=u^{99}$, then by chain rule we have:
$$\frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}=99u^{98}[3x^{2}+16x^{3}],$$ 
so $$\frac{dy}{dx}=99(x^{3}+4x^{4}+7)^{98}(3x^{2}+16x^{3})$$
\begin{example}
If $y=\displaystyle {\frac{1000}{(x^{4}+2x^{2}+8)^{40}}}$, find $\frac{dy}{dx}$
\end{example}
\end{frame}
\begin{frame}
$y=1000(x^{4}+2x^{2}+8)^{-40}$.\\
Let $u=x^{4}+2x^{2}+8$, so we can write $y=1000u^{-40}$\\
The Chain rule is: $$\frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dx}$$
 Now: $$\frac{dy}{du}=(1000)(-40)u^{-41}$$
 $$\frac{du}{dx}=4x^{3}+4x$$
 so $$\frac{dy}{dx}=-40000u^{-41}[4x^{3}+4x]$$
then $$\frac{dy}{dx}=\frac{-40000}{u^{41}}(4x^{3}+4x)$$
 or $$\frac{dy}{dx}=\frac{-40000(4x^{3}+4x)}{(x^{4}+2x^{2}+8)^{41}}$$ 
\end{frame}
\begin{frame}

{\textcolor {red} {\textit{Note:}}} Sometimes it is useful to involve a second (or more) intermediate function $$\frac{dy}{dx}=\frac{dy}{du}\cdot \frac{du}{dv}\cdot \frac{dv}{dx}$$
\begin{example}
Find $\frac{dy}{dx}$, when $$y=\sin ^{4}(x^{5}+7)$$
\end{example}
Let $u=\sin (x^{5}+7)$ and let $v=x^{5}+7$\\
so the chain rule gives $$\frac{d \sin ^{4}(x^{5}+7)}{dx}=\frac{d \sin ^{4}(x^{5}+7)}{d \sin (x^{5}+7)}\cdot \frac{d \sin (x^{5}+7)}{d (x^{5}+7)}\cdot \frac{d(x^{5}+7)}{dx}$$ 
$$\Big [4\sin ^{3}(x^{5}+7) \Big ]\cdot \Big [\cos (x^{5}+7) \Big ]\cdot \Big [ 5x^{4}\Big ]=20x^{4}\cdot \sin ^{3}(x^{5}+7)\cdot \cos (x^{5}+7) $$

\end{frame}
\begin{frame}{Exercises}

Find $\frac{dy}{dx}$, if:
\begin{itemize}


\item $$y=x^{2}e^{\sin x}$$
\item $$y=\tan ^{3}[\sin ^{2}(x^{4})]$$
\end{itemize}
\end{frame}




\end{document}