BRAGA

02 Writing02-02 Notes02-02-285

Volume of solid of revolution (x-axis)

Published 16 Apr 20269 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
  3. 03Real-world use
  4. 04The formula, piece by piece
  5. 05The formula in words
  6. 06Critical Concepts
  7. 07Step-by-step calculation (tiny example)
  8. 08Code examples
V=∫abπy2 dxV = \int_a^b \pi y^2\,dx
(1)

Deep Breakdown

What it tells me (Situation Awareness): When you rotate a curve y=f(x)≥0y = f(x) \geq 0 around the x-axis through 360°, you sweep out a 3D solid. At each xx-value, the cross-section is a disk of radius y=f(x)y = f(x) and area πy2\pi y^2. Stacking infinitely many such disks along the x-axis and summing their volumes gives V=∫abπ[f(x)]2 dxV = \int_a^b \pi [f(x)]^2\,dx — the "disk method." In DA/DS, this formula is rarely applied directly, but the geometric and probabilistic intuition it provides is essential. The disk method is the geometric interpretation of why the chi-squared distribution involves x2x^2 (each squared normal is a "radius" contribution to a sphere-like region). More concretely, it appears in: computing the normalizing constant of the multivariate normal distribution via solid of revolution in polar/spherical coordinates, visualizing how bell curves generate 3D probability masses, and in 3D data visualization tasks (e.g., building a rotational surface from a cross-sectional profile in scientific computing or visualization pipelines).

Flowchart

Curve y = f(x)from x=a to x=bRotate 360degrees aroundthe x-axisAt each x:cross-section isa disk of radiusy = f(x)Disk area = pi *y^2 = pi * [f(x)]^2Disk volume = pi* [f(x)]^2 * dx(infinitesimalslice)Sum all disks: V= integral_a^b pi* [f(x)]^2 dxEvaluate usingantiderivativeF(x): V = pi *[F(b) - F(a)]

Real-world use

Where it is used

Classical geometry: computing volumes of cones, spheres, paraboloids, and ellipsoids via the disk method. Scientific computing: generating 3D surfaces of revolution from 1D profiles (manufacturing, engineering simulations). Statistical insight: the chi-squared distribution's moment generating function involves Gaussian integrals over spherical shells, which are solid of revolution integrals in disguise. Visualization: 3D plots of rotated statistical curves (normal PDF revolved around its axis) to illustrate probability mass geometrically.

Problem it solves

Computing the exact volume of an irregular 3D solid that can be described as a surface of revolution. Without integration, you are limited to geometric formulas that only apply to standard shapes (cylinders, cones, spheres). The disk method generalizes volume computation to any curve.

How it solves the problem

At each xx, the solid's cross-section is a disk with radius y=f(x)y = f(x) and area πy2\pi y^2. A thin slice of thickness dxdx has volume π[f(x)]2 dx\pi [f(x)]^2\,dx. Summing all slices via the integral gives the exact volume. The π\pi comes from the area formula for a circle (A=πr2A = \pi r^2).

Example in a business

A 3D data visualization engineer needs to render a "bell-shaped" container whose cross-section matches a Gaussian profile f(x)=e−x2/2f(x) = e^{-x^2/2} for x∈[−3,3]x \in [-3, 3]. The volume of this container is V=π∫−33e−x2 dxV = \pi\int_{-3}^{3} e^{-x^2}\,dx. This involves the Gaussian integral ∫−∞∞e−x2 dx=π\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}, giving V≈π⋅π=π3/2V \approx \pi \cdot \sqrt{\pi} = \pi^{3/2} (for the infinite range). The exact volume for [−3,3][-3, 3] requires numerical integration, computed with scipy.integrate.quad.

The formula, piece by piece

V=∫abπy2 dx=π∫ab[f(x)]2 dxV = \int_a^b \pi y^2\,dx = \pi\int_a^b [f(x)]^2\,dx
(2)

Each symbol:

  • VV: the resulting volume (cubic units)
  • ∫ab\int_a^b: integrate along the x-axis from aa to bb
  • π\pi: from the area of a circle (A=πr2A = \pi r^2); constant, pulls out of the integral
  • y2=[f(x)]2y^2 = [f(x)]^2: the squared radius of the circular cross-section at position xx
  • dxdx: the infinitesimal thickness of each disk slice Washer method (when there is a hole, inner radius g(x)g(x), outer radius f(x)f(x)):
V=π∫ab([f(x)]2−[g(x)]2)dxV = \pi\int_a^b \left([f(x)]^2 - [g(x)]^2\right)dx
(3)

Shell method (rotating around the y-axis instead, for yy-axis revolution see the companion file):

