TITLE: Discrepancy with absolute value in evaluating a triple integral
QUESTION [5 upvotes]: Evaluate
$$\iiint z^2 \,dx\,dy\,dz $$
over the region common to the sphere
$$x^2 + y^2 + z^2 = a^2$$
and the cylinder
$$x^2 + y^2 = ax.$$
Approach:
working in cylindrical co-ordinates, the integral should simply boil down to:-
$$\int_{-\pi / 2}^{\pi / 2} \int_0^{a\cos \phi} \int_{-\sqrt{a^2-s^2}}^{\sqrt{a^2-s^2}} z^2 \,dz\,d\phi$$
Which boils down to evaluating :
$$ \frac 2 3 \int_{-\pi / 2}^{\pi / 2}d\phi\int_0^{a\cos \phi} (a^2-s^2)^{3/2}s\,ds $$
Let $(a^2-s^2)=u^2$. Then, we get
$$ \frac 2 3 \int_{-\pi / 2}^{\pi / 2}\,d\phi \int_{a\left|\sin\phi\right|}^a u^4\,du \tag{E01} $$
Notice the $|\cdot|$ in the lower limit. (this was done as a result of $\sqrt{x^2}= |x|$ while changing the limits).  This will be the root cause of the trouble that follows:-
$$\frac{2a^5}{15} \int_{-\pi / 2}^{\pi / 2} (1-\left| \sin^5\phi \right|)\,d\phi = \frac{2a^5}{15} ( \pi - I)$$
Now, had the $| \cdot |$ not been present in $E01$, then $I$
would be $0$, since $\sin^5\phi$ is odd. So the answer would be $2\pi/15$.
But, the $|\cdot|$ means that $I$ would be something positive, which would mean the answer is something less than $2\pi/15$.
However, the given answer is: $2\pi/15$. Which made me question the existence of the $|\cdot|$.
Seems to be rather trivial that the $|\cdot|$ should be there.....The second scope for an error could be in determining the limits of the integral...But that seems fine too.
Where have I gone wrong then? Or do I just accept that the book "forgot" the $|\cdot|$ and I am indeed right?

REPLY [3 votes]: You are absolutely right, the absolute values should be there. Anyone who doubts is invited to write the integral as two times the integral over the upper half of the region (since the problem is symmetric with respect to $z$), so that you get $2 \int_0^{\pi/2}$ instead of $\int_{-\pi/2}^{\pi/2}$. Then there are no absolute values involved, and without question you do get a contribution from that $\sin^5 \phi$ term.
For what it's worth, Mathematica agrees: Integrate[z^2, {x, y, z} \[Element] ImplicitRegion[x^2 + y^2 + z^2 <= 1 && x^2 + y^2 <= x, {x, y, z}]]
returns
$$
\frac{2}{225}(-16+15\pi)
,
$$
or in other words
$$
\frac{2\pi}{15} - \frac{32}{225}
.
$$
(That's with $a=1$, obviously. To get the result for any $a>0$, just multiply by $a^5$, for dimensional reasons.)