AP Calculus AB and BC

Derivative of ln(cos x): Answer, Proof, Mistakes

The derivative of ln(cos x) with respect to x is -tan x. By the chain rule with inner function cos x, the derivative is (1/cos x) times -sin x, which equals -sin x over cos x, that is -tan x. This is valid only where cos x is positive, since ln is defined for positive inputs.

ddx[ln(cosx)]=tanx\frac{d}{dx}\left[\ln(\cos x)\right] = -\tan x

The proof: chain rule on ln(cos x)

The outer function is lnu\ln u and the inner is u=cosxu = \cos x. Differentiate the outer to 1u\frac{1}{u}, then multiply by the inner derivative u=sinxu' = -\sin x.

ddxln(cosx)=1cosx(sinx)=sinxcosx=tanx\frac{d}{dx}\ln(\cos x) = \frac{1}{\cos x}\cdot(-\sin x) = -\frac{\sin x}{\cos x} = -\tan x

The quotient sinxcosx\frac{\sin x}{\cos x} is the definition of tanx\tan x, and the minus sign comes straight from the derivative of the inner cosx\cos x. This same pattern gives the standard result tanxdx=lncosx+C\int \tan x\,dx = -\ln|\cos x| + C when read in reverse.

Where the domain restricts the formula

The logarithm only accepts positive inputs, so ln(cosx)\ln(\cos x) is defined only where cosx>0\cos x > 0, on intervals like (π2,π2)\left(-\frac{\pi}{2}, \frac{\pi}{2}\right). The sample points x=0.8,0,0.5,1x = -0.8, 0, 0.5, 1 all sit inside that interval, where cosx\cos x is positive.

On that interval tanx-\tan x is negative for x>0x > 0 and positive for x<0x < 0, so ln(cosx)\ln(\cos x) rises toward its peak at x=0x = 0 and falls after it. That peak matches the maximum of cosx\cos x at x=0x = 0.

Common mistakes

  • Answering tanx\tan x with no minus sign. The inner derivative of cosx\cos x is sinx-\sin x, and that minus carries all the way to the final tanx-\tan x.
  • Answering 1cosx\frac{1}{\cos x} and forgetting the chain rule. Differentiating lnu\ln u gives 1u\frac{1}{u}, but you still multiply by u=sinxu' = -\sin x.
  • Writing sinxcosx-\frac{\sin x}{\cos x} but not recognizing it as tanx-\tan x, then mis-simplifying it to sinxcosx-\sin x \cdot \cos x.
  • Confusing ln(cosx)\ln(\cos x) with cos(lnx)\cos(\ln x). The order of composition is different, and so is the derivative.

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

What is the derivative of ln(cos x)?

It is tanx-\tan x. The chain rule gives 1cosx(sinx)=sinxcosx=tanx\frac{1}{\cos x}\cdot(-\sin x) = -\frac{\sin x}{\cos x} = -\tan x.

Why is there a negative sign?

The inner function is cosx\cos x, whose derivative is sinx-\sin x. That minus sign multiplies through the chain rule and survives in the final answer tanx-\tan x.

What is the domain of the derivative?

It matches the domain of ln(cosx)\ln(\cos x), namely the intervals where cosx>0\cos x > 0, such as (π2,π2)\left(-\frac{\pi}{2}, \frac{\pi}{2}\right). There tanx-\tan x is defined and finite.