Differentiation, Chapter 09

Derivatives of Logarithms

Where d/dx[ln x] = 1/x comes from, why any log base works, how to handle composite log functions, all in plain English with 12 worked examples.

✦ Full Proof of d/dx[ln x] ✦ Any Base logₐ x ✦ Chain Rule Forms ✦ 12 Worked Exercises ✦ Interactive Graph ✦ 10-Question Quiz
Share this page

§ 01What Is a Logarithm? A Quick Plain-English Recap

Before we differentiate logarithms, let us make sure the concept itself is completely clear. Many students treat logs as a mystery: they aren't.

A logarithm answers one question: "What power do I raise the base to in order to get this number?"

For example: log₂(8) = 3, because 2³ = 8. The base is 2, the result is 3, and you're asking "what power of 2 gives me 8?" The answer is 3.

In calculus, one particular base comes up constantly: the number e ≈ 2.718... The logarithm with base e is called the natural logarithm, written ln x. So ln(x) asks: "what power do I raise e to in order to get x?" This is the log you will use in 90% of calculus problems.

ln and log — which is which? In pure mathematics and calculus, "log" almost always means the natural logarithm (base e), not base 10. In engineering and some school contexts, "log" means base 10. On this page we always write ln x for the natural log and logₐ x when the base is something other than e. If your textbook just writes log x, check what base it means.

The key relationship to keep in your head is this: ln and eˣ are inverses of each other. This means ln(eˣ) = x and e^(ln x) = x. This inverse relationship is exactly what we use to derive the derivative.

§ 02Deriving d/dx[ln x] — The Full Proof

The derivative of ln x is 1/x. We are going to show exactly why, using implicit differentiation. No steps are skipped.

The trick is to use the inverse relationship. Instead of differentiating y = ln x directly, we rewrite it as an exponential equation (which we already know how to differentiate) and then use implicit differentiation.

Proof — d/dx [ln x] = 1/x

Start with y = ln x. Rewrite using the definition of the natural log as an inverse of eˣ:

eʸ = x These two equations say exactly the same thing. "y = ln x" and "eʸ = x" are just different ways of writing the same relationship.

Differentiate both sides with respect to x. The left side needs the chain rule: eʸ is a composite function (e to the power y, where y depends on x):

eʸ · dy/dx = 1 Right side: d/dx[x] = 1. Left side: d/dx[eʸ] = eʸ · dy/dx by the chain rule, because d/du[eᵘ] = eᵘ and u = y(x).

Solve for dy/dx by dividing both sides by eʸ:

dy/dx = 1 / eʸ

Now substitute back. We started with eʸ = x, so replace eʸ with x:

dy/dx = 1 / x This is the final result. Notice how cleanly the e disappears — it cancels because of the inverse relationship between ln and eˣ.
The Key Result
d/dx [ln x] = 1/x  ,   x > 0

A few things to notice. First, the domain: ln x is only defined for x > 0, so the derivative 1/x is only valid for x > 0. Second, the result is surprisingly simple: the complicated-looking function ln x has a beautifully clean derivative.

What about ln|x|?

When you extend to negative x, you can show that d/dx[ln|x|] = 1/x for all x ≠ 0. This version is what appears in integration: ∫ 1/x dx = ln|x| + c. The absolute value sign handles the negative-x case.

§ 03Logs to Any Base — d/dx[logₐ x]

What if the base is not e? We use one tool: the change-of-base formula. It converts any log into a natural log, which we can then differentiate.

The change-of-base formula

For any base a > 0, a ≠ 1, the change-of-base formula states:

Change-of-base formula
logₐ(x) = ln(x) / ln(a)

Since ln(a) is just a constant (a is a fixed base, not a variable), we can pull it outside the derivative:

Derivation — d/dx [logₐ x]

Apply change-of-base to rewrite logₐ x in terms of ln:

