Skip to main content

Section 3.3 Logarithmic Differentiation

We’re going to start with a quick fact about logs and their derivatives. The derivative rule for \(\ddx{\ln(x)}\) is still relatively new for us, so it is ok to still be getting comfortable with it, but we should notice this nice fact.
Throughout this section, the goal is to convince any open-minded readers of one thing:
Logs are friends.
Let us be informal and technically not quite correct but hopefully clear in this. Logs really are friendly mathematical objects. They were created to be friendly objects! In a time when doing arithmetic with large numbers was difficult due to a lack of computing technology, logs were introduced to make arithmetic easier.
The general idea is that, if there is some kind of hierarchy of operations, then logs transform operations between things into different operations that are lower on the hierarchy of operations. So logs turn things like products (repeated addition) and quotients (repeated subtraction) into addition and subtraction. Logs turn exponents (repeated multiplication) into coefficients.
Using math notation, we can write the following log properties.

Subsection Logs Are Friends!

Ok, so how will we use these new-found friends? We’re going to think about some functions (and combinations of functions) that are new to us and that aren’t so clear for us to use things like the Product, Quotient, or the Chain Rule. We’ll try to use logs to rewrite our functions into some easier to approach implicitly defined relationships in order for us to differentiate.
But first, let’s build an explanation for the Power Rule for Derivatives.

Activity 3.3.1. Returning to the Power Rule.

