Integrals over a Curve, Multidimensional Integrals

We will look at two examples of path integrals of vector functions of position and examine their path dependence.  The first integral has a non-zero curl (and so we know that it is not the gradient of some scalar potential)

Here is a vector function (xyz, xyz, xyz) for which the curl does not vanish anywhere

<< Calculus`VectorAnalysis`
VectorFunction  = {x y z,  x y z ,  
        y x z}
CurlVectorFunction  =  
      Simplify[Curl[VectorFunction, Cartesian[x, y, z]]]

These are the conditions that the curl is zero:

ConditionsOfZeroCurl  = 
      Table[0 == CurlVectorFunction[[i]], {i, 3}]

There is only one point where this occurs:

FindInstance[ConditionsOfZeroCurl, {x, y, z}]

Let's evaluate the integral of the vector potential ( \(TraditionalForm\`∮\ \(v\& -> \)\ \ • d\(s\& -> \)\)  ) for any  curve that wraps around a cylinder of radius R with an axis that coincides with the z-axis

Any curve that wraps around the cylinder can be parameritized as (x(t), y(t), z(t)) = (R cos(t), R sin(t), A (Subscript[P, 2  π])(t)) where (Subscript[P, 2  π])(t) = (Subscript[P, 2  π])(t + 2π) and in particular (Subscript[P, 2  π])(0) = (Subscript[P, 2  π])(2π).
Therefore d(Overscript[s,  ->]) =    (-R sin(t), R cos(t), (Subscript[(P'), 2  π])(t)) dt = (-y(t), x(t), A (Subscript[(P'), 2  π])(t))     dt
The integrand for an integral of "VectorFunction" around such a curve is (written in terms of an arbitrary P(t):

vf  = 
      VectorFunction . {-y, x,  Amp D[P[t], t]} /. {x -> 
              Radius Cos[t], y -> Radius Sin[t], z -> Amp P[t]} // 
        Simplify

The integral depends on the choice of P(t)

PathDepInt  = Integrate[vf, {t, 0,  2 Pi}]

Let's introduce some specific periodic functions for P. Note how the value of the integral changes as the path changes:

PathDepInt /. P -> Sin

PathDepInt /. P -> Cos

PathDepInt /. {P[t] -> t (t - 2 Pi) ,  P'[t] -> 
          D[t (t - 2 Pi), t]}

However, here is  curious result which shows that some special paths can ``accidentally'' have zero integrals : let P(t) = cos(n t),

pdigen  =  
      PathDepInt /. {P[t] -> Cos[n t],  P'[t] ->  
            D[Cos[n t], t]}

Simplify[pdigen, n ∈  Integers]

thecurves  =  
      ParametricPlot3D[{{Cos[t], Sin[t],  Cos[3 t]}, {Cos[t], Sin[t],  
            Cos[ t]}}, {t, 0, 2 Pi}]

Show[{Graphics3D[Thickness[0.01]], Graphics3D[Hue[0.25, 0.5, 0.5]],  
        thecurves}]

Apparently, the symmetry of the vector function causes cancelation (note results for P = Sin and P=Cos, differ by a minus sign)
But, why doesn't n=1 give us the correct result above? Note that the denominator goes to zero as n->1

Limit[pdigen, n -> 1]

Try the same thing with a conservative (curl free, or exact) Vector Function:

Start with a scalar potential

temp  =  Grad[Exp[x y z], Cartesian[x, y, z]]

Create another vector function that should have a zero curl

AnotherVFunction  =  {(E^(x y z)) y z, (E^(x y z)) x z, (E^(x y z)) x y}
Simplify[Curl[AnotherVFunction, Cartesian[x, y, z]]]

anothervf  = 
      AnotherVFunction . {-y, x,  D[P[t], t]} /. {x -> 
              Radius Cos[t], y -> Radius Sin[t], z -> P[t]} // 
        Simplify

The integral depends doesn't on the choice of P(t)

PathDepInt  = Integrate[anothervf, t]

(PathDepInt /. t -> 2 Pi) -  (PathDepInt /. 
          t -> 0)

For a last example, suppose the curl vanishes on the cylindrical surface defined above:

Suppose we can find a function that has a non-vanishing curl on this surface

VanishOnCylinder  =  x^2  +  y^2  -  Radius^2

CurlOfOneStooge  =  {0, 0, VanishOnCylinder}

It is easy to see that this is the curl of Stooge, where

Stooge  =  {-1/2 Integrate[VanishOnCylinder, y], 
        1/2 Integrate[VanishOnCylinder, x], 0}

In fact, we could add to Stooge, any vector function that has vanishing curl--there are an infinite number of these

Simplify[Curl[Stooge, Cartesian[x, y, z]]]

Its integral doesn't care which path around the cylinder it takes, the integrand doesn't depend on P(t)

WhyIOughta  =  
      Stooge . {-y, x,  D[P[t], t]} /. {x -> Radius Cos[t], 
            y -> Radius Sin[t], z -> P[t]} // Expand

Integrate[WhyIOughta, {t, 0, 2 Pi}]

Multidimensional Integral over Irregular Domains

We will attempt to model the energy of ion just above one half of a triangular capacitor.  Suppose there is a uniformly charged surface  (σ≡charge/area=1) occupying an equilaterial triangle in the z=0 plane:
    
    what is the energy (voltage) of a unit positive charge located at (x,y,z)

The electrical potential goes like  (1/r), therefore the potential of a unit charge located at (x,y,z) from a small surface patch at (ξ,η,0) is ((σ dξ dη)/r)= \(TraditionalForm\`\(dξ\ dη\)\/\@\(\((x - ξ)\)\^\(\(2\)\(\ \)\) + \((y - η)\)\^\(\(2\)\(\ \)\) + z\^\(\(2\)\(\ \)\)\)\)

Therefore it remains to integrate this function over the domain η∈(0,((Sqrt[3])/2)) and ξ∈ ((η/(Sqrt[3])) -  (1/2)) , ((1/2) - (η/(Sqrt[3]))))  
\(TraditionalForm\`∫\_0\%\(\@3\/2\)\(∫\_\(η\/\@3 - \ 1\/2\)\%\(1\/2 - η\/\@3\)\(\(dξ\ dη\)\/\@\(\((x - ξ)\)\^\(\(2\)\(\ \)\) + \((y - η)\)\^\(\(2\)\(\ \)\) + z\^\(\(2\)\(\ \)\)\)\) dξ dη\)\)

Mathematica integrates over the last iterator first:

Integrate[f[x, y], y, x]
Integrate[f[x, y], {y, Yi, Yf}, {x, Xi,  Xf}]
Integrate[f[x, y], {y, Yi, Yf}, {x, Xi[y],  Xf[y]}]

For example,consider the difference in

Integrate[Exp[3  x], {y, 0, 1}, {x, 0, y}]
(Integrate[Exp[3  x], {x, 0, y}])
Integrate[(Integrate[Exp[3  x], {x, 0, y}]),{y, 0, 1}]

Compared to

ntegrate[Exp[3  x], {x, 0, y}, {y, 0, 1}]
(Integrate[Exp[3  x], {y, 0, 1}])
Integrate[ (Integrate[Exp[3  x], {y, 0, 1}]) ,{x, 0, y}]

We will try to find the potential due to a triangular patch on a particle located at (x,y,z=1)

TrianglePotentialDirect  = 
      Integrate[
        (1/(Sqrt[(((x - ξ))^2) + (((y - η))^2) + (z^2)])), {η, 
          0, ((Sqrt[3])/2)}, {ξ, (η/(Sqrt[3])) -  (1/2), (1/2) - (η/(Sqrt[3])) }, 
        Assumptions -> {x ∈ Reals, y ∈  Reals, 
            z > 0}]

Trying to do this directly either takes too long or there is no closed form! We have to work around it by using Indefinite Integrals

TrianglePotentialNumeric[x_,  y_,  z_]  := 
      NIntegrate[
        (1/(Sqrt[(((x - ξ))^2) + (((y - η))^2) + (z^2)])), {η, 
          0, ((Sqrt[3])/2)}, {ξ, (η/(Sqrt[3])) -  (1/2), 
          (1/2) - (η/(Sqrt[3])) }]

TrianglePotentialNumeric[1, 3,  .01]

Plot[TrianglePotentialNumeric[x, x, 1/40], {x, -1, 1}]

Table[
      ContourPlot[
        TrianglePotentialNumeric[x, y, h], {x, -1, 1}, {y, -0.5, 
          1.5}, Contours -> Table[v, {v,  .25, 2,  .25}], 
        ColorFunction -> (Hue[1  - 0.66*#/2] &), 
        ColorFunctionScaling -> False], {h,  .025,  .5,  .025}]

The plot above is for a relatively small height z = 1/20 so the contours reveal the triangular shape of the plate at z = 0.

Now look at a somewhat larger value of z = 1/2. The plot below shows contours that are very nearly circular, indicating that the plate is behaving approximately like an equivalent point charge;