# Untitled

## 1020 days ago by pub

Find the flux of the vector field $\vec F(x,y,z)=\,\lt x^3,x^2y,x^2z \gt\,$ through the cylinder $x^2+y^2 \le4$, $0 \le z \le 3$

We use the general form of the cylinder: $x^2+y^2 \le a^2$, $0 \le z \le b$ so $a=\sqrt{4}=2$ and $b=3$

We will integrate over the surfaces: Part 1: Cylinder + Part 2: Bottom + Part3: Top. Then we will check our answer with the Part 4: Divergence Theorem (aka Gauss-Ostrogradsky).

Surface 1 is the cylinder S. We want $\iint_S \vec F \,d \vec S$

a=2;b=3; var('x y z');var ('u v')
 \newcommand{\Bold}{\mathbf{#1}}\left(x, y, z\right)\newcommand{\Bold}{\mathbf{#1}}\left(u, v\right) \newcommand{\Bold}{\mathbf{#1}}\left(x, y, z\right)\newcommand{\Bold}{\mathbf{#1}}\left(u, v\right)

As always, we ran the SOLVER first (below) and then used that information to get the graphs here.

Graph 1: We use the parameterization of S that we get below to graph the surface. We split it up so we could "see" the orientation.

s=vector((a*cos(u),a*sin(u),v)) S1=parametric_plot3d(s,(u,0,pi/2),(v,0,b),color='blue',opacity=.7,plot_points=[20,20]) S2=parametric_plot3d(s,(u,pi/2,pi),(v,0,b),color='red',opacity=0.7,plot_points=[20,20]) S3=parametric_plot3d(s,(u,pi,3*pi/2),(v,0,b),color='green',opacity=0.7,plot_points=[20,20]) S4=parametric_plot3d(s,(u,3*pi/2,2*pi),(v,0,b),color='yellow',opacity=0.7,plot_points=[20,20]) show(S1+S2+S3+S4)

Graph 2: Our integrand from below is: $16 \, cos^2(u)$. We translate this to: $a^4 \, cos^2(u)$

Click and drag to rotate. Notice that the arrows are not all the same length. We scale the vectors by vs.

As always, to get the arrows, we use the parameterization of S to get the "base point" and then use "base point" plus ($\vec n \cdot$ Integrand) to get the "end point".

vs=10 tx=text3d("x",(0,-a-.18,0)) ty=text3d("y",(a+2,0,0)) vf=sum([sum([arrow3d((a*cos(c),a*sin(c),d),(a*cos(c)+cos(c)*a^4*((cos(c))^2)/vs,a*sin(c)+sin(c)*a^4*((cos(c))^2)/vs,d+0), color=hue((c+8)/8), width=0.8) for c in [0..2*pi,step=pi/8]]) for d in [0..b,step=b/3]]) show(S1+S2+S3+S4+tx+ty+vf)

Preparation for using the SOLVER.

We parameterize the surface with 2 parameters and find a unit vector $\vec n$ normal and pointing out from the surface.

Work particular to this problem:

== Remember that we parameterize a circle $(x-p)^2+(y-q)^2 \le R^2$ with $x=Rcos(u)+p$ and $y=Rsin(u)+q$. We set $z=v$ since we have a cylinder

== Remember we have $a=\sqrt{4}=2$ and $b=3$.

== So: $\left\{ \begin{array}{l}x = a \cos(u) \\y = a\sin(u)\\z = v\end{array} \right.\,\,\,\,\,u \in [0,2\pi ] \,\,\,\,v \in [0,b]$

== By examination, we see: $\vec n=<cos(u),sin(u),0>$   (That is, the vector has no change in z and points directly out from the cylinder circles.)

SOLVER

Step 1: We define $\vec S$, $\vec n$ and $\vec F$. Changes with problem; input your parametrization of Sf and your vector n.

Sf=vector((a*cos(u),a*sin(u),v)) n=vector((cos(u),sin(u),0)) F=vector((x^3,x^2*y,x^2*z))

Step 2: The program finds the partial derivatives.

Sprime_u=diff(Sf,u) view(Sprime_u)
 \newcommand{\Bold}{\mathbf{#1}}\left(-2 \, \sin\left(u\right),\,2 \, \cos\left(u\right),\,0\right) \newcommand{\Bold}{\mathbf{#1}}\left(-2 \, \sin\left(u\right),\,2 \, \cos\left(u\right),\,0\right)
Sprime_v=diff(Sf,v) view(Sprime_v)
 \newcommand{\Bold}{\mathbf{#1}}\left(0,\,0,\,1\right) \newcommand{\Bold}{\mathbf{#1}}\left(0,\,0,\,1\right)

Step 3: The program checks whether our parameterization is "orientation-preserving" or not. Check that we get 1 or -1.
If we get 0 here, we need to change the point, e.g. (u=2.0,v=2.0). Use "real" values with decimal points. (If we get something other than +1, -1 or 0, we have made an error in step 1.)

npar=Sprime_u.cross_product(Sprime_v) np=sign((n.dot_product(npar))(u=1.0,v=1.0)) view(np)
 \newcommand{\Bold}{\mathbf{#1}}1 \newcommand{\Bold}{\mathbf{#1}}1

Step 4: The program defines a standard sage function for "change of variables" for a 2-variable parametrization (surface).

The program changes the variables of $\vec F$.

def changevar(f, eqn, newvar1,newvar2): return f.substitute(eqn)
F=changevar(F,x==Sf,u,v) F=changevar(F,y==Sf,u,v) F=changevar(F,z==Sf,u,v) view(F)
 \newcommand{\Bold}{\mathbf{#1}}\left(8 \, \cos\left(u\right)^{3},\,8 \, \sin\left(u\right) \cos\left(u\right)^{2},\,4 \, v \cos\left(u\right)^{2}\right) \newcommand{\Bold}{\mathbf{#1}}\left(8 \, \cos\left(u\right)^{3},\,8 \, \sin\left(u\right) \cos\left(u\right)^{2},\,4 \, v \cos\left(u\right)^{2}\right)

Step 5: Then program finds the mixed product and multiplies it by the orientation from step 3.

M=matrix(([F,F,F],[Sprime_u,Sprime_u,Sprime_u],[Sprime_v,Sprime_v,Sprime_v])) Int=np*M.determinant() view(Int)
 \newcommand{\Bold}{\mathbf{#1}}16 \, \sin\left(u\right)^{2} \cos\left(u\right)^{2} + 16 \, \cos\left(u\right)^{4} \newcommand{\Bold}{\mathbf{#1}}16 \, \sin\left(u\right)^{2} \cos\left(u\right)^{2} + 16 \, \cos\left(u\right)^{4}

Step 6: Then program computes the integral (flux). Changes with problem - we must put in our intervals of integration.

integral(integral(Int,(u,0,2*pi)),(v,0,b))
 \newcommand{\Bold}{\mathbf{#1}}48 \, \pi \newcommand{\Bold}{\mathbf{#1}}48 \, \pi

So our flux over the cylinder is: $\iint_S \vec F \,d \vec S = 48 \pi$.  For general constants a and b, we have $\iint_S \vec F \,d \vec S = a^4b \pi$

Now we must do the integral over the top and the bottom of the cylinder.  Then we will check our answer with the divergence (Gauss') theorem.

vs=10 tx=text3d("x",(0,-a-.18,0)) ty=text3d("y",(a+2,0,0)) vf=sum([sum([arrow3d((a*cos(c),a*sin(c),d),(a*cos(c)+cos(c)*a^4*((cos(c))^2)/vs,a*sin(c)+sin(c)*a^4*((cos(c))^2)/vs,d+0), color=hue((c+8)/8), width=0.8) for c in [0..2*pi,step=pi/8]]) for d in [0..b,step=b/3]]) show(S1+S2+S3+S4+tx+ty+vf)