Isoperimetric check

Here is some Mathematica code for the sphere, which verifies that the isoperimetric ratio Q is 1 for the sphere. Here r parametrizes the sphere, f is the length of the cross product (you hopefully remember from multi-variable calculus). We then compute the surface area and the volume.

r[phi_,theta_]:={Sin[phi] Cos[theta],Sin[phi] Sin[theta],Cos[phi]};
X=D[r[phi,theta],phi]; Y=D[r[phi,theta],theta]; f=Simplify[Sqrt[Cross[X,Y].Cross[X,Y]] ];
A=8*NIntegrate[f,{phi,0,Pi/2},{theta,0,Pi/2}]      (* 8 quadrants    *)
z=(1-r^2)^(1/2);
V=2 NIntegrate[ 2Pi r  z, {r,0,1}]                 (* 2 half spheres *)
Q=36 Pi V^2/A^3 

Checking the rank

We have a function f from R^3 to R^2 and look at its roots. It is a curve. We also the parametrization r(t) of the curve. The code checks what happens when threading in the curve into the function f(r(t)). This should be zero. Then we compute the Jacobian. This is useful to determine where the curve is singular. The Jacobian has two rows. They are the gradients of p and q. The gradient of p vanishes at the center of the sphere. The gradient of q vanishes at the symmetry axis of the cylinder. The rank of df is not maximal means solving a Lagrange problem dp is parallel to dq.

p= (x + 1/2)^2 + y^2 + z^2-1;                     (* sphere   *)
q= x^2 + y^2 - 1/4;                               (* cylinder *)
r = {Cos[t]^2 - 1/2, Sin[t] Cos[t], Sin[t]};      (* Viviani curve *)
FullSimplify[ {p,q} /. Thread[ Rule[{x,y,z},r]], Rule[Assumptions,Element[t,Reals]]]
df = {{D[p,x],D[p,y],D[p,z]},{D[q,x],D[q,y],D[q,z]}};
{x,y,z} /. Solve[{D[p,x]==0,D[p,y]==0,D[p,z]==0},Reals]

And here is how to plot things:

S1=ContourPlot3D[p==0, {x,-2,2},{y,-2,2},{z,-2,2},ContourStyle->{Yellow,Opacity[0.5]}];
S2=ContourPlot3D[q==0, {x,-2,2},{y,-2,2},{z,-2,2},ContourStyle->{Blue,Opacity[0.5]}];
S3=Graphics3D[{Red,Tube[Table[r /. Rule[t,s],{s,0,2Pi,0.01}],0.1]}]; 
Show[{S1,S2,S3}]