Evaluation of solid that lies inside the sphere
\( \displaystyle x^2+y^2+z^2 =4z \) and between the cone \( \displaystyle \phi =\frac{\pi}{4} \) and \( \displaystyle \phi =\frac{\pi}{3} \)
The sphere is centered in \( (0,0,2) \) and have radius \( 2 \) as
\( \displaystyle{
x^2+y^2+z^2=4z\iff x^2+y^2+z^2-4z+4=4\iff x^2+y^2+(z-2)^2=4
} \)
Therefore a point is inside the sphere when \( 0\leqslant x^2+y^2+(z-2)^2\leqslant 4 \). Using spherical coordinates \( (x,y,z)=r(\cos \phi \sin \theta ,\sin \phi \sin \theta ,\cos \theta ) \) this gives
\( \displaystyle{
0\leqslant x^2+y^2+(z-2)^2\leqslant 4 \iff 0\leqslant r^2-4r\cos \theta +4\leqslant 4
} \)
From the last expression we can see that, at most, \( r=4 \). Then if \( r\in [0,4] \) we find from the same expression that \( \cos \theta \in [r/4,1] \). Altogether this gives the conditions
\( \displaystyle{
r\in [0,4],\,\theta \in [0,\arccos (r/4)] \text{ and }\phi \in [\pi/4,\pi/3]
} \)
Then, if my previous calculations are all right, the volume of the object is
\( \displaystyle{
\int_{0}^4\int_{0}^{\arccos (r/4)}\int_{\pi/4}^{\pi/3}r^2 \sin \theta \,d \phi \,d \theta\,d r=\frac{\pi}{12}\int_{0}^4(1-r/4)\,d r=\frac{\pi }{6}
} \)
Addition: probably something is wrong as I used the conditions \( \phi =\pi/3 \) and \( \phi =\pi/4 \) as semi-planes. I dont see how to define cones from it.