# How to calculate the surface integral of a vector field?

Suppose the oriented surface is described as, the outside of an upper hemisphere $S:x^2+y^2+z^2=1$ inside the cylinder $x^2-x+y^2=0$ The vector field is : ${\vec F}=<x^2,y^2,z^2>$ How to calculate the surface integral of the vector field: $$\iint\limits_{S^+} \vec F\cdot \vec n {\rm d}S$$ Is it the same thing to:

$$\iint\limits_{S^+}x^2{\rm d}y{\rm d}z+y^2{\rm d}x{\rm d}z+z^2{\rm d}x{\rm d}y$$

There is another post here with an answer by@MichaelE2 for the cases when the surface is easily described in parametric form. How to handle this case?

• Note that {x, y, Sqrt[1 - x^2 - y^2]} is one parameterization of the upper hemisphere. There's another in spherical coordinates, and so forth. Apr 18, 2017 at 23:56
• For this case, does that mean S = {{x, y, z} -> {Cos[u] v/2 +1/2, Sin[u] v/2, Sqrt[ 1 - (Cos[u] v/2 +1/2)^2 - (Sin[u] v/2)^2]}, {u, 0, 2 Pi}, {v, 0, 1}}; F = {x^2, y^2, z^2}; Apr 19, 2017 at 1:55

You can try using ImplicitRegion and Integrate:

region = ImplicitRegion[x^2 + y^2 + z^2 == 1 && x^2 - x + y^2 <= 0 && z >= 0, {x, y, z}];

Integrate[#, {x,y,z} ∈ region]& /@ ({x^2, y^2, z^2} . {x, y, z})

(* 38/105 + (5 π)/32 *)


Note that the normal vector is just {x, y, z} for a unit sphere. I also map Integrate over the summands to make things easier for Integrate.

• Heck... this is far simpler than the traditional integration technique I was working on. (+1) Apr 19, 2017 at 0:14
– yode
Apr 19, 2017 at 1:00
• One more question: why Integrate[#, {x, y, z}∈ ImplicitRegion[ x^2 + y^2 + z^2 == 1 && x^2 - x + y^2 <= 0 && z >= 0, {x, y, z}]] &@({x^2, y^2, z^2}.{x, y, z}) is slower than the code in the answer? there is only one / difference @yode @CarlWoll Apr 19, 2017 at 22:45
• Integrate[x^3+y^3+z^3, {x,y,z} ∈ region] is harder for Integrate than doing Integrate[x^3, {x, y, z} ∈ region] + Integrate[y^3, {x, y, z} ∈ region] + Integrate[z^3, {x, y, z} ∈ region]. Apr 19, 2017 at 23:09
• @CarlWoll When I rewrite the direction vector of your surface to another equivalent form, the result is different from yours. Why can't we use {-(x/Sqrt[-x^2 - y^2 + 1]), -(y/Sqrt[-x^2 - y^2 + 1]), 1} instead of {x, y, z} : Integrate[#, {x, y, z} \[Element] region] & /@ ({region = ImplicitRegion[ x^2 + y^2 + z^2 == 1 && x^2 - x + y^2 <= 0 && z >= 0, {x, y, z}]; Integrate[#, {x, y, z} \[Element] region] & /@ ({x^2, y^2, z^2}.{x, y, z}), y^2, z^2}.{-(x/Sqrt[-x^2 - y^2 + 1]), -(y/Sqrt[-x^2 - y^2 + 1]), 1}) Jul 30, 2020 at 1:45

With the new-in-13.3 SurfaceIntegrate:

preg =
ParametricRegion[{u, v, Sqrt[1 - u^2 - v^2]},
{{u, 0, 1}, {v, -Sqrt[u - u^2], Sqrt[u - u^2]}}];

SurfaceIntegrate[{x^2, y^2, z^2}, {x, y, z} ∈ preg]
(* 38/105 + (5 π)/32 *) Sadly the following doesn't work for the moment:

SurfaceIntegrate[{x^2, y^2, z^2}, {x, y, z} ∈
ImplicitRegion[x^2 + y^2 + z^2 == 1 && x^2 - x + y^2 <= 0 && z >= 0, {x, y, z}]]
(* Input returned. *)


Just to illustrate use of MichaelE2's DoubleContourIntegral:

DoubleContourIntegral[{x^2, y^2,
z^2}, {({x, y, z} -> {u, v, Sqrt[1 - u^2 - v^2]}), {u, 0,
1}, {v, -Sqrt[u - u^2], Sqrt[u - u^2]}}]


yields: 38/105 + (5 π)/32

Note the limits of integration.

• Thank you. I use: S = {{x, y, z} -> {Cos[v] u/2 + 1/2, Sin[v] u/2, Sqrt[1 - (Cos[v] u/2 + 1/2)^2 - (Sin[v] u/2)^2]}, {u, 0, 1}, {v, 0, 2 Pi}};F = {x^2, y^2, z^2}; \[DoubleContourIntegral]F \[DifferentialD]S but is very slow. Apr 19, 2017 at 6:20
• Is it possible to convert it into the sum of three double integrals on the projections of the oriented surface to $xoy$,$yoz$ and $xoz$ axis planes? Apr 19, 2017 at 6:26
• ·Integrate[ 1 - x^2 - y^2, {x, 0, 1}, {y, -Sqrt[x - x^2], Sqrt[x - x^2]}]+Integrate[ 1 - z^2 - y^2, {z, 0, 1}, {y, -Sqrt[z^2 - z^4], Sqrt[z^2 - z^4]}]· is the answer. thanks Apr 19, 2017 at 22:29