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.
- Substitute $t=\tan(x/2)$.
- Rewrite $\sin x$, $\cos x$, and $dx$ in terms of $t$.
- Simplify the resulting rational integral.
- 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
- Correction: the source first rewrote $\sin x+2\cos x=\sqrt5\sin(x+\alpha)$ (a valid but unnecessary detour), then made a genuine arithmetic error while completing the square on the resulting $3t^2+2\sqrt5t+3$: it computed $t^2+\tfrac{2\sqrt5}3t=(t+\tfrac{\sqrt5}3)^2+\tfrac49$, but the correct identity is $(t+\tfrac{\sqrt5}3)^2-\tfrac59$ (since $(\sqrt5/3)^2=5/9$, not a value consistent with $+4/9$). This flipped sign propagated into a final answer built around $\sqrt{13}$, which does not differentiate back to the integrand. Skipping the amplitude-phase rewrite and applying the Weierstrass substitution directly to the original integral, as done above, avoids the error entirely and gives a much simpler result.
- The integrand is defined for all real $x$, since $\sin x+2\cos x+3\geq3-\sqrt5>0$ always (as $|\sin x+2\cos x|\leq\sqrt5$).
- The result can be checked by differentiating $\arctan\!\left(\tfrac{\tan(x/2)+1}2\right)$: with $\tau=\tan(x/2)$, this gives $\dfrac{\sec^2(x/2)/4}{1+(\tau+1)^2/4}=\dfrac{1+\tau^2}{\tau^2+2\tau+5}$, and since $\sin x+2\cos x+3=(\tau^2+2\tau+5)/(1+\tau^2)$, this is exactly $1/(\sin x+2\cos x+3)$, matching the integrand.
Result
The solution to the integral is: