AP Calculus AB and BC

Derivative of ln x: Answer, Proof, and Mistakes

The derivative of ln x is 1/x, valid for x > 0. In prime notation, if f(x) = ln x then f'(x) = 1/x. For a composite ln(u), the chain rule gives u'/u, not 1/u. This follows because ln x is the inverse of e^x: writing e^y = x and differentiating gives dy/dx = 1/x.

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

How to prove the derivative of ln x

Start from y=lnxy = \ln x. Because lnx\ln x is the inverse of the natural exponential, this is the same statement as ey=xe^y = x, which already forces x>0x > 0 (the exponential eye^y is always positive).

ey=xe^y = x

Differentiate both sides with respect to xx. The right side is just 1; the left side needs the chain rule, since yy depends on xx.

eydydx=1e^y \cdot \frac{dy}{dx} = 1

Solve for dydx\frac{dy}{dx} and substitute ey=xe^y = x back in.

dydx=1ey=1x\frac{dy}{dx} = \frac{1}{e^y} = \frac{1}{x}

Watch the domain

lnx\ln x exists only for x>0x > 0, so the derivative 1x\frac{1}{x} is stated on that domain. The related function lnx\ln|x| has derivative 1x\frac{1}{x} for every x0x \neq 0, and that is the version that appears when you antidifferentiate 1x\frac{1}{x}.

Where ln x's derivative shows up on the AP exam

The rule ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x} is introduced in Unit 2, Topic 2.7 (Derivatives of cosx\cos x, sinx\sin x, exe^x, and lnx\ln x). It is one of the basic derivatives the College Board expects you to recall without deriving, and Unit 2 carries a weighting of 10 to 15 percent on AB and 5 to 10 percent on BC.

It most often appears inside a composite ln(u)\ln(u), where the chain rule (Unit 3, Topic 3.1) applies and you differentiate the inside and divide by it. It also turns up bare, or folded into a product or quotient such as xlnxx \ln x.

ddx[ln(u)]=uu\frac{d}{dx}\left[\ln(u)\right] = \frac{u'}{u}

The proof above is implicit differentiation (Topic 3.2): you write ey=xe^y = x, differentiate both sides, and solve for dydx\frac{dy}{dx}. It works because lnx\ln x is the inverse of exe^x, the relationship that Topic 3.3 (Differentiating Inverse Functions) is built on. That topic's own rule, g(x)=1f(g(x))g'(x) = \frac{1}{f'(g(x))}, reaches the same answer directly: with f(x)=exf(x) = e^x and g(x)=lnxg(x) = \ln x, g(x)=1elnx=1xg'(x) = \frac{1}{e^{\ln x}} = \frac{1}{x}. So this one derivative ties four CED topics together.

CED topicHow the derivative of ln x appears
2.7 Derivatives of cosx\cos x, sinx\sin x, exe^x, and lnx\ln xThe rule itself, memorized in Unit 2
3.1 The Chain RuleComposites such as ln(x2+1)\ln(x^2+1)
3.2 Implicit DifferentiationDifferentiating ey=xe^y = x to prove the rule
3.3 Differentiating Inverse FunctionsThe inverse-function theorem gives the same 1x\frac{1}{x}

Common mistakes with the derivative of ln x

  • Dropping the chain rule. ddx[ln(x2+1)]=2xx2+1\frac{d}{dx}\left[\ln(x^2+1)\right] = \frac{2x}{x^2+1}, not 1x2+1\frac{1}{x^2+1}. The inside's derivative belongs on top.
  • Using it where lnx\ln x is undefined. There is no value of lnx\ln x for x0x \le 0, so "1x\frac{1}{x} for all xx" is wrong; write x>0x > 0, or x0x \neq 0 if you mean lnx\ln|x|.
  • Confusing lnx\ln x with exe^x. The exponential keeps itself, ddx[ex]=ex\frac{d}{dx}[e^x] = e^x, while ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x} turns into a power. They are inverses, not the same rule.
  • Treating every logarithm like the natural log. For a general base, ddx[logbx]=1xlnb\frac{d}{dx}\left[\log_b x\right] = \frac{1}{x \ln b}. Only base ee gives lnb=1\ln b = 1, which is why lnx\ln x produces the clean 1x\frac{1}{x}.
  • Half-applying the chain rule on (lnx)2(\ln x)^2. The power rule and chain rule combine to 2lnx1x=2lnxx2\ln x \cdot \frac{1}{x} = \frac{2\ln x}{x}; keep both the leftover lnx\ln x and the 1x\frac{1}{x}.

Worked chain-rule examples

Example 1. Differentiate ln(x2+1)\ln(x^2+1). Let u=x2+1u = x^2+1, so u=2xu' = 2x; apply uu\frac{u'}{u}.

ddx[ln(x2+1)]=2xx2+1\frac{d}{dx}\left[\ln(x^2+1)\right] = \frac{2x}{x^2+1}

Example 2. Differentiate ln(sinx)\ln(\sin x). Now u=sinxu = \sin x and u=cosxu' = \cos x, so the quotient simplifies to cotx\cot x.

ddx[ln(sinx)]=cosxsinx=cotx\frac{d}{dx}\left[\ln(\sin x)\right] = \frac{\cos x}{\sin x} = \cot x

Example 3. Differentiate ln(5x)\ln(5x). Here u=5xu = 5x and u=5u' = 5, and the constant cancels.

ddx[ln(5x)]=55x=1x\frac{d}{dx}\left[\ln(5x)\right] = \frac{5}{5x} = \frac{1}{x}

Why the constant vanished

ln(5x)=ln5+lnx\ln(5x) = \ln 5 + \ln x, and ln5\ln 5 is a constant, so ln(5x)\ln(5x) and lnx\ln x share the same derivative 1x\frac{1}{x}. Any positive constant multiplier inside the log drops out.

Check yourself, not just the answer

Type derivatives and get graded on mathematical equivalence, with rule-level hints when you miss, in the Derivative Practice Checker.

Frequently asked questions

Is the derivative of ln x always 1/x?

On the domain of lnx\ln x, yes: for x>0x > 0, ddx[lnx]=1x\frac{d}{dx}[\ln x] = \frac{1}{x}. If you instead use lnx\ln|x|, its derivative is 1x\frac{1}{x} for every x0x \neq 0. The rule only changes when the base is not ee or the inside is not just xx.

What is the derivative of ln(u)?

Use the chain rule: ddx[ln(u)]=uu\frac{d}{dx}[\ln(u)] = \frac{u'}{u}, the derivative of the inside divided by the inside. For instance, ddx[ln(3x2+1)]=6x3x2+1\frac{d}{dx}[\ln(3x^2+1)] = \frac{6x}{3x^2+1}.

Why is the derivative of ln x equal to 1/x?

Because lnx\ln x is the inverse of exe^x. Rewrite y=lnxy = \ln x as ey=xe^y = x, differentiate both sides to get eydydx=1e^y \cdot \frac{dy}{dx} = 1, then solve: dydx=1ey=1x\frac{dy}{dx} = \frac{1}{e^y} = \frac{1}{x}.

What is the derivative of log base b of x?

ddx[logbx]=1xlnb\frac{d}{dx}[\log_b x] = \frac{1}{x \ln b}. For base 10 that is 1xln10\frac{1}{x \ln 10}. Only the natural log, where b=eb = e, gives the clean 1x\frac{1}{x}, since lne=1\ln e = 1.