Q:

Why doesn't this method work for getting volume of a sphere? And how to find volume of a spherical cap?

As far as I dig into higher mathematics, I found a problem myself for getting volume of a spherical cap, as I was doing some experiments with Archimedes Principle.

So what I did was take elemental mass in terms of angle θ taking center of sphere as origin.
So, lets see what I did and what i was getting
$$r = R\cos θ$$ (vertically-opposite angle, see Z looking in figure)
Now volume of small elemental mass
$$dV = πr^2\, dl$$
(where $dl$ is thickness)
$$dl = R\,dθ$$
Putting all together
$$dV = π(R\cos θ)^2(R\,dθ)$$
$$dV = πR^3\cos^2θ\,dθ$$
Now total volume of the sphere if i want to calculate to check this formula is working correct,
$$V = \int_{-π/2}^{π/2} πR^3 \cos^2θ\,dθ$$
$$V = πR^3 \int_{-π/2}^{π/2} \cos^2θ\,dθ$$
$$V = πR^3 \int_{-π/2}^{π/2} \frac{1+\cos2θ}{2}\,dθ$$
$$V = πR^3 \left[ \frac{θ}{2} + \frac{\sin 2θ}{4} \right]_{-π/2}^{π/2}$$
$$V = \frac{π^2R^3}{2}$$
But this contradicts the fact that Volume of sphere is $\frac{4}{3}πR^3$
And in fact, the surface area of the sphere is taken out of this method to, instead taking $πr^2\,dl$ we use $2πr\,dl$ to get elemental area and then integrate from 0 to $\frac{π}{2}$ and then twice that. But doing that will not gonna help in getting volume of a spherical cap, so I took elemental volume.
What is done wrong in this method, any help would be appreciated. :)

A:

Yes, $r=R \cos \theta$ is OK. But also $z=R \sin \theta$ so $dz=R \cos \theta d \theta.$ Then you end up integrating $\pi (R \cos \theta)^2 \cdot (R \cos \theta d \theta)$ i.e. $\pi R^3 (\cos \theta)^3,$ and the cube of cosine integrates to $4/3$ when done $-\pi/2$ to $\pi/2.$

