9. Differentiating Exponentials and Logarithms#
Recall, from earlier in the course, that there is an irrational number \(e\approx 2.718\) which had some special properties. We investigate what happens when we differentiate \(y=e^x\).
9.1. Differentiating exponential functions#
Consider an exponential function \(y=a^x\). For convenience, let’s suppose \(a>1\), so that the function is increasing.
Fig. 9.1 Graph of \(y=a^x\)#
We differentiate this function from first principles. To do this, we must analyse the behaviour of
when \(h\) is a small number.
By standard index laws,
This means that
Now, \(\lim_{h\rightarrow 0}\frac{a^h-1}{h}\) is a constant — specifically, it is the slope of the tangent to \(y=a^x\) when \(x=0\). So we have shown that
where \(C\) is a constant.
The constant \(C\) depends on the base number, \(a\), but nothing else. Moreover, we’ve shown that the derivative of an exponential function is always proportional to itself!
Definition 9.1
Euler’s number, denoted by \(e\), is defined to be the base for which the constant \(C\) of equation (9.1) is equal to \(1\).
Like \(\pi\), \(e\) is an irrational number, and there are many methods to calculate \(e\) to an arbitrary number of decimal places. To 50 decimal places,
The following result is immediate from the definition of \(e\).
Theorem 9.1 (Differentiation of \(e^x\))
The derivative of \(e^x\) is itself:
Remarks:
It can be shown that \(e^x\) is the only function \(f(x)\) such that \(f(0)=1\) and \(f'(x) = f(x)\).
If we forget about the problems that occur with infinite sums, we can also see the above result from differentiating the power series expansion of \(e^x\). \begin{align*} \frac{d}{dx}(e^x) &= \frac{d}{dx}\left(1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\frac{x^4}{4!}+\ldots \right)\ &= 0+ 1 + \frac{2x}{1\times 2} + \frac{3x^2}{1\times 2\times 3} + \frac{4x^3}{1\times 2\times 3\times 4}+\dots\ &= 1+ x + \frac{x^2}{2!} + \frac{x^3}{3!}+\dots\ &= e^x. \end{align*}
Note
The above ‘proof’ relies on the theory of convergence. This is, in some way, a special case: for other similar expansions the above method does not work.
9.2. Examples#
Example 9.1
Let \(y = e^{7x}\). Find \(\frac{dy}{dx}\).
Solution.
We need the chain rule here. Let \(u = 7x\) so that \(y = e^u\). Then
Example 9.2 (Exponential Decay)
In a radioactive decay, the rate of change of mass is directly proportional to the mass remaining.
Let \(y\) be the mass of the sample at time \(t\). Then we are told that \(\frac{dy}{dt}\) is directly proportional to \(y\) (written \(\frac{dy}{dt}\propto y\)), that is
for some constant \(k\), where we have introduced the negative sign since the mass, \(y\), will be decreasing with time. An application of the chain rule shows that if \(y = e^{-kt}\) then
and so \(y = e^{-kt}\) is a solution for the equation (9.2). But, in fact, we can do better. For any constant \(A\), if \(y = Ae^{-kt}\) then
So \(y = Ae^{-kt}\) is also a solution of (9.2) for any \(A \in \mathbb{R}\).
It can be shown that all solutions of (9.2) are of the form \(Ae^{-kt}\) for some constant \(A\in\mathbb{R}\); we call \(y=Ae^{-kt}\) the general solution of (9.2).
Equations such as (9.2) are called differential equations as they contain derivatives as well as the more ordinary terms. Many scientific theories involve differential equations like this.
Fig. 9.2 Exponential decay: \(y=5e^{-\frac{1}{2}t}\), for \(t\geq 0\).#
Example 9.3
Differentiate \(y = e^{x^2}\).
Solution.
We use the chain rule. Let \(u = x^2\) so that \(y = e^u\). Then
In general, if \(y = e^{f(x)}\) and we use the chain rule with \(u = f(x)\), we get \(\frac{dy}{du} = e^{u}\) and \(\frac {du}{dx} = f'(x)\). Thus \(\frac{dy}{dx} = f'(x) e^{u} = f'(x) e^{f(x)}\). Hence we have the following result.
Theorem 9.2
Let \(f(x)\) be a function and let \(y=e^{f(x)}\). Then
9.3. Differentiating \(y = \ln x\)#
We know from earlier in the module that \(e^x\) and \(\ln x\) are inverse functions, that is
Now let \(y = \ln x\). Then \(x = e^y\) and so \(\frac{dx}{dy} = e^y\). By the inverse function rule, we have
(Note that we have to express \(\frac{dy}{dx}\) in terms of \(x\) not in terms of \(y\).) Thus we have proved the following result.
Theorem 9.3 (Differentiation of \(\ln x\))
The derivative of the natural logarithm is given by
9.4. Examples#
Example 9.4
Differentiate \(y = \ln (x^2+1)\).
Solution.
We use the chain rule with \(u = x^2 +1\) so that \(y = \ln u\). Then
Example 9.5
Differentiate \(y = \ln(-x)\) for \(x < 0\).
Solution.
Note that as \(x < 0\), we have \(-x >0\) and so \(\ln(-x)\) exists.
We use the chain rule with \(u = -x\) so that \(y = \ln u\). Then
Remark 9.1
The outcome of Example 9.5 may seem surprising — \(\ln(x)\) is not the only function with derivative \(\frac{1}{x}\)!
The key thing to remember here is whether \(x\) is positive or negative. If \(x\) is negative, then \(\ln(x)\) does make sense, but \(\ln(-x)\) does. So \(\frac{1}{x}\) is the derivative of \(\ln(x)\) when \(x>0\), and the derivative of \(\ln(-x)\) when \(x<0\).
More on this in Chapter 12 Integration.
Example 9.6
Differentiate \(y = \ln\big(f(x)\big)\).
Solution.
We use the chain rule with \(u = f(x)\) so that \(y = \ln u\). Then \(\frac{dy}{du} = \frac 1u\) and \(\frac{du}{dx} = f'(x)\). Thus
So the derivative of \(\ln (f(x))\) is the derivative of the function \(f(x)\) divided by the original function \(f(x)\). We have proved the following theorem.
Theorem 9.4 (Differentiating \(\ln(f(x))\))
Let \(y = \ln (f(x))\). Then
Example 9.7
Differentiate \(y = \ln \left(\frac{x(3x+1)^2}{(x^2+2)^3}\right)\).
Solution.
We can do two things here: either use the theorem above directly with \(f(x)=\frac{x(3x+1)^2}{(x^2+2)^3}\) or, the easier way, we first use the laws of logarithms to simplify the expression for \(y\).
This is now much easier to differentiate, using Theorem 9.4 on each term we get