Problem 227
Medium Roots and Binomials

Evaluate the integral: I = integral dx/(sin x + 2 cos x +

Evaluate the integral: $$ I = \int \frac{dx}{\sin x + 2\cos x + 3}. $$

Explanation of Method

The Weierstrass substitution $t=\tan(x/2)$, applied directly to the original integral, turns every trigonometric function into a rational function of $t$ and collapses the whole problem to a single elementary $\int dt/(t^2+2t+5)$ integral — no amplitude-phase rewriting of $\sin x+2\cos x$ is needed at all.

  1. Substitute $t=\tan(x/2)$.
  2. Rewrite $\sin x$, $\cos x$, and $dx$ in terms of $t$.
  3. Simplify the resulting rational integral.
  4. Complete the square and apply the standard arctangent formula.

Step 1 · Weierstrass substitution

Let $t=\tan(x/2)$, so:

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

Step 2 · Rewrite the denominator

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

Step 3 · Simplify the integral

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

Step 4 · Complete the square and integrate

$$ t^2+2t+5 = (t+1)^2+4, \qquad I = 2\int \frac{dt}{(t+1)^2+4} = 2\cdot\frac12\arctan\left(\frac{t+1}{2}\right) + C = \arctan\left(\frac{t+1}{2}\right) + C. $$

Step 5 · Substitute back

With $t=\tan(x/2)$:

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


Summary Table

Quantity Value
Substitution$t=\tan(x/2)$
Reduced integral$\int 2\,dt/(t^2+2t+5)$

Additional Notes

Result

The solution to the integral is:

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