Online Textbook Practice Tests 1500 Calculus Problems Solved About

2.6: Differentiating Logarithmic Functions

In Section 2.5 we used Implicit Differentiation to attain the derivatives of all six inverse trigonometric functions. In this section we build on this idea by investigating the derivatives of logarithmic functions, as well as their applications. In this section we discuss the following topics:

Derivatives of Logarithmic Functions

In Section 2.2 we defined the number \(e \approx 2.718\) such that \(\textderiv{}{x}(e^x) = e^x.\) The inverse function of the exponential function is the logarithmic function. That is, if \(g(x) = b^x,\) where \(b\) is positive and \(b \ne 1,\) then \(\inv g(x)\) \(= \log_b x.\) The inverse function of \(e^x\) is called the natural logarithm (abbreviated by the symbol \(\ln\)), a logarithm whose base is the number \(e.\) That is, \[g(x) = e^x \iffArrow \inv g(x) = \ln x \pd\]

Figure 1

Letting \(y = \ln x,\) it follows that \(x = e^y.\) Performing Implicit Differentiation, we get \[ 1 = e^y \deriv{y}{x} \so \deriv{y}{x} = \frac{1}{e^y} \pd \] But since \(x = e^y,\) we have \begin{equation} \deriv{}{x} \par{\ln x} = \frac{1}{x} \pd \label{eq:deriv-ln-x} \end{equation} It is astonishing that the rate of change of the natural logarithm, defined using the irrational number \(e \approx 2.718,\) turns out to be such a clean result—the reciprocal function. \(\eqrefer{eq:deriv-ln-x}\) is extremely useful and is central to many operations we will perform in future chapters. This result is intuitive because \(y = \ln x\) slows in growth as \(x\) increases; \(\eqref{eq:deriv-ln-x}\) corroborates this observation by asserting that the curve's tangents decrease to \(0\) as \(x \to \infty\) (Figure 1). Paradoxically, although its tangents decrease to \(0\) as \(x\) grows, the function \(\ln x\) grows to infinity as \(x\) approaches infinity—that is, \(\lim_{x \to \infty} \ln x = \infty.\)

Differentiating Logarithms of Any Base \(\eqrefer{eq:deriv-ln-x}\) gives the derivative of a logarithmic function whose base is \(e.\) But if the base is any positive number \(b \ne 1,\) then the Change of Base Formula for Logarithms (from Section 0.9) gives \[\log_b x = \frac{\ln x}{\ln b} \pd\] Since \(b\) is a constant, \(\ln b\) is a constant. Thus, \[\deriv{}{x} \par{\log_b x} = \frac{1}{\ln b} \cdot \deriv{}{x} \par{\ln x} \pd\] Then using \(\eqref{eq:deriv-ln-x}\) gives \begin{equation} \deriv{}{x} \par{\log_b x} = \frac{1}{x \ln b} \pd \label{eq:deriv-log-b} \end{equation} Observe that \(\eqref{eq:deriv-log-b}\) agrees with \(\eqref{eq:deriv-ln-x}\) because \(\ln b = 1\) if \(b = e.\) This explains why we use the number \(e\) in calculus—so that the derivatives of \(e^x\) and \(\ln x\) are convenient to use.