logₐ(x) = ln(x) / ln(a) ln(a) is a constant — it does not contain x and does not change when we differentiate.

Differentiate. Since 1/ln(a) is a constant multiplier, it comes outside:

d/dx [logₐ x] = (1/ln(a)) · d/dx [ln x] = (1/ln(a)) · (1/x)

Write the final result:

d/dx [logₐ x] = 1 / (x · ln a)
General Log Derivative
d/dx [logₐ x] = 1 / (x · ln a)

Check: when a = e, ln(e) = 1, so the formula gives 1/(x · 1) = 1/x, which matches our result for ln x. Good.

For log base 10 (common log), the derivative is 1/(x · ln 10) ≈ 1/(x · 2.303). This is one reason why calculus prefers the natural log, its derivative is the cleaner 1/x.

§ 04Chain Rule with Logs — ln(f(x))

In practice, the argument of a log is rarely just x. It is usually a function of x, like ln(3x²) or ln(sin x). This is where the chain rule enters.

The chain rule says: when you have a function inside another function, multiply the outer derivative by the inner derivative. For ln(g(x)):

Chain rule with the natural log
d/dx [ln(g(x))] = g′(x) / g(x)

In plain English: differentiate what is inside the log, then divide by what is inside the log. That is all it is.

Quick example — ln(3x + 1)
Inside: g(x) = 3x + 1
g′(x) = 3
d/dx [ln(3x + 1)] = 3 / (3x + 1)
Quick example — ln(x²)
Inside: g(x) = x²
g′(x) = 2x
d/dx [ln(x²)] = 2x / x² = 2/x
Sanity check — ln(x²) vs 2·ln(x) By log laws, ln(x²) = 2·ln(x). So d/dx[2·ln(x)] = 2 · (1/x) = 2/x. Both routes give the same answer — a good sign. Whenever a log argument is a simple power, you can use log laws to simplify before differentiating.

The general chain-rule version for any base

Chain rule with logₐ
d/dx [logₐ(g(x))] = g′(x) / (g(x) · ln a)

The pattern is the same: differentiate the inside, divide by the inside, then divide by ln(a) for the base correction.

§ 05Complete Reference Table

Every log derivative you will encounter in undergraduate calculus, in one place. The chain-rule column shows the composite version, memorise both rows together.

Function f(x) Derivative f′(x) Composite form d/dx[f(g(x))] Notes
ln x 1/x g′(x) / g(x) x > 0; most common in calculus
ln|x| 1/x g′(x) / g(x) Valid for all x ≠ 0; used in integration
logₐ x 1 / (x ln a) g′(x) / (g(x) · ln a) a > 0, a ≠ 1; uses change-of-base
log₁₀ x 1 / (x ln 10) g′(x) / (g(x) · ln 10) ln 10 ≈ 2.303
log₂ x 1 / (x ln 2) g′(x) / (g(x) · ln 2) ln 2 ≈ 0.693
ln(x²) 2/x Same as 2·ln(x) by log laws → 2·(1/x)
ln(xⁿ) n/x Same as n·ln(x) by log laws → n·(1/x)

§ 06Log Laws That Make Differentiation Easier

Before differentiating, it is often worth simplifying a log expression using the log laws. A log of a product becomes a sum; a log of a power becomes a multiple. Both are easier to differentiate.

The three log laws — simplify before differentiating
ln(AB) = ln A + ln B   (product → sum)
ln(A/B) = ln A − ln B   (quotient → difference)
ln(Aⁿ) = n · ln A     (power → multiple)

Example of simplifying first

Suppose you need to differentiate y = ln(x³ · √(x+1)). This looks messy, but log laws turn it into something much cleaner:

Simplify ln(x³ · √(x+1)) before differentiating

Apply the product law, log of a product becomes a sum:

y = ln(x³) + ln(√(x+1))

Apply the power law to each term. Recall √(x+1) = (x+1)^(1/2):

