Tutorials › Calculus I › Nested Logarithmic Derivatives

Exponential and Logarithmic Derivatives · Tutorial 540 of 1495

Nested Logarithmic Derivatives

Learn to differentiate nested natural and common logarithms while checking the domain restrictions at every layer.

Intermediate 10 min read

What You'll Learn

  • Apply the chain rule successively to nested logarithms
  • Differentiate expressions such as ln(ln x)
  • Differentiate logarithms in bases other than e
  • Find the domain restrictions imposed by each logarithm
  • Identify and correct common errors in nested-log derivatives

Why Nested Logarithms Need Care

A logarithm can itself be the input to another logarithm. For example, in \(\ln(\ln x)\), the outer natural logarithm acts on the value of the inner natural logarithm. Differentiating such an expression means following that chain of dependence from the outside inward.

The chain rule gives the method, but it is not enough to write down a derivative mechanically. Each logarithm has a domain restriction, and the expression must satisfy all of them. For \(\ln(\ln x)\), for instance, it is not sufficient that \(x\) be positive: the inner value \(\ln x\) must also be positive so that it can serve as the input to the outer logarithm.

Central principle: Differentiate a nested logarithm one layer at a time, multiplying by the derivative of each inner layer. Separately check that the input to every logarithm is positive.

The Logarithm Rule at Each Layer

For a differentiable function \(u(x)\) with \(u(x)>0\), the derivative of its natural logarithm is

