\chapter{The Natural Logarithm}


The {\bf \index{natural logarithm} natural logarithm}, denoted $y=\ln x$, is the function defined as
follows: $\ln x$ {\it is the area under the reciprocal function $1/u$ from
$u=1$ to $u=x$}.  Using the integral notation, we write:

\begin{rightindent}{3.0in}
\[
        \ln x=\int_1^x\frac{du}{ u}.
\]
 
In the drawing to the right the shaded area is $\ln x$.  Here we are
showing the case $x>1$, when the area is positive.  If $x<1$, on the other
hand, then the limits of integration are ``backwards'' (i.e., the top limit
of integration is less than the bottom limit of integration).  In other
words, if $x<1$, then we traverse the area going from right to left rather
than from left to right.  In that case the area in question is counted with
a negative sign.  If $x=1$, then the area is 0.  If $x\le 0$, then we
cannot define 
\end{rightindent}
\hfill
%-figure IA -----------------------------
\begin{psfigure}{2in}{2in}{figIA.ps}
%\putcrosshair{0,0}
\puttext{-16, -35.}{\Small$1$}
\puttext{22.5, -35.}{\Small$x$}
\puttext{-12.5, 15.}{\Small $\displaystyle y = \frac{1}{u}$}
\end{psfigure}
%------------------------------

\noindent
$\ln x$, because in that case the reciprocal function $1/u$
has an asymptote (i.e., it goes to infinity) between $u=1$ and $u=x$.
Thus, our first property of $\ln x$ is:

\smallskip

\begin{equation}
\ln x\begin{cases}
    >0& \text{if $x>1$;}\\
    =0& \text{if $x=1$;}\\ 
    <0& \text{if $0<x<1$;}\\
 \text{is~undefined}& \text{ if $x\le 0$.}
\end{cases}
\tag{Property 1}
\end{equation}

We say that the
{\it domain} of $\ln x$ is {\it all positive x}.

\smallskip

The next group of \index{properties of ln} properties are the main reason for defining $\ln x$.

\smallskip


\begin{equation}
\frac{d}{ dx}\ln x=\frac{1}{ x};\qquad\frac{d}{ dx}\ln
u=\frac{1}{ u}\,\frac{du}{ dx}.
\tag{Property 2 a}
\end{equation}
The first of these equalities is a direct
result of the ``\index{fundamental theorem of calculus} fundamental theorem of calculus,'' which says that the
derivative of this type of area function is obtained by removing the
integral sign and replacing the dummy variable by the variable in the upper
limit of integration: $\frac{d}{ dx}\int_1^x\frac{1}{ u}du=\frac{1}{ x}$.  The
second equality follows from the chain rule: if $y=\ln u$ and $u=u(x)$,
then 
\[
\frac{dy}{ dx}=\frac{dy}{ du}\cdot\frac{du}{ dx}=\frac{1}{ u}\,\frac{du}{ dx}.
\]
\begin{equation}
\int\frac{dx}{ x}=\ln x +C.
\tag{Property 2 b}
\end{equation}
This means that $\int_a^b\frac{dx}{ x}= \ln b-\ln a$.  Property 2(b) follows
from 2(a), which says that $\ln x$ is an antiderivative of $1/x$.  We
shall later see that if we want to allow the possibility of negative limits
of integration, we must replace $x$ by $|x|$ inside the $\ln$, i.e., we
modify the antiderivative formula as follows: $$
\int\frac{dx}{ x}=\ln|x|+C.
$$ 
This antiderivative formula fills
in a gap in the antiderivative formula we had before for $x^n$, namely,
the case $n=-1$.  For all $n\ne-1$, the antiderivative of $x^n$ is another
power function; but the \index{antiderivative of $x^{-1}$} antiderivative of $x^{-1}$ is a different type of
function, namely, our ``natural logarithm.''  To summarize, we write:
$$
\int x^n\,dx=
\begin{cases}
\frac{1}{ n+1}x^{n+1}+C& \text{ if $n\ne-1$;}\\
  ~~&\\