y = 3·ln(x) + (1/2)·ln(x+1)

Now differentiate term by term: no chain rule complexity needed on the first term:

dy/dx = 3 · (1/x) + (1/2) · [1/(x+1)] = 3/x + 1/(2(x+1))

Compare this to differentiating ln(x³ · √(x+1)) directly using the chain rule: you'd need to differentiate the product x³ · √(x+1) first using the product rule, then divide. The log-law approach is much cleaner.

Rule of thumb: simplify complex log arguments first If the argument of a log is a product, quotient, or power — expand it with the log laws before differentiating. This turns one ugly chain-rule problem into several simple ones.

§ 07Interactive Graph — Function and Derivative Together

The gold curve is the log function itself. The teal curve is its derivative. Hover to read exact values. Try different functions and notice how the derivative curve reflects the changing slope of the original.

← Hover over the graph to explore values

§ 08Twelve Worked Exercises

Attempt each problem yourself before revealing the solution. Every step is explained in plain English: no skipped algebra.

Exercises opened: 0 / 12

Group A — Basic Natural Log Forms (Exercises 1–4)

Exercise 01 Basic
Differentiate   y = ln(x)
  1. This is the foundational result. Apply the definition directly: dy/dx = 1/x
  2. State the domain: the answer is only valid where ln is defined: dy/dx = 1/x,   x > 0
Exercise 02 Basic
Differentiate   y = ln(5x)
You can do this two ways: (a) use the chain rule with g(x) = 5x, or (b) use the log law ln(5x) = ln 5 + ln x first, then differentiate. Both give the same answer.
  1. Method 1, Chain rule: Inside is g(x) = 5x, so g′(x) = 5. Apply d/dx[ln(g)] = g′/g: dy/dx = 5 / (5x) = 1/x
  2. Method 2: Log law first: ln(5x) = ln 5 + ln x. Since ln 5 is a constant, its derivative is zero: dy/dx = 0 + 1/x = 1/x
  3. Both methods agree, any constant multiplier inside ln x disappears when differentiated: dy/dx = 1/x This is why d/dx[ln(cx)] = 1/x for any constant c. The c vanishes. Very useful to know.
Exercise 03 Basic
Differentiate   y = 3·ln(x) + x²
  1. The sum rule says: differentiate each term separately.
  2. Differentiate 3·ln(x). The constant 3 stays out front: d/dx [3·ln x] = 3 · (1/x) = 3/x
  3. Differentiate x² using the power rule: d/dx [x²] = 2x
  4. Add the two results: dy/dx = 3/x + 2x
Exercise 04 Basic
Differentiate   y = ln(x⁴)
Use the log power law: ln(x⁴) = 4·ln(x). Then differentiate — it becomes trivial.
  1. Apply the log power law: ln(x⁴) = 4·ln(x).
  2. Differentiate 4·ln(x): dy/dx = 4 · (1/x) = 4/x
  3. You would get the same answer using the chain rule (g = x⁴, g′ = 4x³, result = 4x³/x⁴ = 4/x), but the log-law route is faster: dy/dx = 4/x

Group B — Chain Rule with ln (Exercises 5–8)

Exercise 05 Medium
Differentiate   y = ln(3x + 7)
  1. Identify the inside function: g(x) = 3x + 7.
  2. Differentiate the inside: g′(x) = 3.
  3. Apply d/dx[ln(g)] = g′/g. Divide the inside derivative by the inside function: dy/dx = 3 / (3x + 7)
  4. This is already fully simplified. State the domain: 3x + 7 > 0, i.e. x > −7/3: dy/dx = 3 / (3x + 7)
Exercise 06 Medium
Differentiate   y = ln(x² + 1)
Inside function is g(x) = x² + 1. Its derivative is 2x. Apply the chain rule formula: g′/g.
  1. Inside function: g(x) = x² + 1. Note that x² + 1 is always positive for all real x, so no domain restriction issues here.
  2. Differentiate the inside: g′(x) = 2x.
  3. Chain rule: dy/dx = 2x / (x² + 1)
  4. This is fully simplified: numerator and denominator share no common factors: dy/dx = 2x / (x² + 1)
