# 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. – Michael E2 Apr 18 '17 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}; – LCFactorization Apr 19 '17 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) – David G. Stork Apr 19 '17 at 0:14
• How about this?Actually I don't very content with the current solution. – yode Apr 19 '17 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 – LCFactorization Apr 19 '17 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]. – Carl Woll Apr 19 '17 at 23:09

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. – LCFactorization Apr 19 '17 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? – LCFactorization Apr 19 '17 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 – LCFactorization Apr 19 '17 at 22:29