DIFFERENTIATING LOGARITHMIC FUNCTIONS
The derivative of the natural logarithm is given by \begin{equation} \deriv{}{x} \par{\ln x} = \frac{1}{x} \pd \eqlabel{eq:deriv-ln-x} \end{equation} If \(b\) is a positive constant and \(b \ne 1,\) then \begin{equation} \deriv{}{x} \par{\log_b x} = \frac{1}{x \ln b} \pd \eqlabel{eq:deriv-log-b} \end{equation}
EXAMPLE 1
Find the point on the curve \(y = \ln x\) to which the tangent line is parallel to the line \(y = 2 + x/3.\)
Figure 2
The given line has a slope of \(1/3.\) Two lines are parallel to each other if they share the same slope. Hence, we seek the point on \(y = \ln x\) at which the slope is equal to \(1/3.\) Since \(\textderiv{y}{x} = 1/x,\) we see \[\frac{1}{x} = \frac{1}{3} \implies x = 3 \pd\] Thus, the line \(y = 2 + x/3\) is parallel to the tangent line to \(y = \ln x\) at \(\boxed{(3, \ln 3)}\) (Figure 2).
EXAMPLE 2
\[\deriv{}{x} \par{\log_4 x}\]
Applying \(\eqref{eq:deriv-log-b}\) with \(b = 4\) shows \[\deriv{}{x} \par{\log_4 x} = \boxed{\frac{1}{x \ln 4}}\] In words, the derivative is \(1/x\) divided by the natural logarithm of the base \(4.\)
EXAMPLE 3
\[\deriv{}{x} \ln \par{x^5 + 7x - 8}\]
By the Chain Rule, \[ \ba \deriv{}{x} \ln \par{x^5 + 7x - 8} &= \frac{1}{x^5 + 7x - 8} \deriv{}{x} \par{x^5 + 7x - 8} \nl &= \boxed{\frac{5x^4 + 7}{x^5 + 7x - 8}} \ea \]
EXAMPLE 4
\[\deriv{}{x} (\ln \abs x)\]
Note that \[ \ln \abs x = \bc \ln x & x \gt 0 \nl \ln(-x) &x \lt 0 \pd \ec \] Differentiating each definition shows \[ \deriv{}{x} (\ln \abs x) = \bc \dfrac{1}{x} & x \gt 0 \nl \dfrac{1}{-x} (-1) = \dfrac{1}{x} &x \lt 0 \pd \ec \]

The result of Example 4 is an extension of \(\eqref{eq:deriv-ln-x}\) and should be remembered: \begin{equation} \deriv{}{x} (\ln \abs x) = \frac{1}{x} \pd \label{eq:deriv-ln|x|} \end{equation} In Chapter 4 we'll need the natural logarithm to be defined for all nonzero values, so \(\eqref{eq:deriv-ln|x|}\) will be important.

Logarithmic Differentiation

To differentiate an expression that contains many powers, products, and quotients, it's often tedious to use just the differentiation rules we have learned so far. But logarithms transform products and quotients into sums and differences, and they convert powers into multiples. Thus, Logarithmic Differentiation is an easier method for differentiating combinations of powers, multiples, and quotients. Let's refresh ourselves on logarithm laws, shown below.

LOGARITHM LAWS
For all real \(p\) and positive \(a\) and \(b,\)
  1. \(\ln(ab) = \ln a + \ln b.\)
  2. \(\ds \ln \par{\frac{a}{b}} = \ln a - \ln b.\)
  3. \(\ln \par{a^p} = p \ln a.\)
LOGARITHMIC DIFFERENTIATION
To find \(\textDeriv{y}{x}\) for \(y = f(x)\) using Logarithmic Differentiation, use the following steps:
  1. Take the natural logarithm of both sides to get \begin{equation} \label{eq:step-1} \ln y = \ln[f(x)] \pd \end{equation} Use logarithm laws to expand \(\ln[f(x)]\) into a sum or difference of logarithms. If \(f(x) \lt 0\) for some values of \(x,\) then write \(\ln \abs y = \ln \abs{f(x)}\) and use \(\eqref{eq:deriv-ln|x|}.\)
  2. Differentiate both sides of \(\eqrefer{eq:step-1}\) implicitly; the resulting left-hand expression is \((1/y) \, \textderiv{y}{x}.\)
  3. Solve for \(\textDeriv{y}{x}\) by multiplying both sides by \(y = f(x).\)
