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

Chain rule, then clean up

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

ddxln(tanx)=1tanxsec2x=sec2xtanx\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. sec2x=1cos2x\sec^{2}x = \frac{1}{\cos^{2}x} and 1tanx=cosxsinx\frac{1}{\tan x} = \frac{\cos x}{\sin x}, so one power of cosx\cos x cancels.

1cos2xcosxsinx=1sinxcosx=2sin2x=2csc2x\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(tanx)\ln\left(\tan x\right) needs tanx>0\tan x > 0, so take the interval (0,π2)\left(0,\frac{\pi}{2}\right). Written as 2sin2x\frac{2}{\sin 2x}, the derivative is transparent: sin2x\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 sec2xtanx\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(tanx)\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 1tanx\frac{1}{\tan x}, that is cotx\cot x, after applying the logarithm rule and forgetting to multiply by the inner derivative sec2x\sec^{2}x.
  • Cancelling inside sec2xtanx\frac{\sec^{2}x}{\tan x} down to secx\sec x. The cancellation that is legal is secxtanx=cscx\frac{\sec x}{\tan x} = \csc x, which leaves secxcscx\sec x\csc x, not secx\sec x. The discarded cscx\csc x is the whole difference, and secxcscx\sec x\csc x is just 1sinxcosx\frac{1}{\sin x\cos x} again.
  • Leaving the answer as sec2xtanx\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(tanx)\ln\left(\tan x\right) as lnxtanx\ln x\cdot\tan x and using the product rule, which produces tanxx+lnxsec2x\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 1sinxcosx\frac{1}{\sin x\cos x}. The chain rule gives sec2xtanx\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 sin2x=2sinxcosx\sin 2x = 2\sin x\cos x, so 1sinxcosx=2sin2x=2csc2x\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 tanx>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.