Initializations

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]

Needs["Utilities`Notation`"]

Notation[X_  ⋂  Y_ ⟺ Intersection[X_,  Y_]]

Notation[a_ mod b_ ⟺ Mod[a_,  b_]]

Needs["DiscreteMath`Combinatorica`"]

Load David Park's ComplexAnalysis application packages:

Needs["DrawGraphics`DrawingMaster`"]
Needs["ComplexAnalysis`ComplexGraphics`"]
Needs["ComplexAnalysis`ComplexRoutines`"]

Define the ComplexGraphics primitive function ComplexCurve:

ComplexCurve::usage  =  "ComplexCurve[f[t], {t, a, b]}] forms a \
curve in the complex plane parametrized by the function f on the interval \
from t = a to t = b.";
ComplexCurve[expr_,  {t_,  tmin_,  tmax_},  opts___?OptionQ]  :=  
      First @ DontShow[
          ParametricPlot[
            Evaluate @ 
              Simplify[coord[ expr],  t  ∈  Reals],  {t,  
              tmin,  tmax},  opts]]

Computer Technology in Undergraduate Mathematics

20 November 2003

Mathematica in Complex Analysis and Discrete Structures: Some examples

Murray Eisenberg
University of Massachusetts/Amherst
murray@math.umass.edu

http://www.math.umass.edu/~murray








Copyright © 2003 by Murray Eisenberg.  All rights reserved.

Discrete structures: greatest common divisor

Problem:  Find gcd(144375, 21175).

GCD[144375, 21175]

{Divisors[144375], Divisors[21175]}
(Divisors[144375]) ⋂ (Divisors[21175])
Max[(Divisors[144375]) ⋂ (Divisors[
            21175])]

FTAa  =  FactorInteger[144375]
FTAb  =  FactorInteger[21175]

(5^2) (7^1) (11^1)

gcd(a,  0)  =  a
gcd(a,  b)  =  gcd(b,  a mod b)

{q = Quotient[144375, 21175],  r0 = 144375 ~Mod~21175}

{q1 = Quotient[21175, r0],  r1 = 21175 ~Mod~ r0}

{q2 = Quotient[r0, r1], r2 =  r0~Mod~ r1}

{q3 = Quotient[r1, r2], r3 = r1 ~Mod~ r2}

gcdProgram[a_,  b_]  :=  
If[
        b  ==  0  &&  a  ≠  0,     
        a, 
   
        gcdProgram[b,  a ~Mod~ b]
]

gcdProgram[144375,  21175]

The mathematical version of Euclidean algorithm:
	gcd(a,  0)  =  a
gcd(a,  b)  =  gcd(b,  a mod b)

A Mathematica implementation:

gcd[a_,  0]  :=  a
gcd[a_,  b_]  :=  gcd[b,  a mod b]

gcd[144375, 21175]

Complex analyis: the 6th roots of unity

Solve[(z^6)  ==  1,  z]

ComplexExpand[z  /.  Solve[(z^6)  ==  1,  z]]

roots6  =  
      ComplexExpand  /@  
        Exp[((2  π)/6) Range[0,  5] I]

(Subscript[ω, 1])  =   ComplexExpand[
          Exp[((2  π)/6) I]];
(Subscript[ω, k])_  :=  ComplexExpand[((Subscript[ω, 1])^k)]
roots6  =  Table[(Subscript[ω, k]),  {k,  0,  5}]

ComplexGraphics[
{
Cobalt,  
          Thickness[0.01],  
ComplexLine[
            Append[roots6,  
              First @ roots6]], 
ForestGreen,  
          ComplexCircle[0,  1],  
Red,  
          PointSize[0.04],  
ComplexPoint  /@  
            roots6
}, 
ImageSize  ->  3 × 72];

Visualize mapping \(TraditionalForm\`sin\  : \ ℂ\  -> \ ℂ\)

f[z_]  :=  Sin[z]

grids = {{{MediumBlue}, {-π,  π,  
              12}, {-π,  π, 
              0}}, {{VenetianRed}, {-π , π,  
              0}, {-π,  π, 12}}};
TwoPanelPlot[
{{# &},  
          CartesianGrid,  {0,  π},  {grids},   {}}, 
{{f[#] &},  
          CartesianGrid,  {0,  4},  {grids},  {}}, 
 
        ImageSize  ->  6*72];

horizontal  =  {CobaltGreen,  Thickness[0.012],  
          ComplexCurve[(1  -  
                    s) (-π   +  (π/4) I)  +  s (π  +  (π/4) I),  {s,  0,  
              1}]};
pts  =  {PointSize[0.04],  
          Sepia,  
          ComplexPoint[-(π/2)   +  (π/4) I],  
          GeraniumLake,  ComplexPoint[(π/4) I],  
          CadmiumOrange,  
          ComplexPoint[ (π/2)  +  (π/4) I]};
grid  =  {{{LightBlue},   {-π,  π,  
              12},  {-π,  π,  12}}};
TwoPanelPlot[
{{# &},  
            CartesianGrid,  {0,  π},  {grid},   {horizontal,  
              pts}},
{{f[#]&}, CartesianGrid, {0,  4}, {grid}, {horizontal,  pts}},
 ImageSize  ->  6*72];

The Riemann sphere

grid = 
{{{RoyalBlue},  {0. , 1, 
              10},  {0. , π/2, 
              16}}, 
{{IndianRed},  {1, 2. , 
              10},  {0. , π/2, 16}}};
gridmap = 
        First[PolarGrid[{# &}, {0, 8}, {grid}]] // 
          FineGrainLines[0.02, 8];

    
northPole  =  {CadmiumLemon,  PointSize[0.03],  
          Point[{0,  0,  1}]};

    
origin  =  {CadmiumOrange,  PointSize[0.02],  
          ComplexPoint[0]};
xAxis  =  {CadmiumLemon,  Thickness[0.01],  
          ComplexLine[{0,  2}]  //  
            FineGrainLines[0.2,  8]};
quarterCircle  =  {Purple,  Thickness[0.01],  
          ComplexCurve[
            Exp[θ I],  {θ,  
              0,  π/2}]} ;

    
TwoPanelPlot[
{
{# &}, 
          PolarGrid, {0, 3}, {grid},  {origin,  xAxis, 
            quarterCircle}
}, 
{
{# &}, 
RiemannSphere, 
{0, 
            1}, 
{ColoredRiemannSphere[][], {gridmap}}, {{northPole},  {{origin,  xAxis,  quarterCircle}  //  
                ComplexPlaneToRiemann}}, 
{ViewPoint ->  {2.486,  1.127,  
                1.5}}
}, 
ImageSize -> 7*72];

Visualize reciprocal mapping \(TraditionalForm\`ℂ\  -> \ ℂ\)

f[z_]  :=  (1/z)

circle  =  {Purple,  Thickness[0.01],  
          ComplexCurve[-1  +  I + 
              2  (E^(I θ)), {θ, 0, 
              2  π},  PlotPoints  ->  100]};
center  =  {CobaltGreen,  PointSize[0.025],  
          ComplexPoint[-1  +  I]};
grid  =  {{{White},  {-3.5,  3.5,  
              6},  {-3.5,   3.5,   6}}};
TwoPanelPlot[
{{# &},  
          CartesianGrid,  {0,  3.5},  {grid},   {circle,  
            center}}, 
{{f[#] &},  
          CartesianGrid,  {0,  3.5, False},  {grid},  {circle,  
            center}}, 
ImageSize  ->  
          7* 72];

northPole  =  {CadmiumLemon,  PointSize[0.03],  
          Point[{0,  0,  1}]};
TwoPanelPlot[
{
{# &}, 
RiemannSphere, 
{0, 
            1}, 
{ColoredRiemannSphere[][], {circle,  
              center}}, 
{{northPole}}, 
{ViewPoint -> {2.482,  2.124,  
                0.943}}
}, 
{
{f[#] &}, 
RiemannSphere, 
{0, 
            1}, 
{ColoredRiemannSphere[][], {circle,  
              center}}, 
{{northPole}}, 
{ViewPoint -> {2.482,  2.124,  
                0.943}}
}, 
ImageSize -> 7*72];

TwoPanelAnimation[
{
{# &}, 
RiemannSphere, 
            rotation,  
{0, 
              1}, 
{ColoredRiemannSphere[][], {circle,  center}}, 
{{northPole}}, 
{ViewPoint -> {2.482,  2.124,  
                  0.943}}
}, 
{
{f[#] &}, 
RiemannSphere, 
            rotation,  
{0, 
              1}, 
{ColoredRiemannSphere[][], {circle,  center}}, 
{{northPole}}, 
{ViewPoint -> {2.482,  2.124,  
                  0.943}}
}, 
ImageSize -> 7*72][24];

Visualize reciprocal mapping \(TraditionalForm\`ℂ\  -> \ ℂ\), continued

f[z]

grid  =  {{{Cerulean},  {0.01,  0.49,  11},  {-4,  4,  
              55}}};
segmentHalf  =  {Cobalt,  Dashing[{0.05,  0.03}],  
          Thickness[0.01],  
          ComplexCurve[(1  -  t) ((1/2)  -  I)  +  
              t ( (1/2)  +  I),  {t,  0,  
              1}]}; 
segmentZero  =  {Cobalt,  Dashing[{0.05,  0.03}],  
          Thickness[0.0077],  
          ComplexCurve[(1  -  t) (- I)  +  
              t ( I),  {t,  0,  
              1}]};
TwoPanelPlot[
{{# &},  
          CartesianGrid,  {0,  1},  {grid},   {segmentZero,  
            segmentHalf}}, 
{{f[#] &},  
          CartesianGrid,  {0,  4,  False},  {grid},  {segmentZero,  
            segmentHalf}}, 
ImageSize  ->  
          7 * 72];

gridmap = 
        First[CartesianGrid[{# &}, {0.5, 0.5}, {grid}]] // 
          FineGrainLines[0.02, 
            8];
northPole  =  {CadmiumLemon,  
          PointSize[0.03],  Point[{0,  0,  1}]};
TwoPanelPlot[
{
{# &}, 
RiemannSphere, 
{0, 
              1}, 
{ColoredRiemannSphere[][], {gridmap}}, 
{{northPole},  {}}, 
{ViewPoint -> {3.260,  
                  0.907,  -0.026}}
},
{
{f[#]&},
RiemannSphere,
{0, 1},
{ColoredRiemannSphere[][], {gridmap}},
{{northPole},  {}},
{ViewPoint -> {3.260,  
                    0.907,  -0.026}}
},
ImageSize -> 7*72];

Do the Cauchy-Riemann equations suffice for differentiability?

If f(z) is differentiable at (Subscript[z, 0])  =  (Subscript[x, 0])  +  i (Subscript[y, 0]), then u  =  Re f and v  =  Im f satisfy the Cauchy-Riemann equations there:
	∂ (u/∂)x  =   ∂ 
                (v/∂)y (0,  0),   \(TraditionalForm\`∂\ u\/∂y\  = \ \ \(-\ \(∂\ v\/∂x\)\)\).

f(z_)  :=  
      ((z^5)/\[LeftBracketingBar])z(\[RightBracketingBar]^4)
f(0)  =  0;

ComplexCollect(
      coord(f(x + I y)))

u(x_,  y_)  :=  
      First[ComplexCollect(coord(f(x  +  I y)))]
v(x_,  y_)  :=  
      Last[ComplexCollect(coord(f(x  +  I y)))]
u(0, 0)  =  0;  v(0, 0)  =  0;

Caauchy-Riemann equations hold at origin:

{((u(Δx, 0)  -  u(0, 0))/Δ)x,  ((v(0, Δy)  -  v(0, 0))/Δ)y}
{((u(Δx, 0)  -  u(0, 0))/Δ)x,  ((v(0, Δy)  -  v(0, 0))/Δ)y}

Simplify[((f(Δx  +  0)  -  
                  f(0))/Δ)x, Δx ∈ ℝ]         (* along line Δy  =  0 *)
Simplify[((f(I  Δx  +  Δx  + 0) - 
                  f(0))/(I Δx  + Δx)), Δx ∈ ℝ]         (* along line Δx  =  Δy *)

Calculus for Life and Social Sciences: doubling time

From a Discovery Module used in Math 127—a webMathematicaapplication
http://webmath.oit.umass.edu/webmath/index.html

Web sites

Math 421, Complex Variables
http://www.math.umass.edu/Courses/Math_421/

Math 455, Discrete Structures
http://www.math.umass.edu/Courses/Math_455_Eisenberg/