Math 421  •  Fall 2006

Contours and contour integrals

Copyright © 2004–2006 by Murray Eisenberg.  All rights reserved.

Initializations

Load David Park's Cardano3 application packages:

Needs["Cardano3`ComplexGraphics`"]
Needs["Cardano3`ComplexRoutines`"]

Turn off some annoying warning messages that might otherwise appear about similarly-named objects.  (If you want to see these messages so as to be sure to avoid harm, evaluate expressions like the ones below but replace Off there by On.)

Off[General::spell]
Off[General::spell1]

The two-arched cycloid: a non-smooth, piecewise-smooth curve

Clear[γ]
γ[
        t_]  :=  (t  -  Sin[t]  -  
            1)  +  I (1  -  Cos[t])

ComplexGraphics[{Red,  Thickness[0.005],  
          ComplexCurve[γ[t],  {t,  0,  4  π}]}];

γ'[t]

γ'[{0,  2  π,  4  π}]

Approximating a contour integral by Riemann sums

The example: Find the integral of the conjugate function \(TraditionalForm\`z\&_\) around the unit circle C (traversed once, in the positive direction).  That is, evaluate:
	\(TraditionalForm\`∮\_\(\(\ \)\(C\)\)\ \ z\&_\ dz\)

Clear[f,  γ]

\(f[z_]\  := z\&_\)

Use one of the usual parametrizations of C:

γ[
        t_]  :=  (E^(I t))
a  =  0;  b  =  2  π;

That parametrization is smooth:

γ'[t]

Approximate the contour integral using n  =  8 points in the partition:

n  =  
      8;  Δt  =  (b  -  a)/n

Subidvide the time interval [a,  b]:

(Subscript[t, k])_  :=  a  +  k Δt
Table[(Subscript[t, k]),  {k,  0,  n}]

Take the corresponding points on the curve:

(Subscript[z, k])_  :=  γ[(Subscript[t, k])]
zs  =  Table[(Subscript[z, k]),  {k,  0,  n}]

ComplexGraphics[{PointSize[0.025],  Red,  ComplexPoint  /@  zs,  
          Blue,  Thickness[0.01],  
          ComplexCircle[0,  1],  
Purple,  
          ComplexPoint  /@  zs},  
        ImageSize  ->  4 * 72];

The increments in z:

Δ(Subscript[z, k])_  :=  (Subscript[z, k])  -  (Subscript[z, k  -  1])
Table[Δ(Subscript[z, k]),  {k,  0,  n}]

As sample points, choose midpoints of each arc on C:

(Subscript[c, k])_  :=  γ[(1/2) ((Subscript[t, k - 1])  +  (Subscript[t, k]))]
cs  =  Table[(Subscript[c, k]),  {k,  1,  n}]

Visualize all that so far:

ComplexGraphics[{PointSize[0.025],  Red,  ComplexPoint  /@  zs,  
          Blue,  Thickness[0.01],  
          ComplexCircle[0,  1],  
Purple,  
          ComplexPoint  /@  cs},  
        ImageSize  ->  4 * 72];

Evaluate the given function f at each of those sample points:

Table[f[(Subscript[c, k])],  {k,  0,  n}]

Form the Riemann sum approximation:

(∑_(k = 1)^n) f[(Subscript[c, k])] Δ(Subscript[z, k])  //  N  //  
      Chop

Automate the process:

MidpointSum[f_,  γ_,  {a_,  b_},  
        n_]  := 
Module[{Δt  =  (b  -  
                  a)/n,  k,  t,  z,  Δz,  
          c}, 
t[k_]  :=  a  +  k Δt;  
        z[k_]  :=  γ[t[k]];  Δz[k_]  :=  
          z[k]  -  z[k  -  1]; 
c[
            k_]  :=  γ[(1/2) (t[k  -  1]  +  
                  t[k])]; 
 
        Chop @ N[(∑_(k = 1)^n) f[c[k]] Δz[
                  k]]
]

Here's that same Riemann sum using midpoints of the subintervals of the t-interval:

MidpointSum[f, γ,  {0,  2  π},  8]

Now take such midpoint-using Riemann sum approximations where the number of subintervals keeps increasing by a factor of 10; we'll want to see many more decimal places here.  (The evaluation may take a while!)

NumberForm[#,  15] &  /@  
      Table[MidpointSum[f, γ,  {0,  2  π},  (10^j)],  {j,  
          0,  5}]