Math glossary

Integral of Cot x: Formula, Proof, and Definite Examples

Derive the cotangent integral with substitution. Use six examples to check signs, handle an inner angle, and spot improper limits.

TL;DR

The integral of cotangent is ∫cotxdx=ln|sinx|+C\int\cot x\,dx=\ln|\sin x|+C. Rewrite cotangent as cosx/sinx\cos x/\sin x and substitute u=sinxu=\sin x. Work on an interval that does not contain a zero of sine.

Key Points

  • Cotangent is the quotient of cosine and sine.
  • The derivative of the denominator is the numerator, so substitution produces a logarithm.
  • Absolute value allows the formula to work where sine is negative.
  • Cotangent is undefined at integer multiples of π\pi.
  • A definite integral across a singularity needs separate limits.

What is the integral of cot x?

For angles in radians, the indefinite integral is

∫cotxdx=ln|sinx|+C.\int\cot x\,dx=\ln|\sin x|+C.

This formula describes all antiderivatives on a connected interval where sinx≠0\sin x\ne0. You can also write −ln|cscx|+C-\ln|\csc x|+C because cscx=1/sinx\csc x=1/\sin x on that interval. The logarithm of the reciprocal reverses the sign. Wolfram MathWorld, Cotangent

At x=kπx=k\pi for an integer kk, cotangent is undefined. On consecutive intervals between these points, separate constants can be chosen independently. The antiderivatives guide explains why a constant is shared only within a connected interval.

The graph of log absolute sine has separate arches on the intervals from minus pi to zero and zero to pi, with gaps at the endpoints
The antiderivative has separate branches. Evaluate a proper definite integral on just one branch at a time.

How do you integrate cotangent by substitution?

  1. Rewrite cotx\cot x as cosx/sinx\cos x/\sin x.
  2. Let u=sinxu=\sin x, so du=cosxdxdu=\cos x\,dx.
  3. The remaining integral is ∫du/u=ln|u|+C\int du/u=\ln|u|+C.
  4. Substitute back to obtain ln|sinx|+C\ln|\sin x|+C.

To check, use the derivative rule ddxln|g(x)|=g′(x)/g(x)\frac{d}{dx}\ln|g(x)|=g'(x)/g(x) wherever g(x)≠0g(x)\ne0. With g(x)=sinxg(x)=\sin x, the derivative is cosx/sinx=cotx\cos x/\sin x=\cot x. On an interval where sinx<0\sin x<0, differentiate ln(−sinx)\ln(-\sin x) directly. The two minus signs cancel. OpenStax, Integrals Involving Exponential and Logarithmic Functions

The derivative of cotangent gives −csc2x-\csc^2x. This explains a related but different integral. Integrating csc2x\csc^2x returns −cotx+C-\cot x+C. Integrating cotx\cot x itself returns the logarithm above.

How do you integrate cotangent with a different inner angle?

For constants a≠0a\ne0 and bb, use u=ax+bu=ax+b and dx=du/adx=du/a:

∫cot(ax+b)dx=1aln|sin(ax+b)|+C.\int \cot(ax+b)\,dx=\frac1a\ln|\sin(ax+b)|+C.

The factor 1/a1/a cancels the inner derivative when you check. If a=0a=0, the integrand is the constant cotb\cot b provided sinb≠0\sin b\ne0. Its antiderivative is then xcotb+Cx\cot b+C. The integration formulas guide shows other logarithmic forms with the same derivative-over-function pattern.

When does a definite cotangent integral converge?

If both endpoints and everything between them lie inside one interval where sine is nonzero, subtract the log values at the bounds:

∫abcotxdx=ln|sinb|−ln|sina|.\int_a^b\cot x\,dx =\ln|\sin b|-\ln|\sin a|.

Inspect the entire interval first. Even if both endpoints are valid, a multiple of π\pi in the middle can make the integral improper. For an internal singularity, both one-sided integrals must converge on their own. Two infinite contributions do not cancel in the ordinary definition. A symmetric Cauchy principal value is a separate quantity. OpenStax, Improper Integrals

Six Worked Cotangent Integral Examples

Example 1