$$ \frac{d}{dx}\ln(u(x))=\frac{u'(x)}{u(x)}. $$

For a logarithm in base \(b\), where \(b>0\) and \(b\ne 1\), the corresponding rule is

$$ \frac{d}{dx}\log_b(u(x))=\frac{u'(x)}{u(x)\ln b}, \qquad u(x)>0. $$

In both formulas, the denominator contains the current logarithm's input, and the numerator contains the derivative of that input. If the input is itself a logarithm, its derivative must still be included. The formulas apply on intervals where the input is differentiable and positive.

Worked Example: The Derivative of \(\ln(\ln x)\)

Worked Example: Differentiating \(\ln(\ln x)\)

Find the domain and derivative of \(f(x)=\ln(\ln x)\).

Step 1: Find the domain. The inner logarithm \(\ln x\) is defined when \(x>0\). It is then the input to the outer logarithm, so we also require \(\ln x>0\). Since the natural logarithm is increasing and \(\ln 1=0\), this second condition is equivalent to \(x>1\). Thus the domain is \(x>1\).

Step 2: Differentiate the outer layer. Its input is \(u(x)=\ln x\), so \(u'(x)=1/x\). The natural-log rule gives

$$ f'(x)=\frac{u'(x)}{u(x)} =\frac{1/x}{\ln x} =\frac{1}{x\ln x}, \qquad x>1. $$

Step 3: Check the result at a point in the domain. At \(x=e^2\), the derivative formula gives \(1/(e^2\cdot 2)=1/(2e^2)\). Applying the layers directly gives \((1/\ln(e^2))(1/e^2)=(1/2)(1/e^2)=1/(2e^2)\), as required.

Why the Nested Rule Works

The derivative formula for \(\ln(\ln x)\) is not a separate rule that must be memorized. It follows directly from the ordinary natural-log derivative and the chain rule. The same reasoning works when the inner logarithm has a more complicated input.

Derived formula: If \(g\) is differentiable and \(g(x)>1\), then $$ \frac{d}{dx}\ln(\ln(g(x)))=\frac{g'(x)}{g(x)\ln(g(x))}. $$ The condition \(g(x)>1\) ensures both that \(\ln(g(x))\) is defined and that it is positive, as required for the outer logarithm.

Here is a derivation. Let \(u(x)=\ln(g(x))\). Since \(g(x)>1\), \(u(x)>0\), so the outer logarithm is defined. Apply the chain rule to \(\ln(u(x))\), then apply it again to \(u(x)=\ln(g(x))\):

$$ \begin{aligned} \frac{d}{dx}\ln(\ln(g(x))) &=\frac{u'(x)}{u(x)}\\ &=\frac{1}{\ln(g(x))}\cdot\frac{g'(x)}{g(x)}\\ &=\frac{g'(x)}{g(x)\ln(g(x))}. \end{aligned} $$

Each factor has a distinct role: \(1/\ln(g(x))\) comes from differentiating the outer logarithm, while \(g'(x)/g(x)\) comes from differentiating the inner one. Omitting either factor fails to account for one of the layers.

Worked Example: A Common Logarithm Outside a Natural Logarithm

Worked Example: Differentiating \(\log_2(\ln(x^2+1))\)

Find the domain and derivative of \(f(x)=\log_2(\ln(x^2+1))\).

Step 1: Enforce the outer logarithm's condition. The input to \(\log_2\) must be positive, so \(\ln(x^2+1)>0\). This is equivalent to \(x^2+1>1\), or \(x^2>0\). Therefore \(x\ne 0\). The inner logarithm is defined for every real \(x\), because \(x^2+1\ge 1>0\). Thus the domain is all real \(x\) except \(0\).

Step 2: Differentiate the outer layer. The input is \(u(x)=\ln(x^2+1)\). For a base-2 logarithm, the derivative is \(u'(x)/(u(x)\ln 2)\).

Step 3: Differentiate the input. By the chain rule, \(u'(x)=2x/(x^2+1)\). Substituting this value gives

$$ \begin{aligned} f'(x) &=\frac{u'(x)}{u(x)\ln 2}\\ &=\frac{2x/(x^2+1)}{\ln(x^2+1)\ln 2}\\ &=\frac{2x}{(x^2+1)\ln(x^2+1)\ln 2}, \qquad x\ne 0. \end{aligned} $$

Step 4: Check at \(x=1\). The formula gives \(2/(2\ln 2\cdot\ln 2)=1/(\ln 2)^2\). Directly applying the outer derivative rule at \(x=1\), the input value is \(\ln 2\), and its derivative is \(2/(1+1)=1\). Thus the derivative is \(1/(\ln 2\cdot\ln 2)=1/(\ln 2)^2\), matching the formula.

Track the Domain from Outside In

For a nested expression, check each logarithm's input in turn. The outermost logarithm must receive a positive value. If that value is another logarithm, the inner logarithm must be positive; that requirement may be stricter than merely asking that its own input be positive.

For example, in \(\ln(\ln(3x-2))\), the inner logarithm requires \(3x-2>0\). The outer logarithm additionally requires \(\ln(3x-2)>0\), which is equivalent to \(3x-2>1\), or \(x>1\). The stronger condition \(x>1\) automatically satisfies the inner logarithm's condition as well.

Once the domain is established, the chain rule can be organized as a sequence of layers. In this example, the innermost expression is \(3x-2\), the middle layer is its natural logarithm, and the outer layer is the natural logarithm of that result.

1
Differentiate the outer logarithm.
For \(\ln(v)\), use \(v'/v\), where \(v=\ln(3x-2)\).
2
Differentiate the middle logarithm.
The derivative of \(\ln(3x-2)\) is \(3/(3x-2)\).
3
Multiply the layer derivatives.
The result is \(3/((3x-2)\ln(3x-2))\), valid for \(x>1\).

Worked Example: A Logarithm of a Logarithm in Another Base

Worked Example: Differentiating \(\ln(\log_3(2x-1))\)

Find the domain and derivative of \(f(x)=\ln(\log_3(2x-1))\).

Step 1: Find the domain. The inner logarithm requires \(2x-1>0\). Its value is then the input to the outer natural logarithm, so we also need \(\log_3(2x-1)>0\). Since the base \(3\) is greater than \(1\), this inequality is equivalent to \(2x-1>1\). Hence \(x>1\), which also guarantees \(2x-1>0\).

Step 2: Differentiate each layer. Set \(u(x)=\log_3(2x-1)\). The base-3 logarithm rule gives

$$ u'(x)=\frac{2}{(2x-1)\ln 3}. $$

Now differentiate the outer natural logarithm:

$$ \begin{aligned} f'(x) &=\frac{u'(x)}{u(x)}\\ &=\frac{2}{(2x-1)\ln 3\;\log_3(2x-1)}\\ &=\frac{2}{(2x-1)\ln(2x-1)}, \qquad x>1. \end{aligned} $$

The final equality uses \(\log_3(2x-1)=\ln(2x-1)/\ln 3\), so the factors \(\ln 3\) cancel.

Step 3: Check at \(x=2\). Here \(2x-1=3\), so \(\log_3(3)=1\), and \(u'(2)=2/(3\ln 3)\). The outer derivative is \(u'(2)/u(2)=(2/(3\ln 3))/1=2/(3\ln 3)\). The simplified formula also gives \(2/(3\ln 3)\).

A Common Mistake: Dropping an Inner Derivative

A frequent error is to differentiate the outer logarithm but then stop, as if its input were simply \(x\). For instance, an incorrect calculation for \(\ln(\ln x)\) is

$$ \frac{d}{dx}\ln(\ln x)=\frac{1}{\ln x}. $$

This omits the derivative of the inner input \(\ln x\). The correction is to apply the chain rule: the outer derivative contributes \(1/\ln x\), and the inner derivative contributes \(1/x\). Therefore

$$ \frac{d}{dx}\ln(\ln x) =\frac{1}{\ln x}\cdot\frac{1}{x} =\frac{1}{x\ln x}, \qquad x>1. $$

A related domain error is to assume that \(x>0\) alone is enough for \(\ln(\ln x)\). For \(0<x\le 1\), the value \(\ln x\) is nonpositive, so it cannot be the input to the outer natural logarithm. The actual domain is \(x>1\).

A Reliable Procedure

For a nested logarithmic expression, a careful solution separates domain analysis from differentiation. This prevents a formally correct chain-rule expression from being used at points where the original function does not exist.

  1. Identify every logarithm and require its input to be positive.
  2. Combine those requirements to state the domain of the original function.
  3. Differentiate the outermost logarithm using the appropriate base rule.
  4. Continue inward, multiplying by the derivative of each input.
  5. Simplify only after all layer derivatives have been included, and state where the derivative is valid.

The order of differentiation is from outside to inside, while the domain conditions must be checked at every level. In particular, an outer natural logarithm whose input is another logarithm requires that inner logarithm to be positive, not merely defined.

Check Your Understanding

For each question, give a derivative and state the domain on which the original function is defined.

  1. Differentiate \(\ln(\ln(x+2))\). Which condition is stronger: the domain condition for the inner logarithm or the one imposed by the outer logarithm?
  2. Differentiate \(\log_5(\ln x)\). Why must \(x\) be greater than \(1\), rather than merely positive?
  3. Find the domain of \(\ln(\log_2(x-1))\).
  4. In differentiating \(\ln(\ln(x^2+4))\), what derivative factor is contributed by the innermost expression \(x^2+4\)?
  5. Explain why \(\frac{d}{dx}\ln(\ln x)=1/\ln x\) is incomplete.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon