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(sinx)]=cotx\frac{d}{dx}\left[\ln(\sin x)\right] = \cot x

The proof: chain rule on ln(sin x)

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

ddxln(sinx)=1sinxcosx=cosxsinx=cotx\frac{d}{dx}\ln(\sin x) = \frac{1}{\sin x}\cdot\cos x = \frac{\cos x}{\sin x} = \cot x

The ratio cosxsinx\frac{\cos x}{\sin x} is the definition of cotx\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 sinx>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 ln1=0\ln 1 = 0 at x=π2x = \frac{\pi}{2}, then falls back to -\infty. The derivative agrees: cotx\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(sinx)\ln(\sin x) produces cotx\cot x, an antiderivative of cotx\cot x is a logarithm of sine. The absolute value in the standard form covers the intervals where sinx\sin x is negative.

cotxdx=lnsinx+C\int \cot x\,dx = \ln|\sin x| + C

The substitution behind it is u=sinxu = \sin x with du=cosxdxdu = \cos x\,dx, which turns cosxsinxdx\int \frac{\cos x}{\sin x}\,dx into 1udu\int \frac{1}{u}\,du.

Common mistakes

  • Answering cscx\csc x. That is 1sinx\frac{1}{\sin x}, the outer part alone, with the inner derivative cosx\cos x never applied.
  • Answering tanx\tan x by flipping the ratio. Cosine lands on top, so the quotient is cosxsinx\frac{\cos x}{\sin x}.
  • Confusing ln(sinx)\ln(\sin x) with sin(lnx)\sin(\ln x), whose derivative is cos(lnx)x\frac{\cos(\ln x)}{x}.
  • Using the formula where sinx0\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 cotx\cot x. The chain rule gives 1sinxcosx=cosxsinx\frac{1}{\sin x}\cdot\cos x = \frac{\cos x}{\sin x}, which is cotx\cot x.

Why is the answer not csc x?

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

What is the derivative of ln(cos x)?

It is tanx-\tan x, by the same chain rule: 1cosx(sinx)=sinxcosx\frac{1}{\cos x}\cdot(-\sin x) = -\frac{\sin x}{\cos x}.