Home » Blog » Evaluate a definite integral of sin x / (1 + cos x + sin x)

Evaluate a definite integral of sin x / (1 + cos x + sin x)

Compute the following integral.

    \[ \int_0^{\frac{\pi}{2}} \frac{\sin x \, dx}{1 + \cos x + \sin x}. \]

We make the substitution u = \tan \left( \frac{x}{2} \right). This gives us

    \begin{align*}  \sin x &= \frac{2u}{u^2+1} \\  \cos x &= \frac{1-u^2}{1+u^2} \\  dx &= \frac{2 \, du}{u^2+1}. \end{align*}

For the bounds of integration we have

    \[ \tan \left( \frac{0}{2} \right) = \tan 0 = 0, \qquad \tan \left( \frac{\pi}{4} \right) = 1. \]

Therefore, we have

    \begin{align*}  \int_0^{\frac{\pi}{2}} \frac{ \sin x \, dx}{1 + \cos x + \sin x} &= \int_0^1 \frac{ \left( \frac{2u}{u^2+1} \right) \left( \frac{2 \, du}{u^2+1} \right)}{\left( \frac{2u}{u^2+1} \right) + \left( \frac{1-u^2}{1+u^2} \right) + 1} \\[10pt]  &= \int_0^1 \frac{4u \, du}{2u^3 + 2u^2 + 2u + 2} \\[10pt]  &= 2 \int_0^1 \frac{u \, du}{(u^2+1)(u+1)}. \end{align*}

Now, we use partial fractions to rewrite the integrand. First,

    \[ \frac{u}{(u^2+1)(u+1)} = \frac{Au+B}{u^2+1} + \frac{C}{u+1}. \]

This gives us the equation

    \[ (Au+B)(u+1) + C(u^2+1) = u. \]

Evaluating at u = -1 we obtain C = -\frac{1}{2}. Then plugging this value of C in and solving for A and B we obtain A = B = \frac{1}{2}. Therefore,

    \begin{align*}  2 \int_0^1 \frac{u \, du}{(u^2+1)(u+1)} &= 2 \int_0^1 \left( \frac{1}{2} \frac{u + 1}{u^2+1} - \frac{1}{2} \frac{1}{u+1} \right) \, du \\[10pt]  &= \int_0^1 \frac{u+1}{u^2+1} \, du - \int_0^1 \frac{1}{u+1} \, du \\[10pt]  &= \int_0^1 \frac{1}{u^2+1} \, du + \frac{1}{2} \int_0^1 \frac{2u}{u^2+1} \, du - \int_0^1 \frac{1}{u+1} \,du \\[10pt]  &= \left(\arctan u + \frac{1}{2} \log (u^2+1) - \log |1+u|\right) \Bigr \rvert_0^1 \\[10pt]  &= \frac{\pi}{4} + \frac{1}{2} \log 2 - \log 2 \\[9pt]  &= \frac{\pi}{4} - \frac{1}{2} \log 2. \end{align*}

One comment

Point out an error, ask a question, offer an alternative solution (to use Latex type [latexpage] at the top of your comment):