AP Calculus AB and BC

Integral of csc x: Answer, Derivation, Mistakes

The integral of csc x is -ln|csc x + cot x| + C. You get it by multiplying the integrand by (csc x + cot x)/(csc x + cot x), which makes the numerator the derivative of the denominator, so the substitution u = csc x + cot x turns the problem into -du/u. It holds on any interval free of the points where sin x = 0.

∫csc⁡x dx=−ln⁡∣csc⁡x+cot⁡x∣+C\int \csc x\,dx = -\ln\left|\csc x + \cot x\right| + C

Why the integral of csc x is -ln|csc x + cot x|

Unlike ∫csc⁡2x dx\int \csc^2 x\,dx, this one is not a derivative rule read backwards. Nothing in your table differentiates to csc⁡x\csc x, so the move is to rewrite the integrand until substitution (Topic 6.9, Integrating Using Substitution) applies. Multiply by a form of 11 chosen so the numerator becomes the derivative of the denominator.

∫csc⁡x dx=∫csc⁡x⋅csc⁡x+cot⁡xcsc⁡x+cot⁡x dx=∫csc⁡2x+csc⁡xcot⁡xcsc⁡x+cot⁡x dx\int \csc x\,dx = \int \csc x \cdot \frac{\csc x + \cot x}{\csc x + \cot x}\,dx = \int \frac{\csc^2 x + \csc x \cot x}{\csc x + \cot x}\,dx

Now let u=csc⁡x+cot⁡xu = \csc x + \cot x. From Topic 2.10 (Finding the Derivatives of Tangent, Cotangent, Secant, and/or Cosecant Functions), ddx[csc⁡x]=−csc⁡xcot⁡x\frac{d}{dx}\left[\csc x\right] = -\csc x \cot x and ddx[cot⁡x]=−csc⁡2x\frac{d}{dx}\left[\cot x\right] = -\csc^2 x, so du=−(csc⁡xcot⁡x+csc⁡2x)dxdu = -\left(\csc x \cot x + \csc^2 x\right)dx. The numerator above is exactly −du-du.

∫−duu=−ln⁡∣u∣+C=−ln⁡∣csc⁡x+cot⁡x∣+C\int \frac{-du}{u} = -\ln\left|u\right| + C = -\ln\left|\csc x + \cot x\right| + C

