2.4 General Exponential and Logarithmic Functions

For a general exponential function \(y = a^x\), with \(a > 0\), use logarithmic differentiation to find its derivative:

\begin{align*} \ln\,y ~&=~ \ln\,\left(a^x\right) ~=~ x \,\ln\,a\\ \ddx\,(\ln\,y) ~&=~ \ddx\,(x \,\ln\,a) ~=~ \ln\,a\\ \frac{y'}{y} ~&=~ \ln\,a \quad\Rightarrow\quad y' ~=~ y \cdot \ln\,a \end{align*}

Thus, the derivative of \(y = a^x\) is:

Theorem 2.11

\[ \ddx\,\left(a^x\right) ~=~ (\ln\,a)\;a^x \]

In general, for an exponent of the form \(u = u(x)\):

Theorem 2.12

\[ \ddx\,\left(a^u\right) ~=~ (\ln\,a)\;a^u \;\cdot\; \dudx \]

Example 2.13

Find the derivative of \(y = 2^{\cos x}\).

Solution: This is the case where \(a = 2\), so:

\[ \dydx = (\ln\,2)\;2^{\cos x} \;\cdot\; \ddx\,(\cos x) ~=~ -(\ln\,2)\;(\sin x)\;2^{\cos x} \]

Note that any exponential function \(y = a^x\) can be expressed in terms of the exponential function \(e^x\). Since

\[ a^x ~>~ 0 \quad\Rightarrow\quad e^{\ln\,(a^x)} ~=~ a^x ~~, \]

and since \(\ln\,(a^x) = x\,\ln\,a\), then:

\[ a^x ~=~ e^{x\,\ln\,a} \]

Computers and calculators often use the above formula to calculate \(a^x\).

The function \(y = a^x\) has an inverse for any \(a > 0\), except for \(a = 1\) (in that case \(y = 1^x = 1\) is just a constant function). To see this, notice that since \(a^x > 0\) for all \(x\), and \(\ln\,a < 0\) for \(0 < a < 1\), while \(\ln\,a > 0\) for \(a > 1\), then \(\dydx = (\ln\,a)\,a^x\) is always negative if \(0 < a < 1\) and always positive if \(a > 1\). Thus, \(y = a^x\) is a strictly decreasing function if \(0 < a < 1\), and it is a strictly increasing function if \(a > 1\). The graphs in each case are shown in Figure 2.4.1.

tikzpicture[>=latex,every node/.style=font=,domain=-1.9:3.9] [->,black!60,line width=1pt] (-2,0) -- (4,0) node[pos=1.0,right] x; [->,black!60,line width=1pt] (0,0) -- (0,4) node[pos=1.0,above] y; [below] at (0,0) 0; [below left] at (0,0.9) 1; [linecolor,line width=1.5pt] plot ( ,exp(ln(1.4)* )); [linecolor,line width=1.5pt] plot ( ,exp(ln(0.5)* )); [below right] at (2,2) a > 1; [right] at (-1.5,3) a < 1; (0,1) circle (2.5pt); tikzpicture

Figure 2.4.1\(y = a^x\)

tikzpicture[>=latex,every node/.style=font=,domain=0.2:4.9] [->,black!60,line width=1pt] (-1,0) -- (5,0) node[pos=1.0,right] x; [->,black!60,line width=1pt] (0,-2.22) -- (0,2.22) node[pos=1.0,above] y; [below left] at (0,0) 0; [below] at (1,-0.15) 1; [linecolor,line width=1.5pt] plot ( ,1.264*ln( )); [linecolor,line width=1.5pt] plot ( ,-1.264*ln( )); [above left] at (3.3,1.6) a > 1; [below right] at (3.5,-1) a < 1; (1,0) circle (2.5pt); tikzpicture

Figure 2.4.2\(y = \log_a x\)

Hence, for any \(a >0\) with \(a \ne 1\) the function \(f(x) = a^x\) is one-to-one, so it has an inverse function, called the base \(\bm{a}\) logarithm and denoted by \(f^{-1}(x) = \log_a x\). It is often spoken as “log base \(a\) of \(x\)”. The graphs for \(a < 1\) and \(a > 1\) are shown in Figure 2.4.2. Note that the natural logarithm is just the base \(a\) logarithm in the special case with \(a = e\), i.e. \(\ln\,x = \log_e x\). The base \(a\) logarithm has properties similar to those of the natural logarithm (and the corresponding properties of \(a^x\)):

\begin{align*} \log_a\,(b c) ~&=~ \log_a b ~+~ \log_a c & a^{b} \cdot a^{c} ~&=~ a^{b + c}\\ \log_a\,\left(\frac{b}{c}\right) ~&=~ \log_a b ~-~ \log_a c & \frac{a^b}{a^c} ~&=~ a^{b - c}\\ \log_a b^c ~&=~ c\, \log_a b & \left(a^b\right)^c ~&=~ a ^{bc}\\ \log_a 1 ~&= 0 & a^0 ~&=~ 1 \end{align*}

Note that \(\log_a x\) can be put in terms of the natural logarithm, since

\[ x ~=~ a^{\log_a x} \quad\Rightarrow\quad \ln\,x ~=~ \ln\,\left(a^{\log_a x}\right) ~=~ (\log_a x) \cdot (\ln\,a) \]

so dividing the last expression by \(\ln\,a\) gives:

\[ \log_a x ~=~ \frac{\ln\,x}{\ln\,a} \]

The above formula is useful on calculators that do not have a \(\log_a x\) key or function. Taking the derivative of both sides yields:

Theorem 2.13

\[ \ddx\,\left(\log_a x\right) ~=~ \frac{1}{x \,\ln\,a} \]

In general, when taking the logarithm of a function \(u = u(x)\):

Theorem 2.14

\[ \ddx\,\left(\log_a u\right) ~=~ \frac{1}{u \,\ln\,a} \;\cdot\; \dudx ~=~ \frac{u'}{u \,\ln\,a} \]

Example 2.14

Find the derivative of \(y = \log_2 (\cos\,4x)\).

Solution: This is the case where \(a = 2\), so:

\[ \dydx = \frac{1}{(\cos\,4x)\,(\ln\,2)} \;\cdot\; \ddx\,(\cos\,4x) ~=~ -\frac{4 \sin\,4x}{(\ln\,2)\,(\cos\,4x)} \]

The number \(a\) is the base of both the logarithm function \(\log_a x\) and the exponential function \(a^x\). Base 2 and base 10 are the most commonly used bases other than base \(e\). Base 10 is how numbers are normally expressed, as combinations of powers of 10 (e.g. \(2014 = \bm{2} \cdot 10^3 \;+\; \bm{0} \cdot 10^2 \;+\; \bm{1} \cdot 10^1 \;+\; \bm{4} \cdot 10^0\)). Base 2 is especially useful in computer science, since computers represent all numbers in binary format, i.e. as a sequence of zeros and ones, indicating how many successive powers of two to take and then sum up.[1] For example, the number 6 is represented in binary format as 110, since \(\bm{1} \cdot 2^2 \;+\; \bm{1} \cdot 2^1 \;+\; \bm{0} \cdot 2^0 ~=~ 4 + 2 + 0 = 6\).


Exercises

A

For Exercises 1-9, find the derivative of the given function.

3

  1. \(y = \dfrac{3^x ~+~ 3^{-x}}{2}\)

  2. \(y = 2^{\ln\,3x}\vphantom{\dfrac{3^x}{2}}\)

  3. \(y = 2^{2^x}\vphantom{\dfrac{3^x}{2}}\)

    3

  4. \(y = \tan^{-1} \pi^x\)

  5. \(y = \log_2 \,(x^2 + 1)\)

  6. \(y = \log_{10} \,e^x\)

    3

  7. \(y = \sin\,\left(\log_2 \,\pi x\right)\)

  8. \(y = \log_2 \,4^{2x}\)

  9. \(y = 8^{\log_2 \,x}\)

B

  1. Show that for all constants \(k\) the function \(y = A a^{\frac{kx}{\ln\,a}}\) satisfies the differential equation \(\dydx = ky\). Does this contradict the statement made in Section 2.3 that the only solution to that differential equation is of the form \(y = A e^{kx}\)? Explain your answer.


  1. Binary notation leads to the joke “There are 10 kinds of people in the world: those who understand binary and those who do not.”