EXAMPLE 5
Use Logarithmic Differentiation to differentiate \[y = \frac{x^5 \, \sqrt[3]{x^2 + 1}}{\cos^2 x}\]
It would be highly strenuous to use the Product and Quotient Rules. Instead, we take the natural logarithm of both sides and apply logarithm laws, as follows: \[ \ba \ln y &= \ln \par{\frac{x^5 \, \sqrt[3]{x^2 + 1}}{\cos^2 x}} \nl &= \ln \par{x^5} + \ln \par{x^2 + 1}^{1/3} - \ln (\cos^2 x) \nl &= 5 \ln x + \tfrac{1}{3} \ln \par{x^2 + 1} - 2 \ln (\cos x) \pd \ea \] Using Implicit Differentiation, we get \[ \ba \frac{1}{y} \deriv{y}{x} &= \frac{5}{x} + \frac{1}{3} \par{\frac{2x}{x^2 + 1}} - 2 \par{\frac{-\sin x}{\cos x}} \nl &= \frac{5}{x} + \frac{2x}{3x^2 + 3} + 2 \tan x \pd \ea \] Solving for \(\textderiv{y}{x}\) and remembering the explicit formula for \(y,\) we attain \[ \ba \deriv{y}{x} &= y \par{\frac{5}{x} + \frac{2x}{3x^2 + 3} + 2 \tan x} \nl &= \boxed{\frac{x^5 \, \sqrt[3]{x^2 + 1}}{\cos^2 x} \par{\frac{5}{x} + \frac{2x}{3x^2 + 3} + 2 \tan x}} \ea \]
EXAMPLE 6
\[\deriv{}{x} \par{x^{\sqrt[3] x}}\]

Both the base and power are variable, so we cannot use the Power Rule. Instead, there are two viable options—using Logarithmic Differentiation or converting the base to be \(e.\)

Method 1 Taking the natural logarithm of both sides of \(y = x^{\sqrt[3] x}\) gives \[ \ba \ln y &= \ln \par{x^{\sqrt[3] x}} \nl &= \sqrt[3] x \, \ln x \nl &= x^{1/3} \ln x \pd \ea \] Performing Implicit Differentiation, we have \[ \ba \frac{1}{y} \deriv{y}{x} &= \par{\tfrac{1}{3} x^{-2/3}} \ln x + x^{1/3} \par{\frac{1}{x}} \nl &= \frac{\ln x}{3 x^{2/3}} + \frac{1}{x^{2/3}} \nl &= \frac{\ln x + 3}{3 x^{2/3}} \pd \ea \] Solving for \(\textderiv{y}{x}\) (and remembering \(y = x^{\sqrt[3] x}\)), we attain \[ \ba \deriv{y}{x} &= y \par{\frac{\ln x + 3}{3 x^{2/3}}} \nl &= \boxed{x^{\sqrt[3] x} \par{\frac{\ln x + 3}{3 x^{2/3}}}} \ea \]

Method 2 Note that \[x^{\sqrt[3] x} = \par{e^{\ln x}}^{\sqrt[3] x} = e^{\sqrt[3] x \, \ln x} \pd\] By the Chain Rule, \[ \ba \deriv{}{x} \par{e^{\sqrt[3] x \, \ln x}} &= e^{\sqrt[3] x \, \ln x} \deriv{}{x} \par{\sqrt[3] x \, \ln x} \nl &= e^{\sqrt[3] x \, \ln x} \par{\frac{\ln x + 3}{3 x^{2/3}}} \nl &= \boxed{x^{\sqrt[3] x} \par{\frac{\ln x + 3}{3 x^{2/3}}}} \ea \]

