Integral of cot x
Updated 6 November 2026 · Checked numerically by the ihateDesmos engine
The integral of cot x
∫
cot(x)
dx =ln(|sin(x)|)+C
The integral of cot x is ln|sin x| + C. Writing cot x as cos x / sin x shows that the top is the derivative of the bottom.
y=cot(x)
in blue and its integral y=ln(|sin(x)|)
(with C = 0) in red. Defined for x ≠ nπ.How to integrate cot x
Method: u-substitution.
- 1Write the integrand as a fraction: cot x = cos x / sin x.
- 2Let u = sin x, so du = cos x dx.
- 3The integral becomes ∫(1/u) du = ln|u|.
- 4Substitute back: ln|sin x| + C.
What it means
cot x is positive up to π/2 and negative after it, so ln|sin x| rises to its maximum of 0 at π/2, then falls away, heading to −∞ at 0 and π.
The integral from π/4 to π/2
Using the antiderivative: F(π/2) − F(π/4) = (ln 2)/2, which is about ln 2/2. A direct numerical integration of cot x gives ln 2/2, which agrees.
Check by differentiating
The derivative of the answer should give back the original function. The last column measures that slope directly from the answer, and it matches.
| x | cot x | Slope of the answer |
|---|---|---|
| 1/2 | 1.83049 | 1.83049 |
| π/4 | 1 | 1 |
| π/2 | 0 | 0 |
| 2 | −0.457658 | −0.457658 |
| 13/5 | −1.66224 | −1.66224 |
Common mistakes
- Writing −csc²x, which is the derivative of cot x, not its integral.
Frequently asked questions
What is the integral of cot x?
The integral of cot x is ln|sin x| + C, for x ≠ nπ.
What is the integral of cot x from π/4 to π/2?
(ln 2)/2, which is about ln 2/2.
Keep going
Integrate any function
Type your own function into the integral calculator for the steps, the answer and a graph.