Tutorials › AP Calculus › Derivatives of Logarithms with Other Bases

Trigonometric and Exponential Derivatives · Tutorial 149 of 999

Derivatives of Logarithms with Other Bases

Learn why the derivative of \(\log_a x\) is \(1/(x\ln a)\), and how the base and input restrictions affect its use.

Intermediate 8 min read

What You'll Learn

  • State the restrictions on the base and input of a logarithm.
  • Derive the derivative formula for logarithms with bases other than \(e\).
  • Differentiate logarithms with bases greater than one and between zero and one.
  • Use the formula to find slopes and tangent lines at specified inputs.
  • Identify and correct errors involving the factor \(\ln a\) and the sign of the derivative.

Why the Base Changes the Derivative

A logarithm answers an inverse question: what exponent on a base \(a\) produces a given positive number \(x\)? The natural logarithm \(\ln x\) uses base \(e\). Logarithms with other bases are related to it by a constant factor, so their derivatives are related by that same factor.

This connection lets us use the natural logarithm derivative to find the derivative for every valid base. The important detail is that the factor is \(1/\ln a\), not \(1/a\) or \(1\). The base restriction matters because \(\ln a\) must be defined and must not be zero.

Key formula: For a constant base \(a>0\), \(a\ne 1\), and input \(x>0\), \(\displaystyle \frac{d}{dx}\log_a x=\frac{1}{x\ln a}\).

Change of Base and Its Conditions

For \(a>0\), \(a\ne 1\), and \(x>0\), the change-of-base formula is

$$ \log_a x=\frac{\ln x}{\ln a}. $$

To see why it is true, let \(y=\log_a x\). By the definition of logarithm, \(a^y=x\). Taking natural logarithms of both sides gives \(\ln(a^y)=\ln x\), and the logarithm power rule gives \(y\ln a=\ln x\). Since \(a\ne1\), we have \(\ln a\ne0\), so division by \(\ln a\) yields \(y=\ln x/\ln a\).

The restrictions are part of the formula, not optional technicalities. A real logarithm \(\log_a x\) requires a positive input \(x\). Its real base must be positive and different from \(1\): base \(1\) cannot produce values other than \(1\), and a negative base does not define a real logarithm for every positive input. Also, when \(a=1\), the denominator \(\ln a\) would be zero.

Definition and domain: For a fixed real base \(a>0\), \(a\ne1\), the function \(f(x)=\log_a x\) is defined for \(x>0\). The base \(a\) is fixed while \(x\) varies.

Deriving the Derivative Formula

The earlier material on the natural logarithm derivative establishes that \(\frac{d}{dx}\ln x=\frac1x\) for \(x>0\). Use change of base to write \(\log_a x\) as a constant multiple of \(\ln x\). Since \(a\) is fixed, \(\ln a\) is a constant, and the constant-multiple rule applies.

1
Rewrite with natural logarithms.
For \(x>0\), \(\log_a x=\frac{\ln x}{\ln a}\), where \(\ln a\) is constant with respect to \(x\).
2
Differentiate the constant multiple.
\(\frac{d}{dx}\left(\frac{\ln x}{\ln a}\right)=\frac{1}{\ln a}\frac{d}{dx}(\ln x)\).
3
Use the natural logarithm derivative.
For \(x>0\), this becomes \(\frac{1}{\ln a}\cdot\frac1x=\frac1{x\ln a}\).
$$ \frac{d}{dx}\log_a x = \frac{d}{dx}\left(\frac{\ln x}{\ln a}\right) = \frac{1}{\ln a}\cdot\frac1x = \frac{1}{x\ln a}, \qquad a>0,\ a\ne1,\ x>0. $$

This derivation also explains the structure of the answer. The \(1/x\) comes from differentiating \(\ln x\), while \(1/\ln a\) records how the chosen base differs from \(e\). The result applies only when the base is constant and the input \(x\) is positive.

Worked Examples

Worked Example: Differentiate a Logarithm with Base 2

Find the derivative of \(f(x)=\log_2 x\), and find its slope at \(x=4\).

The base is \(a=2\), which is positive and not \(1\), and the function is defined for \(x>0\). Apply the formula:

$$ f'(x)=\frac{1}{x\ln 2}. $$

At \(x=4\), substitute \(4\) for \(x\):

$$ f'(4)=\frac{1}{4\ln 2}. $$