EXAMPLE 7
If \(y = e^{\sin x},\) then find \(\textDeriv{y}{x}.\)
It's possible to use the Chain Rule to find \(\textDeriv{y}{x},\) but using logarithms is an alternate method. Taking the natural logarithm of both sides of \(y = e^{\sin x},\) we get \[ \ba \ln y &= \ln \left(e^{\sin x}\right) \nl &= (\sin x) \ln e \pd \ea \] Because \(\ln e = 1,\) we have \begin{equation} \label{eq:ex-1-lny} \ln y = \sin x \pd \end{equation} We perform Implicit Differentiation with respect to \(x\) to solve for \(\textDeriv{y}{x}.\) Differentiating both sides of \(\eqRefer{eq:ex-1-lny}\) gives \[\frac{1}{y} \deriv{y}{x} = \cos x \pd\] We multiply both sides by \(y = e^{\sin x}\) to isolate \(\textDeriv{y}{x} \col\) \[ \ba \deriv{y}{x} &= \boxed{e^{\sin x} \cos x} \ea \]
EXAMPLE 8
If \(y = x \sin^2 x,\) then find \(\textDeriv{y}{x}.\)
The function \(y = x \sin^2 x\) can be negative for some values of \(x,\) so we write \[\abs y = \abs{x \sin^2 x} = \abs{x (\sin x)^2} \pd\] We take the natural logarithm of both sides and use logarithm properties to get \[ \ba \ln \abs y &= \ln \abs{x (\sin x)^2} \nl &= \ln \abs x + 2 \ln \abs{\sin x} \pd \ea \] We differentiate both sides with respect to \(x.\) Using \(\eqref{eq:deriv-ln|x|}\) gives \[ \ba \frac{1}{y} \deriv{y}{x} &= \frac{1}{x} + \frac{2 \cos x}{\sin x} \pd \ea \] At this point we solve for \(\textDeriv{y}{x}.\) Multiplying both sides by \(y = x \sin^2 x\) yields \[ \ba \deriv{y}{x} &= x \sin^2 x \left(\frac{1}{x} + \frac{2 \cos x}{\sin x}\right) \nl &= \boxed{\sin^2 x + 2 x \cos x \sin x} \ea \]
EXAMPLE 9
Find \(\textDeriv{y}{x}\) if \[y = \sqrt{\frac{x^2 \sin x}{e^x}} \pd \]
Assuming the expression on the right is positive, we first take the natural logarithm of both sides: \begin{equation} \ln y = \ln \par{\sqrt{\frac{x^2 \sin x}{e^x}}} \pd \label{eq:sqrt} \end{equation} The square root of a value is equivalent to raising the value to the power of \(1/2.\) Thus, logarithm properties allow us to rewrite the right side of \(\eqref{eq:sqrt}\) as \[ \ba \tfrac{1}{2} \ln \par{\frac{x^2 \sin x}{e^x}} &= \tfrac{1}{2} \ln \left(x^2 \sin x\right) - \tfrac{1}{2} \ln(e^x) \nl &= \tfrac{1}{2} \ln(x^2) + \tfrac{1}{2} \ln(\sin x) - \tfrac{1}{2} x \nl &= \ln \abs x + \tfrac{1}{2} \ln(\sin x) - \tfrac{1}{2} x \pd \ea \] Hence, \(\eqRefer{eq:sqrt}\) becomes \[\ln y = \ln \abs x + \tfrac{1}{2} \ln(\sin x) - \tfrac{1}{2} x \pd\] We use Implicit Differentiation with respect to \(x\) to find \(\textDeriv{y}{x} \col\) \[ \ba \frac{1}{y} \deriv{y}{x} &= \frac{1}{x} + \frac{\cos x}{2 \sin x} - \frac{1}{2} \nl \deriv{y}{x} &= y \left(\frac{1}{x} + \frac{\cos x}{2 \sin x} - \frac{1}{2}\right) \nl &= \boxed{\sqrt{\frac{x^2 \sin x}{e^x}} \left(\frac{1}{x} + \frac{1}{2} \cot x - \frac{1}{2}\right)} \ea \]

The Number \(e\) as a Limit

Since \(e\) is prevalent in calculus, we often need to recognize limits as disguised versions of \(e.\) If \(f(x) = \ln x,\) then \(f'(x) = 1/x\) and so \(f'(1) = 1.\) From the limit definition of a derivative, we get \[ \ba f'(1) &= \lim_{h \to 0} \frac{f(1 + h) - f(1)}{h} \nl &= \lim_{h \to 0} \frac{\ln(1 + h) - \ln 1}{h} \nl &= \lim_{h \to 0} \frac{1}{h} \ln (1 + h) \nl &= \lim_{h \to 0} \ln(1 + h)^{1/h} \pd \ea \] Since \(f'(1) = 1,\) we have \[1 = \lim_{h \to 0} \ln(1 + h)^{1/h} \pd\] Raising \(e\) to the power of each side, and noting that the exponential function is continuous, we see \begin{align} e^1 &= e^{\lim_{h \to 0} \ln(1 + h)^{1/h}} \nonum \nl e &= \lim_{h \to 0} e^{\ln (1 + h)^{1/h}} \nonum \nl e &= \lim_{h \to 0} (1 + h)^{1/h} \pd \label{eq:e-lim-x} \end{align}

