How to calculate volume of a cylinder using triple integration in "spherical" co-ordinate system?

Lets have a cylinder given by $x^2+y^2=1$ which is cut from the top by plane $z=2$ and bottom by $z=-2$.I am having problem regarding the limits of ρ for the equation ∭ ρ sin^2ϕ dρ dϕ dθ where ϕ is the angle that ρ makes with z axis and $θ$ is the azimuthal angle. I know ρ should start from zero but should it end at(or its upper limit be) cosec(ϕ)???


Solution 1:

@Mehnni has nothing left for me just making a plot illustrating his post:

enter image description here

Solution 2:

Here is what you should have

$$ V = 2\left(\int_{0}^{2\pi}\int_{0}^{\tan^{-1}(1/2)}\int_{0}^{2\sec \phi}+\int_{0}^{2\pi}\int_{\tan^{-1}(1/2)}^{\pi/2}\int_{0}^{\csc \phi}\right)\rho^2\sin(\phi)d\rho d\phi d\theta.$$

You should have plots to see what's going on.