Stokes' Theorem

This notebook describes how to use Mathematica to compute the integrals that arise from Stokes' Theorem.  In particular, you'll see how to:
- Compute the surface integral version\(TraditionalForm
      \`∫\_□\%□\(∫\_S
            \%□\( Curl(F)\) . N dσ\)\).
- Compute the line integral over a closed path in 3 space \(TraditionalForm
      \`∫\_C\%□ F . dR\).
The example used here has a vector field of F(x,y,z) = <yx^2, -xy^2, z^2> over the paraboloid z = x^2 + y^2 for x^2 + y^2 <= 9 (i.e. the closed path R(t) is <3Cos(t), 3Sin(t), 9> ).

The functions in this notebook are set up to be easily cut-and-pasted so you can easily experiment with them.

TO SEE WHAT THIS NOTEBOOK PROVIDES:
- Select Kernel|Evaluation|Evaluate_Notebook to execute all the cell and produce the graphics.
- Then scroll through reading the commands and associated comments while you look at the commands' results.
- All input cells are set up such that they can be cut-and-pasted in their entirety for easy "re-use".

The material in this notebook was originally developed by Capt Rob Wolverton and was re-formatted into a tutorial by Lt Col Steve Hadfield, both of the USAF Academy, Dept of Mathematical Sciences.	
Filename: stokes_theorem.nb

Surface Integral Version

Here we compute the surface integral version \(TraditionalForm
      \`∫\_□\%□\(∫\_S
            \%□\( Curl(F)\) . N dσ\)\) over the paraboloid z = x^2 + y^2 for x^2 + y^2 <= 9.  Here's how the code works:
Line 1 - Clears any previous symbol definitions to avoid conflicts.
Line 2 - Loads the Calculus`VectorAnalysis` package needed for the Curl function.
Line 3 - Defines the vector field.
Line 4 - Defines the surface.
Line 5 - Computes the normal vector for the surface, N^(hat).
Line 6 - Computes the curl of the vector field.   NOTE:  We need to tell Mathematica what coordinate system we are working in (here it is Cartesian).
Line 7..8 - Computes the partial derivates of the surface with respect to x and y and squares them setting up to build the differential surface area
Line 9 - Evaluates the surface integral making a conversion to cylindrical coordinates.
NOTE:  We print out the N^(hat) surface normal, the curl, and the value of the integral.

Clear[F, S, r, the, CuF, Nhat, x, y, z]Needs["Calculus`VectorAnalysis`"]\(F[x_, y_, z_] = {x*y, y*z, x*z}; 
S[x_, y_] = x\^2 + y\^2; 

    Nhat[x_, y_, z_] = {D[S[x, y], x], D[S[x, y], y], \(-1\)}/
        Sqrt[1 + D[S[x, y], x]\^2 + D[S[x, y], y]\^2]\)CuF[x_, y_, z_] = Curl[F[x, y, z], Cartesian[x, y, z]]\(Sx[x_, y_] = D[S[x, y], x]\^2; 
Sy[x_, y_] = D[S[x, y], y]\^2; 

    ∫\_0
        \%\(2  π\)\(∫\_0\%3
          \((CuF[r*Cos[θ], r*Sin[θ], z] . 
              Nhat[r*Cos[θ], r*Sin[θ], z])\)*
          Sqrt[1 + Sx[r*Cos[θ], r*Sin[θ]] + 
              Sy[r*Cos[θ], r*Sin[θ]]]*r \[DifferentialD]r 
          \[DifferentialD]θ\)\)

Line Integral Version

Here we compute the line integral version \(TraditionalForm
      \`∫\_C\%□ F . dR\) over the closed path R(t) is <3Cos(t), 3Sin(t), 9>.  Here's how the code works:
Line 1 - Clears any previous symbol definitions to avoid conflicts.
Line 2..4 - Define the components of the path R(t).
Line 5 - Defines the closed path R(t).
Line 6 - Defines the vector field.
Line 7 - Computes the line integral.
NOTE:  We print out the parameterized version of the vector field and the value of the integral.

Clear[R, F, x, y, z, t, ds]\(x[t_] = 3*Cos[t]; 
y[t_] = 3*Sin[t]; 
z[t_] = 9; 

    R[t_] = {x[t], y[t], z[t]}; 

    F[t_] = {x[t]*y[t], y[t]*z[t], x[t]*z[t]}\)(∫_0^(2  π))F[t] . R'[t] \[DifferentialD]t