V=2π∫abx f(x) dxV = 2\pi\int_a^b x\,f(x)\,dx
(4)

The formula in words

"Imagine the curve y=f(x)y = f(x) as the radius of a coin at each xx-position. Stack infinitely many coins of radius f(x)f(x) and thickness dxdx along the x-axis. Each coin has volume π[f(x)]2 dx\pi [f(x)]^2\,dx. Add all coins from x=ax = a to x=bx = b: that sum is the volume of the 3D solid."

Critical Concepts

  • Disk method: only valid when the curve is non-negative (y=f(x)≥0y = f(x) \geq 0) and there is no hole. For a hole, use the washer method.
  • Washer method: V=π∫ab([f(x)]2−[g(x)]2) dxV = \pi\int_a^b ([f(x)]^2 - [g(x)]^2)\,dx where f(x)≥g(x)≥0f(x) \geq g(x) \geq 0.
  • Shell method alternative: for revolution around the y-axis, use V=2π∫abxf(x) dxV = 2\pi\int_a^b x f(x)\,dx. Sometimes easier depending on the region.
  • Sphere check: revolving y=r2−x2y = \sqrt{r^2 - x^2} (upper semicircle) from −r-r to rr around x-axis gives V=π∫−rr(r2−x2) dx=43πr3V = \pi\int_{-r}^{r}(r^2 - x^2)\,dx = \frac{4}{3}\pi r^3
  • Cone check: revolving y=rhxy = \frac{r}{h}x from 00 to hh gives V=π∫0hr2h2x2 dx=13πr2hV = \pi\int_0^h \frac{r^2}{h^2}x^2\,dx = \frac{1}{3}\pi r^2 h
  • DA/DS analogy: the volume under a bivariate normal surface (rotating the 1D Gaussian around its axis) yields π∫−∞∞e−x2 dx=π3/2\pi\int_{-\infty}^{\infty} e^{-x^2}\,dx = \pi^{3/2} — the same geometric structure as the normalizing constant of the multivariate normal.

Step-by-step calculation (tiny example)

Compute the volume of the solid formed by revolving y=xy = \sqrt{x} from x=0x = 0 to x=4x = 4 around the x-axis.

Step 1: Identify f(x)f(x) and set up the integral f(x)=xf(x) = \sqrt{x}, so [f(x)]2=x[f(x)]^2 = x.

V=π∫04x dxV = \pi\int_0^4 x\,dx
(5)

Step 2: Antiderivative ∫x dx=x22\int x\,dx = \frac{x^2}{2}

Step 3: Apply FTC

V=π[x22]04=π(162−0)=8π≈25.13V = \pi\left[\frac{x^2}{2}\right]_0^4 = \pi\left(\frac{16}{2} - 0\right) = 8\pi \approx 25.13
(6)

The solid (a paraboloid of revolution) has volume 8π≈25.138\pi \approx 25.13 cubic units.

Code examples

Beginner example (Python)

python
import numpy as np
from scipy import integrate


def f(x: float) -> float:
    """Curve to revolve: y = sqrt(x)."""
    return np.sqrt(x)


def disk_integrand(x: float) -> float:
    """Disk area at x: pi * [f(x)]^2 = pi * x."""
    return np.pi * f(x)**2


# Numerical integration
volume_numerical, error = integrate.quad(disk_integrand, 0, 4)

# Analytic: V = pi * integral_0^4 x dx = pi * [x^2/2]_0^4 = 8*pi
volume_analytic = 8 * np.pi
print(f"Volume (disk method, numerical): {volume_numerical:.6f}")
print(f"Volume (disk method, analytic): {volume_analytic:.6f}")
print(f"8*pi = {8 * np.pi:.6f}")
print(f"Match: {abs(volume_numerical - volume_analytic) < 1e-8}")

# Riemann disk sum (visual intuition)
N = 10_000
x_vals = np.linspace(0, 4, N)
dx = 4.0 / (N - 1)
disk_areas = np.pi * f(x_vals)**2
volume_riemann = float(np.sum(disk_areas) * dx)
print(f"\nRiemann disk sum (N={N}): {volume_riemann:.6f}")

# Sphere verification: revolve y = sqrt(r^2 - x^2) from -r to r
R = 3.0
volume_sphere_numerical, _ = integrate.quad(lambda x: np.pi * (R**2 - x**2), -R, R)
volume_sphere_analytic = (4.0 / 3.0) * np.pi * R**3
print(f"\nSphere (r={R}): numerical = {volume_sphere_numerical:.4f}, "
      f"analytic = {volume_sphere_analytic:.4f}")

