<s>[INST] Volume between paraboloid $x^2 +y^2 -4a(z+a)=0$ and sphere $x^2 + y^2 +z^2 =R^2$ I'm trying to obtein the volume via triple integral but think I'm setting the wrong radius. The solid in particular is bounded by the sphere $x^2 + y^2 +z^2 =R^2$ and above the parabolloid $x^2 +y^2 -4a(z+a)=0$ (consedering $R>a>0$). I'm setting cylindrical coordinates and I do eventually get $\theta \in [0,2\pi[$ and $(\rho^2 / 4a) -a\leq z \leq R^2-\rho^2$. I deduce that the radius must be limited in between $0$ and $4Ra-4a^2$ (Intersection is at height $z=R-2a$), so the volume should be:
$$\int_{0} ^{2\pi} \int_0 ^{4Ra-4a^2} \int_{(\rho^2 /4a)-a} ^{R^2 -\rho^2} \mathrm{d}V$$
, but this integral results in a different expression from the original solution. My teacher told us the solution is $2\pi \left ( \frac{a^3}{3} - aR^2 + \frac{2R^3}{3} \right )$.
 [/INST] Note that it is not advisable to integrate in cylindrical coordinates because the $z$-limit could be either on the sphere or the parapoloid depending on $a$. Instead, integrate in spherical coordinates with the limits $\theta\in (\cos^{-1}\frac{R-2a}R,\pi)$. The volume is then
\begin{align}
V=&\>2\pi\int_{\cos^{-1}\frac{R-2a}R}^\pi 
\int_{\frac{2a}{1-cos\theta}}^R \rho^2\sin\theta \>d\rho \>d\theta\\
= &\>\frac{2\pi}3 \int_{\cos^{-1}\frac{R-2a}R}^\pi  \left( R^3 - \frac{8a^3}{(1-\cos \theta)^3}\right)\sin\theta \>d\theta\\
 = &\>\frac{2\pi}3 \left[ R^3 (1-\cos \theta)+\frac{4a^3}{(1-\cos \theta)^2}\right]_{{\cos \theta \>=\>1-\frac{2a}R}}^{\theta=\pi}\\
=&\> 2\pi \left ( \frac{a^3}{3} - aR^2 + \frac{2R^3}{3} \right )
\end{align}
</s>