\ln|x|+C&\text{if $n=-1$.}
\end{cases}
$$

\smallskip

Before discussing further properties of $\ln x$, we give some examples of
the use of Properties 2(a) and 2(b).


\begin{example}
%{\bf Example 1.} 
Find the derivative of $x\,\ln^2(\sin x)$.

\smallskip
By the product rule,
\begin{align*} 
\frac{d}{ dx}\bigl(x\,\ln^2(\sin x)\bigr)&=x\,\frac{d}{ dx}\bigl(\ln^2(\sin
x)\bigr)+1\cdot\ln^2(\sin x)\\ &=x\cdot 2\ln(\sin x)\frac{d}{
dx}\bigl(\ln(\sin x)\bigr)+\ln^2(\sin x)\\ &=2x\ln(\sin x)\frac{1}{
\sin x}\cos x+\ln^2(\sin x)=2x\cot x\,\ln(\sin x)+\ln^2(\sin x).
\end{align*}

\end{example}


\begin{example}
%{\bf Example 2.} 
Find the definite integrals 
$$
\text{(a)}~\int_0^2\frac{dx}{
3x+1};\qquad\text{(b)}~\int_{-2}^{-1}\frac{dx}{ x};
\qquad\text{(c)}~\int_0^{\pi/4}\tan x\,dx;\qquad\text{(d)}~\int_2^4\frac{2x}{ x^2-2}
dx.
$$

In several of these integrals it is useful to rewrite Property 2(a) with
$x$ replaced by $u$, and then make a $u$-substitution to transform the
integral with respect to $x$ to an integral with respect to $u$ having the
form in Property 2(a), i.e., $\int\frac{1}{ u}du$.

\smallskip
(a) We make the substitution $u=3x+1$, so that $du=3dx$, and hence
$dx=\frac{1}{ 3}du$.  The limits of integration in (a) change as follows:
$x=0\Longrightarrow u=3\cdot 0+1=1$; and $x=2\Longrightarrow u=3\cdot
2+1=7$.  Thus, we obtain 
$$
\int_0^2\frac{dx}{ 3x+1}=\frac{1}{
3}\int_1^7\frac{du}{ u}=\frac{1}{ 3}\ln 7.
$$

\smallskip
 
(b) Since our limits of integration are negative, we use 
the version of the antiderivative formula with the absolute value inside
the $\ln$.  We obtain: 
$$
\ln|x|\bigm|_{-2}^{-1}=\ln|-1|-\ln|-2| =\ln 1-\ln 2=-\ln 2.
$$
\begin{rightindent}{3.0 truein}
\noindent
We can verify directly that this is the right answer: the
area in question is an integral of the negative branch of the reciprocal
function (which is in the third quadrant).  But the area there from $-2$ to
$-1$ is exactly the same as the area under the positive branch of the
reciprocal function from $1$ to $2$, except that it is counted negatively
because of being {\it below} the axis.  Thus, the answer $-\ln 2$ agrees
with the picture in the graph at the right.
\end{rightindent}
\hfill 
%-figure IB -----------------------------
\begin{psfigure}{2.5in}{2.0in}{figIB.ps}
%\putcrosshair{0,0}
\puttext{-33.5, 5.}{\Tiny $-2$}
\puttext{-17, 5.}{\Tiny $-1$}
\puttext{32., -5.}{\Tiny $2$}
\puttext{16., -5.}{\Tiny $1$}
\puttext{27, 25.}{\Small $y = 1/x$}
\end{psfigure}
%------------------------------

(c) At first glance, this has nothing to do with $\ln$.  However, if we
rewrite $\tan x$ as $\sin x/\cos x$, and notice that the derivative of
$u=\cos x$ is $du=-\sin x dx$, we can transform this integral into $\int
du/u$.  More precisely, we obtain 
$$
\int_0^{\pi/4}\frac{\sin x\,dx}{ \cos
x}=\int_{\cos 0}^{\cos(\pi/4)}\frac{-du}{ u}=-\int_1^{\sqrt{2}/2}\frac{du}{
u}=-\ln(\sqrt{2}/2).
$$

