Volumes by Slicing
Although computing volumes of 3-dimensional solids typically requires three variables, there’s a certain category of functions for which we can compute the volume using techniques we’re already familiar with. If the 3D solid has consistent cross-sections, whose areas can be expressed as a function of one variable, then we can set up a definite integral to compute its volume.
We’ll start with solids of revolution. These are solids that are constructed by revolving a 2D region in the plane about a vertical or horizontal line. Because these solids are constructed by revolving about a fixed, straight axis, all of the cross-sections taken perpendicular to that axis are circles.
Then, we’ll move onto solids with a 2D base and cross-sections given by a simple geometric shape, like a square or a triangle.
Basic Setup
Suppose we have a solid called $S$ whose cross-sections taken perpendicular to the $x$-axis are given by $A(x)$ over $[a,b]$. The volume of $S$ is given by
$$ S = \int_{a}^{b} A(x) \ dx $$
As we saw in the last section, it’s possible to integrate in terms of $y$. If the cross-sections are taken perpendicular to the $y$-axis, then we set up the integral above in terms of $y$.
Let’s dive in with an example.
One Region - Many Solids
Consider the region in the plane enclosed by $y = \frac{1}{2}x^2$, $y = 0$, and $x = 2$.

What happens if we revolve this region about the $x$-axis?
Revolve about the $x$-axis

The cross-sections taken perpendicular to the $x$-axis are all circles. The radius of the circle at $x$ is given by the function/curve $\frac{1}{2}x^2$. So, our cross-sectional area function is
$$ A(x) = \pi \left( \frac{1}{2}x^2 \right)^2 $$
Notice that in the image above, we’ve drawn more than just a disk; we’ve drawn a thin cylinder with a radius of $\frac{1}{2}x^2$ and a thickness or height of $dx$. What we’re really doing is filling the solid with thin cylinders and adding up all of their volumes.
$$ \underbrace{\pi \left( \frac{1}{2}x^2 \right)^2 dx}_{\pi r^2 h} $$
Since the region/solid extends from $x = 0$ to $x = 2$, we integrate over $[0,2]$:
$$ \begin{aligned} V &= \int_{0}^{2} \pi \left( \frac{1}{2}x^2 \right)^2 dx \cr &= \pi \int_{0}^{2} \frac{1}{4} x^4 \ dx \cr &= \frac{\pi}{20}x^5 \biggr\rvert_{0}^{2} \cr &= \frac{\pi}{20}(2^5 - 0^5) \cr &= \frac{32\pi}{20} \cr &= \boxed{\frac{8\pi}{5}} \end{aligned} $$
Now, what if we take the same region and revolve it about the $y$-axis?
Revolve about the $y$-axis
Revolving about the $y$-axis gives us a dramatically different shape:

I’ve included a washer in the middle of the solid to show that (a) the center is hollow (like a cylinder with a bowl cut out of the center) and (b) that we’ll need our area function to give us the area of a washer.
Each washer is a disk with a smaller disk cut out of it.

We’ll call the smaller disk’s radius $r$ and the larger one’s $R$. Notice that in our 3D picture, the small radius extends from the $y$-axis to the parabola while the large radius extends from the $y$-axis to the vertical line $x = 2$.
The shaded area is given by $A = \pi R^2 - \pi r^2$. All we have to do is figure out what these radii are. This is easier to see on the 2D region. We can simply draw a line from the axis through the region:

Since we’re measuring off of the $y$-axis, we have to do everything in terms of $y$. This means we have to rewrite all of our curves and lines as functions of $y$:
$$ y = \frac{1}{2}x^2 \Longrightarrow x = \sqrt{2y} $$
So, we have $r = \sqrt{2y}$ and $R = 2$. Thus,
$$ \begin{aligned} V &= \int_0^2 \pi(2)^2 - \pi\left( \sqrt{2y} \right)^2 dy \cr &= \pi \int_{0}^{2} 4 - 2y \ dy \cr &= \pi \left( 4y - y^2 \biggr\rvert_{0}^{2} \right) \cr &= \pi \left( (8 - 4) - (0 - 0) \right) \cr &= \boxed{4 \pi } \end{aligned} $$
Using the same ideas we applied here, we can revolve the same region about other horizontal and vertical lines.
Revolve about $x = 3$.
If we revolve about $x = 3$, we get something like this:

Once again, we have a washer, which means we’ll be integrating $\pi R^2 - \pi r^2$. However, now the radii are being measured off of the line $x = 3$.

Looking at the 2D picture, we can see that
$$R + \sqrt{2y} = 3 \Longrightarrow \boxed{R = 3 - \sqrt{2y}}$$
$$r + 2 = 3 \Longrightarrow \boxed{r = 1}$$
Thus, we have
$$ \boxed{V = \int_{0}^{2} \pi(3 - \sqrt{2y})^2 - \pi(1)^2\ dx} $$
Square cross-sections
Solids of revolution are not the only kinds of 3D solids we can build out of 2D regions. We can take the region to be the base of the shape and define any kind of cross-section we like, as long as it’s consistent.
Consider the solid whose base is the region we’ve been working with and whose cross-sections taken perpendicular to the $x$-axis are squares.
Here’s what that would look like:

In this case, the area formula for the cross-section becomes
$$\boxed{A = (\text{side})^2}$$
The length of a side is the distance from the $x$-axis to the curve:

So, in this case, the height is just $x^2/2$:
$$ \boxed{V = \int_{0}^{2} \left( \frac{x^2}{2} \right)^2 \ dx} $$