Find ∫3cotxdx\int 3\cot x\,dx for 0<x<π0<x<\pi.

  1. Pull out the factor of 3.
  2. Sine is positive throughout the given interval.
  3. The family is 3ln(sinx)+C3\ln(\sin x)+C, whose derivative is 3cotx3\cot x.

Example 2

Find ∫cot(4x−π/6)dx\int\cot(4x-\pi/6)\,dx.

  1. Let u=4x−π/6u=4x-\pi/6 and divide by the inner derivative 4.
  2. Integrate cotangent in uu.
  3. The answer is 14ln|sin(4x−π/6)|+C\tfrac14\ln|\sin(4x-\pi/6)|+C, on any interval avoiding the zeroes of the sine inside the logarithm.

Example 3

Compute ∫π/6π/2cotxdx\int_{\pi/6}^{\pi/2}\cot x\,dx.

  1. Sine stays positive and never vanishes there.
  2. The endpoint sine values are 1/21/2 and 1.
  3. The integral is ln1−ln(1/2)=ln2\ln 1-\ln(1/2)=\ln 2.

Example 4

Compute ∫π/4π/2cotxdx\int_{\pi/4}^{\pi/2}\cot x\,dx.

  1. Both endpoints lie in (0,π)(0,\pi).
  2. Subtract ln(2/2)\ln(\sqrt2/2) from ln1\ln 1.
  3. The result is 12ln2\frac12\ln 2.

Example 5

Does ∫0π/2cotxdx\int_0^{\pi/2}\cot x\,dx converge?

  1. Replace the lower limit by ε>0\varepsilon>0 because cotangent is undefined at zero.
  2. The integral from ε\varepsilon to π/2\pi/2 equals −ln(sinε)-\ln(\sin\varepsilon).
  3. As ε\varepsilon tends to zero from above, the integral grows without bound. It diverges to positive infinity.

Example 6

Evaluate ∫−π/3−π/6cotxdx\int_{-\pi/3}^{-\pi/6}\cot x\,dx.

  1. This interval lies in (−π,0)(-\pi,0), where sine is negative.
  2. The endpoint absolute values are 3/2\sqrt3/2 and 1/21/2 in increasing order of xx.
  3. Subtracting the logs gives ln(1/3)=−12ln3\ln(1/\sqrt3)=-\tfrac12\ln 3. The sign agrees with cotangent being negative throughout the interval.

Common Cotangent Integration Mistakes

Mistake 1: Refusing negative values of sine

Keep the absolute value for a domain where sine may be negative. For example, on (−π,0)(-\pi,0) you can write ln(−sinx)+C\ln(-\sin x)+C.

Mistake 2: Switching the logarithm sign

A plus sign goes with ln|sinx|\ln|\sin x|. The minus sign applies when using the reciprocal, as in −ln|cscx|-\ln|\csc x|.

Mistake 3: Applying endpoint subtraction across a pole

The interval [−π/4,π/4][-\pi/4,\pi/4] crosses zero. The left side diverges to negative infinity and the right side to positive infinity. Endpoint subtraction cannot evaluate the improper integral even though the endpoints give matching logarithms.

Try It Yourself

  1. Find ∫2cot(3x)dx\int 2\cot(3x)\,dx.
  2. Compute ∫π/32π/3cotxdx\int_{\pi/3}^{2\pi/3}\cot x\,dx.
  3. On (0,π)(0,\pi), find the antiderivative with value 4 at x=π/2x=\pi/2.

Answers. 1. 23ln|sin(3x)|+C\tfrac23\ln|\sin(3x)|+C. 2. Zero, since the sine values match and the interval stays in one branch. 3. ln(sinx)+4\ln(\sin x)+4.

Conclusion

  • Spot the derivative of sine in the numerator before substituting.
  • Keep absolute values whenever the sign of sine is unknown.
  • Check for multiples of pi before subtracting endpoint values.

Read More

Research Behind This Article

  1. Eric W. Weisstein, Cotangent. Wolfram MathWorld
  2. OpenStax, Calculus Volume 1: Integrals Involving Exponential and Logarithmic Functions. OpenStax
  3. OpenStax, Calculus Volume 2: Integrals Involving Exponential and Logarithmic Functions. OpenStax
  4. OpenStax, Calculus Volume 2: Improper Integrals. OpenStax