<s>[INST] Integration By Substitution： Why are the two results different? The sphere: $x^2+y^2+z^2\leq a^2$ is intercepted by the cylindrical surface $x^2+y^2=ax$. Calculate the intercepted volume.
Consider the intercepted volume of the upper hemisphere, and then multiply it by 2:
$$D=\{(x,y):x^2+y^2\leq ax\}$$
Now calculate $A$:
$$A=\iint\limits_{D}\sqrt{a^2-x^2-y^2}\text{d}x\mathrm{d}y=\int_{\color{magenta}{-\pi/2}}^{\pi/2}{\text{d}\theta\int^{a\cos\theta}_{0}}r\sqrt{a^2-r^2}\text{d}r 
\\= \color{magenta}{2}\int_{\color{magenta}{0}}^{\pi/2}\text{d}\theta\int^{a\cos\theta}_{0}r\sqrt{a^2-r^2}\text{d}r\\
=\frac{2}{3}a^3\int^{\pi/2}_{\color{magenta}{0}}(1-\sin^3\theta)\text{d}\theta=\color{red}{\frac{a^3}{3}(\pi-\frac{4}{3})} $$ if I don't change the lower limit of integral, the result would be:
$$
\frac{1}{3}a^3\int^{\pi/2}_{\color{magenta}{-\pi/2}}(1-\sin^3\theta)\text{d}\theta= \color{red}{\frac{a^3}{3}\pi}
$$
Why does the change in limit affect the result?(The two red parts are different)
 [/INST] Thanks @Benjamin_Gal.
In the comment of this question, he pointed out:
$$
(\sin^2\theta)^{3/2}=|\sin^3\theta|\ne\sin^3\theta
$$
And the correction would be:
$$
\begin{eqnarray}
A=\iint\limits_{D}\sqrt{a^2-x^2-y^2}\text{d}x\mathrm{d}y&=&\int_{\color{black}{-\pi/2}}^{\pi/2}{\text{d}\theta\int^{a\cos\theta}_{0}}r\sqrt{a^2-r^2}\text{d}r 
\\
&=&\frac{1}{3}a^3\int^{\pi/2}_{\color{black}{-\pi/2}}(1-|\sin^3\theta|)\text{d}\theta=\color{black}{\frac{a^3}{3}(\pi-\frac{4}{3})}
\end{eqnarray}
$$
</s>