This question goes back a few weeks, Python function(s) are mentioned… I’ve learned many programming languages in my career, never did bother with Python all that much, but since this is a Calculus question, I’ll proceed with that, so this answer will be mostly for Calculus posterity.
The problem has 2 parts:
(a) A centered bored hole of 1mm in the sphere.
(b) Given a resulting volume, same bore size, find the radius.
There are several approaches for such Volumes problems, including (a) “Parallel Disks” and “Cylindrical Shells”. We are asked to present both techniques, which I do, then solve them, and we confirm the same answer in both cases (which is not necessary in practice… one method is chosen when the problem lends itself to it more naturally).
(a) Parallel Disks
Consider a Sphere centered at the Origin, radius ‘r’, centered “bored” hole through the Sphere has radius “h” (hole). The bore to be considered is vertical, centered around y-axis. The circle x² + y² = r² is rotated about the y-axis for the sphere. Consider the “Hemisphere” with “bore”:
The bore extends from 0 to x = h ==> For Hemisphere, y goes from 0 to yₘₐₓ = √(r² - h²) for our Integration on “y”.
V ≈ 2 Σ πxᵢ²Δy - πh²Δy ==> V = 2 ∫₀ʸ⁻ᵐᵃˣ [π(r² - y²) - π(h²)] dy = 2 ∫₀ʸ⁻ᵐᵃˣ [π(r² - h²) - π(y²)] dy
V = 2π ∫₀ʸ⁻ᵐᵃˣ [(r² - h²) - y²] dy= 2π ∫₀ʸ⁻ᵐᵃˣ [(r² - h²) - y²] dy = 2π [(r² - h²)y - y³/3] | ₀ʸ⁻ᵐᵃˣ
V = 2π [(r² - h²)√(r² - h²) - (√(r² - h²))³ / 3] = 2π(2/3) (r² - h²)³/² ==> V = (4π/3)(r² - h²)³/²
For bore hole h = 1, V = (4π/3)(r² - 1)³/²
(b) Cylindrical Shells (about y-axis)
xᵢ : h -> r ==> V ≈ Σ [ π(xᵢ + Δx)² - πxᵢ² ] (2yᵢ) = Σ [ π(xᵢ + Δx)² - πxᵢ² ] (2√(r² - xᵢ²)) ==>
V ≈ 2 Σ [ π(xᵢ² + 2xᵢΔx + Δx² - πxᵢ² ] (√(r² - xᵢ²)) = 2 Σ [ π(2xᵢ + Δx ] (√(r² - xᵢ²)) ᵢΔx
= 2 Σ [ π(2xᵢ) (√(r² - xᵢ²) Δx ==>
V = (h -> r) 2π ∫ √(r² - x²)(2x dx) = (h -> r) (-2π) ∫ (r² - x²)¹/²(-2x dx) = (-2π) (r² - x²)³/² / (3/2) | (h -> r)
V = (-2π)(2/3) [ (r² - r²)³/² - (r² - h²)³/² ] ==> V = (4π/3)(r² - h²)³/²
(c) Given V = 200 mm³, with bore hole ‘h=1 mm', find radius ‘r’
V = (4π/3)(r² - h²)³/² = 200 ==> (4π/3)(r² - 1)³/² = 200 ==> r² - 1 = [200(3/4π)]²/³ ==> r² = 1 + [200(3/4π)]²/³ ==>
r = √(1 + [200(3/4π)]²/³) ==> r = √(1 + 13.16) ==> r = √(14.16) ==> r = 3.76 mm
(d) Observations
Fwiw, the volumed bored out of the sphere is _not_ a cylinder, but removed what would be both "rounded ends” at each end of the cylinder, as well:
Volume of Sphere: (4π/3)r³
Volume of Bore: (4π/3)[r³ - (r² - h²)³/²]
Volume of Cylinder bored out (without the “end caps”): πh²√(r² - h²) # see “yₘₐₓ" in (a) above.
Volume of bored “end caps” : (Volume of Bore) - (Volume of Cylinder bored) =
(4π/3)[r³ - (r² - h²)³/²] - πh²√(r² - h²) = π [ (4/3)[r³ - (r² - h²)³/²] - h²√(r² - h²) ] # a mouthful !!