\smallskip

(d) Here we notice that the expression in the denominator has its
derivative sitting with $dx$ in the numerator.  This means that
substituting $u$ for the denominator will result in $du/u$.  That is, we
set $u=x^2-2$, so that $du=2xdx$.  The limits of integration change from
$2$ to $2^2-2=2$ and from $4$ to $4^2-2=14$.  So we obtain
$\int_2^{14}du/u=\ln(14)-\ln 2$.

\smallskip

We will soon see that the answers to parts (c) and (d) can be simplified.

\end{example}

\smallskip

Before giving the next group of properties of $\ln$, we make a useful
observation.  We defined $\ln a$ to be the area under $y=1/x$ from $x=1$ to
$x=a$.  But it turns out that for any positive number $b$ this value $\ln
a$ is also the area under $y=1/x$ from $x=b$ to $x=ab$.  For example, $\ln
2$ is the area from 1 to 2, and it is also the area from 3 to 6 (or from
1000 to 2000, etc.).  Roughly speaking, this is because the latter area is
obtained by taking the area from 1 to 2, expanding it horizontally, and
then contracting it vertically by the same factor.  More precisely, to show
that $\ln a$ is equal to $\int_b^{ab}dx/x$, we write $\ln a=\int_1^adx/x$
and make the $u$-substitution $u=bx$.  Then $du=b\,dx$, and the limits of
integration become $b\cdot 1$ to $b\cdot a$, i.e., 
$$
\ln a=\int_1^a\frac{dx}{x}
=\int_1^a\frac{b\,dx}{ b\,x}=\int_b^{ab}\frac{du}{ u}.
$$
 The name of the
variable of integration is irrelevant, so that we can equally well write
$\ln a=\int_b^{ab}dx/x$.  It is now easy to obtain our next basic group of
properties.

\begin{equation}
     \ln(ab)=\ln a+\ln b\,.      \tag{Property 3 a}
\end{equation}  
This follows because $\ln a=\int_b^{ab}dx/x=\ln(ab)-\ln b$.

\begin{equation}
      \ln(1/a)=-\ln a.   \tag{Property 3 b}
\end{equation}
This is because, by part (a), we have $\ln(1/a)+\ln a=\ln 1=0$.

\begin{equation}
      \ln(a/b)=\ln a-\ln b\,. \tag{Property 3 c}
\end{equation}
This follows immediately from part (a) if we replace $b$ by $1/b$ and use
part (b).

\begin{equation}
      \ln(a^n)=n\,\ln a \,. \tag{Property 3 d}
\end{equation}
First note that part (a) can be repeated when you have more than two
factors: $\ln(abc)=\ln a+\ln(bc)=\ln a+\ln b+
\ln c$, and so on.  Thus, if $n$ is a positive integer, we can write
$\ln(a^n)=\ln(a\cdot a\cdot a\cdots a)=\ln a+\ln a+\ln a+\cdots+\ln a=
n\,\ln a$.  If $n$ is a negative integer, one uses a similar argument with
$a$ replaced by $1/a$.  The formula $\ln(a^n)=n\,\ln a$ applies for any $n$
(integer or not), but we shall omit the proof in the case when $n$ is not
an integer.  (But see Problem 2 in the homework for a proof.)

\begin{example}
%{\bf Example 3.} 
Simplify the answers to parts (c)--(d) of Example 2.

\smallskip
In part (c) we have $-\ln(\sqrt{2}/2)=-(\ln(2^{1/2})-\ln 2)
=-\left(\frac{1}{2}\ln 2\>-\>\ln 2\right)
=\frac{1}{ 2}\ln 2$.  In part (d) we have
$\ln(14)-\ln 2=\ln(14/2)=\ln 7$.