Exponential Function Raising both sides of \(\eqref{eq:e-lim-x}\) to the power of \(x\) shows \[ \ba e^x &= \parbr{\lim_{h \to 0} (1 + h)^{1/h}}^x \nl &= \lim_{h \to 0} (1 + h)^{x/h} \pd \ea \] By letting \(n = x/h,\) we note that \(n \to \infty\) as \(h \to 0^+.\) Because \(h = x/n,\) the limit becomes \begin{equation} e^x = \lim_{n \to \infty} \par{1 + \frac{x}{n}}^n \pd \label{eq:exp-lim} \end{equation} Taking \(x = 1\) gives another limit representation of \(e \col\) \begin{equation} e = \lim_{n \to \infty} \par{1 + \frac{1}{n}}^n \pd \label{eq:e-lim} \end{equation} This limit is famous, and in Chapter 8 we will investigate this limit's presence in compound interest.

EXPONENTIAL FUNCTION DEFINED BY A LIMIT
The exponential function is given by the limit \begin{equation} e^x = \lim_{n \to \infty} \par{1 + \frac{x}{n}}^n \pd \eqlabel{eq:exp-lim} \end{equation}
EXAMPLE 10
\[\lim_{n \to \infty} \par{\frac{5 + 2n}{2n}}^n\]
Rewriting the limit shows \[ \ba \lim_{n \to \infty} \par{\frac{5 + 2n}{2n}}^n &= \lim_{n \to \infty} \par{1 + \frac{5/2}{n}}^n \pd \ea \] By comparison to \(\eqref{eq:exp-lim},\) we see \(x = 5/2.\) So the limit equals \(\boxed{e^{5/2}}.\)

Derivatives of Logarithmic Functions The natural logarithm is the inverse function of \(e^x.\) We denote the natural logarithm as \(\ln x,\) whose base is \(e\) and derivative is \begin{equation} \deriv{}{x} \par{\ln x} = \frac{1}{x} \pd \eqlabel{eq:deriv-ln-x} \end{equation} If \(b\) is a positive constant and \(b \ne 1,\) then \begin{equation} \deriv{}{x} \par{\log_b x} = \frac{1}{x \ln b} \pd \eqlabel{eq:deriv-log-b} \end{equation} The following derivative is also noteworthy: \begin{equation} \deriv{}{x} (\ln \abs x) = \frac{1}{x} \pd \eqlabel{eq:deriv-ln|x|} \end{equation}

Logarithmic Differentiation Logarithmic Differentiation is an application of Implicit Differentiation that allows for simpler differentiation of products, quotients, and powers of functions. If \(y = f(x),\) then to find \(\textDeriv{y}{x}\) using Logarithmic Differentiation, use the following steps.

  1. Take the natural logarithm of both sides to get \begin{equation} \ln y = \ln[f(x)] \pd \eqlabel{eq:step-1} \end{equation} Use logarithm laws to expand \(\ln[f(x)]\) into a sum or difference of logarithms.
  2. Differentiate both sides of \(\eqrefer{eq:step-1}\) implicitly; the resulting left-hand expression is \((1/y) \, \textderiv{y}{x}.\)
  3. Solve for \(\textDeriv{y}{x}\) by multiplying both sides by \(y = f(x).\)

The Number \(e\) as a Limit The exponential function is given by the limit \begin{equation} e^x = \lim_{n \to \infty} \par{1 + \frac{x}{n}}^n \pd \eqlabel{eq:exp-lim} \end{equation} The number \(e\) has the following limit representation: \begin{equation} e = \lim_{n \to \infty} \par{1 + \frac{1}{n}}^n \pd \eqlabel{eq:e-lim} \end{equation}