# 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}}$$

-
Have you tried anything yet? – Bey Oct 21 '12 at 4:58
Looks like the second integral involves the polylogarithm. – Joe Oct 21 '12 at 4:59
I don't see any answers for the second one yet. I don't know anything about polylogarithm, but I think I see a way to proceed if it works. – Mike Oct 21 '12 at 5:27
I think it's much better to ask two separate questions in two posts, not in a single one. – Martin Sleziak Oct 21 '12 at 7:39

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})$.

-
Very nice work. I was trying to find the indefinite integral for the second one, but I lost my will at trying to integrate $\frac{\sqrt2}2\tan^{-1}(\frac{\sqrt2}2\tan x)dx$. :) – Mike Oct 21 '12 at 6:14

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.

-
Why other substitution? It is direct:$$\int (2-u)^{-1/2}\,du=-2(2-u)^{1/2}+C$$ – DonAntonio Oct 21 '12 at 5:10
Fair point, getting a bit tired here! Also, I felt it may be easier to see where the negative out front comes from if he let $t = 2-u, dt = -u \ du$. – Joe Oct 21 '12 at 5:12
See when you subtitute the limits of integration, this integral would be 0. – ILoveMath Oct 21 '12 at 5:45

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}$

-

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.

-