Paul's Online Notes
Paul's Online Notes
Home / Calculus I / Derivatives / Logarithmic Differentiation
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best views in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (should be able to scroll to see them) and some of the menu items will be cut off due to the narrow screen width.

Section 3.13 : Logarithmic Differentiation

There is one last topic to discuss in this section. Taking the derivatives of some complicated functions can be simplified by using logarithms. This is called logarithmic differentiation.

It’s easiest to see how this works in an example.

Example 1 Differentiate the function. \[y = \frac{{{x^5}}}{{\left( {1 - 10x} \right)\sqrt {{x^2} + 2} }}\]
Show Solution

Differentiating this function could be done with a product rule and a quotient rule. However, that would be a fairly messy process. We can simplify things somewhat by taking logarithms of both sides.

\[\ln y = \ln \left( {\frac{{{x^5}}}{{\left( {1 - 10x} \right)\sqrt {{x^2} + 2} }}} \right)\]

Of course, this isn’t really simpler. What we need to do is use the properties of logarithms to expand the right side as follows.

\[\begin{align*}\ln y & = \ln \left( {{x^5}} \right) - \ln \left( {\left( {1 - 10x} \right)\sqrt {{x^2} + 2} } \right)\\ \ln y & = \ln \left( {{x^5}} \right) - \ln \left( {1 - 10x} \right) - \ln \left( {\sqrt {{x^2} + 2} } \right)\end{align*}\]

This doesn’t look all that simple. However, the differentiation process will be simpler. What we need to do at this point is differentiate both sides with respect to \(x\). Note that this is really implicit differentiation.

\[\begin{align*}\frac{{y'}}{y} & = \frac{{5{x^4}}}{{{x^5}}} - \frac{{ - 10}}{{1 - 10x}} - \frac{{\frac{1}{2}{{\left( {{x^2} + 2} \right)}^{ - \frac{1}{2}}}\left( {2x} \right)}}{{{{\left( {{x^2} + 2} \right)}^{\frac{1}{2}}}}}\\ \frac{{y'}}{y} & = \frac{5}{x} + \frac{{10}}{{1 - 10x}} - \frac{x}{{{x^2} + 2}}\end{align*}\]

To finish the problem all that we need to do is multiply both sides by \(y\) and the plug in for \(y\) since we do know what that is.

\[\begin{align*}y' & = y\left( {\frac{5}{x} + \frac{{10}}{{1 - 10x}} - \frac{x}{{{x^2} + 2}}} \right)\\ & = \frac{{{x^5}}}{{\left( {1 - 10x} \right)\sqrt {{x^2} + 2} }}\left( {\frac{5}{x} + \frac{{10}}{{1 - 10x}} - \frac{x}{{{x^2} + 2}}} \right)\end{align*}\]

Depending upon the person, doing this would probably be slightly easier than doing both the product and quotient rule. The answer is almost definitely simpler than what we would have gotten using the product and quotient rule.

So, as the first example has shown we can use logarithmic differentiation to avoid using the product rule and/or quotient rule.

We can also use logarithmic differentiation to differentiate functions in the form.

\[y = {\left( {f\left( x \right)} \right)^{g\left( x \right)}}\]

Let’s take a quick look at a simple example of this.

Example 2 Differentiate \(y = {x^x}\).
Show Solution

We’ve seen two functions similar to this at this point.

\[\frac{d}{{dx}}\left( {{x^n}} \right) = n{x^{n - 1}}\hspace{0.5in}\frac{d}{{dx}}\left( {{a^x}} \right) = {a^x}\ln a\]

Neither of these two will work here since both require either the base or the exponent to be a constant. In this case both the base and the exponent are variables and so we have no way to differentiate this function using only known rules from previous sections.

With logarithmic differentiation we can do this however. First take the logarithm of both sides as we did in the first example and use the logarithm properties to simplify things a little.

\[\begin{align*}\ln y & = \ln {x^x}\\ \ln y & = x\ln x\end{align*}\]

Differentiate both sides using implicit differentiation.

\[\frac{{y'}}{y} = \ln x + x\left( {\frac{1}{x}} \right) = \ln x + 1\]

As with the first example multiply by \(y\) and substitute back in for \(y\).

\[\begin{align*}y' & = y\left( {1 + \ln x} \right)\\ & = {x^x}\left( {1 + \ln x} \right)\end{align*}\]

Let’s take a look at a more complicated example of this.

Example 3 Differentiate \(y = {\left( {1 - 3x} \right)^{\cos \left( x \right)}}\).
Show Solution

Now, this looks much more complicated than the previous example, but is in fact only slightly more complicated. The process is pretty much identical, so we first take the log of both sides and then simplify the right side.

\[\ln y = \ln \left[ {{{\left( {1 - 3x} \right)}^{\cos \left( x \right)}}} \right] = \cos \left( x \right)\ln \left( {1 - 3x} \right)\]

Next, do some implicit differentiation.

\[\frac{{y'}}{y} = - \sin \left( x \right)\ln \left( {1 - 3x} \right) + \cos \left( x \right)\frac{{ - 3}}{{1 - 3x}} = - \sin \left( x \right)\ln \left( {1 - 3x} \right) - \cos \left( x \right)\frac{3}{{1 - 3x}}\]

Finally, solve for \(y'\) and substitute back in for \(y\).

\[\begin{align*}y' & = - y\left( {\sin \left( x \right)\ln \left( {1 - 3x} \right) + \cos \left( x \right)\frac{3}{{1 - 3x}}} \right)\\ & = - {\left( {1 - 3x} \right)^{\cos \left( x \right)}}\left( {\sin \left( x \right)\ln \left( {1 - 3x} \right) + \cos \left( x \right)\frac{3}{{1 - 3x}}} \right)\end{align*}\]

A messy answer but there it is.

We’ll close this section out with a quick recap of all the various ways we’ve seen of differentiating functions with exponents. It is important to not get all of these confused.

\[\begin{array}{ll}\displaystyle \frac{d}{{dx}}\left( {{a^b}} \right) = 0 & \hspace{1.0in}{\mbox{This is a constant}}\\ \displaystyle \frac{d}{{dx}}\left( {{x^n}} \right) = n{x^{n - 1}} & \hspace{1.0in}{\mbox{Power Rule}}\\ \displaystyle \frac{d}{{dx}}\left( {{a^x}} \right) = {a^x}\ln a & \hspace{1.0in}{\mbox{Derivative of an exponential function}}\\ \displaystyle \frac{d}{{dx}}\left( {{x^x}} \right) = {x^x}\left( {1 + \ln x} \right) & \hspace{1.0in}{\mbox{Logarithmic Differentiation}}\end{array}\]

It is sometimes easy to get these various functions confused and use the wrong rule for differentiation. Always remember that each rule has very specific rules for where the variable and constants must be. For example, the Power Rule requires that the base be a variable and the exponent be a constant, while the exponential function requires exactly the opposite.

If you can keep straight all the rules you can’t go wrong with these.