Thus, the slope at \(x=4\) is exactly \(1/(4\ln 2)\). As a check, change base first: \(f(x)=\ln x/\ln2\). Differentiating gives \(f'(x)=(1/\ln2)(1/x)=1/(x\ln2)\), matching the result. At \(x=4\), the point on the graph is \((4,\log_2 4)=(4,2)\). The tangent line there is \(y-2=\frac{1}{4\ln2}(x-4)\); its slope agrees with the derivative evaluated at \(4\).

Worked Example: Differentiate a Common Logarithm

Let \(g(x)=\log_{10}x\). Find \(g'(x)\) and the slope at \(x=10\).

The base \(10\) is positive and different from \(1\), and \(x\) must be positive. The formula gives

$$ g'(x)=\frac{1}{x\ln10}. $$

Substitute \(x=10\):

$$ g'(10)=\frac{1}{10\ln10}. $$

Because \(\log_{10}10=1\), the graph passes through \((10,1)\). Its tangent line there is \(y-1=\frac{1}{10\ln10}(x-10)\). To check the differentiation, rewrite \(g(x)=\ln x/\ln10\). Since \(\ln10\) is constant, \(g'(x)=(1/\ln10)(1/x)=1/(x\ln10)\), as obtained above.

Worked Example: A Base Between 0 and 1

Let \(h(x)=\log_{1/3}x\). Find its derivative and evaluate the slope at \(x=1/3\).

The base \(1/3\) is positive and not equal to \(1\), so it is valid. Also, the input must satisfy \(x>0\). Apply the formula:

$$ h'(x)=\frac{1}{x\ln(1/3)}. $$

Using \(\ln(1/3)=-\ln3\), this can also be written

$$ h'(x)=-\frac{1}{x\ln3}. $$

At \(x=1/3\),

$$ h'\left(\frac13\right) = -\frac{1}{(1/3)\ln3} = -\frac{3}{\ln3}. $$

The slope is negative, consistent with the fact that logarithms with bases between \(0\) and \(1\) decrease as \(x\) increases. Check by change of base: \(h(x)=\ln x/\ln(1/3)=-\ln x/\ln3\), so \(h'(x)=-(1/\ln3)(1/x)=-1/(x\ln3)\), agreeing with the formula. Also, \(h(1/3)=1\), so the point at which the slope was evaluated is \((1/3,1)\).

How the Base Determines the Sign

The denominator \(x\ln a\) controls the sign of the derivative. The domain requires \(x>0\), so \(x\) is always positive. What remains is the sign of \(\ln a\).

BaseSign of \(\ln a\)Sign of derivative
\(a>1\)Positive\(\frac{1}{x\ln a}>0\)
\(0<a<1\)Negative\(\frac{1}{x\ln a}<0\)

Thus, the derivative is positive when \(a>1\) and negative when \(0<a<1\). This agrees with the behavior of the functions themselves: a logarithm with base greater than \(1\) increases, while a logarithm with base between \(0\) and \(1\) decreases. In either case the derivative is never zero at a point in the domain.

Common Mistake: Dropping the Base Factor

A frequent error is to treat every logarithm as if its derivative were simply \(1/x\). For example, a mistaken calculation might be

$$ \frac{d}{dx}\log_2x=\frac1x. $$

This omits the factor \(1/\ln2\). The correction is to change base before differentiating:

$$ \log_2x=\frac{\ln x}{\ln2} \quad\Longrightarrow\quad \frac{d}{dx}\log_2x = \frac{1}{\ln2}\cdot\frac1x = \frac{1}{x\ln2}. $$

The incorrect answer would give slope \(1/4\) at \(x=4\), while the correct slope is \(1/(4\ln2)\). They are not equal because \(\ln2\ne1\). A related mistake is to write \(1/(x\log_a a)\): since \(\log_a a=1\), this would again give \(1/x\), not the correct formula. The denominator specifically contains the natural logarithm of the base, \(\ln a\).

When to Use the Formula

Before using \(\frac{d}{dx}\log_a x=\frac{1}{x\ln a}\), check the expression and its conditions:

  • The base \(a\) is a fixed constant.
  • The base satisfies \(a>0\) and \(a\ne1\).
  • The input satisfies \(x>0\).
  • The denominator includes both \(x\) and \(\ln a\).

If the base is \(e\), then \(\log_e x=\ln x\), and the formula reduces to \(\frac{1}{x\ln e}=\frac1x\), since \(\ln e=1\). For another valid base, retain the \(\ln a\) factor. The formulas here concern \(\log_a x\) with the input \(x\) itself; differentiating a logarithm whose input is a more complicated expression involves additional differentiation rules.

Theorem: If \(a\) is a constant with \(a>0\) and \(a\ne1\), then \(f(x)=\log_a x\) is defined and differentiable for \(x>0\), and \(\displaystyle f'(x)=\frac{1}{x\ln a}\).

Check Your Understanding

Use the base restrictions and derivative formula to answer each question.

  1. What conditions must \(a\) and \(x\) satisfy for \(\log_a x\) to be a real-valued logarithm in this formula?
  2. Find \(\frac{d}{dx}\log_5x\), and then find the derivative's value at \(x=5\).
  3. Differentiate \(\log_{1/2}x\). Should its derivative be positive or negative for \(x>0\)?
  4. A student claims \(\frac{d}{dx}\log_7x=1/x\). Identify the missing factor and write the corrected derivative.
  5. Explain why the derivative formula cannot be used with \(a=1\).

Test yourself: AP Calculus practice exams

Ready to check what you know? Work an AP-style practice exam, then open the full solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers all of AP Calculus AB & BC: 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
Clinical Biostats