# Integral of csc x: Formula, Derivation and Examples

> The integral of csc x is -ln|csc x + cot x| + C, also written ln|csc x - cot x| or ln|tan(x/2)|. See the derivation, why the forms agree and examples.

Source: https://practicecalculus.com/integrals/csc-x
Updated: 2026-11-06

$$ \int \csc x\,dx = -\ln\lvert\csc x + \cot x\rvert + C $$

## At a glance

- **Antiderivative:** $-\ln\lvert\csc x + \cot x\rvert + C$
- **Equivalent form:** $\ln\lvert\csc x - \cot x\rvert + C$
- **Half-angle form:** $\ln\left\lvert\tan\dfrac{x}{2}\right\rvert + C$
- **Method:** Multiply by $\dfrac{\csc x + \cot x}{\csc x + \cot x}$
- **From π/3 to π/2:** $\dfrac{1}{2}\ln 3 \approx 0.549$

## Key takeaways

- The integral of $\csc x$ is $-\ln\lvert\csc x + \cot x\rvert + C$.
- It can also be written $\ln\lvert\csc x - \cot x\rvert + C$ or $\ln\left\lvert\tan\frac{x}{2}\right\rvert + C$.
- The derivation mirrors the one for $\sec x$, with an extra minus sign from the derivatives of $\csc$ and $\cot$.
- The integral of $\frac{1}{\sin x}$ is the same thing, since $\csc x = \frac{1}{\sin x}$.

The **integral of $\csc x$ is $-\ln\lvert\csc x + \cot x\rvert + C$**. It is the cosecant twin of the [integral of sec x](/integrals/sec-x), and it is derived with the same trick.

$$\int \csc x\,dx = -\ln\lvert\csc x + \cot x\rvert + C = \ln\lvert\csc x - \cot x\rvert + C$$

## Graph of csc x and the area under it

```graph
title: 'Area under y = csc x from π/3 to π/2, with the antiderivative y = ln|tan(x/2)|'
caption: 'The shaded area is $\frac{1}{2}\ln 3 \approx 0.549$. The dashed antiderivative crosses zero at $x = \frac{\pi}{2}$, where $\tan\frac{\pi}{4} = 1$.'
x: [-0.2, 3.4]
y: [-3, 4]
functions:
  - expr: csc(x)
    label: y = csc x
    domain: [0.26, 2.88]
  - expr: ln(abs(tan(x/2)))
    label: y = ln|tan(x/2)| (antiderivative)
    dashed: true
    domain: [0.1, 3.04]
shade: {expr: csc(x), from: 1.0472, to: 1.5708}
points:
  - [1.5708, 1, '(π/2, 1)']
```

## Derivation, step by step

1. Multiply by $\frac{\csc x + \cot x}{\csc x + \cot x}$:
$$\int\csc x\,dx = \int\frac{\csc^2 x + \csc x\cot x}{\csc x + \cot x}\,dx$$
2. Let $u = \csc x + \cot x$. Using the [derivative of csc x](/derivatives/csc-x) and the [derivative of cot x](/derivatives/cot-x):
$$du = (-\csc x\cot x - \csc^2 x)\,dx = -(\csc^2 x + \csc x\cot x)\,dx$$
3. So the numerator is $-du$, and the integral is $\int\frac{-du}{u} = -\ln\lvert u\rvert + C$.
4. Substitute back: $-\ln\lvert\csc x + \cot x\rvert + C$.

## Why the three forms are equal

First, $(\csc x + \cot x)(\csc x - \cot x) = \csc^2 x - \cot^2 x = 1$. So

$$-\ln\lvert\csc x + \cot x\rvert = \ln\frac{1}{\lvert\csc x + \cot x\rvert} = \ln\lvert\csc x - \cot x\rvert$$

Second, $\csc x - \cot x = \frac{1 - \cos x}{\sin x}$, and the half-angle identity says $\frac{1 - \cos x}{\sin x} = \tan\frac{x}{2}$. That gives $\ln\left\lvert\tan\frac{x}{2}\right\rvert$.

## Check by differentiating

Use the form $\ln\lvert\csc x - \cot x\rvert$:

$$\frac{d}{dx}\ln\lvert\csc x - \cot x\rvert = \frac{-\csc x\cot x + \csc^2 x}{\csc x - \cot x} = \frac{\csc x(\csc x - \cot x)}{\csc x - \cot x} = \csc x \checkmark$$

## Definite integrals

At $x = \frac{\pi}{2}$: $\csc - \cot = 1 - 0 = 1$, so the antiderivative is $\ln 1 = 0$. At $x = \frac{\pi}{3}$: $\csc - \cot = \frac{2}{\sqrt{3}} - \frac{1}{\sqrt{3}} = \frac{1}{\sqrt{3}}$. So

$$\int_{\pi/3}^{\pi/2}\csc x\,dx = 0 - \ln\frac{1}{\sqrt{3}} = \frac{1}{2}\ln 3 \approx 0.549$$

The integral from $0$ to anything diverges, because $\csc x$ has a vertical asymptote at $x = 0$ and $\ln\tan\frac{x}{2} \to -\infty$.

## Substitution variants

$$\int\csc(ax + b)\,dx = \frac{1}{a}\ln\lvert\csc(ax + b) - \cot(ax + b)\rvert + C$$

**Example 1.** $\int\csc(3x)\,dx = \frac{1}{3}\ln\lvert\csc 3x - \cot 3x\rvert + C$.

**Example 2.** $\int\frac{dx}{2\sin x\cos x} = \int\frac{dx}{\sin 2x} = \int\csc(2x)\,dx = \frac{1}{2}\ln\lvert\tan x\rvert + C$, using the half-angle form with $\frac{2x}{2} = x$.

**Example 3.** $\int\frac{\cos x}{\sin x}\,dx$ looks similar, but it is the [integral of cot x](/integrals/cot-x), which equals $\ln\lvert\sin x\rvert + C$.

## Common mistakes

1. **Answering $-\csc x\cot x$.** That is the derivative of $\csc x$.
2. **Losing the minus sign** in front of $\ln\lvert\csc x + \cot x\rvert$. Its derivative would then be $-\csc x$.
3. **Mixing the forms.** $-\ln\lvert\csc x - \cot x\rvert$ is wrong: the minus sign goes with the plus inside, and vice versa.
4. **Answering $-\cot x$.** That is the integral of $\csc^2 x$, not $\csc x$.

Practise with [trig integral problems](/practice-problems/trig-integrals).

## Frequently asked questions

### What is the integral of csc x?

The integral of $\csc x$ is $-\ln\lvert\csc x + \cot x\rvert + C$, which equals $\ln\lvert\csc x - \cot x\rvert + C$.

### Why do -ln|csc x + cot x| and ln|csc x - cot x| agree?

$(\csc x + \cot x)(\csc x - \cot x) = \csc^2 x - \cot^2 x = 1$, so $\csc x - \cot x = \frac{1}{\csc x + \cot x}$. Taking logs turns the reciprocal into a minus sign.

### What is the integral of 1/sin x?

Since $\frac{1}{\sin x} = \csc x$, it is $\ln\left\lvert\tan\frac{x}{2}\right\rvert + C$, or any of the equivalent forms.

### What is the integral of csc(3x)?

It is $\frac{1}{3}\ln\lvert\csc 3x - \cot 3x\rvert + C$.
