Why does the lower limit of Integration change to a zero and where does the 8 come from? I'm working through an example from Stewart's book, and I can not work out why the lower bound of integration changes to a $0$. Also I am confused as to where the $8$ comes from?

I am assuming there is a rule being applied here that I am unaware of.
I can't find any similar examples.


  $$4\int_{-\pi/2}^{\pi/2}\cos^4\theta\ d\theta=8\int_0^{\pi/2}\cos^4\theta\ d\theta$$
Imagine trying to find the area of a circle.  It suffices to find the area of a semicircle, then doubling it, right?

For any function that satisfies $$f(x)=f(-x),$$ we have $$\int_{-a}^af(x)\,dx=2\int_0^af(x)\,dx.$$  We call these functions even functions.
The integral can be though of as the purple shaded area in the figure below.



Because the integrand is even (it is symmetric across the $y$-axis), the area on the left of the $y$-axis (the blue area) is equal to the area on the right side of the $y$-axis (the blue area).  The area of the red region is the integral over the interval $[0,\pi/2]$.



More generally, we have the following:


  Theorem: Suppose that $f : [-L,L] \to\mathbb{R}$ be an even, continuous function.  Then
  $$ \int_{-L}^{L} f(x)\,\mathrm{d}x = 2 \int_{0}^{L} f(x)\,\mathrm{d}x. $$


Proof:  By the linearity of integration,
$$ \int_{-L}^{L} f(x) \,\mathrm{d}x
= \int_{-L}^{0} f(x)\,\mathrm{d}x + \int_{0}^{L} f(x)\,\mathrm{d}x. \tag{1}$$
Making the change of variables $u = -x$, the first term becomes
$$ \int_{-L}^{0} f(x)\,\mathrm{d}x
= -\int_{L}^{0} f(-u)\,\mathrm{d}u
= \int_{0}^{L} f(-u)\,\mathrm{d}u. $$
Since $f$ is even, $f(-u) = f(u)$ for any $u \in [-L,L]$.  Therefore
$$ \int_{0}^{L} f(-u)\,\mathrm{d}u
= \int_{0}^{L} f(u)\,\mathrm{d}u. $$
Substituting this back into (1), we obtain
\begin{align}\int_{-L}^{L} f(x) \,\mathrm{d}x
&amp;= \int_{-L}^{0} f(x)\,\mathrm{d}x + \int_{0}^{L} f(x)\,\mathrm{d}x \\
&amp;= \int_{0}^{L} f(u)\,\mathrm{d}u + \int_{0}^{L} f(x)\,\mathrm{d}x \tag{these terms are equal}\\
&amp;= 2\int_{0}^{L} f(x)\,\mathrm{d}x.
\end{align}
The last identity holds, as $u$ and $x$ are just dummy variables.  After integration, the result is a constant which does not depend on either of these variables.