Tutorials › Calculus I › Composite Logarithms in Arbitrary Bases

Exponential and Logarithmic Derivatives · Tutorial 539 of 1495

Composite Logarithms in Arbitrary Bases

Differentiate composite logarithms by tracking the inner function, its positive domain, and the constant factor determined by the base.

Intermediate 9 min read

What You'll Learn

  • State the domain and differentiability conditions for a composite logarithm.
  • Apply the derivative rule for log base a of u(x).
  • Explain why the factor 1 over ln a appears.
  • Handle bases between zero and one without losing the derivative’s sign.
  • Check a result by differentiating the change-of-base expression.

Introduction

A logarithm can have a function, rather than just a variable, as its argument. For example, \(\log_2(x^2+1)\) changes as \(x\) changes both because the inside function changes and because the logarithm measures that change on a particular base scale.

The derivative must account for both effects. The inner function contributes its derivative, while the logarithm’s base contributes a constant factor. Keeping these contributions separate makes the rule straightforward to use and helps prevent sign and domain errors.

The derivative rule

Let \(a\) be a fixed real number satisfying \(a>0\) and \(a\ne 1\). Let \(u\) be differentiable on an open interval \(I\), and suppose \(u(x)>0\) for every \(x\in I\). These conditions ensure that the logarithm is defined throughout the interval and that the derivative can be evaluated there.

Theorem: If \(f(x)=\log_a(u(x))\), under the conditions above, then for every \(x\in I\), $$ f'(x)=\frac{u'(x)}{u(x)\ln(a)}. $$

