Question:
Find the following integral: $\int{\sqrt{1+\cos(x)}}dx$
My attempt:
$$\int{\sqrt{1+\cos(x)}}dx$$
$$=\int{\sqrt{2\cos^{2}\frac{x}{2}}}dx$$
$$=\int{\sqrt{2}\ \left|\cos\frac{x}{2}\right|}dx$$
$$=\sqrt{2}\int{\left|\cos\frac{x}{2}\right|}dx\tag4$$
$$=\sqrt{2}\int{\pm\cos\frac{x}{2}}dx$$
$$=\pm\sqrt{2}\int{\cos\frac{x}{2}}dx$$
$$=\pm2\sqrt{2}\sin\frac{x}{2}+C$$
My book's attempt:
$$\int{\sqrt{1+\cos(x)}}dx$$
$$=\int{\sqrt{2\cos^{2}\frac{x}{2}}}dx$$
$$=\int{\sqrt{2}\cos\frac{x}{2}}dx$$
$$=\sqrt{2}\int{\cos\frac{x}{2}}dx$$
$$=2\sqrt{2}\sin\frac{x}{2}+C$$
Basically, my book didn't put $\pm$ sign, while I did. My book did this essentially: $\sqrt{x^2}=x$, while I did this: $\sqrt{x^2}=|x|$. Is my process more correct?
Best Answer
The correct way to continue from line $(4)$ is to split up the integral such that each of the integrand's $x$-intercepts is a limit of integration.