# How can I get the volume enclosed by two orthogonal cylindrical surfaces (Radius is a variable, not a specific value)?

I can get the volume enclosed by two orthogonal cylindrical surfaces when the radius of the bottom circle of the cylinder is a specific value (for example, r1=r2=2):

    Clear["Global*"];
v1 = ImplicitRegion[x^2 + y^2 <= 2^2, {x, y, z}];
v2 = ImplicitRegion[x^2 + z^2 <= 2^2, {x, y, z}];
v = RegionIntersection[v1, v2];
Volume[v]

(*128/3*)


How can I get the volume enclosed by two orthogonal cylindrical surfaces when the radius of the bottom circle of the cylinder is a variable "r" (r1==r2==r), not a specific value?

v1 = ImplicitRegion[x^2 + y^2 <= r^2, {x, y, z}];
v2 = ImplicitRegion[x^2 + z^2 <= r^2, {x, y, z}];
v = RegionIntersection[v1, v2];
Assuming[r > 0, Volume[v]]


(16 r^3)/3

• Thanks!! @cvgmt Feb 28, 2022 at 1:51
• Assuming[r > 0, ImplicitRegion[{x^2 + y^2 <= r^2, x^2 + z^2 <= r^2}, {x, y, z}] // Volume] Feb 28, 2022 at 2:01

This was the fastest way that came to mind. Do a bunch of values and then guess the result. Like so:

Table[v1 = ImplicitRegion[x^2 + y^2 <= r^2, {x, y, z}];
v2 = ImplicitRegion[x^2 + z^2 <= r^2, {x, y, z}];
v = RegionIntersection[v1, v2];
Volume[v], {r, 1, 12, 1}]


{16/3, 128/3, 144, 1024/3, 2000/3, 1152, 5488/3, 8192/3, 3888, \ 16000/3, 21296/3, 9216}

Then, you run

FindSequenceFunction[{16/3, 128/3, 144, 1024/3, 2000/3, 1152, 5488/3,
8192/3, 3888, 16000/3, 21296/3, 9216}, r]


which gives

(16 r^3)/3

Bonus feature: rewrite it in terms of π.

Solve[16/3 xx == 4/3 Pi, xx] // Simplify


{{xx -> π/4}}`

• Thanks :-) @kcr Feb 28, 2022 at 1:53
• @lotus2019 you are welcome :-) Feb 28, 2022 at 1:54