# 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.

Source: https://practicecalculus.com/functions/logarithmic-functions
Updated: 2026-11-03

$$ f(x) = \log_b x, \quad b > 0,\ b \ne 1 $$

## At a glance

- **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$

## Key takeaways

- The logarithm $\log_b x$ is the exponent you put on $b$ to get $x$, so it is the inverse of $b^x$.
- Change of base, $\log_b x = \frac{\ln x}{\ln b}$, turns every logarithm into a multiple of $\ln x$.
- Its derivative is $\frac{1}{x\ln b}$, which reduces to $\frac{1}{x}$ when $b = e$.
- Every log function passes through $(1, 0)$ and has a vertical asymptote at $x = 0$.

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](/functions/exponential-functions), and in calculus every logarithm is a constant multiple of the [natural logarithm](/functions/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

```graph
title: 'Graphs of y = log base 2 of x, y = ln(x) and y = log base 10 of x'
caption: 'All logarithms with base greater than $1$ pass through $(1, 0)$ and increase slowly. A larger base gives a flatter curve.'
x: [-0.5, 10]
y: [-3, 4]
functions:
  - expr: ln(x)/ln(2)
    label: y = log base 2
  - expr: ln(x)
    label: y = ln x
  - expr: log(x)
    label: y = log base 10
points:
  - [1, 0, '(1, 0)']
vertical:
  - {x: 0, label: 'x = 0'}
```

## 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](/rules/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](/rules/logarithmic-differentiation). They also appear in the integral of $\frac{1}{x}$ and in many [improper integrals](/blog/improper-integrals). For the derivative rules side by side with exponentials, read the guide to [derivatives of exponential and logarithmic functions](/blog/derivatives-of-exponential-and-logarithmic-functions).

## 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$.