Here \(a\) is constant, \(\ln(a)\) is therefore a nonzero constant, and \(u'(x)\) is the derivative of the argument. The denominator includes both \(u(x)\) and \(\ln(a)\). A useful way to remember the structure is: differentiate the inside, divide by the inside, then divide by the natural logarithm of the base.

The positivity condition applies to the argument \(u(x)\), not necessarily to \(x\) itself. The formula is used on intervals where \(u\) is positive. If the domain has separate intervals, the same rule applies on each interval on which the stated conditions hold.

Why the rule works

The change-of-base identity expresses a logarithm in base \(a\) using natural logarithms. Because \(a\) is fixed and positive, and \(a\ne1\), its natural logarithm is defined and nonzero:

$$ \log_a(u(x))=\frac{\ln(u(x))}{\ln(a)}. $$

Since \(u(x)>0\), the derivative rule for the natural logarithm of a differentiable positive function gives \(\frac{d}{dx}\ln(u(x))=\frac{u'(x)}{u(x)}\). The denominator \(\ln(a)\) is constant, so it remains as a factor when differentiating. Thus

$$ \begin{aligned} \frac{d}{dx}\log_a(u(x)) &=\frac{d}{dx}\left(\frac{\ln(u(x))}{\ln(a)}\right)\\ &=\frac{1}{\ln(a)}\frac{d}{dx}\ln(u(x))\\ &=\frac{1}{\ln(a)}\frac{u'(x)}{u(x)}\\ &=\frac{u'(x)}{u(x)\ln(a)}. \end{aligned} $$

This derivation uses two ingredients: the change-of-base identity and the chain rule for the natural logarithm. It also shows why the formula cannot be applied where \(u(x)\le 0\): the real-valued logarithm \(\ln(u(x))\) is not defined there.

The base determines a constant factor

The base affects the derivative through \(1/\ln(a)\). This factor is constant with respect to \(x\), but its sign depends on the base.

Base conditionSign of \(\ln(a)\)Effect to keep in mind
\(a>1\)PositiveThe base factor \(1/\ln(a)\) is positive.
\(0<a<1\)NegativeThe base factor \(1/\ln(a)\) is negative.

The sign of the full derivative also depends on \(u'(x)\), since \(u(x)>0\). In particular, a base between zero and one does not mean that the derivative is always negative: the sign of \(u'(x)\) matters too. Keep \(\ln(a)\) in the expression until its sign has been handled carefully.

Worked examples

Worked Example: A quadratic argument with base 2

Differentiate \(f(x)=\log_2(x^2+1)\), and check the result.

First, \(x^2+1\ge1>0\) for every real \(x\), so the logarithm is defined on all of \(\mathbb R\). Set \(u(x)=x^2+1\). Then

$$ u'(x)=2x,\qquad \ln(a)=\ln(2). $$

Apply the rule:

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

To check, rewrite the original function using change of base and differentiate:

$$ \begin{aligned} \frac{d}{dx}\left(\frac{\ln(x^2+1)}{\ln(2)}\right) &=\frac{1}{\ln(2)}\cdot\frac{2x}{x^2+1}\\ &=\frac{2x}{(x^2+1)\ln(2)}. \end{aligned} $$

This matches the result. At \(x=0\), the derivative is \(0\), consistent with the fact that the inner function \(x^2+1\) has derivative \(0\) there.

Worked Example: A decreasing inner function and a base below 1

Differentiate \(g(x)=\log_{1/3}(5-2x)\) on its domain.

The argument must be positive:

$$ 5-2x>0 \quad\Longrightarrow\quad -2x>-5 \quad\Longrightarrow\quad x<\frac{5}{2}. $$

Thus the domain is the open interval \((-\infty,5/2)\). Set \(u(x)=5-2x\). Then \(u'(x)=-2\), and

$$ \ln\left(\frac13\right) =\ln(1)-\ln(3) =-\ln(3). $$

Substitution into the derivative rule gives

$$ \begin{aligned} g'(x) &=\frac{-2}{(5-2x)\ln(1/3)}\\ &=\frac{-2}{(5-2x)(-\ln(3))}\\ &=\frac{2}{(5-2x)\ln(3)}. \end{aligned} $$

For a check, use change of base, then differentiate on the domain \(x<5/2\):

$$ \begin{aligned} \frac{d}{dx}\left(\frac{\ln(5-2x)}{\ln(1/3)}\right) &=\frac{1}{\ln(1/3)}\cdot\frac{-2}{5-2x}\\ &=\frac{2}{(5-2x)\ln(3)}. \end{aligned} $$

The result is positive on the domain. Both the negative derivative of the argument and the negative value of \(\ln(1/3)\) contribute to that sign.

Worked Example: A polynomial argument on two intervals

Differentiate \(h(x)=\log_3(x^2-4)\) wherever it is defined.

The argument must be positive. Factor and solve the inequality:

$$ \begin{aligned} x^2-4&>0,\\ (x-2)(x+2)&>0. \end{aligned} $$

The product is positive when both factors are positive or both are negative. Hence \(x>2\) or \(x<-2\); the domain is \((-\infty,-2)\cup(2,\infty)\). On either interval, let \(u(x)=x^2-4\), so \(u'(x)=2x\). Therefore

$$ \begin{aligned} h'(x) &=\frac{2x}{(x^2-4)\ln(3)}. \end{aligned} $$

To check, differentiate the change-of-base expression on either domain interval:

$$ \begin{aligned} \frac{d}{dx}\left(\frac{\ln(x^2-4)}{\ln(3)}\right) &=\frac{1}{\ln(3)}\cdot\frac{2x}{x^2-4}\\ &=\frac{2x}{(x^2-4)\ln(3)}. \end{aligned} $$

This is the same derivative. Notice that \(x^2-4\) is positive on both intervals, so the formula is valid on each one. At \(x<-2\), the derivative is negative; at \(x>2\), it is positive.

A common mistake: omitting the argument in the denominator

A frequent error is to differentiate the inside and divide only by the natural logarithm of the base. For instance, for \(p(x)=\log_3(2x+1)\), an incorrect calculation is

$$ p'(x)\ \text{(incorrect)}=\frac{2}{\ln(3)}. $$

This omits the factor \(2x+1\). The logarithm’s derivative rule requires division by the entire positive argument as well as by \(\ln(3)\). The domain condition is \(2x+1>0\), or \(x>-1/2\), and the correct calculation is

$$ \begin{aligned} p'(x) &=\frac{2}{(2x+1)\ln(3)}. \end{aligned} $$

For a direct check at \(x=1\), the correct derivative is \(2/(3\ln(3))\), whereas the incorrect expression gives \(2/\ln(3)\). They differ by a factor of \(3\). Differentiating \(\ln(2x+1)/\ln(3)\) gives \(2/((2x+1)\ln(3))\), confirming the correction.

A second sign-related pitfall is to replace \(\ln(a)\) by a positive quantity without checking the base. If \(0<a<1\), then \(\ln(a)<0\). Replacing it by \(\ln(1/a)\) requires also accounting for the negative sign, since \(\ln(a)=-\ln(1/a)\).

A reliable procedure

For a composite logarithm \(\log_a(u(x))\), organize the calculation in this order:

1
Check the base.
Confirm that \(a>0\) and \(a\ne1\). These conditions make the real logarithm valid and ensure \(\ln(a)\ne0\).
2
Find the argument’s domain.
Solve \(u(x)>0\), and identify the interval or intervals where the logarithm is defined.
3
Differentiate the argument.
Compute \(u'(x)\) separately so it is clear which factor comes from the chain rule.
4
Apply and simplify the rule.
Use \(u'(x)/(u(x)\ln(a))\), preserving the sign of \(\ln(a)\), especially when \(0<a<1\).
5
Check the result.
Differentiate \(\ln(u(x))/\ln(a)\) and compare, while ensuring the answer is stated only on the logarithm’s domain.

Why the domain and base conditions matter

The formula contains \(u(x)\) in the denominator, and the real logarithm also requires \(u(x)>0\). The positivity condition therefore has both a meaning in the original function and a role in the derivative calculation. Points where \(u(x)=0\) are not included in the real domain, so the derivative formula does not extend through them as a derivative of the original function.

The restrictions on \(a\) are equally essential. A real logarithm base must be positive, and base \(1\) is excluded because \(\log_1(y)\) does not define a logarithm function: \(1^z=1\) for every real \(z\), so it cannot produce general positive values \(y\). In the derivative formula this exclusion appears as \(\ln(1)=0\), which would make the denominator zero.

These checks are not optional details after the differentiation. They determine where the original function exists and whether the derivative rule applies. State the domain first when the inside function can be zero or negative, and retain the base factor until the final simplification.

Check Your Understanding

For each question, account for the domain as well as the derivative.

  1. Differentiate \(\log_5(3x+4)\) and state its domain.
  2. Differentiate \(\log_{1/2}(x^2+2)\). What sign does the base factor \(1/\ln(1/2)\) have?
  3. On which intervals is \(\log_7(9-x^2)\) defined? Write its derivative on those intervals.
  4. Explain why the derivative rule requires both \(u(x)>0\) and \(a>0,\ a\ne1\).
  5. Identify the missing factor in the incorrect claim \(\frac{d}{dx}\log_4(x+6)=1/\ln(4)\), then give the corrected derivative and domain.

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