Derivatives

Derivative of ln(x): Formula, Proof and Examples

Derivative of ln(x): Formula, Proof and Examples — CalculusCalc cover image

Quick answer: the derivative of the natural logarithm is

$$\frac{d}{dx}\ln(x) = \frac{1}{x}, \qquad x > 0$$

That one line covers most homework problems, but the reason it is true, and how it combines with the chain rule, is what makes the harder questions easy. This guide walks through both, then works through examples from warm-up level to exam level.

Why it works: the intuition

Picture the graph of \( y = \ln x \). It climbs steeply just to the right of zero, passes through \( (1, 0) \), and then keeps rising more and more slowly. The formula \( \frac{1}{x} \) describes exactly that behavior: the slope is 1 at \( x = 1 \), only 0.1 at \( x = 10 \), and 0.01 at \( x = 100 \). The logarithm never stops increasing, but each extra unit of \( x \) adds less than the one before.

There is also a neat picture based on inverse functions. The graph of \( \ln x \) is the mirror image of \( e^x \) across the line \( y = x \). Mirroring swaps rise and run, so slopes turn into their reciprocals. On the exponential curve, the slope at height \( x \) is \( x \) itself (because \( e^x \) is its own derivative). Flip that point over the diagonal and the slope becomes \( \frac{1}{x} \).

A third way to read the result: \( \ln x \) measures growth in relative terms. Going from 1 to 2 and from 50 to 100 both add \( \ln 2 \) to the logarithm, because both are doublings. A step of size \( \Delta x \) is a fraction \( \frac{\Delta x}{x} \) of the current value, so the log changes by about \( \frac{\Delta x}{x} \). That is the derivative \( \frac1x \) in disguise.

Why the derivative of ln(x) is 1/x

Proof 1: using the inverse of e^x

Let \( y = \ln(x) \). By definition this means \( e^{y} = x \). Differentiate both sides with respect to \( x \) (this is implicit differentiation):

$$e^{y}\,\frac{dy}{dx} = 1 \quad\Longrightarrow\quad \frac{dy}{dx} = \frac{1}{e^{y}} = \frac{1}{x}$$

The last step uses \( e^{y} = x \) again.

Proof 2: from the limit definition

Start with the definition of the derivative and combine the two logs with the quotient law:

$$\begin{aligned} \frac{d}{dx}\ln x &= \lim_{h\to 0}\frac{\ln(x+h) - \ln x}{h} \\ &= \lim_{h\to 0}\frac{1}{h}\ln\left(1 + \frac{h}{x}\right) \end{aligned}$$

Substitute \( n = x/h \). As \( h \to 0^{+} \), \( n \to \infty \), and the expression becomes \( \frac{1}{x}\ln\left(1 + \frac{1}{n}\right)^{n} \). Since \( \left(1 + \frac{1}{n}\right)^{n} \to e \) and \( \ln e = 1 \), the limit is \( \frac{1}{x} \).

This second proof shows why the natural log is the one with the clean derivative: the number \( e \) appears on its own in the limit, and \( \ln e = 1 \) is what removes every extra constant.

The chain rule version: derivative of ln(g(x))

Most exam questions put something inside the logarithm. Combine the rule above with the chain rule:

