0
$\begingroup$

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. *)
$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – tad
    Commented Mar 7, 2022 at 4:32
  • $\begingroup$ Also failed. @tad $\endgroup$
    – lotus2019
    Commented Mar 7, 2022 at 6:25
  • $\begingroup$ @lotus2019 Your second approach using NIntegrate works! $\endgroup$ Commented Mar 7, 2022 at 7:01
  • $\begingroup$ 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 $\endgroup$
    – lotus2019
    Commented Mar 7, 2022 at 7:37

1 Answer 1

1
$\begingroup$

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*)

addendum

Analytical solution (spherical coordinates) evalutes too

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]    
(*-2 a \[Pi] Log[h/a]*)

and agrees with the numerical solution

int[1,1/2]//N (*4.35517*)
$\endgroup$
1
  • $\begingroup$ Great answer! That's exactly what I want. Thanks a lot! @Ulrich Neumann $\endgroup$
    – lotus2019
    Commented Mar 7, 2022 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.