\end{example}


\section[The curve $y=\text{ln} x$]{Appearance of the Curve $y=\mbox{ln}\, x$.} 

Recall what Property 1 says: the function $y=\ln x$ has domain consisting
of all {\it positive} $x$, its graph crosses the $x$-axis at $x=1$, and the
function is positive when $x>1$ and negative when $0<x<1$.  It is an {\it
increasing} function, because its derivative is $1/x$, which is always
positive for $x>0$.  However, when $x$ is large this derivative is quite
small.  In other words, the slope of the curve tends to ``level off.''  On
the other hand, when $x$ is near 0 the slope is very large, i.e., the curve
is steep.  At the point $x=1$ where the curve crosses the $x$-axis, the
slope is 1, i.e., the curve is increasing at a $45^\circ$ angle as it
crosses the axis.


\begin{centering}
%-figure IC -----------------------------
\begin{psfigure}{4in}{3.0in}{figIC.ps}
%\putcrosshair{0,0}
\puttext{-34, -5}{\Small$1$}
\puttext{-13.3, 25.}{\Small$y = \ln x$}
\end{psfigure}\\
%------------------------------
\end{centering}

We now ask whether the curve $y=\ln x$ increases without bound as $x$
increases, or whether it is bounded by a horizontal asymptote.  It is
possible for an increasing curve to be bounded --- for example, the curve
$y=$Arctan$\,x$.  It is also possible for a curve whose slopes are becoming
smaller and smaller (``leveling off'') to increase without bound --- for
example, the curve $y=\sqrt{x}$.  So our question is: does $y=\ln x$ look
more like the Arctan curve or the square root curve?  The answer to this
question is: more like the square root curve, i.e., {\it there is no
horizontal asymptote}.  To see this, we can use Property 3(d) with a very
large value of $n$.  For example, 
$$
\ln\left(2^{1000}\right)=1000\ln
2=693,\quad\ln\left(2^{1000000}\right)
=693147,\quad\ln\left(2^{10000000000}\right)=693147181.
$$ 
Thus, we can get
$\ln x$ to be as large as we want by choosing $x$ to be 2 to a large enough
power.

\smallskip

Even though $\ln x$ and $\sqrt{x}$ both approach infinity (fairly slowly)
as $x\longrightarrow\infty$, the former function approaches infinity more
slowly than the latter one.  If we look at the ratio $\ln x/\sqrt{x}$, and
set $x$ equal to an extremely large number (like $10^{1000}$, for example),
we find that 
$$
\frac{\ln 10^{1000}}{\sqrt{10^{1000}}}=\frac{1000\ln 10}{10^{500}}.
$$ 
Here the numerator is about 230, while the denominator is a 1
followed by 500 zeros!  So the ratio is extremely close to 0, i.e., $\ln
x$, while fairly large, is much much smaller than $\sqrt{x}$.  The same
argument can be used to show that $\ln x$ approaches infinity slower than
{\it any} $n$-th root function.  For example, the ratio $\ln x/{\root 10
\of x}$ has limit 0 as $x
\longrightarrow\infty$.  To summarize: {\it the natural logarithm function
grows without bound as $x$ increases, but very, very slowly}.

\smallskip

At the other end, as $x\longrightarrow 0$, the function $\ln x$ approaches
$-\infty$.  This is because a very small positive number is the reciprocal
of a very large positive number, and so its logarithm is the negative of
the logarithm of the very large number.



\section[Log base $a$]{Relation with Logarithm-to-the-Base-$a$} 

