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<h<a)$)
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. *)
NIntegrate
works! $\endgroup$