# Surface integral help

Calculate surface integral:

$$\iint_{\Sigma} \frac{\mathrm{d} S}{z}$$

$$\Sigma$$:The top of a sphere ($$x^{2}+y^{2}+z^{2}=a^{2}$$) cut by a plane ($$z = h (0)

My code:

Clear["Global*"];
reg = ImplicitRegion[\!$$TraditionalForm\ \*SuperscriptBox[\(x$$, $$2$$] +
\*SuperscriptBox[$$y$$, $$2$$] +
\*SuperscriptBox[$$z$$, $$2$$] ==
\*SuperscriptBox[$$a$$, $$2$$]\) && z >= h && a > 0 && 0 < h < a, {x,
y, z}];
f[x_, y_, z_] := 1/z
Integrate[f[x, y, z], Element[{x, y, z}, reg]]

(* Integrate returns unevaluated. *)


Even if I assign values to all variables:

Clear["Global*"];
reg = ImplicitRegion[x^2 + y^2 + z^2 == 1 && z > 1/2, {x, y, z}];
f[x_, y_, z_] := 1/z
Integrate[f[x, y, z], Element[{x, y, z}, reg]]

(* Integrate returns unevaluated. *)


If I use spherical coordinates by use ParametricRegion and with a=1, h=1/2, I can get a result:

Clear["Global*"];
reg = ParametricRegion[{Cos[ϕ]*Sin[θ],
Sin[ϕ]*Sin[θ],
Cos[θ]}, {{ϕ, 0, 2 π}, {θ, 0,
ArcCos[1/2]}}];
f[x_, y_, z_] := 1/z
Integrate[f[x, y, z], Element[{x, y, z}, reg]]

(*π Log[4]*)


However, if a and h are not assigned, the result cannot be obtained:

Clear["Global*"];
reg = ParametricRegion[{r*Cos[ϕ]*Sin[θ],
r*Sin[ϕ]*Sin[θ],
r*Cos[θ]}, {{ϕ, 0, 2 π}, {r, a, a}, {θ, 0,
ArcCos[h/a]}}];
f[x_, y_, z_] := 1/z
Integrate[f[x, y, z], Element[{x, y, z}, reg],
Assumptions -> a > 0 && 0 < h < a]

(* Doesn't finish calculating in 500 seconds. *)

• Do you expect this integral has a closed form for symbolic parameters a and h? As a start, try specifying exact numerical values for a and h to see how complicated the expression is. E.g., a=1 and h=1/2.
Mar 7, 2022 at 4:32
• Also failed. @tad Mar 7, 2022 at 6:25
• @lotus2019 Your second approach using NIntegrate works! Mar 7, 2022 at 7:01
• Thank you. If I use ParametricRegion with a=1, h=1/2, I can get a result. But if a and h are not assigned, the result cannot be obtained. @Ulrich Neumann Mar 7, 2022 at 7:37

If you're looking for numerical result as function of a,h try

f[x_, y_, z_] := 1/z
intN[a_?NumericQ, h_?NumericQ] :=NIntegrate[f[x, y, z],Element[{x, y, z}, ImplicitRegion[x^2 + y^2 + z^2 == a^2 && h < z < a, {x,y, z}] ]]

intN[1,1/2] (*4.35517*)


int[a_ , h_ ] =Integrate[f[a Cos[\[CurlyPhi]] Sin[ \[Theta]], a Sin[\[CurlyPhi]] Sin[ \[Theta]], a Cos[ \[Theta]]] a^2 Sin[\[Theta]], {\[CurlyPhi], 0, 2 Pi}, {\[Theta], 0, ArcCos[h/a]}, Assumptions -> a > h > 0]

int[1,1/2]//N (*4.35517*)
`