%\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 16 ]{\large{ Lecture 16 } 
\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}{Logarithmic Differentiation}

One could use the product and quotient rule to differentiate the following type of function.
\begin{example}
$$f(x)=\frac{(x^{2}+5)(x+3)^{2}\sqrt{x+7}}{(x+4)^{5}}$$
\end{example}
Alternatively, we could first take the log of both sides: 
$$\ln f(x)=\ln (x^{2}+5)+2\ln (x+3)+\frac{1}{2}\ln (x+7)-5\ln (x+4)$$
then differentiate\\
First note: $$\frac{d}{dx}(\ln f(x))=\frac{d \ln f(x)}{d f(x)}\cdot \frac{d f(x)}{dx}=\frac{1}{f(x)}\cdot \frac{d f(x)}{dx}=\frac{1}{f(x)}\cdot f'(x)$$
 

\end{frame}
\begin{frame}
So differentiating the above: $$\frac{f'(x)}{f(x)}=\frac{2x}{x^{2}+5}+\frac{2}{x+3}+\frac{1}{2(x+7)}-\frac{5}{x+4}$$ \visible<2->{So $$f'(x)=\Big [ \frac{(x^{2}+5)(x+3)^{2}\sqrt{x+7}}{(x+4)^{5}} \Big ]\cdot \Big [ \frac{2x}{x^{2}+5}+\frac{2}{x+3}+\frac{1}{2(x+7)}-\frac{5}{x+4} \Big ]$$}
\end{frame}
\begin{frame}{Continuous and Differentiable Function}

\begin{example}
Determine values of $k$ and $m$ such that $h(x)$ is continuous and differentiable at all points. $$h(x)=\left\{
  \begin{array}{rcr}
    4x+k & if & x<3 \\
    mx^{3}-1 & if & x\geq 3 \\
  \end{array}
\right.$$
\end{example}
To be continuous: $$\lim_{x \to 3^{-}} h(x)=\lim_{x \to 3^{+}} h(x)$$ So, 
$$4(3)+k=m(3)^{3}-1 \Rightarrow 12+k=27m-1 \Rightarrow k=27m-13$$
\end{frame}

\begin{frame}
A function $h(x)$ is differentiable at $a$ if the following limit exists:
$$\lim_{x \to a} \frac{f(x)-f(a)}{x-a}$$
this limit exists, if both of the one-sided limits exist and are equal:
$$\lim_{x \to 3^{-}} \frac{(4x+k)-(27m-1)}{x-3}=\lim_{x \to 3^{-}} \frac{4x-12}{x-3}=4$$
Also $$\lim_{x \to 3^{+}} \frac{(mx^{3}-1)-(27m-1)}{x-3}=\lim_{x \to 3^{+}} \frac{m(x^{3}-27)}{x-3}$$$$=\lim_{x \to 3^{+}} m(x^{2}+3x+9)=27m$$
\end{frame}
\begin{frame}
so $$4=3m(3^{2}) \Rightarrow 4=27m \Rightarrow m=27/4$$
As $k=27m-13$, $k=27(4/27)-13 \Rightarrow k=4-13=-9$ 
\end{frame}



\end{document}