Check it by differentiating, which is how you should check every antiderivative. With u=csc⁡x+cot⁡xu = \csc x + \cot x, the chain rule gives ddx[−ln⁡∣u∣]=−u′u=csc⁡xcot⁡x+csc⁡2xcsc⁡x+cot⁡x=csc⁡x(cot⁡x+csc⁡x)csc⁡x+cot⁡x=csc⁡x\frac{d}{dx}\left[-\ln\left|u\right|\right] = -\frac{u'}{u} = \frac{\csc x \cot x + \csc^2 x}{\csc x + \cot x} = \frac{\csc x\left(\cot x + \csc x\right)}{\csc x + \cot x} = \csc x.

The minus sign is the whole difference from sec x

Compare ∫sec⁡x dx=ln⁡∣sec⁡x+tan⁡x∣+C\int \sec x\,dx = \ln\left|\sec x + \tan x\right| + C. The same trick produces both, but the cosecant derivatives each carry a minus sign, so the cosecant answer picks up the leading minus. Cofunction results in calculus almost always differ from their partners by exactly one sign.

Equivalent forms you may see

Three answers that look different are the same function, so a textbook, a solver, and your teacher can all be right at once. Since csc⁡2x−cot⁡2x=1\csc^2 x - \cot^2 x = 1, the product (csc⁡x+cot⁡x)(csc⁡x−cot⁡x)\left(\csc x + \cot x\right)\left(\csc x - \cot x\right) equals 11, which makes the two factors reciprocals and flips the sign of the logarithm.

−ln⁡∣csc⁡x+cot⁡x∣+C=ln⁡∣csc⁡x−cot⁡x∣+C=ln⁡∣tan⁡x2∣+C-\ln\left|\csc x + \cot x\right| + C = \ln\left|\csc x - \cot x\right| + C = \ln\left|\tan\frac{x}{2}\right| + C

The half-angle version follows from csc⁡x−cot⁡x=1−cos⁡xsin⁡x=tan⁡x2\csc x - \cot x = \frac{1 - \cos x}{\sin x} = \tan\frac{x}{2}. All three differentiate to csc⁡x\csc x, and all three agree numerically on (0,π)\left(0, \pi\right), so use whichever your class writes. If a grader expects one form, convert with the identity rather than reworking the integral.

Where this integral shows up on the AP exam

Topic 6.8 (Finding Antiderivatives and Indefinite Integrals: Basic Rules and Notation) is where the memorized list lives, and ∫csc⁡x dx\int \csc x\,dx sits at the edge of it: the basic cosecant facts you are expected to recall instantly are ∫csc⁡2x dx=−cot⁡x+C\int \csc^2 x\,dx = -\cot x + C and ∫csc⁡xcot⁡x dx=−csc⁡x+C\int \csc x \cot x\,dx = -\csc x + C. Unit 6 carries a weighting of 15 to 20 percent on both AB and BC.

Inside a composite, substitution puts the constant out front. With u=5xu = 5x and du=5 dxdu = 5\,dx:

∫csc⁡(5x) dx=−15ln⁡∣csc⁡(5x)+cot⁡(5x)∣+C\int \csc(5x)\,dx = -\frac{1}{5}\ln\left|\csc(5x) + \cot(5x)\right| + C

On a definite integral, both endpoints have to lie between consecutive zeros of sin⁡x\sin x, since csc⁡x\csc x blows up wherever sin⁡x=0\sin x = 0. Both endpoints below sit inside (0,π)\left(0, \pi\right), so the Fundamental Theorem of Calculus applies.

∫π/6π/2csc⁡x dx=[−ln⁡∣csc⁡x+cot⁡x∣]π/6π/2=0+ln⁡(2+3)≈1.317\int_{\pi/6}^{\pi/2} \csc x\,dx = \left[-\ln\left|\csc x + \cot x\right|\right]_{\pi/6}^{\pi/2} = 0 + \ln\left(2 + \sqrt{3}\right) \approx 1.317

It also arrives in Unit 7 through separable differential equations. Separating dydx=ysin⁡x\frac{dy}{dx} = \frac{y}{\sin x} gives ∫dyy=∫csc⁡x dx\int \frac{dy}{y} = \int \csc x\,dx, so the solution carries this logarithm on both sides.

Common mistakes with the integral of csc x

  • Dropping the leading minus sign. Writing ln⁡∣csc⁡x+cot⁡x∣+C\ln\left|\csc x + \cot x\right| + C differentiates to −csc⁡x-\csc x, which is off by a factor of −1-1 on every problem that uses it.
  • Answering −cot⁡x-\cot x. That is ∫csc⁡2x dx\int \csc^2 x\,dx. The square is what makes that one immediate and this one require the rewrite.
  • Answering −csc⁡x-\csc x. That is ∫csc⁡xcot⁡x dx\int \csc x \cot x\,dx, a different integrand.
  • Guessing ln⁡∣csc⁡x∣\ln\left|\csc x\right| because the answer contains a logarithm. Only ∫u′u dx\int \frac{u'}{u}\,dx produces ln⁡∣u∣\ln\left|u\right|, and csc⁡x\csc x is not the derivative of csc⁡x\csc x over itself. Differentiating ln⁡∣csc⁡x∣\ln\left|\csc x\right| gives −cot⁡x-\cot x, not csc⁡x\csc x.
  • Multiplying by csc⁡x−cot⁡xcsc⁡x−cot⁡x\frac{\csc x - \cot x}{\csc x - \cot x} and then mishandling the sign. That version works too and gives ln⁡∣csc⁡x−cot⁡x∣+C\ln\left|\csc x - \cot x\right| + C, but the numerator then matches +du+du, so there is no leading minus.
  • Integrating across an asymptote. ∫−π/2π/2csc⁡x dx\int_{-\pi/2}^{\pi/2} \csc x\,dx is not 00 by symmetry: the integrand is unbounded at x=0x = 0 inside the interval, so the Fundamental Theorem does not apply and the integral diverges.
  • Confusing it with ∫cot⁡x dx=ln⁡∣sin⁡x∣+C\int \cot x\,dx = \ln\left|\sin x\right| + C, which really is a u′u\frac{u'}{u} integral and needs no trick.

Quick practice with csc integrands

  1. ∫csc⁡(5x) dx=−15ln⁡∣csc⁡(5x)+cot⁡(5x)∣+C\int \csc(5x)\,dx = -\frac{1}{5}\ln\left|\csc(5x) + \cot(5x)\right| + C, with u=5xu = 5x.
  2. ∫xcsc⁡(x2)dx=−12ln⁡∣csc⁡(x2)+cot⁡(x2)∣+C\int x\csc\left(x^2\right)dx = -\frac{1}{2}\ln\left|\csc\left(x^2\right) + \cot\left(x^2\right)\right| + C, with u=x2u = x^2 and du=2x dxdu = 2x\,dx.
  3. ∫π/4π/2csc⁡x dx=ln⁡(1+2)≈0.881\int_{\pi/4}^{\pi/2} \csc x\,dx = \ln\left(1 + \sqrt{2}\right) \approx 0.881.
  4. ∫π/3π/2csc⁡x dx=12ln⁡3≈0.549\int_{\pi/3}^{\pi/2} \csc x\,dx = \frac{1}{2}\ln 3 \approx 0.549.
  5. ∫csc⁡2x dx=−cot⁡x+C\int \csc^2 x\,dx = -\cot x + C and ∫csc⁡xcot⁡x dx=−csc⁡x+C\int \csc x \cot x\,dx = -\csc x + C, the two you should never have to derive.
  6. ∫cot⁡x dx=ln⁡∣sin⁡x∣+C\int \cot x\,dx = \ln\left|\sin x\right| + C, with u=sin⁡xu = \sin x.

Every answer on this page is machine checked

An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.

Frequently asked questions

Is −ln⁡∣csc⁡x+cot⁡x∣+C-\ln\left|\csc x + \cot x\right| + C the same as ln⁡∣csc⁡x−cot⁡x∣+C\ln\left|\csc x - \cot x\right| + C?

Yes. Because csc⁡2x−cot⁡2x=1\csc^2 x - \cot^2 x = 1, the quantities csc⁡x+cot⁡x\csc x + \cot x and csc⁡x−cot⁡x\csc x - \cot x are reciprocals, and −ln⁡∣u∣=ln⁡∣1u∣-\ln\left|u\right| = \ln\left|\frac{1}{u}\right|. Both differentiate to csc⁡x\csc x, so both are correct antiderivatives.

Why do you multiply by csc⁡x+cot⁡xcsc⁡x+cot⁡x\frac{\csc x + \cot x}{\csc x + \cot x}?

Because it manufactures a u′u\frac{u'}{u} pattern. The numerator becomes csc⁡2x+csc⁡xcot⁡x\csc^2 x + \csc x \cot x, which is exactly −ddx[csc⁡x+cot⁡x]-\frac{d}{dx}\left[\csc x + \cot x\right], so u=csc⁡x+cot⁡xu = \csc x + \cot x turns the integral into ∫−duu\int \frac{-du}{u}. Nothing else about the integrand suggests substitution, which is why this one is memorized as a trick rather than discovered.

What is the difference between ∫csc⁡x dx\int \csc x\,dx and ∫csc⁡2x dx\int \csc^2 x\,dx?

They are unrelated in difficulty. ∫csc⁡2x dx=−cot⁡x+C\int \csc^2 x\,dx = -\cot x + C is a derivative rule reversed and takes no work. ∫csc⁡x dx=−ln⁡∣csc⁡x+cot⁡x∣+C\int \csc x\,dx = -\ln\left|\csc x + \cot x\right| + C needs the multiply-by-one rewrite. Read the exponent before you start.

Where is −ln⁡∣csc⁡x+cot⁡x∣-\ln\left|\csc x + \cot x\right| valid?

On any open interval where sin⁡x≠0\sin x \neq 0, such as (0,π)\left(0, \pi\right). At every multiple of π\pi the integrand has a vertical asymptote, so one antiderivative cannot bridge two intervals and a definite integral whose limits straddle a multiple of π\pi diverges.