Surfaces Integrals

Surface Integrals of Functions

Example 1

Integrate G(x,y,z)=(x^2)z over the portion of the cone (z^2)=(x^2)+(y^2) that lies between z=1 and z=4.

Solution

Parameterize the surface:

r[p_,θ_]={p Cos[θ],p Sin[θ],p}
surface=ParametricPlot3D[r[p,θ],{p,1,2},{θ,0,2π},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

shadowr[p_,θ_]={p Cos[θ],p Sin[θ],0}
shadowregion=ParametricPlot3D[shadowr[p,θ],{p,1,2},{θ,0,2π},ColorFunction->"DarkRainbow",AxesLabel->{"x","y","z"}];
Show[surface,shadowregion,PlotRange->All]

Here is the calculation for the integral:

G=(x^2)z/.x->r[p,θ][[1]]/.y->r[p,θ][[2]]/.z->r[p,θ][[3]]

integrand=G*(Sqrt[Cross[D[r[p,θ],p],D[r[p,θ],θ]].Cross[D[r[p,θ],p],D[r[p,θ],θ]]])

Integrate[Integrate[integrand,{p,1,2}],{θ,0,2π}]

Oriented Surfaces

A non-orientable surface

r[s_,t_]={(2+s Cos[t/2])Cos[t],(2+s Cos[t/2])Sin[t],s Sin[t/2]}

surface=ParametricPlot3D[r[s,t],{s,-2,2},{t,0,2π},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

If you start on one side and move around teh surface, you will end up at the same point ON THE OTHER SIDE OF THE SURFACE. That make sit non-orientable.

Positive orientation for (x^2)+(y^2)+(z^2)=1

We need our module for plotting vectors in (ℝ^3):

Arrow3D[{x1_,y1_,z1_},{x2_,y2_,z2_},color_]:=Module[{line,head,headsize},
headsize=0.015*(Sqrt[(((x1-x2))^2)+(((y1-y2))^2)+(((z1-z2))^2)]);
head=Sphere[{x2,y2,z2},headsize];
line=Line[{{x1,y1,z1},{x2,y2,z2}}];
Return[Graphics3D[{color,Thickness[0.02],line,head}]];
]

r[ϕ_,θ_]={Sin[ϕ]Cos[θ],Sin[ϕ] Sin[θ],Cos[ϕ]}

surface=ParametricPlot3D[r[ϕ,θ],{θ,0,2π},{ϕ,0,π},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"},PlotStyle->Opacity[0.65]]

rϕ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],ϕ]/.ϕ->1/.θ->1,Darker[Green]];
rθ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],θ]/.ϕ->1/.θ->1,Darker[Green]];

normal[ϕ_,θ_]=Cross[D[r[ϕ,θ],ϕ],D[r[ϕ,θ],θ]]

nor=Arrow3D[r[1,1],r[1,1]+normal[1,1],Darker[Blue]];

Show[surface,rϕ,rθ,nor]

Notice how the two derivative vectors are deined in terms of tangents to the grid curves on the surface (they don't line up exactly with the grid lines since Mathematica puts the grid lines wherever it wants).

Negative orientation for (x^2)+(y^2)+(z^2)=1

The surface doesn't change when we go to the negative orientation--what changes is the order of the cross product used to find a normal vector. I've highlighted the change in red.

rϕ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],ϕ]/.ϕ->1/.θ->1,Darker[Green]];
rθ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],θ]/.ϕ->1/.θ->1,Darker[Green]];

normal[ϕ_,θ_]=Cross[D[r[ϕ,θ],θ],D[r[ϕ,θ],ϕ]]

nor=Arrow3D[r[1,1],r[1,1]+normal[1,1],Darker[Blue]];

Show[surface,rϕ,rθ,nor]

I've reduced the opaciity of the sphere so we can see inside. Notice how the normal vector now points inside the sphere.

Surface Integrals of Vector Fields: flux through a surface

Recall Flux in (ℝ^2): Flux=(∮_C) (OverVector[F])·(OverHat[n]) ds

Needs["VectorFieldPlots`"]

F={x,1}
field=VectorFieldPlot[F,{x,-1,1},{y,-1,1}];

r[t_]={Cos[t],(1/2)Sin[t]}
curve=ParametricPlot[r[t],{t,0,2Pi},PlotStyle->{Red,Thick}];

Show[curve,field]