Exercise 07 Medium
Differentiate   y = ln(sin x)
Inside function is g(x) = sin x. You need its derivative — recall d/dx[sin x] = cos x.
  1. Inside function: g(x) = sin x. Derivative: g′(x) = cos x.
  2. Chain rule: dy/dx = cos(x) / sin(x)
  3. Recognise the trig identity: cos x / sin x = cot x: dy/dx = cot x So d/dx[ln(sin x)] = cot x. This result appears often in integration, ∫cot x dx = ln|sin x| + c.
Exercise 08 Medium
Differentiate   y = ln(x³ · √(x + 1))
Use log laws to break this up before differentiating: ln(x³ · √(x+1)) = ln(x³) + ln(√(x+1)) = 3·ln x + (1/2)·ln(x+1). Then differentiate term by term.
  1. Apply log product law: ln(x³ · √(x+1)) = ln(x³) + ln(√(x+1)).
  2. Apply log power law to each term. √(x+1) = (x+1)^(1/2): y = 3·ln(x) + (1/2)·ln(x+1)
  3. Differentiate term by term: dy/dx = 3·(1/x) + (1/2)·[1/(x+1)]
  4. Simplify: dy/dx = 3/x + 1/(2(x+1))

Group C — Combined Rules (Exercises 9–12)

Exercise 09 Hard
Differentiate   y = x² · ln(x)
This is a product of two functions: u = x² and v = ln(x). Apply the product rule: dy/dx = u′v + uv′.
  1. Product rule with u = x² and v = ln(x): u′ = 2x,   v′ = 1/x
  2. Apply dy/dx = u′v + uv′: dy/dx = 2x·ln(x) + x²·(1/x)
  3. Simplify the second term, x² / x = x: dy/dx = 2x·ln(x) + x
  4. Factor out x: dy/dx = x(2·ln x + 1)
Exercise 10 Hard
Differentiate   y = ln(x) / x
This is a quotient. Use the quotient rule with u = ln(x) (top) and v = x (bottom). The quotient rule: dy/dx = (u′v − uv′) / v².
  1. Quotient rule with u = ln(x) and v = x: u′ = 1/x,   v′ = 1
  2. Apply dy/dx = (u′v − uv′) / v²: = [(1/x)·x − ln(x)·1] / x²
  3. The (1/x)·x in the numerator simplifies to 1: = [1 − ln(x)] / x²
  4. dy/dx = (1 − ln x) / x²
Exercise 11 Hard
Differentiate   y = ln(ln(x))
This is a log of a log — a double chain rule. The outer function is ln(something) and the inner function is ln(x). Apply the chain rule: outer derivative × inner derivative.
  1. Outer function: ln(u) where u = ln(x). Derivative of outer: 1/u = 1/ln(x).
  2. Inner function: ln(x). Derivative of inner: 1/x.
  3. Chain rule, multiply them: dy/dx = (1/ln x) · (1/x)
  4. dy/dx = 1 / (x · ln x) Domain requires x > 0 (for ln x to exist) and ln x > 0 (for ln(ln x) to exist), so x > 1.
Exercise 12 Hard
Differentiate   y = ln((x² + 3) / (2x − 1))
Use the log quotient law first: ln(A/B) = ln A − ln B. This splits one messy chain-rule problem into two simple ones.
  1. Apply the log quotient law: ln((x²+3)/(2x−1)) = ln(x²+3) − ln(2x−1).
  2. Differentiate ln(x²+3). Inside: g = x²+3, g′ = 2x: d/dx[ln(x²+3)] = 2x / (x²+3)
  3. Differentiate ln(2x−1). Inside: g = 2x−1, g′ = 2: d/dx[ln(2x−1)] = 2 / (2x−1)
  4. Subtract (because of the minus sign between the two log terms): dy/dx = 2x/(x²+3) − 2/(2x−1)

