3.10 A Bag of Logarithmic Tricks

Story (The Astronomer’s Lifesaver).

In the early 17th century, before the dawn of mechanical calculators, astronomers and navigators spent agonizing portions of their lives multiplying gargantuan numbers to predict celestial motions. The Scottish mathematician John Napier introduced a radical parlor trick in 1614: a mathematical function that could metamorphose painful multiplication into gentle addition. This conceptual leap—the logarithm—remains one of the most powerful algebraic tools in modern calculus.

Before we engage in the algebraic gymnastics of logarithmic differentiation, we must firmly ground ourselves in the two fundamental derivatives of exponential and logarithmic functions:

dd⁢x⁢(ex)=ex,dd⁢x⁢(log⁡|x|)=1x(x≠0).\frac{\mathrm{d}}{\mathrm{d}x}\left(\mathrm{e}^{x}\right)=\mathrm{e}^{x},% \qquad\frac{\mathrm{d}}{\mathrm{d}x}\left(\log\left\lvert x\right\rvert\right)% =\frac{1}{x}\quad(x\neq 0).

It is a central philosophy in mathematics to reduce the unfamiliar to the familiar. How do we differentiate log10⁡x\log_{10}x or 2x2^{x}? Rather than memorizing an endless catalog of new rules, we manipulate the expressions back to our native base, e\mathrm{e}.

Example 3.10.1.

Let f⁢(x)=2xf(x)=2^{x}. Find f′⁢(x)f^{\prime}(x).

Solution.

We again use the logarithm to free the variable xx from the exponent:

log⁡f⁢(x)=log⁡(2x)=x⁢log⁡2.\log f(x)=\log(2^{x})=x\log 2.

Differentiating both sides implicitly with respect to xx requires the chain rule on the left-hand side:

(log⁡f⁢(x))′=(x⁢log⁡2)′1f⁢(x)⁢f′⁢(x)=log⁡2.\begin{split}(\log f(x))^{\prime}&{}=(x\log 2)^{\prime}\\ \frac{1}{f(x)}f^{\prime}(x)&{}=\log 2.\end{split}

Solving for f′⁢(x)f^{\prime}(x) and substituting our original function f⁢(x)=2xf(x)=2^{x} back into the expression yields:

f′⁢(x)=f⁢(x)⁢log⁡2=2x⁢log⁡2.f^{\prime}(x)=f(x)\log 2=2^{x}\log 2.

∎

Example 3.10.2.

Let f⁢(x)=log10⁡xf(x)=\log_{10}x. Find f′⁢(x)f^{\prime}(x).

Solution.

We begin by invoking the fundamental definition of the logarithm to unpack the function:

10f⁢(x)=10log10⁡x=x.10^{f(x)}=10^{\log_{10}x}=x.

By taking the natural logarithm of both sides, we project the equation into our preferred base:

log⁡(10f⁢(x))=log⁡x.\log\left(10^{f(x)}\right)=\log x.

Applying the exponent rule log⁡(ab)=b⁢log⁡a\log(a^{b})=b\log a, we pull the function down from the exponent:

f⁢(x)⁢log⁡10=log⁡x⟹f⁢(x)=log⁡xlog⁡10.f(x)\log 10=\log x\implies f(x)=\frac{\log x}{\log 10}.

Now, differentiation is trivial. Because 1log⁡10\frac{1}{\log 10} is merely a constant scalar, we apply the standard derivative for the natural logarithm:

f′⁢(x)=1log⁡10⁢(log⁡x)′=1log⁡10⋅1x=1x⁢log⁡10.f^{\prime}(x)=\frac{1}{\log 10}(\log x)^{\prime}=\frac{1}{\log 10}\cdot\frac{1% }{x}=\frac{1}{x\log 10}.

∎

Exercise 3.10.3.

Test your intuition by generalizing the previous examples. Find the derivative of:

  1. 1.
    ​

    f⁢(x)=loga⁡xf(x)=\log_{a}x, where a>0a>0 and x>0x>0.

  2. 2.
    ​

    f⁢(x)=axf(x)=a^{x}, where a>0a>0.

We now confront a more stubborn class of functions. What happens when the base and the exponent are both variables? Consider f⁢(x)=(x2+1)sin⁡xf(x)=(x^{2}+1)^{\sin x}. The power rule requires a constant exponent. The exponential rule requires a constant base. Here, both rules fail entirely.

Intuition (Log as an Algebraic Hammer).

When dealing with variables in both the base and the exponent, the logarithm acts as an algebraic “lowering operator.” By taking the logarithm of both sides, we convert a tricky exponentiation into a more manageable multiplication, perfectly poised for the product rule. This is the essence of logarithmic differentiation.

Example 3.10.4.

Find the derivative of f⁢(x)=(x2+1)sin⁡xf(x)=(x^{2}+1)^{\sin x}.

Solution.

Take the natural logarithm of both sides to bring the trigonometric exponent down to the baseline:

log⁡f⁢(x)=log⁡[(x2+1)sin⁡x]=(sin⁡x)⁢log⁡(x2+1).\log f(x)=\log\left[(x^{2}+1)^{\sin x}\right]=(\sin x)\log(x^{2}+1).

