Q:

Switching $2\int_0^{2\pi} |\cos(\frac{\theta}{2})|d\theta$ to $4\int_0^{\pi} \cos(\frac{\theta}{2})d\theta$? 

Context: Obtaining the arclength of path $r=\cos(\theta)+1$ (polar) using a path integral, $\theta \in [0,2\pi]$.
I'm currently following a solution guide to a problem, and at one step, the author switches from $2\int_0^{2\pi} \left|\cos\left(\frac{\theta}{2}\right)\right|d\theta$ to $4\int_0^{\pi} \cos\left(\frac{\theta}{2}\right)d\theta$. 
This is probably a really obvious/dumb question but why does he do this?  I notice that you get two completely different results depending on whether or not you make this step.  But why is it done? 

A:

I would first like to point out that the result should be the same regardless of whether you take the step to change the integral.  See this and this, which yield the same result. 
Now, take a look at the graph of $\displaystyle f_1 (x) = \cos \frac{x}{2}$

Letting $\displaystyle f_2 (x) = |f_1 (x)|$, we get

And notice how $f_2 (x)$ is symmetric along the line $x = \pi$. Because $\displaystyle |\cos \frac{\theta}{2}|$ is the only term in the integrand, we note that we can split the integral into two parts, namely:
$$2 \int_0^{2\pi} |\cos \frac{\theta}{2}| d\theta = 2 \int_0^{\pi} \cos \frac{\theta}{2} d\theta + 2 \int_{\pi}^{2\pi} \cos \left(\pi - \frac{\theta}{2}\right) d\theta = 4 \int_0^{\pi} \cos \frac{\theta}{2} d\theta$$
Picture credits go to Wolfram Alpha.