Two interesting and basic integrals. Show: $$\int_0^\pi \sqrt{1 + \sin(x)}\,dx.\ = 4$$
and $$\int_0^\pi \frac{xdx}{1 + \cos^2(x)} = \frac{\pi^2}{2\sqrt{2}}$$
 A: For the first one, you can use the identity $\sin(x)=-\cos(\frac{\pi}{2}+x)$.
Then by half angle formula
$$1+\sin(x)=1- \cos(\frac{\pi}{2}+x)=2 \sin^2(\frac{\pi}{4}+\frac{x}{2})$$
Thus
$$\int_0^\pi \sqrt{1 + \sin(x)}\,dx.\ = \int_0^\pi \sqrt{2}\sin(\frac{\pi}{4}+\frac{x}{2})\,dx=-2\sqrt{2}\cos(\frac{\pi}{4}+\frac{x}{2})|_0^\pi=4$$
Second one
Let $I=\int_0^\pi \frac{xdx}{1 + \cos^2(x)}$.
Let $u= \pi-x$. Then
$$I= \int_0^\pi \frac{(\pi-u)}{1 + \cos^2(\pi-u)}du=\int_0^\pi \frac{\pi}{1 + \cos^2(u)}du -I $$
Thus
$$2I=\pi \int_0^\pi \frac{1}{1+\cos^2(u)} du=2 \pi \int_0^\frac{\pi}{2} \frac{1}{1+\cos^2(u)} du$$
by the symmetry about $u=\frac{\pi}{2}$.
Thus
$$I= \pi \int_0^\frac{\pi}{2} \frac{1}{1+\cos^2(u)} du= \pi \int_0^\frac{\pi}{2} \frac{\sec^2(u)}{1+\sec^2(u)} du=\pi \int_0^\frac{\pi}{2} \frac{\sec^2(u)}{2+\tan^2(u)} du$$
This integral becomes a trivial improper integral after the obvious substitution $v =\tan(u)$.
P.S. $I= \pi \int_0^\frac{\pi}{2} \frac{1}{1+\cos^2(u)} du$ can also be calculated with the standard substitution $t=\tan(\frac{u}{2})$.
A: Hint:
For the first integral, try $u = 1 + \sin x$. Then $du = \cos x \  dx.$ Get everything in terms of $u$ and the integral cleans up nicely to:
$$\int \frac{1}{\sqrt{2-u}} \ du$$
You should be able to integrate that.
A: For the first integral, the important point is how to get the right answer $4$. The indefinite integral equals
$$ \int \sqrt{1+\sin(x)}dx = 2\,{\frac { \left( \sin \left( x \right) -1 \right) \sqrt {1+\sin
 \left( x \right) }}{\cos \left( x \right) }}\,.$$
If we evaluate the definite integral by substituting the integration limits $x=0..\pi$ in the answer , we will get $0$.
Here is one suggestion, just split the interval of integration $(0,\pi)=(0,\frac{\pi}{6})\cup(\frac{\pi}{6},\frac{\pi}{2})\cup (\frac{\pi}{2},\pi)\,.$ Evaluating the indefinite integral on these intervals gives the values $2-\sqrt{2}, \sqrt{2},\sqrt{2}\,.$ adding these values yields the desired result.
A: Another "trick" that works for certain trigonometric expressions is rationalizing:
$1+\sin x=\frac{1+\sin x}{1} \frac{1-\sin x}{1-\sin x}=\frac{\cos^2 x}{1-\sin x}$
