AP Calculus AB and BC

Derivative of ln(tan x): Answer, Proof, Simplification

The derivative of ln(tan x) is 1 divided by sin x cos x, which is also written 2 csc(2x). The chain rule gives sec^2 x over tan x, and the deciding step is simplifying that quotient, because the raw version hides where the derivative is small and where it grows without bound.

ddx[ln⁡(tan⁡x)]=1sin⁡xcos⁡x\frac{d}{dx}\left[\ln\left(\tan x\right)\right] = \frac{1}{\sin x\cos x}

Chain rule, then clean up

Outer function ln⁡u\ln u, inner function u=tan⁡xu = \tan x. Differentiating the outer gives 1u\frac{1}{u} and the inner derivative is sec⁡2x\sec^{2}x, so the first form of the answer is a quotient of trig functions.

ddxln⁡(tan⁡x)=1tan⁡x⋅sec⁡2x=sec⁡2xtan⁡x\frac{d}{dx}\ln\left(\tan x\right) = \frac{1}{\tan x}\cdot\sec^{2}x = \frac{\sec^{2}x}{\tan x}

Convert everything to sines and cosines and the quotient collapses. sec⁡2x=1cos⁡2x\sec^{2}x = \frac{1}{\cos^{2}x} and 1tan⁡x=cos⁡xsin⁡x\frac{1}{\tan x} = \frac{\cos x}{\sin x}, so one power of cos⁡x\cos x cancels.

1cos⁡2x⋅cos⁡xsin⁡x=1sin⁡xcos⁡x=2sin⁡2x=2csc⁡2x\frac{1}{\cos^{2}x}\cdot\frac{\cos x}{\sin x} = \frac{1}{\sin x\cos x} = \frac{2}{\sin 2x} = 2\csc 2x

Why the simplified form is worth the extra line

ln⁡(tan⁡x)\ln\left(\tan x\right) needs tan⁡x>0\tan x > 0, so take the interval (0,π2)\left(0,\frac{\pi}{2}\right). Written as 2sin⁡2x\frac{2}{\sin 2x}, the derivative is transparent: sin⁡2x\sin 2x runs from 00 up to 11 and back to 00 across that interval.

So the derivative is never smaller than 22, hits exactly 22 at x=π4x = \frac{\pi}{4}, and blows up at both ends of the interval. The blow-up at x=π2x = \frac{\pi}{2} is invisible in sec⁡2xtan⁡x\frac{\sec^{2}x}{\tan x}, where both parts run to infinity at once and the quotient's behaviour is not readable off the page, and nothing in that form shows the minimum value of 22.

The derivative is also positive everywhere on the interval, which confirms that ln⁡(tan⁡x)\ln\left(\tan x\right) is increasing throughout, running from −∞-\infty at the left end to +∞+\infty at the right.

The mistakes students make

Three of the four below produce a wrong answer outright. The other produces a correct answer in a form that costs marks whenever the question goes on to ask about behaviour.

  • Reporting 1tan⁡x\frac{1}{\tan x}, that is cot⁡x\cot x, after applying the logarithm rule and forgetting to multiply by the inner derivative sec⁡2x\sec^{2}x.
  • Cancelling inside sec⁡2xtan⁡x\frac{\sec^{2}x}{\tan x} down to sec⁡x\sec x. The cancellation that is legal is sec⁡xtan⁡x=csc⁡x\frac{\sec x}{\tan x} = \csc x, which leaves sec⁡xcsc⁡x\sec x\csc x, not sec⁡x\sec x. The discarded csc⁡x\csc x is the whole difference, and sec⁡xcsc⁡x\sec x\csc x is just 1sin⁡xcos⁡x\frac{1}{\sin x\cos x} again.
  • Leaving the answer as sec⁡2xtan⁡x\frac{\sec^{2}x}{\tan x}. It is correct, but it hides that the derivative never drops below 22 and blows up at both ends of (0,π2)\left(0,\frac{\pi}{2}\right), which is exactly what a follow-up part will ask about.
  • Reading ln⁡(tan⁡x)\ln\left(\tan x\right) as ln⁡x⋅tan⁡x\ln x\cdot\tan x and using the product rule, which produces tan⁡xx+ln⁡xsec⁡2x\frac{\tan x}{x}+\ln x\sec^{2}x, an answer for a different function entirely.

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(tan x)?

It is 1sin⁡xcos⁡x\frac{1}{\sin x\cos x}. The chain rule gives sec⁡2xtan⁡x\frac{\sec^{2}x}{\tan x}, and rewriting in sines and cosines reduces it to that.

Why is the derivative of ln(tan x) equal to 2 csc(2x)?

Because the double angle identity says sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos x, so 1sin⁡xcos⁡x=2sin⁡2x=2csc⁡2x\frac{1}{\sin x\cos x} = \frac{2}{\sin 2x} = 2\csc 2x. All three forms are the same function.

What is the domain of ln(tan x)?

Wherever tan⁡x>0\tan x > 0, such as (0,π2)\left(0,\frac{\pi}{2}\right) and (π,3π2)\left(\pi,\frac{3\pi}{2}\right). The derivative formula applies on those intervals only.