COMPLEX ANALYSIS: Mathematica 4.1 Notebooks
(c) John H. Mathews, and
Russell W. Howell, 2002
Complimentary software to accompany our textbook:

COMPLEX ANALYSIS: for Mathematics and Engineering, 
4th Edition,  2001,  ISBN: 0-7637-1425-9
Jones & Bartlett Publishers, Inc.  
40 Tall Pine Drive, Sudbury, MA 01776  
Tele.  (800) 832-0034, FAX:  (508)  443-8000  
E-mail:  mkt@jbpub.com  
Internet:  http://www.jbpub.com/  
This free software is compliments of the authors.
John H. Mathews,   mathews@fullerton.edu 
Russell W. Howell,  howell@westmont.edu

CHAPTER 10  APPLICATIONS of HARMONIC FUNCTIONS

a = A = b = B = c = k = R = T = u = U = v = V = w = W = x = X = y = Y = z = Z = 
                                        0; 
Clear[a, a0, a1, a2, a3, A, b, B, 
        CR, Δx, Δy, eq1, eq2, eqns, f, f1, F, F1, 
        F2, F3, F4, g, G, lines, n, P, Ψ, ϕ, Φ, 
        r, r0, solset, θ, t, T, T1, T2, Q, u, u0, U, U1, v, v0, V, V1, 
        w, w0, W, W1, x, x1, x2, x3, y, z, z1, z2, z3, 
        z4]; 
Needs["Graphics`ComplexMap`"]; 
Needs["Graphics`ParametricPlot3D`"]
Needs["Graphics`Colors`"];

Section 10.1	Preliminaries

Section 10.2	Invariance of Laplace's Equation and the Dirichlet Problem

Section 10.3  Poisson's Integral for the Upper Half-Plane

The Dirichlet problem for the upper half plane  Im (z) > 0  is to find a function  ϕ (x, y)  that is harmonic in the upper half plane and has the boundary values ϕ (x, 0) = U (x),  where  U (x),  is a real-valued function of the real variable x. An important method for solving this problem is our next result which is attributed to the French mathematician Siméon Poisson.