Beginner example (R)

r
# Volume of solid of revolution: y = sqrt(x), x in [0, 4], around x-axis
f <- function(x) sqrt(x)
disk_integrand <- function(x) pi * f(x)^2  # pi * x

# Numerical integration
result <- integrate(disk_integrand, lower = 0, upper = 4)
cat("Volume (numerical):", result$value, "\n")  # ~25.1327
cat("8*pi = ", 8 * pi, "\n")  # ~25.1327

# Sphere verification: y = sqrt(r^2 - x^2)
r <- 3
vol_sphere <- integrate(function(x) pi * (r^2 - x^2), -r, r)$value
cat("Sphere volume (numerical):", vol_sphere, "\n")
cat("Sphere volume (4/3*pi*r^3):", (4/3) * pi * r^3, "\n")

Professional example (Python)

python
"""
Gaussian solid of revolution as intuition for multivariate normal normalizing constant.

The univariate standard normal PDF is:
    f(x) = (1/sqrt(2*pi)) * exp(-x^2/2).
Revolving f(x) around the x-axis generates a 3D solid.

    Volume = pi * integral_{-inf}^{inf} [f(x)]^2 dx
           = pi * (1/(2*pi)) * integral_{-inf}^{inf} exp(-x^2) dx
           = pi * (1/(2*pi)) * sqrt(pi)
           = sqrt(pi) / 2

This connects to the Gaussian integral: integral exp(-x^2) dx = sqrt(pi),
which underlies the bivariate normal normalizing constant.

We compute this numerically and compare to the analytic result,
then visualize the solid cross-sections as a matplotlib plot.
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate


def normal_pdf(x: float, sigma: float = 1.0) -> float:
    """Univariate standard normal PDF."""
    return (1.0 / (sigma * np.sqrt(2 * np.pi))) * np.exp(-0.5 * (x / sigma)**2)


# Volume of Gaussian solid of revolution (improper integral)
SIGMA = 1.0
volume_num, err = integrate.quad(lambda x: np.pi * normal_pdf(x, SIGMA)**2, -np.inf, np.inf)
volume_analytic = np.sqrt(np.pi) / 2  # = pi * (1/(2*pi)) * sqrt(pi)
print("=== Gaussian Solid of Revolution ===")
print(f"f(x) = Normal PDF with sigma={SIGMA}")
print(f"Volume = pi * int_{{-inf}}^{{inf}} [f(x)]^2 dx")
print(f" Numerical: {volume_num:.8f}")
print(f" Analytic: {volume_analytic:.8f} [= sqrt(pi)/2]")
print(f" sqrt(pi)/2: {np.sqrt(np.pi)/2:.8f}")
print(f" Match: {abs(volume_num - volume_analytic) < 1e-8}")
print()

# Gaussian integral connection: int exp(-x^2) dx = sqrt(pi)
gaussian_integral, _ = integrate.quad(lambda x: np.exp(-x**2), -np.inf, np.inf)
print(f"Gaussian integral int exp(-x^2) dx = {gaussian_integral:.6f} (expected: sqrt(pi) = {np.sqrt(np.pi):.6f})")
print()

# Visualization: disk cross-sections
x_plot = np.linspace(-3, 3, 300)
y_plot = normal_pdf(x_plot, SIGMA)
fig, axes = plt.subplots(1, 2, figsize=(12, 4))

# Left: the curve being revolved
axes[0].plot(x_plot, y_plot, "b-", linewidth=2, label="Normal PDF")
axes[0].fill_between(x_plot, 0, y_plot, alpha=0.2, color="blue")
axes[0].set_title("Curve to revolve: Normal PDF", fontsize=11)
axes[0].set_xlabel("x")
axes[0].set_ylabel("y = f(x)")
axes[0].legend()

# Right: disk areas pi*y^2 vs x (integrand of volume formula)
disk_areas = np.pi * y_plot**2
axes[1].plot(x_plot, disk_areas, "r-", linewidth=2)
axes[1].fill_between(x_plot, 0, disk_areas, alpha=0.2, color="red")
axes[1].set_title(f"Disk areas: $\\pi [f(x)]^2$ (integral = volume ≈ {volume_num:.4f})", fontsize=11)
axes[1].set_xlabel("x")
axes[1].set_ylabel("$\\pi [f(x)]^2$")
plt.tight_layout()
plt.savefig("gaussian_solid_of_revolution.png", dpi=120, bbox_inches="tight")
plt.close()
print("Plot saved: gaussian_solid_of_revolution.png")

Source: domain knowledge

#calculus#integral-calculus#improper-integrals-multiple-integrals-and-volumes

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close