Rewrite in natural logarithms

When the base of a logarithm contains the variable, change to base \(e\) and use the quotient rule.

\[\log_{a} b = \frac{\ln b}{\ln a}\]

What it says

The base-\(a\) rule assumes the base is a fixed number. If the base moves with \(x\) — as in \(\log_{x}2\) — that assumption fails, and there is no separate rule to learn.

Instead, apply the change-of-base identity to turn the expression into a ratio of natural logarithms. Both parts are then ordinary functions of \(x\), and the quotient rule finishes the job.

This is a rewriting step rather than a differentiation rule, which is why the calculator lists it as its own line in the working: it records the moment the expression changed form.

When it applies

  • The base of a logarithm contains the differentiation variable.
  • Expressions such as \(\log_{x}2\) or \(\log_{x}(x + 1)\).
  • Any time base-\(e\) form would be easier to work with.

Five worked examples

Every line is the step the calculator would show, in the order it applies them. Each graph is live: hover it to read both curves and see the tangent whose slope is the derivative, drag to pan, scroll to zoom.

Example 1
\[\frac{d}{dx}\left[\log_{x}\left(2\right)\right]\]
  1. Change of base.

    \[\log_{x}2 = \frac{\ln 2}{\ln x}\]
  2. \(\ln 2\) is a constant; differentiate \(\left(\ln x\right)^{-1}\) with the chain rule.

    \[= \ln 2 \cdot \left(-\frac{1}{\left(\ln x\right)^{2}}\right)\cdot\frac{1}{x}\]
  3. Collect.

    \[= -\frac{\ln 2}{x\left(\ln x\right)^{2}}\]
Answer
\[-\frac{\ln\left(2\right)}{x \ln^{2}\left(x\right)}\]

The pole at \(x = 1\) splits the graph into two branches that both fall. On the right the curve sinks toward zero from above; on the left it approaches zero from below, and f′ dives sharply near the pole on either side.

Negative for \(x > 1\): as the base grows, \(\log_{x}2\) falls.

Open log(x,2) in the calculator
Example 2
\[\frac{d}{dx}\left[\log_{x}\left(e\right)\right]\]
  1. Change of base, and \(\ln e = 1\).

    \[\log_{x}e = \frac{1}{\ln x}\]
  2. Chain rule on \(\left(\ln x\right)^{-1}\).

    \[= -\frac{1}{x\left(\ln x\right)^{2}}\]
Answer
\[-\frac{1}{x \ln^{2}\left(x\right)}\]

Two falling branches either side of the pole at \(x = 1\), with f′ negative wherever the function exists.

The same shape as the previous example without the \(\ln 2\) factor.

Open log(x,e) in the calculator
Example 3
\[\frac{d}{dx}\left[\log_{2 x}\left(3\right)\right]\]
  1. Change of base.

    \[\log_{2x}3 = \frac{\ln 3}{\ln 2x}\]
  2. Chain rule, noting \(\frac{d}{dx}\ln 2x = \frac{1}{x}\).

    \[= -\frac{\ln 3}{\left(\ln 2x\right)^{2}}\cdot\frac{1}{x}\]
  3. Collect.

    \[= -\frac{\ln 3}{x\left(\ln 2x\right)^{2}}\]
Answer
\[-\frac{\ln\left(3\right)}{x \ln^{2}\left(2 x\right)}\]

The pole has moved to \(x = \tfrac{1}{2}\), where \(\ln 2x\) is zero; otherwise the picture is unchanged.

The constant inside the base contributes nothing extra, exactly as it does for \(\ln\).

Open log(2x,3) in the calculator
Example 4
\[\frac{d}{dx}\left[\log_{x}\left(x + 1\right)\right]\]
  1. Both parts now contain \(x\).

    \[\log_{x}\left(x + 1\right) = \frac{\ln\left(x + 1\right)}{\ln x}\]
  2. Quotient rule.

    \[= \frac{\frac{1}{x+1}\ln x - \ln\left(x + 1\right)\cdot\frac{1}{x}}{\left(\ln x\right)^{2}}\]
Answer
\[\frac{\frac{\ln\left(x\right)}{x + 1} - \frac{\ln\left(x + 1\right)}{x}}{\ln^{2}\left(x\right)}\]

Both parts contain x here, so the quotient rule is needed. f approaches 1 for large x as the two logarithms converge.

This is the case that really needs the rewrite — neither logarithm rule can touch it directly.

Open log(x,x+1) in the calculator
Example 5
\[\frac{d}{dx}\left[\log_{x}\left(\sin\left(x\right)\right)\right]\]
  1. Change of base.

    \[= \frac{\ln \sin x}{\ln x}\]
  2. Quotient rule, with \(\frac{d}{dx}\ln\sin x = \cot x\).

    \[= \frac{\cot x\,\ln x - \frac{\ln \sin x}{x}}{\left(\ln x\right)^{2}}\]
Answer
\[\frac{\frac{\cos\left(x\right) \ln\left(x\right)}{\sin\left(x\right)} - \frac{\ln\left(\sin\left(x\right)\right)}{x}}{\ln^{2}\left(x\right)}\]

The graph arrives in fragments, one for each interval where the sine is positive.

Defined only where \(\sin x > 0\) and \(x > 0\), \(x \neq 1\).

Open log(x,sin(x)) in the calculator

Watch out for

  • Do not treat a variable base as constant — \(\frac{1}{x\ln a}\) is wrong when \(a\) contains \(x\).
  • After rewriting, the denominator \(\ln x\) is a function, so the quotient rule is needed, not the constant multiple rule.
  • \(\left(\ln x\right)^{2}\) in the denominator is the square of the logarithm, not \(\ln\left(x^{2}\right)\).