Theorem 10.3 (Poisson's Integral Formula), Page 401. Let U be a real-valued function that is piecewise continuous and bounded for all real t.  The function  

			ϕ (x, y)=(y/π) (∫_(-∞)^∞)((U (t))/((((x  -  t))^2)  +  
                    (y^2))) dt  

is  harmonic in the upper half plane  Im[z] > 0  and has the boundary values  

			ϕ (x, 0) = U (x)  

wherever  U  is continuous.

Proof of Theorem 10.3, see text Page 401.

Example 10.11,  Page 403.  Find a function ϕ (x, y) that is harmonic in the upper half-plane  Im[z] > 0,  which takes on the boundary values  

ϕ (x, 0) = 
        1   when    | 
          x | <1, 
ϕ (x, 0) = 
        0   when    | x | >1.

Solution 10.11.

The solution is similar to Example 10.7,  Page 316, but the method of solution is different.

Enter the function U[t] and use the Poisson integral to construct  ϕ (x, y).

Remove[U, v, x, y, 
        z]; 
Clear[t, ϕ]; 
U[t_]  =  1; 
ϕ[x_, y_]  =  
        Apart[Together[
            (y/π) (∫_(-1)^1) U[t]/((((x - t))^2) + 
                        (y^2)) \[DifferentialD]t]]; 
v[x_, y_]  =  
        ReplaceAll[ϕ[x, y], 
          ArcTan[z_] -> -ArcTan[(1/z)]]; 
Print["  U[t]  =  ", U[t]];   
Print[" "]; 
\(\(Print[\*""ϕ[x,y]  =  (y/π) (∫_(-1)^1)U[t]/((((x - t))^2) + (y^2))\[DifferentialD]t""];\)\ \ \)
Print[" "]; 
Print["ϕ[x,y]  =  ", ϕ[x, y]]; 
Print[" "]; 
Print["ϕ[x,y]  =  ", 
        v[x, y]];

Using the trigonometric identity   arctan (-t) = -arctan (t), the above result can be written as  ϕ (x, y) = (1/π) 
            arctan ((y/(x - 1))) - (1/π) 
            arctan ((y/(x + 1))).  We can verify some of the boundary values by taking limits.

Print["     ϕ[x,y] = ", ϕ[x, 
          y]]; 
\(\(Print[\*"" \!\(lim\+\(y -> 0\)\) ϕ[-2,y] = "", 
        Limit[ϕ[\(-2\), y], \ y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[((-1)/2),y] = "", Limit[ϕ[\(-1\)\/2, y], \ 
          y -> 0]];\)\ \)
\(\(Print[\*"" \!\(lim\+\(y -> 0\)\) ϕ[0,y] = "", 
        Limit[ϕ[0, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[(1/2),y] = "", Limit[ϕ[1\/2, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" \!\(lim\+\(y -> 0\)\) ϕ[2,y] = "", 
        Limit[ϕ[2, y], \ y -> 0]];\)\ \)

Use Mathematica to make a contour plot of the solution.

cont = Table[k, {k, 0, 1, (1/10)}]; 
ContourPlot[ϕ[x, y], {x, -2, 2}, {y, 0.000001, 
          2}, 
Contours -> cont, 
        PlotPoints -> 35, 
        AspectRatio -> (1/2), 
ColorFunction -> 
          Hue]; 
Print["Contour plot for"]; 
Print["ϕ[x,y] = ", ϕ[x, 
          y]]; 
Print[""]; 
Print[ϕ[x, y] == c]; 
Print["where  c = ", cont];

Then use Mathematica to make a 3D plot of the solution.

Plot3D[ϕ[x, y], {x, -2, 2}, {y, 0.00001, 
          1.5}, PlotPoints -> {41, 
            16}, 
AxesLabel -> {"x", "y", "\
ϕ[x,y]  "}, ColorFunction -> Hue]; 
Print["ϕ[x,y] = ", ϕ[x, 
          y]];

Therefore, the function  ϕ[x, 
          y] = (1/π) ArcTan[((1 - x)/y)] + (1/π) 
            ArcTan[((1 + x)/y)]  is harmonic in the upper half-plane  Im[z] > 0,  and takes on the desired boundary values.

Example 10.12,  Page 403.  Find a function ϕ (x, y) that is harmonic in the upper half-plane  Im[z] > 0,  which takes on the boundary values  

ϕ (x, 0) = 
        x   when    | 
          x | <1, 
ϕ (x, 0) = 
        0   when    | x | >1.

Solution 10.12.

Enter the function U[t] and use the Poisson integral to construct  ϕ (x, y).

Remove[t, U, v, x, y, 
        z]; 
Clear[ϕ]; 
U[t_]  =  t; 
g[t_] = 
        (y/π) ∫U[t]/((((x - t))^2) + 
                    (y^2)) \[DifferentialD]t; 
ϕ[x_, y_]  =  
        Expand[(y/π) (∫_(-1)^1) U[t]/((((x - t))^2) + 
                      (y^2)) \[DifferentialD]t]; 
ϕ[x_, y_]  =  Expand[g[1] - g[-1]]; 
v[x_, y_]  = 
        ReplaceAll[ϕ[x, y], 
          ArcTan[z_] -> -ArcTan[(1/z)]]; 
Print["  U[t]  =  ", U[t]];   
Print[" "]; 
\(\(Print[\*""ϕ[x,y]  =  (y/π) (∫_(-1)^1)U[t]/((((x - t))^2) + (y^2))\[DifferentialD]t""];\)\ \ \)
Print[" "]; 
Print["ϕ[x,y]  =  ", ϕ[x, y]]; 
Print[" "]; 
Print["ϕ[x,y]  =  ", v[x, y]];

Using the identities  arctan (-t) = -arctan (t)  and  ln ((a/b)) = 
          ln (a) - ln (b),  the above result can be written as  \(ϕ \((x, y)\) = \(x\/π\) 
            arctan \((y\/\(x\  - \ 1\))\) - \(x\/π\) 
            arctan \((y\/\(x\  + \ 1\))\) + \(y\/\(2\ π\)\) 
            ln \((\(\((x - 1)\)\^2\  + \ y\^2\)\/\(\((x + 1)\)\^2\  + \ y\^2\))\)\).  However for computing values of ArcTan we use the two variable form of the function and the following version of  ϕ[x, y].  We can verify some of the boundary values by taking limits.

ϕ[x_, 
          y_] = (x/π) ArcTan[x - 1, y] - (x/π) 
            ArcTan[x + 1, y] + (y/(2 π)) 
            Log[(((((x - 1))^2) + (y^2))/((((x + 1))^2) + (y^2)))]; 
Print["ϕ[x,y] = ", ϕ[x, y]]; 
\(\(Print[\*"" (lim_(y -> 0)) ϕ[((-3)/2),y] = "", Limit[ϕ[\(-3\)\/2, y], \ 
          y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[((-3)/4),y] = "", Limit[ϕ[\(-3\)\/4, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[((-1)/2),y] = "", Limit[ϕ[\(-1\)\/2, y], \ 
          y -> 0]];\)\ \)
\(\(Print[\*"" \!\(lim\+\(y -> 0\)\) ϕ[0,y] = "", 
        Limit[ϕ[0, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[(1/2),y] = "", Limit[ϕ[1\/2, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[(3/4),y] = "", Limit[ϕ[3\/4, y], \ y -> 0]];\)\ \)
\(\(Print[\*"" (lim_(y -> 0)) ϕ[(3/2),y] = "", Limit[ϕ[3\/2, y], \ y -> 0]];\)\ \)

Use Mathematica to make a contour plot of the solution.

ContourPlot[ϕ[x, y], {x, -2, 2}, {y, 
          0.000001, 2}, 
Contours -> 10, 
        PlotPoints -> 35, 
        AspectRatio -> (1/2), 
ColorFunction -> 
          Hue]; 
Print["Contour plot for"]; 
Print["ϕ[x,y] = ", ϕ[x, 
          y]];

Then use Mathematica to make a 3D plot of the solution.

Plot3D[ϕ[x, y], {x, -1.5, 1.5}, {y, 
          (10^(-8)), 0.5}, 
        PlotPoints -> {31, 
            11}, 
PlotRange -> {{-1.5, 1.5}, {0, 
              0.5}, {-1.05, 1.05}}, 
        AxesLabel -> {"x", "   y", "ϕ[x,y]  "}, 
        Ticks -> {Range[-2, 2, 1], Range[0, 0.5, 0.25], 
            Range[-1, 1, 0.5]}, BoxRatios -> {1, 1, 0.8}, 
        ViewPoint -> {2.5, -3, 2}, 
        ColorFunction -> Hue]; 
Print["ϕ[x,y]  =  ", ϕ[x, 
          y]];

Therefore, the function  \(\(\(\ \)\(ϕ \((x, y)\) = \(x\/π\) 
            arctan \((y\/\(x\  - \ 1\))\) - \(x\/π\) 
            arctan \((y\/\(x\  + \ 1\))\) + \(y\/\(2\ π\)\) 
            ln \((\(\((x - 1)\)\^2\  + \ y\^2\)\/\(\((x + 1)\)\^2\  + \ y\^2\))\)\)\)\)  is harmonic in the upper half-plane  Im[z] > 0,  and takes on the desired boundary values.

Example 10.13,  Page 404.  Use Poisson's Integral formula to find the harmonic function  ϕ (x, y) that is harmonic in the upper half-plane  Im[z] > 0,  that takes on the boundary values  

\(ϕ \((x, 
            0)\) = \(-1\)\ \ \ for\ \ \ \ \ \ \ x < \(-1\), 
ϕ \((x, 0)\) = \ 
        x\ \ \ \ for\ \ \  - 1 < x < 
          1, 
ϕ \((x, 0)\) = \ 
        1\ \ \ \ for\ \ \ \ \ \ \ 1 < \(\(x\)\(.\)\)\)

Solution 10.13.

This is similar to Example 10.17,  Page 416, but the method of solution is different.

Using techniques from Section 10.2, the function  v (x, y) = 
        1 - (1/π) arctan ((y/(x  +  1))) - (1/π) 
            arctan ((y/(x  -  1)))  is harmonic in the upper half plane and takes on the boundary values
\(v \((x, 
            0)\) = \(-1\)\ \ \ for\ \ \ \ \ \ \ x < \(-1\), 
v \((x, 0)\) = \ 
        0\ \ \ \ for\ \ \  - 1 < x < 1, 
v \((x, 0)\) = \ 
        1\ \ \ \ for\ \ \ \ \ \ \ 1 < \(\(x\)\(.\)\)\) 

Thus, we should add it to the solution  ϕ (x, y)  in Example 10.12 to obtain the desired result.  However, with Mathematica  we need to use  ArcTan[x ± 1, y]  instead of  ArcTan[
          (y/(x  ±  1))].

Enter the function U[t] and use the Poisson integral to construct  ϕ (x, y).

Remove[t, U, v, V, x, y, 
        z]; 
Clear[ϕ]; 
U[t_]  =  t; 
g[t_] = 
        (y/π) ∫U[t]/((((x - t))^2) + 
                    (y^2)) \[DifferentialD]t; 
ϕ[x_, y_]  =  
        Expand[(y/π) (∫_(-1)^1) U[t]/((((x - t))^2) + 
                      (y^2)) \[DifferentialD]t]; 
ϕ[x_, y_]  =  Expand[g[1] - g[-1]]; 
v[x_, y_]  =  
        ReplaceAll[ϕ[x, y], 
          ArcTan[z_] -> -ArcTan[(1/z)]]; 
V[x_, y_]  =  
        1  -  (1/π) ArcTan[x + 1, y]  - (1/π) 
            ArcTan[x - 1, y]; 
ϕ[x_, y_]  =  ϕ[x, y]  +  V[x, y]; 
v[x_, y_]  =  v[x, y]  +  V[x, y]; 
Print["  U[t] = ", U[t]];   
Print[" "]; 
Print["V[x,y] = ", V[x, y]]; 
Print[" "]; 
\(\(Print[\*""ϕ[x,y] = (y/π) (∫_(-1)^1)U[t]/((((x - t))^2) + (y^2))\[DifferentialD]t + V[x,y]""];\)\ \ \)
Print[" "]; 
Print["ϕ[x,y] = ", ϕ[x, y]];  
Print[" "]; 
Print["ϕ[x,y] = ", v[x, y]];

Use Mathematica to make a contour plot of the solution.

ϕ[x_, y_] = 
      1 + (x/π) (ArcTan[((1 - x)/y)] - 
              ArcTan[((-1 - x)/y)])

    -(1/π) (ArcTan[-1 + x, y] + 
              ArcTan[1 + x, y]) + (y/(2  π)) 
          Log[((1 - 2 x + (x^2) + (y^2))/(1 + 2 x + (x^2) + (y^2)))]; 
ContourPlot[ϕ[x, y], {x, -3, 3}, {y, 0.000001, 
          3}, 
Contours -> 10, PlotPoints -> 35, 
        AspectRatio -> (1/2), 
ColorFunction -> 
          Hue]; 
Print["Contour plot for"]; 
Print["ϕ[x,y] = ", ϕ[x, 
          y]];

Then use Mathematica to make a 3D plot of the solution.

Plot3D[ϕ[x, y], {x, -3, 3}, {y, 
          (10^(-6)), 2}, PlotPoints -> {31, 21}, 
        PlotRange -> {{-3, 3}, {0, 2}, {-1, 1}}, 
        AxesLabel -> {"x", "y", "  ϕ[x,y]"}, 
        Ticks -> {Range[-5, 5, 1], Range[-5, 5, 0.5], 
            Range[-1, 1, 0.5]}, ViewPoint -> {-2.5, -3, 2}, 
        ColorFunction -> Hue]; 
Print["ϕ[x,y]  =  ", ϕ[x, 
          y]];

Therefore, the function 
ϕ[x, y] = 
        1 + (x/π) (ArcTan[((1 - x)/y)] - 
                ArcTan[((-1 - x)/y)])
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(-\(1\/π\)\) \((ArcTan[\(-1\) + x, y] + ArcTan[1 + x, y])\)\)
\(\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(+\(y\/\(2  π\)\)\) 
        Log[\(1\  - \ 2\ x\  + \ x\^2\  + \ y\^2\)\/\(1\  + \ 2\ x\  + \ x\^2\  + \ y\^2\)]\) 
is harmonic in the upper half-plane  Im[z] > 0,  and takes on the desired boundary values.

Library Research Experience for Undergraduates

Project I. Write on the Dirichlet problem and include some applications.

1. Flanigan, Francis J., (1973), ''Some Half-Plane Dirichlet Problems: A Bare Hands Approach (in Classroom Notes),'' Am. Math. M., Vol. 80, No. 1. (Jan., 1973), pp. 59-61, Jstor.   

2. Garding, Lars, (1979), ''The Dirichlet Problem,'' Math. Intell., V. 2, No. 1, pp. 43-53.

3. Goulet, John, (1983), ''The Dirichlet Problem: A Mathematical Development,'' Pi Mu Epsilon J., V. 7, No. 8, pp. 502-511.

4. Minda, David, ''The Dirichlet Problem for a Disk (in Notes),'' Am. Math. M., Vol. 97, No. 3. (Mar., 1990), pp. 220-223, Jstor.   

5. Netuka, Ivan, ''The Dirichlet Problem for Harmonic Functions,'' Am. Math. M., Vol. 87, No. 8. (Oct., 1980), pp. 621-628, Jstor.

Section 10.3  Exercises for Poisson's Integral for the Upper Half-Plane
See textbook page 405.

Section 10.4	Two Dimensional Mathematical Models

Section 10.5	Steady State Temperatures

Section 10.6	Two-Dimensional Electrostatics

Section 10.7	Two-Dimensional Fluid Flow

Section 10.8	The Joukowski Airfoil

Section 10.9	The Schwarz-Christoffel Transformation

Section 10.10	Image of a Fluid Flow

Section 10.11	Sources and Sinks

GO TO  THE  Table of Contents