§ 09Common Mistakes

These are the errors that come up most often in assessments. Reading them now costs you nothing: repeating them in an exam costs you marks.

✗ Writing d/dx[ln x] = ln(1) = 0

Wrong: Some students confuse "differentiate ln x" with "substitute x = 1 into ln x." These are completely different operations.

Correct: d/dx[ln x] = 1/x. The derivative is a function of x, not a number.

✗ Forgetting the chain rule — writing d/dx[ln(3x+1)] = 1/(3x+1)

Wrong: This omits the inner derivative. The inside is g = 3x+1, so g′ = 3.

Correct: d/dx[ln(3x+1)] = 3/(3x+1). Always ask: what is inside the log, and what is its derivative?

✗ Treating ln(x + y) as ln(x) + ln(y)

Wrong: The product law says ln(x · y) = ln x + ln y. Addition inside a log is not the same as multiplication: ln(x + y) cannot be split up.

Correct: Only use log laws when the argument is a product, quotient, or power.

✗ Differentiating ln(x²) as 1/x² instead of 2/x

Wrong: Treating ln(x²) as though x² is just sitting there passively, giving 1/x².

Correct: Either use the chain rule (2x / x² = 2/x) or use the log power law first (ln(x²) = 2·ln x, derivative = 2/x). Both give 2/x.

✗ Ignoring the domain restriction

ln x is only defined for x > 0. When the argument is a function g(x), the domain of the derivative is wherever g(x) > 0. Examiners sometimes award marks specifically for stating this.

§ 1010-Question Quiz

Test your understanding. Pick an answer for each question, then press Submit to see your score with full explanations.

Log Derivatives — Quiz

Question 01 of 10
What is d/dx [ln x]?
  • ln(1/x)
  • 1/x
  • x · ln x
Question 02 of 10
What is d/dx [ln(7x)]?
  • 7/x
  • 1/(7x)
  • 1/x
  • ln 7 / x
Question 03 of 10
Find d/dx [ln(x² + 4)]
  • 1/(x² + 4)
  • 2/(x² + 4)
  • 2x/(x² + 4)
  • x/(x² + 4)
Question 04 of 10
What is d/dx [log₁₀ x]?
  • 1/x
  • 10/x
  • 1/(x · ln 10)
  • ln(10)/x
Question 05 of 10
Find d/dx [ln(sin x)]
  • sin x / cos x
  • tan x
  • cot x
  • 1/sin x
Question 06 of 10
The derivative of ln x is derived by writing eʸ = x and then differentiating both sides. After differentiating, we get eʸ · dy/dx = 1. The next step is ...
  • Substitute y = ln x to get dy/dx = 1/ln x
  • Divide both sides by eʸ, then replace eʸ with x to get dy/dx = 1/x
  • Multiply both sides by eʸ
  • Take ln of both sides
Question 07 of 10
Find d/dx [x · ln x]
  • ln x
  • 1 + ln x
  • x + ln x
  • ln x / x
Question 08 of 10
Using log laws, what is the first step to simplify ln(x⁵ / (x+2)) before differentiating?
  • ln(x⁵) · ln(x+2)
  • 5·ln x − ln(x+2)
  • ln(x⁵ − x − 2)
  • 5·ln x / ln(x+2)
Question 09 of 10
Find d/dx [ln(ln x)]
  • 1/x
  • 1/(x · ln x)
  • ln x / x
  • 1/(ln x)²
Question 10 of 10
The function y = ln x has derivative 1/x. What does this tell us about the gradient of y = ln x at x = 1?
  • The gradient is 0
  • The gradient is undefined
  • The gradient is 1
  • The gradient is ln 1 = 0
❧     ❧     ❧

Cookie Settings