Historically, the first
logarithms used were ``\index{logarithms to the base 10} logarithms to the base 10,'' denoted $\log_{10}$.
The definition of the function $y=\log_{10}x$ is: $y$ is the power to which
$10$ must be raised to get $x$, i.e., $10^y=x$.  More generally, if $a$ is
any fixed number greater than 1 (for example, \index{log to the base $a=2$} log to the base $a=2$ is
often used in computer science), then we define $\log_ax$ as the power to
which $a$ is raised to get $x$.  That is,
\[
y=\log_ax\qquad\text{means~that~\qquad}a^y=x.
\]
It is not hard to relate
this ``old-fashioned'' logarithm to the natural logarithm $\ln$.  Namely,
if $y=\log_ax$, then to find $y$ in terms of $\ln$ we take $\ln$ of both
sides of the relation $a^y=x$, obtaining $\ln(a^y)=y\ln a=\ln x$, i.e.,
$y=\ln x/\ln a$.  Since $y=\log_ax$, we conclude that 
\[
\log_ax=\frac{\ln x}{\ln a}.
\] 
For example, $\log_{10}x= \ln x/\ln(10)=0.4343\ln x$.  The only difference
between the different kinds of logarithm is a constant factor.  Thus, there
is no problem in taking the derivative of $\log_a$: 
$\frac{d}{dx}\log_ax=\frac{1}{\ln a}\cdot\frac{1}{ x}$.

\section{Logarithmic Differentiation} 

Although it may seem that we can already take the derivative of almost any
function for which we can write down a formula, you may have noticed that
there is one type of function which we have not been able to differentiate,
namely, a function of the form $y=f(x)^{g(x)}$, where $g(x)$ is {\bf not a
constant}.  Of course, if $g(x)$ is a constant, then we can use the rule
for the derivative of $f(x)^n$.  But this rule {\bf cannot be used if the
exponent is a function of $x$ rather than a constant}.  Instead we must use
a procedure called {\bf \index{logarithmic differentiation} logarithmic differentiation}.  As its name implies,
it consists of two parts: (1) take the $\ln$ of both sides of the equation
$y=f(x)^{g(x)}$, and (2) differentiate both sides of the resulting
equation.  In part (1), be sure to use Property 3(d) of $\ln$, with $a$
replaced by $f(x)$ and $n$ replaced by $g(x)$.  We illustrate with the
following examples.


\begin{example}
%{\bf Example 6.} 
Find the derivative of (a) $(\sin x)^x$; (b) $(\ln x)^{\ln
x}$.

\smallskip

(a) We first take the $\ln$ of both sides of $y=(\sin x)^x$, obtaining $\ln
y=\ln\left((\sin x)^x\right)=x\ln(\sin x)$.  When taking $d/dx$ of both
sides, on the left we use Property 2(a) of $\ln$ and on the right we use
the product rule: 
$$
\frac{1}{ y}\cdot\frac{dy}{ dx}=x\frac{1}{\sin x}\,\cos
x+1\cdot\ln(\sin x)= x\cot x+\ln(\sin x).
$$ 
Finally, we multiply both sides
by $y$, and express $dy/dx$ in terms of $x$ by replacing $y$ by $(\sin
x)^x$: 
$$
\frac{dy}{ dx}=\bigl(x\cot x+\ln(\sin x)\bigr)y=\bigl(x\cot
x+\ln(\sin x)
\bigr)(\sin x)^x.
$$

\smallskip

(b) We write $y=(\ln x)^{\ln x}$, and $\ln y=\ln\left((\ln x)^{\ln
x}\right) =\ln x\>\ln(\ln x)$.  Taking $d/dx$ of both sides gives:
$$
\frac{1}{ y}\,\frac{dy}{ dx}=\ln x\>\frac{d}{ dx}\bigl(\ln(\ln x)\bigr)+
\frac{1}{ x}\ln(\ln x)=\ln x\biggl(\frac{1}{\ln x}\>\frac{1}{ x}\biggr)+\frac{1}{
x}\ln(\ln x)=\frac{1+\ln(\ln x)}{ x},
$$
 and hence 
$$
\frac{dy}{ dx}=\frac{1+\ln(\ln
x)}{ x}\,y=\frac{1+\ln(\ln x)}{ x}(\ln x)^{\ln x}.
$$
\end{example}
% 
