AP Calculus AB and BC

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

The derivative of ln(sin x) with respect to x is cot x. The chain rule gives 1/(sin x) times cos x, which is cos x over sin x, and that ratio is the definition of cot x. The formula holds wherever sin x is positive, for instance on the interval from 0 to pi, since a logarithm needs a positive input.

ddx[ln⁡(sin⁡x)]=cot⁡x\frac{d}{dx}\left[\ln(\sin x)\right] = \cot x

The proof: chain rule on ln(sin x)

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

ddxln⁡(sin⁡x)=1sin⁡x⋅cos⁡x=cos⁡xsin⁡x=cot⁡x\frac{d}{dx}\ln(\sin x) = \frac{1}{\sin x}\cdot\cos x = \frac{\cos x}{\sin x} = \cot x

The ratio cos⁡xsin⁡x\frac{\cos x}{\sin x} is the definition of cot⁡x\cot x, so a two step chain rule (Topic 3.1) collapses into one named function.

Where ln(sin x) is defined

A logarithm accepts positive inputs only, so this function needs sin⁡x>0\sin x > 0. That gives the intervals (0,π)(0, \pi), (2π,3π)(2\pi, 3\pi), and every shift of those by 2π2\pi. Outside them the function does not exist, so neither does a slope.

On (0,π)(0, \pi) the graph climbs from −∞-\infty to a maximum of ln⁡1=0\ln 1 = 0 at x=π2x = \frac{\pi}{2}, then falls back to −∞-\infty. The derivative agrees: cot⁡x\cot x is positive on (0,π2)\left(0, \frac{\pi}{2}\right), zero at π2\frac{\pi}{2}, and negative on (π2,π)\left(\frac{\pi}{2}, \pi\right).

The same fact read backwards: the integral of cot x

Since differentiating ln⁡(sin⁡x)\ln(\sin x) produces cot⁡x\cot x, an antiderivative of cot⁡x\cot x is a logarithm of sine. The absolute value in the standard form covers the intervals where sin⁡x\sin x is negative.

∫cot⁡x dx=ln⁡∣sin⁡x∣+C\int \cot x\,dx = \ln|\sin x| + C

The substitution behind it is u=sin⁡xu = \sin x with du=cos⁡x dxdu = \cos x\,dx, which turns ∫cos⁡xsin⁡x dx\int \frac{\cos x}{\sin x}\,dx into ∫1u du\int \frac{1}{u}\,du.

Common mistakes

  • Answering csc⁡x\csc x. That is 1sin⁡x\frac{1}{\sin x}, the outer part alone, with the inner derivative cos⁡x\cos x never applied.
  • Answering tan⁡x\tan x by flipping the ratio. Cosine lands on top, so the quotient is cos⁡xsin⁡x\frac{\cos x}{\sin x}.
  • Confusing ln⁡(sin⁡x)\ln(\sin x) with sin⁡(ln⁡x)\sin(\ln x), whose derivative is cos⁡(ln⁡x)x\frac{\cos(\ln x)}{x}.
  • Using the formula where sin⁡x≤0\sin x \leq 0, for example at x=4x = 4. The original function is undefined there.

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

It is cot⁡x\cot x. The chain rule gives 1sin⁡x⋅cos⁡x=cos⁡xsin⁡x\frac{1}{\sin x}\cdot\cos x = \frac{\cos x}{\sin x}, which is cot⁡x\cot x.

Why is the answer not csc x?

csc⁡x=1sin⁡x\csc x = \frac{1}{\sin x} is only the outer derivative. The chain rule multiplies it by the inner derivative cos⁡x\cos x, and the product simplifies to cot⁡x\cot x.

What is the derivative of ln(cos x)?

It is −tan⁡x-\tan x, by the same chain rule: 1cos⁡x⋅(−sin⁡x)=−sin⁡xcos⁡x\frac{1}{\cos x}\cdot(-\sin x) = -\frac{\sin x}{\cos x}.