Logarithm rule, base a

A logarithm to any constant base is the natural logarithm scaled by a fixed factor.

\[\frac{d}{dx}\log_{a} x = \frac{1}{x\ln a}\]

What it says

The change-of-base identity \(\log_{a}x = \frac{\ln x}{\ln a}\) turns every logarithm into a constant multiple of \(\ln x\). Since \(\ln a\) is just a number, the constant multiple rule finishes the job: \(\frac{1}{\ln a}\cdot\frac{1}{x}\).

So the only difference from the natural logarithm is a fixed divisor. For base \(e\) it disappears, because \(\ln e = 1\); for base \(10\) it is \(\ln 10 \approx 2.3026\), which is why \(\log_{10}\) curves flatten so much faster.

In this calculator, \(\log(a, x)\) means \(\log_{a}x\), and \(\log_{2}\) and \(\log_{10}\) have their own shorthands \(\texttt{log2}\) and \(\texttt{log10}\).

When it applies

  • A logarithm whose base is a constant other than \(e\).
  • \(\log_{2}\) in computing work, \(\log_{10}\) in decibels, pH and orders of magnitude.
  • If the base itself contains the variable, this rule does not apply — the expression is rewritten in natural logs instead.

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_{2}\left(x\right)\right]\]
  1. Change of base.

    \[\log_{2}x = \frac{\ln x}{\ln 2}\]
  2. \(\frac{1}{\ln 2}\) is a constant factor.

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

The shape of \(\ln x\) stretched vertically by \(\tfrac{1}{\ln 2} \approx 1.44\), with f′ correspondingly above the curve \(\tfrac{1}{x}\). Changing the base rescales the whole picture; it does not bend it.

About \(1.4427/x\) — steeper than \(\ln x\), because \(\log_{2}\) climbs faster.

Open log(2,x) in the calculator
Example 2
\[\frac{d}{dx}\left[\log_{10}\left(x\right)\right]\]
  1. Same route, base \(10\).

    \[= \frac{1}{x\ln 10}\]
Answer
\[\frac{1}{x \ln\left(10\right)}\]

The flattest member of the family, and its derivative — about \(\tfrac{0.434}{x}\) — is the smallest of them.

\(\ln 10 \approx 2.3026\), so the common logarithm has under half the slope of \(\ln x\).

Open log(10,x) in the calculator
Example 3
\[\frac{d}{dx}\left[\log_{2}\left(x^{3}\right)\right]\]
  1. Use the power law first: \(\log_{2}x^{3} = 3\log_{2}x\).

    \[= 3\;\frac{d}{dx}\left[\log_{2}x\right]\]
  2. Then the base-\(a\) rule.

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

Three times the height of \(\log_{2}x\) and three times the slope at every point, because \(\log_{2}x^{3} = 3\log_{2}x\).

The chain rule gives the same thing: \(\frac{3x^{2}}{x^{3}\ln 2} = \frac{3}{x\ln 2}\).

Open log(2,x^3) in the calculator
Example 4
\[\frac{d}{dx}\left[\log_{5}\left(3 x\right)\right]\]
  1. Chain rule with \(u = 3x\).

    \[= \frac{1}{3x\ln 5}\cdot 3\]
  2. The \(3\) cancels.

    \[= \frac{1}{x\ln 5}\]
Answer
\[\frac{1}{x \ln\left(5\right)}\]

Only for \(x > 0\). The curve rises steeply and then settles into a near-straight climb, while f′ decays toward the axis.

As with \(\ln\), a constant factor inside the logarithm shifts the graph but does not tilt it.

Open log(5,3x) in the calculator
Example 5
\[\frac{d}{dx}\left[x \log_{2}\left(x\right)\right]\]
  1. Product rule with \(f = x\), \(g = \log_{2}x\).

    \[= 1 \cdot \log_{2}x + x\cdot\frac{1}{x\ln 2}\]
  2. The \(x\) cancels in the second term.

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

The \(n\log n\) curve familiar from sorting costs, turning at \(x = \tfrac{1}{e}\) where f′ crosses zero.

The shape of \(n\log_{2}n\), the cost of a merge sort — its derivative is what makes the curve just steeper than linear.

Open x log(2,x) in the calculator

Watch out for

  • The divisor is \(\ln a\), the natural log of the base — not \(\log a\) and not \(a\).
  • \(\log(a, x)\) here means base \(a\); a single-argument \(\log(x)\) means the natural logarithm.
  • A variable base needs a rewrite, not this rule.