Integral of cot x: Formula, Derivation and Examples
The integral of cot x is ln|sin x| + C. See the u-substitution with u = sin x, how it pairs with tan x, plus cot(ax), cot² x and definite integral examples.
Trigonometric integrals Updated 2 min read
At a glance
- Antiderivative
- \ln\lvert\sin x\rvert + C
- Equivalent form
- -\ln\lvert\csc x\rvert + C
- Method
- Rewrite as \dfrac{\cos x}{\sin x}, then u = \sin x
- Linear form
- \int\cot(ax)\,dx = \dfrac{1}{a}\ln\lvert\sin(ax)\rvert + C
- Check
- \dfrac{d}{dx}\ln\lvert\sin x\rvert = \cot x
On this page
The integral of \cot x is \ln\lvert\sin x\rvert + C. It comes from one substitution and is the mirror image of the integral of tan x.
Graph of cot x and its antiderivative
Derivation, step by step
- Rewrite: \displaystyle\int\cot x\,dx = \int\frac{\cos x}{\sin x}\,dx.
- Let u = \sin x. Then du = \cos x\,dx.
- Substitute: \displaystyle\int\frac{du}{u} = \ln\lvert u\rvert + C.
- Put u = \sin x back: \ln\lvert\sin x\rvert + C.
Step 3 is the integral of 1/x. Because \ln\lvert\sin x\rvert = -\ln\lvert\csc x\rvert, some books write the answer as -\ln\lvert\csc x\rvert + C. It is the same function.
Check by differentiating
The forward direction is different: the derivative of cot x is -\csc^2 x.
Comparing tan and cot
| \tan x | \cot x | |
|---|---|---|
| Rewrite | \frac{\sin x}{\cos x} | \frac{\cos x}{\sin x} |
| Substitution | u = \cos x, du = -\sin x\,dx | u = \sin x, du = \cos x\,dx |
| Integral | -\ln\lvert\cos x\rvert + C | \ln\lvert\sin x\rvert + C |
| Derivative | \sec^2 x | -\csc^2 x |
The minus sign shows up for \tan x but not for \cot x, because \cos x differentiates to -\sin x while \sin x differentiates to +\cos x.
Definite integrals
Starting at x = 0 gives a divergent improper integral, since \ln\sin x \to -\infty as x \to 0^+.
Substitution variants
Example 1. \int\cot(4x)\,dx = \frac{1}{4}\ln\lvert\sin 4x\rvert + C.
Example 2. \int x\cot(x^2)\,dx = \frac{1}{2}\ln\lvert\sin(x^2)\rvert + C, with u = x^2.
Example 3: cot squared. Use \cot^2 x = \csc^2 x - 1:
Check: \frac{d}{dx}(-\cot x - x) = \csc^2 x - 1 = \cot^2 x.
Example 4: a hidden cot. \int\frac{\cos x}{3\sin x + 2}\,dx = \frac{1}{3}\ln\lvert 3\sin x + 2\rvert + C, with u = 3\sin x + 2.
Common mistakes
- Answering -\csc^2 x. That is the derivative of \cot x.
- Adding a minus sign by analogy with \tan x. -\ln\lvert\sin x\rvert has derivative -\cot x.
- Answering \ln\lvert\cos x\rvert. The log goes on the denominator of \frac{\cos x}{\sin x}, which is \sin x.
- Dropping the absolute value. \sin x < 0 on (\pi, 2\pi).
Practise with u-substitution problems.
Practice it now
U-substitution
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson