Logarithm rule

The natural logarithm differentiates to the reciprocal of its argument.

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

What it says

\(\ln x\) is the inverse of \(e^{x}\), and inverting a function reciprocates its slope. Since \(e^{x}\) has slope \(e^{x} = y\) at height \(y\), its inverse has slope \(\frac{1}{y}\) — at the point \(x\), that is \(\frac{1}{x}\).

This is the one derivative that fills the gap left by the power rule. Every power \(x^{n}\) integrates to another power except \(n = -1\); \(\ln x\) is what \(\frac{1}{x}\) integrates to.

Composed with something else, the pattern is \(\frac{u'}{u}\): derivative of the inside over the inside. That form is worth recognising on sight, because it appears everywhere in integration too.

When it applies

  • The natural logarithm of the variable or of an expression in it.
  • \(\log(x)\) in this calculator means the natural logarithm, matching most mathematical writing.
  • Any \(\frac{u'}{u}\) pattern, read backwards.

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[\ln\left(x\right)\right]\]
  1. Straight from the rule.

    \[\frac{d}{dx}\left[\ln x\right] = \frac{1}{x}\]
Answer
\[\frac{1}{x}\]

f rises without bound but ever more slowly, and f′ falls away toward zero. Near the origin the roles reverse: f dives toward \(-\infty\) while f′ climbs, both consequences of the same vertical tangent.

Defined only for \(x > 0\), where the derivative is positive and shrinking.

Open ln(x) in the calculator
Example 2
\[\frac{d}{dx}\left[\ln\left(5 x\right)\right]\]
  1. Chain rule: inside over inside.

    \[= \frac{1}{5x}\cdot\frac{d}{dx}\left[5x\right] = \frac{5}{5x}\]
  2. The \(5\) cancels.

    \[= \frac{1}{x}\]
Answer
\[\frac{1}{x}\]

The curve is lifted by \(\ln 5 \approx 1.61\), yet f′ is exactly the \(\tfrac{1}{x}\) of the previous graph: a vertical shift changes no slope.

Unsurprising once you notice \(\ln 5x = \ln 5 + \ln x\): the two functions differ by a constant, so they have the same slope.

Open ln(5x) in the calculator
Example 3
\[\frac{d}{dx}\left[\ln\left(x^{2} + 1\right)\right]\]
  1. Inside over inside, with \(u = x^{2} + 1\).

    \[= \frac{1}{x^{2} + 1}\cdot 2x\]
  2. Tidy.

    \[= \frac{2x}{x^{2} + 1}\]
Answer
\[\frac{2 x}{x^{2} + 1}\]

A symmetric bowl with its floor at the origin, flanked by an odd derivative that peaks at \(x = \pm 1\) and decays after.

The argument is never zero, so this derivative is defined for all real \(x\).

Open ln(x^2+1) in the calculator
Example 4
\[\frac{d}{dx}\left[x \ln\left(x\right)\right]\]
  1. Product rule with \(f = x\), \(g = \ln x\).

    \[= 1 \cdot \ln x + x \cdot \frac{1}{x}\]
  2. The second term simplifies to \(1\).

    \[= \ln x + 1\]
Answer
\[\ln\left(x\right) + 1\]

f dips to a minimum at \(x = \tfrac{1}{e} \approx 0.368\), and f′ crosses zero at precisely that point.

This is why \(\int \ln x\,dx = x\ln x - x\).

Open x ln(x) in the calculator
Example 5
\[\frac{d}{dx}\left[\ln\left(\sin\left(x\right)\right)\right]\]
  1. Inside over inside, with \(u = \sin x\).

    \[= \frac{1}{\sin x}\cdot\cos x\]
  2. Which is the cotangent.

    \[= \cot x\]
Answer
\[\frac{\cos\left(x\right)}{\sin\left(x\right)}\]

Arches between the zeros of \(\sin x\), each plunging toward \(-\infty\) at both ends, with f′ running from \(+\infty\) to \(-\infty\) across every one.

A tidy example of the \(\frac{u'}{u}\) shape producing a familiar function.

Open ln(sin(x)) in the calculator

Watch out for

  • \(\frac{d}{dx}\ln u\) is \(\frac{u'}{u}\), not \(\frac{1}{u}\) — the inner derivative is part of the answer.
  • \(\ln(x^{2})\) is not \(\left(\ln x\right)^{2}\). The first gives \(\frac{2}{x}\), the second \(\frac{2\ln x}{x}\).
  • For a base other than \(e\) there is an extra \(\frac{1}{\ln a}\) — see the base-\(a\) rule.