We had a convention that flux was measured by traversing the curve in a counterclockwise direction (see page 1157). In essence, this convention was providing an orientation to the curve C.

Basic Idea in (ℝ^3):Flux=∫(∫_S) (OverVector[F])·(OverHat[n]) dσ

Here is a paraboloid as a surface:

a=2;
b=2;
r[u_,θ_]={(Sqrt[u]) a Cos[θ],(Sqrt[u]) b Sin[θ],u}
surface=ParametricPlot3D[r[u,θ],{θ,0,2Pi},{u,-10,10},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

Let's put a vector field F in our plot.

Needs["VectorFieldPlots`"]

field=VectorFieldPlot3D[{x,y,z},{x,-5,5},{y,-5,5},{z,0,10},PlotPoints->7,VectorHeads->True];
Show[surface,field]

What the flux tells you, in a very general sense, is how much the arrows are moving from the inside to the outside of the paraboloid--really, how the arrows pass through the surface (the arrows that go out the top don't hit the surface, so don't contribute to the flux). If we orient the surface so that the normal points outwards, the flux will be positive (basically in the direction of the normal). If we use the inward pointing normal, the vector field is acting in the opposite direction and the flux would be negative). When computing flux through a surface, the orientation matters!!

Example

Determine the flux for the vector field F=<0,0,z> through the surface S: (x^2)+(y^2)+(z^2)=16, z>0 with outward pointing normal.

Solution

r[ϕ_,θ_]={4 Sin[ϕ]Cos[θ],4 Sin[ϕ] Sin[θ],4 Cos[ϕ]}
surface=ParametricPlot3D[r[ϕ,θ],{θ,0,2π},{ϕ,0,π/2},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

field=VectorFieldPlot3D[{0,0,z},{x,-4,4},{y,-4,4},{z,0,4},PlotPoints->7,VectorHeads->True];
Show[surface,field]

Since we are told to use an outward pointing normal, we expect our flux to be positive.

r[ϕ_,θ_]={4 Sin[ϕ]Cos[θ],4 Sin[ϕ] Sin[θ],4 Cos[ϕ]}

cross=Cross[D[r[ϕ,θ],ϕ],D[r[ϕ,θ],θ]]

F:={0,0,z}/.x->r[ϕ,θ][[1]]/.y->r[ϕ,θ][[2]]/.z->r[ϕ,θ][[3]]

integrand=F.cross

Integrate[Integrate[integrand,{ϕ,0,π/2}],{θ,0,2π}]

We are done.

Let's look at some pictures to help us see that we made the right choice in the order of the cross product (we are pretty sure we did because the flux is positive!)

We need our module for plotting vectors in (ℝ^3):

Arrow3D[{x1_,y1_,z1_},{x2_,y2_,z2_},color_]:=Module[{line,head,headsize},
headsize=0.015*(Sqrt[(((x1-x2))^2)+(((y1-y2))^2)+(((z1-z2))^2)]);
head=Sphere[{x2,y2,z2},headsize];
line=Line[{{x1,y1,z1},{x2,y2,z2}}];
Return[Graphics3D[{color,Thick,line,head}]];
]

And here we plot the vectors for ϕ=1,θ=1 (and set a=5 to get a plot):

a=5;
rϕ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],ϕ]/.ϕ->1/.θ->1,Darker[Green]];
rθ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],θ]/.ϕ->1/.θ->1,Darker[Green]];

normal[ϕ_,θ_]=Cross[D[r[ϕ,θ],ϕ],D[r[ϕ,θ],θ]]

nor=Arrow3D[r[1,1],r[1,1]+normal[1,1],Darker[Blue]];

Show[surface,rϕ,rθ,nor]

The normal is the outward pointing one, so we got the correct order in the cross product. You should also notice how the derivatives are r point along the grid lines of the surface.

Further Examples -- try them before you look at solutions! They are all homework problems.

Example 16.6.17

Find the surface area of the portion of the plane y+2z=2 inside (x^2)+(y^2)=1.

Solution

Parameterize the surface:

r[u_,v_]={u Cos[v],u Sin[v],1-u/2 Sin[v]}
surface=ParametricPlot3D[r[u,v],{u,0,1},{v,0,2π},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

shadowr[u_,v_]={u Cos[v],u Sin[v],0}
shadowregion=ParametricPlot3D[shadowr[u,v],{u,0,1},{v,0,2π},ColorFunction->"DarkRainbow",AxesLabel->{"x","y","z"}];
Show[surface,shadowregion,PlotRange->All]

Here is the calculation for surface area:

Cross[D[r[u,v],u],D[r[u,v],v]]
integrand=(Sqrt[Cross[D[r[u,v],u],D[r[u,v],v]].Cross[D[r[u,v],u],D[r[u,v],v]]])
Integrate[Integrate[integrand,{u,0,1}],{v,0,2Pi}]

Example 16.6.31

Integrate G(x,y,z)=z over the portion of the plane x+y+z=4 that lies above the square 0≤x≤1, 0≤y≤1 in the x y-plane.

Solution

Parameterize the surface:

r[u_,v_]={u,v,4-u-v}
surface=ParametricPlot3D[r[u,v],{u,0,1},{v,0,1},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

shadowr[u_,v_]={u,v,0}
shadowregion=ParametricPlot3D[shadowr[u,v],{u,0,1},{v,0,1},ColorFunction->"DarkRainbow",AxesLabel->{"x","y","z"}];
Show[surface,shadowregion,PlotRange->All]

Here is the calculation for the integral:

Cross[D[r[u,v],u],D[r[u,v],v]]
G:=z/.x->r[u,v][[1]]/.y->r[u,v][[2]]/.z->r[u,v][[3]]

integrand=G*(Sqrt[Cross[D[r[u,v],u],D[r[u,v],v]].Cross[D[r[u,v],u],D[r[u,v],v]]])

Integrate[Integrate[integrand,{u,0,1}],{v,0,1}]

Example 16.6.41

Find the flux of F=<x y,0,-z> outward through the cone z=(Sqrt[(x^2)+(y^2)]), 0≤z≤1.

Solution

Parameterize the surface:

r[u_,v_]={u Cos[v],u Sin[v], u}
surface=ParametricPlot3D[r[u,v],{u,0,1},{v,0,2π},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

shadowr[u_,v_]={u Cos[v],u Sin[v],0}
shadowregion=ParametricPlot3D[shadowr[u,v],{u,0,1},{v,0,2π},ColorFunction->"DarkRainbow",AxesLabel->{"x","y","z"}];
Show[surface,shadowregion,PlotRange->All]

Here is the calculation for the flux:

Cross[D[r[u,v],u],D[r[u,v],v]]
F:={x y,0,-z}/.x->r[u,v][[1]]/.y->r[u,v][[2]]/.z->r[u,v][[3]]

integrand=F.Cross[D[r[u,v],v],D[r[u,v],u]]

Integrate[Integrate[integrand,{u,0,1}],{v,0,2π}]

Let's look at some pictures that help us understand why we took (Subscript[r, v])×(Subscript[r, u])instead of (Subscript[r, u])×(Subscript[r, v]). You ALWAYS have to check that you are getting the normal in the correct orientation when doing flux problems! Let's look at the vectors at the specific point (1,1,(Sqrt[2])) on the surface, which occurs at u=1/2,v=1/3.

We need our module for plotting vectors in (ℝ^3):

Arrow3D[{x1_,y1_,z1_},{x2_,y2_,z2_},color_]:=Module[{line,head,headsize},
headsize=0.015*(Sqrt[(((x1-x2))^2)+(((y1-y2))^2)+(((z1-z2))^2)]);
head=Sphere[{x2,y2,z2},headsize];
line=Line[{{x1,y1,z1},{x2,y2,z2}}];
Return[Graphics3D[{color,Thick,line,head}]];
]

And here we plot the vectors:

ru=Arrow3D[r[1/2,1/3],r[1/2,1/3]+D[r[u,v],u]/.u->1/2/.v->1/3,Darker[Green]];
rv=Arrow3D[r[1/2,1/3],r[1/2,1/3]+D[r[u,v],v]/.u->1/2/.v->1/3,Darker[Green]];

normal[u_,v_]=Cross[D[r[u,v],u],D[r[u,v],v]];

nor=Arrow3D[r[1/2,1/3],r[1/2,1/3]+normal[1/2,1/3],Darker[Blue]];

Show[surface,ru,rv,nor]

You can readily see that the cross product (Subscript[r, u])×(Subscript[r, v]) points INTO the surface, and so it would give an INWARD pointing normal. This means tha the cross product  (Subscript[r, v])×(Subscript[r, u]) will give the OUTWARD pointing normal, which was what we wanted.

ru=Arrow3D[r[1/2,1/3],r[1/2,1/3]+D[r[u,v],u]/.u->1/2/.v->1/3,Darker[Green]];
rv=Arrow3D[r[1/2,1/3],r[1/2,1/3]+D[r[u,v],v]/.u->1/2/.v->1/3,Darker[Green]];

normal[u_,v_]=Cross[D[r[u,v],v],D[r[u,v],u]];

nor=Arrow3D[r[1/2,1/3],r[1/2,1/3]+normal[1/2,1/3],Darker[Blue]];

Show[surface,ru,rv,nor]

You should also notice how the derivatives are r point along the grid lines of the surface.

We can  also show the surface and the vector field, to help us see what is going on:

Needs["VectorFieldPlots`"]

field=VectorFieldPlot3D[{x y,0,-z},{x,-1,1},{y,-1,1},{z,-1,1},PlotPoints->5,VectorHeads->True];
Show[surface,field]

Notice how the field is moving from the inside to the outside of the surface? That's why when we used the outward pointing normal we got a positive flux.

Example 16.5.25

Find the flux of F=<x,y,z> outward through the surface (x^2)+(y^2)+(z^2)=(a^2) in the first octant.

Solution

Parameterize the surface (set a=5 just to get a plot):

a=5;
r[ϕ_,θ_]={a Sin[ϕ]Cos[θ],a Sin[ϕ] Sin[θ],a Cos[ϕ]}
surface=ParametricPlot3D[r[ϕ,θ],{θ,0,π/2},{ϕ,0,π/2},ColorFunction->"CherryTones",AxesLabel->{"x","y","z"}]

shadowr[ϕ_,θ_]={a Sin[ϕ]Cos[θ],a Sin[ϕ] Sin[θ],0}
shadowregion=ParametricPlot3D[shadowr[ϕ,θ],{θ,0,π/2},{ϕ,0,π/2},ColorFunction->"DarkRainbow",AxesLabel->{"x","y","z"}];
Show[surface,shadowregion,PlotRange->All]

Let's put the vector field F in our plot.

Needs["VectorFieldPlots`"]

field=VectorFieldPlot3D[{x,y,z},{x,-1,5},{y,-1,5},{z,-1,5},PlotPoints->5,VectorHeads->True];
Show[surface,field]

We would expect the flux integral to be positive when we use the outward pointing normal.

Here is the calculation for the flux, but we redefine r because we want to leave a unspecified.

Clear[a]
r[ϕ_,θ_]={a Sin[ϕ]Cos[θ],a Sin[ϕ] Sin[θ],a Cos[ϕ]}
cross=Cross[D[r[ϕ,θ],ϕ],D[r[ϕ,θ],θ]]
F:={x,y,z}/.x->r[ϕ,θ][[1]]/.y->r[ϕ,θ][[2]]/.z->r[ϕ,θ][[3]]

integrand=F.cross

Integrate[Integrate[integrand,{ϕ,0,π/2}],{θ,0,π/2}]

Let's look at some pictures to help us see that we made the right choice in the order of the cross product (we are pretty sure we did because the flux is positive!)

We need our module for plotting vectors in (ℝ^3):

Arrow3D[{x1_,y1_,z1_},{x2_,y2_,z2_},color_]:=Module[{line,head,headsize},
headsize=0.015*(Sqrt[(((x1-x2))^2)+(((y1-y2))^2)+(((z1-z2))^2)]);
head=Sphere[{x2,y2,z2},headsize];
line=Line[{{x1,y1,z1},{x2,y2,z2}}];
Return[Graphics3D[{color,Thick,line,head}]];
]

And here we plot the vectors for ϕ=1,θ=1 (and set a=5 to get a plot):

a=5;
rϕ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],ϕ]/.ϕ->1/.θ->1,Darker[Green]];
rθ=Arrow3D[r[1,1],r[1,1]+D[r[ϕ,θ],θ]/.ϕ->1/.θ->1,Darker[Green]];

normal[ϕ_,θ_]=Cross[D[r[ϕ,θ],ϕ],D[r[ϕ,θ],θ]]

nor=Arrow3D[r[1,1],r[1,1]+normal[1,1],Darker[Blue]];

Show[surface,rϕ,rθ,nor]

The normal is the outward pointing one, so we got the correct order in the cross product. You should also notice how the derivatives are r point along the grid lines of the surface.