Problem 59
Hard Rational and Quadratic

Evaluate the integral: I = integral dx/(1 + sin(x))

Evaluate the integral: $$ I = \int \frac{dx}{1 + \sin(x)}. $$

Explanation of Method

The Weierstrass substitution $t=\tan(x/2)$ converts any rational function of $\sin x$ and $\cos x$ into an ordinary rational function of $t$, using $\sin x = \frac{2t}{1+t^2}$, $\cos x=\frac{1-t^2}{1+t^2}$, and $dx=\frac{2}{1+t^2}dt$. Substituting these turns $1+\sin x$ into a perfect square over $1+t^2$, which cancels cleanly against the numerator.

  1. Substitute $t=\tan(x/2)$ and rewrite $\sin x$, $dx$ in terms of $t$.
  2. Simplify $1+\sin x$ into a single fraction in $t$.
  3. Reduce the resulting integral to a simple power of $(1+t)$.
  4. Integrate and substitute back $t=\tan(x/2)$.

Step 1 · Use the Weierstrass substitution

To solve this integral, we use the substitution:

$$ t = \tan\left(\frac{x}{2}\right). $$

This substitution is a common method when dealing with integrals involving $\sin(x)$ and $\cos(x)$. The following identities hold:

$$ dx = \frac{2}{1+t^2}\,dt, \qquad \sin(x) = \frac{2t}{1+t^2}. $$

Step 2 · Simplify $1+\sin x$

Substituting the expression for $\sin(x)$:

$$ 1+\sin(x) = 1 + \frac{2t}{1+t^2} = \frac{1+t^2+2t}{1+t^2} = \frac{(1+t)^2}{1+t^2}. $$

This is the key simplification: the denominator becomes a perfect square divided by $1+t^2$.

Step 3 · Substitute into the integral

Substituting $dx = \dfrac{2}{1+t^2}\,dt$ and $1+\sin(x)=\dfrac{(1+t)^2}{1+t^2}$ into the integral:

$$ I = \int \frac{\frac{2}{1+t^2}}{\frac{(1+t)^2}{1+t^2}}\,dt = \int \frac{2}{(1+t)^2}\,dt. $$

The $1+t^2$ factors cancel exactly, leaving a simple power of $(1+t)$.

Step 4 · Integrate

Using the power rule for integration:

$$ \int \frac{2}{(1+t)^2}\,dt = 2\int (1+t)^{-2}\,dt = 2\cdot \left(-\frac{1}{1+t}\right) = -\frac{2}{1+t}. $$

Thus:

$$ I = -\frac{2}{1+t} + C. $$

Step 5 · Substitute back $t = \tan(x/2)$

Finally, substituting back $t = \tan\left(\dfrac{x}{2}\right)$, we obtain the result:

$$ I = -\frac{2}{1+\tan\left(\frac{x}{2}\right)} + C. $$


Summary Table

Quantity Value
Substitution$t = \tan(x/2)$
$1+\sin x$ in terms of $t$$(1+t)^2/(1+t^2)$
Reduced integral$\int 2(1+t)^{-2}\,dt$

Additional Notes

Result

The solution to the integral is:

$$ I = -\frac{2}{1+\tan\left(\frac{x}{2}\right)} + C. $$