We now differentiate implicitly with respect to xx. The left side requires the chain rule, while the right side demands the product rule.

(log⁡f⁢(x))′=[(sin⁡x)⁢log⁡(x2+1)]′1f⁢(x)⋅f′⁢(x)=(sin⁡x)′⁢log⁡(x2+1)+sin⁡x⁢(log⁡(x2+1))′f′⁢(x)f⁢(x)=(cos⁡x)⁢log⁡(x2+1)+(sin⁡x)⋅1x2+1⋅(x2+1)′f′⁢(x)f⁢(x)=(cos⁡x)⁢log⁡(x2+1)+sin⁡xx2+1⁢(2⁢x).\begin{split}(\log f(x))^{\prime}&{}=\left[(\sin x)\log(x^{2}+1)\right]^{% \prime}\\ \frac{1}{f(x)}\cdot f^{\prime}(x)&{}=(\sin x)^{\prime}\log(x^{2}+1)+\sin x% \left(\log(x^{2}+1)\right)^{\prime}\\ \frac{f^{\prime}(x)}{f(x)}&{}=(\cos x)\log(x^{2}+1)+(\sin x)\cdot\frac{1}{x^{2% }+1}\cdot(x^{2}+1)^{\prime}\\ \frac{f^{\prime}(x)}{f(x)}&{}=(\cos x)\log(x^{2}+1)+\frac{\sin x}{x^{2}+1}(2x)% .\end{split}

Multiplying both sides by f⁢(x)f(x) yields:

f′⁢(x)=f⁢(x)⁢[(cos⁡x)⁢log⁡(x2+1)+2⁢x⁢sin⁡xx2+1].f^{\prime}(x)=f(x)\left[(\cos x)\log(x^{2}+1)+\frac{2x\sin x}{x^{2}+1}\right].

Finally, we substitute the original expression for f⁢(x)f(x):

f′⁢(x)=(x2+1)sin⁡x⁢[(cos⁡x)⁢log⁡(x2+1)+2⁢x⁢sin⁡xx2+1].f^{\prime}(x)=(x^{2}+1)^{\sin x}\left[(\cos x)\log(x^{2}+1)+\frac{2x\sin x}{x^% {2}+1}\right].

∎

Exercise 3.10.5.

Suppose f⁢(x)f(x) and g⁢(x)g(x) are differentiable functions such that f⁢(x)>0f(x)>0. Show your mastery of logarithmic differentiation by finding the derivative of:

F⁢(x)=[f⁢(x)]g⁢(x).F(x)=\left[f(x)\right]^{g(x)}.
Caveat (The Tower of Powers).

Students are often tempted to differentiate F⁢(x)=f⁢(x)g⁢(x)F(x)=f(x)^{g(x)} by treating it either as a power function (bringing down the g⁢(x)g(x)) or an exponential function. It is neither! The base and the exponent are both moving targets. Logarithmic differentiation is the only robust way to tame this beast.

The classic identities of logarithms—namely log⁡(a⁢b)=log⁡a+log⁡b\log(ab)=\log a+\log b and log⁡(a/b)=log⁡a−log⁡b\log(a/b)=\log a-\log b—are not just theoretical niceties; they are practical imperatives. Before diving into calculus, one should always ask if algebra can simplify the landscape.

Example 3.10.6.

Find the derivative of y=x2/3⁢x2+1(2⁢x+1)3y=\frac{x^{2/3}\sqrt{x^{2}+1}}{(2x+1)^{3}}.

Solution.

We are faced with a choice of strategy.

  1. 1.
    ​

    Approach 1: Quotient Rule Immediately (Good luck!). Differentiating this heinous rational function would require nested applications of the quotient rule, product rule, and chain rule. While mathematically valid, this path is an exercise in masochism and invites countless algebra errors.

  2. 2.
    ​

    Approach 2: Simplify by Log First. We can evaluate d⁢yd⁢x\frac{\mathrm{d}y}{\mathrm{d}x} by observing that

    log⁡y=23⁢log⁡x+12⁢log⁡(x2+1)−3⁢log⁡(2⁢x+1),\log y=\frac{2}{3}\log x+\frac{1}{2}\log(x^{2}+1)-3\log(2x+1),

    and differentiating gives

    1y⁢d⁢yd⁢x=23⁢x+xx2+1−62⁢x+1,\frac{1}{y}\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{2}{3x}+\frac{x}{x^{2}+1}-% \frac{6}{2x+1},

    which we solve to get

    d⁢yd⁢x=x2/3⁢x2+1(2⁢x+1)3⁢(23⁢x+xx2+1−62⁢x+1).\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{x^{2/3}\sqrt{x^{2}+1}}{(2x+1)^{3}}\left(% \frac{2}{3x}+\frac{x}{x^{2}+1}-\frac{6}{2x+1}\right).

∎

Moral (Look Before You Leap).

Never underestimate the power of preprocessing your functions algebraically. The logarithm is particularly adept at shattering complex fractions into a sequence of gentle linear terms.