2.5. Exponentials and Logarithms

The Exponential

The exponential function ex, where e=2.71828… is the base of natural logarithms, comes constantly up in applications as diverse as credit-card interest, the growth of animal populations, and electric circuits. For its derivative we have

\begin{align} \frac{de^x}{dx} &= \frac{e^{x+dx}-e^x}{dx} \\ &= \frac{e^x e^{dx}-e^x}{dx} \\ &= e^x \: \frac{e^{dx}-1}{dx} \end{align}

The second factor, (edx-1)/dx, doesn't have x in it, so it must just be a constant. Therefore we know that the derivative of ex is simply ex, multiplied by some unknown constant,

$\frac{de^x}{dx} = c\:e^x .$

A rough check by graphing at, say x=0, shows that the slope is close to 1, so c is close to 1. Numerical calculation also shows that, for example, (e0.001-1)/0.001=1.00050016670838 is very close to 1. But how do we know it's exactly one when dx is really infinitesimal? We can use Inf:

   : [exp(d)-1]/d
1+0.5d+...


(The ... indicates where I've snipped some higher-order terms out of the output.) It seems clear that c is equal to 1 except for negligible terms involving higher powers of dx. A rigorous proof is given on page 151.

Example 22

◊ The concentration of a foreign substance in the bloodstream generally falls off exponentially with time as c=coe-t/a, where co is the initial concentration, and a is a constant. For caffeine in adults, a is typically about 7 hours. An example is shown in Figure K. Differentiate the concentration with respect to time, and interpret the result. Check that the units of the result make sense.

◊ Using the chain rule,

\begin{align} \frac{dc}{dt} &= c_{\text{o}}e^{-t/a}\cdot\left(-\frac{1}{a}\right) \\ &= -\frac{c_{\text{o}}}{a}e^{-t/a} \end{align}

This can be interpreted as the rate at which caffeine is being removed from the blood and put into the person's urine. It's negative because the concentration is decreasing. According to the original expression for x, a substance with a large a will take a long time to reduce its concentration, since t/a won't be very big unless we have large t on top to compensate for the large a on the bottom. In other words, larger values of a represent substances that the body has a harder time getting rid of efficiently. The derivative has a on the bottom, and the interpretation of this is that for a drug that is hard to eliminate, the rate at which it is removed from the blood is low.

It makes sense that a has units of time, because the exponential function has to have a unitless argument, so the units of t/a have to cancel out. The units of the result come from the factor of co/a, and it makes sense that the units are concentration divided by time, because the result represents the rate at which the concentration is changing.

Figure K. Example 22. A typical graph of the concentration of caffeine in the blood, in units of milligrams per liter, as a function of time, in hours.

Example 23

◊ Find the derivative of the function y=10x.

◊ In general, one of the tricks to doing calculus is to rewrite functions in forms that you know how to handle. This one can be rewritten as a base-e exponent:

\begin{align} y &= 10^x \\ \ln y &= \ln\left(10^x\right) \\ \ln y &= x \ln 10 \\ y &= e^{x\ln 10} \end{align}

Applying the chain rule, we have the derivative of the exponential, which is just the same exponential, multiplied by the derivative of the inside stuff:

\begin{align} \frac{dy}{dx} = e^{x\ln 10} \cdot \ln 10 . \end{align}

In other words, the “c” referred to in the discussion of the derivative of ex becomes c=ln 10 in the case of the base-10 exponential.

The Logarithm

The natural logarithm is the function that undoes the exponential. In a situation like this, we have

$\frac{dy}{dx} = \frac{1}{dx/dy} ,$

where on the left we're thinking of y as a function of x, and on the right we consider x to be a function of y. Applying this to the natural logarithm,

\begin{align} y &= \ln x \\ x &= e^y \\ \frac{dx}{dy} &= e^y \\ \frac{dy}{dx} &= \frac{1}{e^y} \\ &= \frac{1}{x} \\ \frac{d \ln x}{dx} &= \frac{1}{x} . \end{align}

Figure L. Differentiation and integration of functions of the form xn. Constants out in front of the functions are not shown, so keep in mind that, for example, the derivative of x2 isn't x, it's 2x.

This is noteworthy because it shows that there must be an exception to the rule that the derivative of xn is nxn-1, and the integral of xn-1 is xn/n. (On page 37 I remarked that this rule could be proved using the product rule for negative integer values of k, but that I would give a simpler, less tricky, and more general proof later. The proof is Example 24 below.) The integral of x-1 is not x0/0, which wouldn't make sense anyway because it involves division by zero [5]. Likewise the derivative of x0=1 is 0x-1, which is zero. Figure L shows the idea. The functions xn form a kind of ladder, with differentiation taking us down one rung, and integration taking us up. However, there are two special cases where differentiation takes us off the ladder entirely.

[5] Speaking casually, one can say that division by zero gives infinity. This is often a good way to think when trying to connect mathematics to reality. However, it doesn't really work that way according to our rigorous treatment of the hyperreals. Consider this statement: “For a nonzero real number a, there is no real number b such that a=0b.” This means that we can't divide a by 0 and get b. Applying the transfer principle to this statement, we see that the same is true for the hyperreals: division by zero is undefined. However, we can divide a finite number by an infinitesimal, and get an infinite result, which is almost the same thing.

Example 24

◊ Prove d(xn)/dx = nxn-1 for any real value of n, not just an integer.

◊ \begin{align} y &= x^n \\ &= e^{n ln x} \end{align}

By the chain rule,

\begin{align} \frac{dy}{dx} &= e^{n ln x} \cdot \frac{n}{x} \\ &= x^n \cdot \frac{n}{x} \\ &= nx^{n-1} \end{align}

(For n=0, the result is zero.)

When I started the discussion of the derivative of the logarithm, I wrote y=ln x right off the bat. That meant I was implicitly assuming x was positive. More generally, the derivative of ln|x| equals 1/x, regardless of the sign (see problem 29 on page 50).