# Looking for where I went wrong: Finding the volume of a solid that lies within both a cylinder and sphere

I'm currently working on this question:

Find the volume of the solid that lies within both the cylinder $$x^2+y^2=1$$ and the sphere $$x^2+y^2+z^2=4$$.

I decided to use polar coordinates so that the cylinder equation becomes $$r^2=1$$ and the sphere becomes $$r^2+z^2=4$$.

Solving for $$z$$, I get the inequality $$-\sqrt{4-r^2}\leq z\leq \sqrt{4-r^2}$$. Since I know what $$r^2$$ is, I plug that in to get the inequality where $$z$$ is between $$-\sqrt{3}$$ and $$\sqrt{3}$$. Combining that to make a triple integral, I get:

$$\int_0^{2\pi}\int_0^1\int_{-\sqrt{3}}^\sqrt{3}r\,\mathrm{d}z\,\mathrm{d}r\,\mathrm{d}\theta$$

However, Slader has a different answer where they didn't plug in $$\sqrt{3}$$ into the bounds. Why does plugging in the value for $$r^2$$ make the calculation wrong? Isn't $$r^2$$ always $$1$$?

“Isn’t $$r^2$$ always 1?”

Yes, on the surface of the cylinder.

But you aren’t integrating on the surface of the cylinder. You’re integrating over a three-dimensional region, namely the one bounded by both the cylinder and the sphere. This region is described in cylindrical coordinates as the set with

$$r\in[0,1]$$ $$\theta\in[0,2\pi)$$ $$z\in\left[-\sqrt{4-r^2}, \sqrt{4-r^2}\right]$$

• Note that the integral you did, with $\pm\sqrt{3}$, just gives the volume of a cylinder, with height $2\sqrt{3}$. You left off the spherical caps. Commented Feb 14, 2019 at 20:20

No, $$r$$ is not always $$1$$. We're in the integral; $$r$$ is a variable we're going to integrate over later, and it doesn't have any fixed value.

The cylinder equation $$r=1$$ represents part of the boundary. It's certainly not true for every point inside the solid.

A more interesting and beautiful answer is that the answer is the same as the difference of two spheres. One is the sphere of diameter 4, described in the problem, and the other is the sphere with the same diameter as the height of the 'napkin ring' [1] which is the volume left after removing the cylinder intersection you want to find. Basic Pythagoras and volume of sphere equation gets you the answer - no need for calculus.

I've repeated this answer a few times to similar questions before but it's simplicity is ignored as OP always thinks they MUST do it the complicated way because the question is being asked in a calculus course.