$$\frac{d}{dx}\ln\big(g(x)\big) = \frac{g'(x)}{g(x)}$$

In words: derivative of the inside, divided by the inside. The ratio \( \frac{g'}{g} \) is called the relative rate of change of \( g \), which is why logarithms show up whenever growth is measured in percentages.

Worked examples

Example 1: \( \ln(3x) \). The inside is \( 3x \), so the derivative is \( \frac{3}{3x} = \frac{1}{x} \). This surprises many students, but it makes sense: \( \ln(3x) = \ln 3 + \ln x \), and \( \ln 3 \) is a constant.

Example 2: \( \ln(x^2 + 1) \). The inside has derivative \( 2x \), so you divide that by the inside:

$$\frac{d}{dx}\ln(x^2+1) = \frac{2x}{x^2+1}$$

Example 3: \( \ln(\sin x) \). The inside is \( \sin x \) and its derivative is \( \cos x \):

$$\frac{d}{dx}\ln(\sin x) = \frac{\cos x}{\sin x} = \cot x$$

Example 4: \( x\ln x \). Two functions are multiplied, so use the product rule:

$$\frac{d}{dx}\big(x \ln x\big) = 1\cdot\ln x + x\cdot\frac{1}{x} = \ln x + 1$$

Example 5: simplify first. Take \( y = \ln\frac{x+1}{x-1} \) for \( x > 1 \). You could use the quotient rule inside the chain rule, but log laws make it much shorter. Split the log into a difference, then differentiate each piece:

$$\begin{aligned} y &= \ln(x+1) - \ln(x-1) \\ y' &= \frac{1}{x+1} - \frac{1}{x-1} \\ &= \frac{-2}{x^2 - 1} \end{aligned}$$

The same trick works for roots. Since \( \ln\sqrt{x^2+4} = \frac12\ln(x^2+4) \), its derivative is \( \frac12\cdot\frac{2x}{x^2+4} = \frac{x}{x^2+4} \).

Example 6: a tangent line. Find the line tangent to \( y = \ln x \) at \( x = e \). The point is \( (e, 1) \) because \( \ln e = 1 \), and the slope is \( \frac{1}{e} \). The point-slope form gives \( y - 1 = \frac1e(x - e) \), which simplifies to

$$y = \frac{x}{e}$$

This tangent line passes through the origin, a fact that often appears in exam questions. See the equation of a tangent line guide for the general method.

Example 7 (exam level): maximize \( \frac{\ln x}{x} \). By the quotient rule,

$$\frac{d}{dx}\frac{\ln x}{x} = \frac{\frac1x\cdot x - \ln x}{x^2} = \frac{1 - \ln x}{x^2}$$

The derivative is zero when \( \ln x = 1 \), so at \( x = e \). It is positive before \( e \) and negative after, so the function reaches its maximum value \( \frac{1}{e} \) there. This is the classic way to show that \( e^\pi > \pi^e \).

What about ln|x|?

The function \( \ln|x| \) is defined for every \( x \neq 0 \), and its derivative is also \( \frac{1}{x} \) on both sides of zero. For negative \( x \), \( \ln|x| = \ln(-x) \), and the chain rule gives \( \frac{-1}{-x} = \frac{1}{x} \). That is exactly why the antiderivative of \( \frac{1}{x} \) is written \( \ln|x| + C \) (see the integral of 1/x).

Logarithms with other bases

For \( \log_a x \), change the base first: \( \log_a x = \frac{\ln x}{\ln a} \). Then

$$\frac{d}{dx}\log_a x = \frac{1}{x\ln a}$$

So \( \frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10} \approx \frac{0.4343}{x} \). The extra factor \( \frac{1}{\ln a} \) is just a constant, so every logarithm has the same shape of derivative; only the natural log has the factor equal to 1.

Common mistakes

  • Dropping the inside derivative. Writing \( \frac{d}{dx}\ln(x^2+1) = \frac{1}{x^2+1} \) forgets to multiply by the derivative of the inside, \( 2x \). The correct answer is \( \frac{2x}{x^2+1} \).
  • Mixing up \( (\ln x)^2 \) and \( \ln(x^2) \). These are different functions. \( \ln(x^2) = 2\ln x \) has derivative \( \frac{2}{x} \), while \( (\ln x)^2 \) needs the chain rule and has derivative \( \frac{2\ln x}{x} \).
  • Differentiating a constant log. \( \ln 5 \) is just a number, so its derivative is 0, not \( \frac15 \).
  • Inventing a log law. \( \ln(x + 1) \) is not \( \ln x + \ln 1 \). Log laws turn products into sums, never sums into sums. Leave \( \ln(x+1) \) alone and use the chain rule.
  • Forgetting the domain. \( \ln x \) only exists for \( x > 0 \), so its derivative formula is only meaningful there. Use \( \ln|x| \) when negative inputs matter.

Where the derivative of ln(x) is used

  • Logarithmic differentiation. Taking \( \ln \) of both sides turns products, quotients and variable exponents into sums. It is the standard way to handle the derivative of x^x.
  • Integration. Reading the rule backwards gives \( \int\frac{g'(x)}{g(x)}\,dx = \ln|g(x)| + C \), the pattern behind many substitution problems and results like the integral of ln(x).
  • Exponentials. Since \( e^x \) and \( \ln x \) are inverses, knowing one derivative gives the other, as in the derivative of e^2x.
  • Growth rates. In science and economics, \( \frac{d}{dt}\ln P(t) \) is the percentage growth rate of a quantity \( P \).

Try it with the step-by-step solver

Type any logarithmic function below and the solver shows each rule it applies. You can also use the full derivative calculator for functions with several layers.

Step-by-step solverExact symbolic engine

Interactive Calculus Problem Solver

Derivatives, antiderivatives, definite and improper integrals, and limits. Every answer comes with the rules used, and antiderivatives are verified by differentiating them back.

Try:
Input syntax
  • Powers x^2, roots sqrt(x), cbrt(x), absolute value |x|
  • Implicit multiplication works: 3x sin(2x)
  • sin cos tan sec csc cot, asin acos atan, sinh cosh tanh
  • e^x or exp(x); ln(x) and log(x) are both the natural log
  • Constants pi and e; bounds accept inf and -inf
Enter a function and press Solve to see a full worked solution.

Practice problems

Try these before checking the answers.

  1. \( \frac{d}{dx}\ln(5x) \)
  2. \( \frac{d}{dx}\ln(x^3 + 2x) \)
  3. \( \frac{d}{dx}\,x^2\ln x \)
  4. \( \frac{d}{dx}\ln(\cos x) \)
  5. \( \frac{d}{dx}(\ln x)^2 \)
  6. \( \frac{d}{dx}\ln(\ln x) \)
  7. \( \frac{d}{dx}\log_{10}(x^2) \)

Answers: (1) \( \frac{1}{x} \); (2) \( \frac{3x^2 + 2}{x^3 + 2x} \); (3) \( 2x\ln x + x \); (4) \( -\tan x \); (5) \( \frac{2\ln x}{x} \); (6) \( \frac{1}{x\ln x} \); (7) \( \frac{2}{x\ln 10} \).

FAQ

Is the derivative of ln(x) the same as the derivative of log(x)?

In calculus, \( \log x \) usually means the natural log, so yes. If \( \log x \) means base 10, the derivative is \( \frac{1}{x\ln 10} \).

What is the second derivative of ln(x)?

Differentiate \( x^{-1} \) with the power rule: \( \frac{d^2}{dx^2}\ln x = -\frac{1}{x^2} \). It is always negative, so \( \ln x \) is concave down everywhere.

What is the derivative of ln(2x)?

It is \( \frac{2}{2x} = \frac{1}{x} \), for the same reason as Example 1.

What is the derivative of ln(x) at x = 2?

Plug into \( \frac1x \): the slope of \( \ln x \) at \( x = 2 \) is \( \frac12 \).

Why is the answer 1/x and not a power of x?

The power rule gives \( x^{n-1} \) with a factor \( n \), and no value of \( n \) produces \( x^{-1} \) with a nonzero factor. The logarithm fills exactly that gap, which is why \( \ln x \) is the antiderivative of \( \frac1x \).

Further reading

Calculators for this topic

Leave a comment

Your email address will not be published. Required fields are marked *