practicecalculus
Exponential and logarithmic functions

Logarithmic Functions log_b(x): Graphs, Rules, Derivative, Integral

Logarithmic functions log_b x: definition, graphs, log rules, change of base, the derivative 1/(x ln b), the integral and worked examples.

Exponential and logarithmic functions Updated 3 min read

At a glance

f(x) = \log_b x, \quad b > 0,\ b \ne 1
Domain
(0, \infty)
Range
(-\infty, \infty)
Derivative
\frac{1}{x\ln b}
Integral
\frac{x\ln x - x}{\ln b} + C
Change of base
\log_b x = \frac{\ln x}{\ln b}
Inverse
b^x
On this page
  1. Definition and formula
  2. Graphs of logarithmic functions
  3. Key properties
  4. Log rules
  5. Derivative of log_b x
  6. Integral of log_b x
  7. Worked examples
  8. Common mistakes
  9. How it connects

A logarithmic function \log_b x returns the exponent you need on the base b to produce x. For example \log_2 8 = 3 because 2^3 = 8. Logarithms undo exponential functions, and in calculus every logarithm is a constant multiple of the natural logarithm.

Definition and formula

\log_b x = y \iff b^y = x, \qquad b > 0,\ b \ne 1,\ x > 0

Common bases: \log_{10}x (often written \log x), \ln x = \log_e x, and \log_2 x in computer science.

Graphs of logarithmic functions

Graphs of y = log base 2 of x, y = ln(x) and y = log base 10 of x
All logarithms with base greater than 1 pass through (1, 0) and increase slowly. A larger base gives a flatter curve.

Key properties

  • Domain (0, \infty), range all reals.
  • Passes through (1, 0) and (b, 1) for every base.
  • Vertical asymptote x = 0.
  • Increasing if b > 1, decreasing if 0 < b < 1.
  • Inverse of b^x: b^{\log_b x} = x for x > 0 and \log_b(b^x) = x for all x. The graph is b^x reflected across y = x.
  • Slow growth: for b > 1, \log_b x \to \infty but slower than any positive power of x.

Log rules

For x, y > 0:

Rule Formula
Product \log_b(xy) = \log_b x + \log_b y
Quotient \log_b\frac{x}{y} = \log_b x - \log_b y
Power \log_b(x^k) = k\log_b x
Change of base \log_b x = \frac{\ln x}{\ln b}
Special values \log_b 1 = 0, \log_b b = 1

Derivative of log_b x

Change of base makes this a constant multiple of \ln x:

\frac{d}{dx}\log_b x = \frac{1}{\ln b}\cdot\frac{d}{dx}\ln x = \frac{1}{x\ln b}

With the chain rule, \frac{d}{dx}\log_b g(x) = \frac{g'(x)}{g(x)\ln b}. When b = e, \ln e = 1 and you recover \frac{d}{dx}\ln x = \frac{1}{x}.

Integral of log_b x

\int \log_b x\,dx = \frac{1}{\ln b}\int \ln x\,dx = \frac{x\ln x - x}{\ln b} + C

Worked examples

Example 1: evaluate. \log_3 81 = 4 because 3^4 = 81, and \log_2\frac{1}{8} = -3 because 2^{-3} = \frac{1}{8}.

Example 2: derivative. \frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10}. At x = 10 the slope is \frac{1}{10\ln 10} \approx 0.0434.

Example 3: chain rule. \frac{d}{dx}\log_2(x^2 + 1) = \frac{2x}{(x^2 + 1)\ln 2}.

Example 4: use log rules first. \frac{d}{dx}\log_5\left(x^3\sqrt{x}\right) = \frac{d}{dx}\tfrac{7}{2}\log_5 x = \frac{7}{2x\ln 5}.

Example 5: solving an exponential equation. To solve 2^x = 10, take \log_2 of both sides: x = \log_2 10 = \frac{\ln 10}{\ln 2} \approx 3.32.

Common mistakes

  1. Forgetting the \ln b in the derivative. \frac{d}{dx}\log_{10}x \ne \frac{1}{x}.
  2. Splitting a log of a sum. \log_b(x + y) \ne \log_b x + \log_b y.
  3. Writing \frac{\log_b x}{\log_b y} = \log_b(x - y). The quotient rule is for the log of a quotient, not a quotient of logs.
  4. Flipping the change of base. It is \frac{\ln x}{\ln b}, not \frac{\ln b}{\ln x}.

How it connects

Logarithms turn exponential equations into linear ones and products into sums, the idea behind logarithmic differentiation. They also appear in the integral of \frac{1}{x} and in many improper integrals. For the derivative rules side by side with exponentials, read the guide to derivatives of exponential and logarithmic functions.

Practice it now

Exponentials and logarithms

Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.

Practice this lesson

Frequently asked questions

What is the derivative of log base b of x?

The derivative is \frac{d}{dx}\log_b x = \frac{1}{x\ln b}. For example, \frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10}.

What is the integral of log base b of x?

Write \log_b x = \frac{\ln x}{\ln b} and use \int \ln x\,dx = x\ln x - x. The result is \int \log_b x\,dx = \frac{x\ln x - x}{\ln b} + C.

What is the change of base formula?

For any valid bases, \log_b x = \frac{\log_a x}{\log_a b}. In calculus the natural choice is a = e, giving \log_b x = \frac{\ln x}{\ln b}.

Why is the log of a negative number undefined?

A positive base raised to any real power is positive, so no exponent gives a negative number or zero. That is why \log_b x is defined only for x > 0.

Written by the PracticeCalculus team

We build interactive calculus lessons and write every page to be clear and correct. Spotted something off? Tell us and we will fix it.