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⁡(cos⁡x)]=−tan⁡x\frac{d}{dx}\left[\ln(\cos x)\right] = -\tan x

The proof: chain rule on ln(cos x)

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

ddxln⁡(cos⁡x)=1cos⁡x⋅(−sin⁡x)=−sin⁡xcos⁡x=−tan⁡x\frac{d}{dx}\ln(\cos x) = \frac{1}{\cos x}\cdot(-\sin x) = -\frac{\sin x}{\cos x} = -\tan x

The quotient sin⁡xcos⁡x\frac{\sin x}{\cos x} is the definition of tan⁡x\tan x, and the minus sign comes straight from the derivative of the inner cos⁡x\cos x. This same pattern gives the standard result ∫tan⁡x dx=−ln⁡∣cos⁡x∣+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⁡(cos⁡x)\ln(\cos x) is defined only where cos⁡x>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 cos⁡x\cos x is positive.

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

Common mistakes

  • Answering tan⁡x\tan x with no minus sign. The inner derivative of cos⁡x\cos x is −sin⁡x-\sin x, and that minus carries all the way to the final −tan⁡x-\tan x.
  • Answering 1cos⁡x\frac{1}{\cos x} and forgetting the chain rule. Differentiating ln⁡u\ln u gives 1u\frac{1}{u}, but you still multiply by u′=−sin⁡xu' = -\sin x.
  • Writing −sin⁡xcos⁡x-\frac{\sin x}{\cos x} but not recognizing it as −tan⁡x-\tan x, then mis-simplifying it to −sin⁡x⋅cos⁡x-\sin x \cdot \cos x.
  • Confusing ln⁡(cos⁡x)\ln(\cos x) with cos⁡(ln⁡x)\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 −tan⁡x-\tan x. The chain rule gives 1cos⁡x⋅(−sin⁡x)=−sin⁡xcos⁡x=−tan⁡x\frac{1}{\cos x}\cdot(-\sin x) = -\frac{\sin x}{\cos x} = -\tan x.

Why is there a negative sign?

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

What is the domain of the derivative?

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