Back in Section 2.3 we built an explanation for why \(\ddx{x^n}=nx^{n-1}\) that relied on thinking about exponents as repeated multiplication: it relied on \(n\) being some positive integer. We said, at the time, that the Power Rule generalizes and works for any integer, but did so without explanation.
Let’s consider \(y=x^n\) where \(n\) is just some real number without any other restrictions.
(a)
Apply a logarithm to both sides of this equation:
\begin{equation*} \ln(y) = \ln(x^n) \end{equation*}
Now use one of the Properties of Logarithms to rewrite this equation.
(b)
Use implicit differentiation to find \(\dydx\) or \(y'\text{.}\)
Hint.
Remember that when you solve for \(\dydx\) or \(y'\text{,}\) you might have some \(y\)-variables in your derivative. Replace them with \(y=x^n\text{.}\)
(c)
Explain to yourself why this is equivalent to the Power Rule that we built so long ago:
\begin{equation*} \ddx{x^n}=nx^{n-1}\text{.} \end{equation*}
(d)
Let’s get weird. What if we have a not-quite-power function? Where the thing in the exponent isn’t simply a number, but another variable?
Let’s use the same technique to think about \(y=x^x\) and its derivative. First, though, confirm that this is not a power function (and so we cannot use the Power Rule to find the derivative) and is also not an exponential function (and so the derivative isn’t itself or itself scaled by a log).
(e)
Now apply a log to both sides:
\begin{equation*} \ln(y) = \ln(x^x)\text{.} \end{equation*}
Rewrite this using the same log property as before, and then use implicit differentiation to find \(\dydx\) or \(y'\text{.}\)
Hint.
Don’t forget that in order to find \(\dydx{x\ln(x)}\text{,}\) we need to use the Product Rule.
(f)
Explain to yourself why logs are friends, especially when trying to differentiate functions in the form of \(y=\left(f(x)\right)^{g(x)}\text{.}\)
This idea that we’ve just implemented (applying a logarithm to make some function more friendly and then using implicit differentiation to differentiate) is often called logarithmic differentiation. It works so well because logs are friends.

Subsection Wow, So Friendly!

This is incredible! We can now differentiate a whole new class of functions! Functions raised to functions, what could we think of next!
How about products and quotients of functions? I know, I know, we have The Product and Quotient Rules...what about big products and quotients? Annoying ones. Complicated ones.

Activity 3.3.2. Logarithmic Differentiation with Products and Quotients.

Let’s say we’ve got some function that has products and quotients in it. Like, a lot. Consider the function:
\begin{equation*} y=\frac{(x-4)^2\sqrt{3x+1}}{(x+1)^7(x+5)^3}\text{.} \end{equation*}
(a)
Work out a general strategy for how you would find \(y'\) directly. Where would you have to use Quotient Rule? What are the pieces? Where would you have to use Product Rule? What are the pieces? Where would you have to use the Chain Rule? What are the pieces?
To be clear: do not actually differentiate this. Just look at it in horror and try to outline a plan that some other fool would use.
Solution.
\begin{align*} \dydx \amp =\ddx{\frac{(x-4)^2\sqrt{3x+1}}{(x+1)^7(x+5)^3}}\\ \amp = \dfrac{ (x+1)^7(x+5)^3\ddx{\overbrace{(x-4)^2\sqrt{3x+1}}^{\text{Product Rule}}} - (x-4)^2\sqrt{3x+1} \ddx{\overbrace{(x+1)^7(x+5)^3}^{\text{Product Rule}}}}{((x+1)^7(x+5)^3)^2}\\ \amp = \frac{(x+1)^7(x+5)^3\left(2(x-4)\sqrt{3x+1} + \frac{3(x-4)^2}{2\sqrt{3x+1}}\right) - (x-4)^2\sqrt{3x+1}\left(7(x+1)^6(x+5)^3 + 3(x+1)^7(x+5)^2\right)}{(x+1)^{14}(x+5)^{6}} \end{align*}
What now? Can we “simplify” this somehow? Maybe, but I am not doing any more of this!
(b)
Let’s instead use logarithmic differentiation. First, apply the log to both sides to get:
\begin{equation*} \ln(y) = \ln\left(\frac{(x-4)^2\sqrt{3x+1}}{(x+1)^7(x+5)^3}\right)\text{.} \end{equation*}
Since this function is just a bunch of products of things with exponents all put into some big quotient, we can use our log properties to rewrite this!
(c)
We should have:
\begin{equation*} \ln(y) = 2\ln(x-4)+\frac{1}{2}\ln(3x+1) - 7\ln(x+1) - 3\ln(x+5)\text{.} \end{equation*}
Confirm this.
(d)
Now differentiate both sides! You’ll have to use some Chain Rule (but not a lot)! Refer back to Fact 3.3.1 for help here.
(e)
Solve for \(\dydx\) or \(y'\text{.}\)
(f)
While this is not a nice looking expression for the derivative, spend some time confirming that this was a nicer process than differentiating directly. This is because logs are friends.
So how do we wrap this up? I hope we can see that logs are a useful and powerful tool: we can use logarithmic differentiation to transform our functions to become “easier to work with” versions of themselves: we put everything on a log-scale and allow our properties of logarithms to make the operations become a bit more accessible.
This is a commonly used trick in many applications of calculus. Specifically, this is used often enough in statistics that there is a whole paradigm of estimation (called Maximum Likelihood Estimation) that uses a log-transformed version of a likelihood function and then applies some basic calculus ideas (that we’ll cover in Section 4.5) to perform some powerful estimations.
While I hope that we end up leaving this section knowing that logs are friends, we can probably add a second (and related result) that we’re using over and over.
Using the Chain Rule is probably easier than any other option.
We apply logs in order to rewrite these functions in a friendly way because we would rather use the Chain Rule than any combination of other derivative strategies.

Practice Problems Practice Problems

1.

For each of the following functions, find the derivatives in two ways: directly, and after using properties of logs or exponentials to rewrite the function and differentiate.
(a)
\(f(x) = \ln\left(\sqrt{5x^2e^x}\right)\)
(b)
\(g(x) = \left(e^{5x^3+\ln(x)}\right)^7\)

2.

Use logarithmic differentiation to find the derivative of each of the following.
(c)
\(y = (x+5)^6(x-5)^9(3x+1)^3\)
(d)
\(y = \dfrac{(x+2)^{2/3}(x+5)^{7/3}}{(x-4)^{5/3}}\)

3.

For the function \(f(x)=x^2e^{-x^2}\text{,}\) find the points where the graph of \(f\) has horizontal tangent lines.