0% found this document useful (0 votes)
181 views602 pages

Shaw_Complex Analysis With Mathematica

Uploaded by

Juanda Vasconez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
181 views602 pages

Shaw_Complex Analysis With Mathematica

Uploaded by

Juanda Vasconez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 602

CD ath

M
up em
da ati
te ca
d ®6
fo
r
Complex Analysis
with Mathematica®

William T. Shaw
Complex Analysis with Mathematicar
Complex Analysis with Mathematica
r

William T. Shaw
St Catherine’s College, Oxford and
Oxford Centre for Industrial and Applied Mathematics
University Printing House, Cambridge cb2 8bs, United Kingdom

Cambridge University Press is part of the University of Cambridge.


It furthers the University’s mission by disseminating knowledge in the pursuit of
education, learning and research at the highest international levels of excellence.

www.cambridge.org
Information on this title: www.cambridge.org/9780521836265
© Cambridge University Press 2006
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First published 2006
Reprinted with corrections 2008
A catalogue record for this publication is available from the British Library
isbn 978-0-521-83626-5 Hardback
Additional resources for this publication at www.cambridge.org/9780521836265
Cambridge University Press has no responsibility for the persistence or accuracy
of URLs for external or third-party internet websites referred to in this publication,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.

All additional material supplied from the Cambridge University Press website is protected by copyright and
other intellectual property laws. The customer acquires only the right to use the additional material and does
not acquire any other rights, express or implied, unless these are stated explicitly in a separate licence.

To the extent permitted by applicable law, Cambridge University Press is not liable for direct
damages or loss of any kind resulting from the use of this product or from errors or faults
contained in it, and in every case Cambridge University Press’s liability shall be limited to the
amount actually paid by the customer for the product.
For Helen and Benjamin
A CD-ROM formerly accompanied this publication:
the contents of the CD-ROM are now located at
www.cambridge.org/9780521836265
Contents

Preface xv
Why this book? xv
How this text is organized xvi
Some suggestions on how to use this text xxi
About the enclosed CD xxii
Exercises and solutions xxiv
Acknowledgements xxiv

1 Why you need complex numbers 1


Introduction 1
1.1 First analysis of quadratic equations 1
1.2 Mathematica investigation: quadratic equations 3
Exercises 8

2 Complex algebra and geometry 10


Introduction 10
2.1 Informal approach to ‘real’ numbers 10
2.2 Definition of a complex number and notation 12
2.3 Basic algebraic properties of complex numbers 13
2.4 Complex conjugation and modulus 14
2.5 The Wessel–Argand plane 14
2.6 Cartesian and polar forms 15
2.7 DeMoivre’s theorem 21
2.8 Complex roots 25
2.9 The exponential form for complex numbers 29
2.10 The triangle inequalities 32
2.11 Mathematica visualization of complex roots and logs 33
2.12 Multiplication and spacing in Mathematica 35
Exercises 35

3 Cubics, quartics and visualization of complex roots 41


Introduction 41
3.1 Mathematica investigation of cubic equations 42
3.2 Mathematica investigation of quartic equations 45
viii Contents

3.3 The quintic 51


3.4 Root movies and root locus plots 51
Exercises 53

4 Newton–Raphson iteration and complex fractals 56


Introduction 56
4.1 Newton–Raphson methods 56
4.2 Mathematica visualization of real Newton–Raphson 57
4.3 Cayley’s problem: complex global basins of attraction 59
4.4 Basins of attraction for a simple cubic 62
4.5 More general cubics 67
4.6 Higher-order simple polynomials 71
4.7 Fractal planets: Riemann sphere constructions 73
Exercises 76

5 A complex view of the real logistic map 78


Introduction 78
5.1 Cobwebbing theory 79
5.2 Definition of the quadratic and cubic logistic maps 80
5.3 The logistic map: an analytical approach 81
5.4 What about n=3,4,...? 89
5.5 Summary of our root-finding investigations 91
5.6 The logistic map: an experimental approach 91
5.7 Experiment one: 0 < λ < 1 92
5.8 Experiment two: 1 < λ < 2 √ 93
5.9 Experiment three: 2 < λ < 5 93
5.10 Experiment four: √ 2.45044 <√λ < 2.46083 95
5.11 Experiment five: √ 5 < λ < 5 +  96
5.12 Experiment six: 5 < λ 96
5.13 Bifurcation diagrams 98
5.14 Symmetry-related bifurcation 100
5.15 Remarks 102
Exercises 103

6 The Mandelbrot set 105


Introduction 105
6.1 From the logistic map to the Mandelbrot map 105
6.2 Stable fixed points: complex regions 107
6.3 Periodic orbits 110
6.4 Escape-time algorithm for the Mandelbrot set 114
6.5 MathLink versions of the escape-time algorithm 120
6.6 Diving into the Mandelbrot set: fractal movies 126
6.7 Computing and drawing the Mandelbrot set 129
Exercises 135
Appendix: C Code listings 136
Contents ix

7 Symmetric chaos in the complex plane 138


Introduction 138
7.1 Creating and iterating complex non-linear maps 139
7.2 A movie of a symmetry-increasing bifurcation 143
7.3 Visitation density plots 145
7.4 High-resolution plots 146
7.5 Some colour functions to try 146
7.6 Hit the turbos with MathLink! 148
7.7 Billion iterations picture gallery 149
Exercises 154
Appendix: C code listings 155

8 Complex functions 159


Introduction 159
8.1 Complex functions: definitions and terminology 159
8.2 Neighbourhoods, open sets and continuity 163
8.3 Elementary vs. series approach to simple functions 165
8.4 Simple inverse functions 169
8.5 Branch points and cuts 171
8.6 The Riemann sphere and infinity 175
8.7 Visualization of complex functions 176
8.8 Three-dimensional views of a complex function 183
8.9 Holey and checkerboard plots 187
8.10 Fractals everywhere? 189
Exercises 192

9 Sequences, series and power series 194


Introduction 194
9.1 Sequences, series and uniform convergence 194
9.2 Theorems about series and tests for convergence 196
9.3 Convergence of power series 202
9.4 Functions defined by power series 205
9.5 Visualization of series and functions 205
Exercises 207

10 Complex differentiation 208


Introduction 208
10.1 Complex differentiability at a point 209
10.2 Real differentiability of complex functions 211
10.3 Complex differentiability of complex functions 212
10.4 Definition via quotient formula 213
10.5 Holomorphic, analytic and regular functions 214
10.6 Simple consequences of the Cauchy–Riemann equations 214
10.7 Standard differentiation rules 215
10.8 Polynomials and power series 217
10.9 A point of notation and spotting non-analytic functions 220
x Contents

10.10 The Ahlfors–Struble(?) theorem 221


Exercises 233

11 Paths and complex integration 237


Introduction 237
11.1 Paths 237
11.2 Contour integration 240
11.3 The fundamental theorem of calculus 241
11.4 The value and length inequalities 242
11.5 Uniform convergence and integration 243
11.6 Contour integration and its perils in Mathematica! 244
Exercises 245

12 Cauchy’s theorem 248


Introduction 248
12.1 Green’s theorem and the weak Cauchy theorem 248
12.2 The Cauchy–Goursat theorem for a triangle 250
12.3 The Cauchy–Goursat theorem for star-shaped sets 254
12.4 Consequences of Cauchy’s theorem 255
12.5 Mathematica pictures of the triangle subdivision 259
Exercises 261

13 Cauchy’s integral formula and its remarkable consequences 263


Introduction 263
13.1 The Cauchy integral formula 263
13.2 Taylor’s theorem 265
13.3 The Cauchy inequalities 271
13.4 Liouville’s theorem 271
13.5 The fundamental theorem of algebra 272
13.6 Morera’s theorem 274
13.7 The mean-value and maximum modulus theorems 275
Exercises 275

14 Laurent series, zeroes, singularities and residues 278


Introduction 278
14.1 The Laurent series 278
14.2 Definition of the residue 282
14.3 Calculation of the Laurent series 282
14.4 Definitions and properties of zeroes 286
14.5 Singularities 287
14.6 Computing residues 292
14.7 Examples of residue computations 293
Exercises 299
Contents xi

15 Residue calculus: integration, summation and the argument


principle 302
Introduction 302
15.1 The residue theorem 302
15.2 Applying the residue theorem 304
15.3 Trigonometric integrals 305
15.4 Semicircular contours 313
15.5 Semicircular contour: easy combinations of trigonometric
functions and polynomials 316
15.6 Mousehole contours 318
15.7 Dealing with functions with branch points 320
15.8 Infinitely many poles and series summation 324
15.9 The argument principle and Rouché’s theorem 328
Exercises 335

16 Conformal mapping I: simple mappings and Möbius trans-


forms 338
Introduction 338
16.1 Recall of visualization tools 338
16.2 A quick tour of mappings in Mathematica 340
16.3 The conformality property 347
16.4 The area-scaling property 348
16.5 The fundamental family of transformations 348
16.6 Group properties of the Möbius transform 349
16.7 Other properties of the Möbius transform 350
16.8 More about ComplexInequalityPlot 354
Exercises 355

17 Fourier transforms 357


Introduction 357
17.1 Definition of the Fourier transform 358
17.2 An informal look at the delta-function 359
17.3 Inversion, convolution, shifting and differentiation 363
17.4 Jordan’s lemma: semicircle theorem II 366
17.5 Examples of transforms 368
17.6 Expanding the setting to a fully complex picture 372
17.7 Applications to differential equations 373
17.8 Specialist applications and other Mathematica functions
and packages 376
Appendix 17: older versions of Mathematica 377
Exercises 379

18 Laplace transforms 381


Introduction 381
18.1 Definition of the Laplace transform 381
18.2 Properties of the Laplace transform 383
xii Contents

18.3 The Bromwich integral and inversion 387


18.4 Inversion by contour integration 387
18.5 Convolutions and applications to ODEs and PDEs 390
18.6 Conformal maps and Efros’s theorem 395
Exercises 398

19 Elementary applications to two-dimensional physics 401


Introduction 401
19.1 The universality of Laplace’s equation 401
19.2 The role of holomorphic functions 403
19.3 Integral formulae for the half-plane and disk 406
19.4 Fundamental solutions 408
19.5 The method of images 413
19.6 Further applications to fluid dynamics 415
19.7 The Navier–Stokes equations and viscous flow 425
Exercises 430

20 Numerical transform techniques 433


Introduction 433
20.1 The discrete Fourier transform 433
20.2 Applying the discrete Fourier transform in one dimension 435
20.3 Applying the discrete Fourier transform in two dimensions 437
20.4 Numerical methods for Laplace transform inversion 439
20.5 Inversion of an elementary transform 440
20.6 Two applications to ‘rocket science’ 441
Exercises 448

21 Conformal mapping II: the Schwarz–Christoffel mapping 451


Introduction 451
21.1 The Riemann mapping theorem 452
21.2 The Schwarz–Christoffel transformation 452
21.3 Analytical examples with two vertices 454
21.4 Triangular and rectangular boundaries 456
21.5 Higher-order hypergeometric mappings 463
21.6 Circle mappings and regular polygons 465
21.7 Detailed numerical treatments 470
Exercises 470

22 Tiling the Euclidean and hyperbolic planes 473


Introduction 473
22.1 Background 473
22.2 Tiling the Eudlidean plane with triangles 475
22.3 Tiling the Eudlidean plane with other shapes 481
22.4 Triangle tilings of the Poincaré disc 485
22.5 Ghosts and birdies tiling of the Poincaré disc 490
22.6 The projective representation 497
Contents xiii

22.7 Tiling the Poincaré disc with hyperbolic squares 499


22.8 Heptagon tilings 507
22.9 The upper half-plane representation 510
Exercises 512

23 Physics in three and four dimensions I 513


Introduction 513
23.1 Minkowski space and the celestial sphere 514
23.2 Stereographic projection revisited 515
23.3 Projective coordinates 515
23.4 Möbius and Lorentz transformations 517
23.5 The invisibility of the Lorentz contraction 518
23.6 Outline classification of Lorentz transformations 520
23.7 Warping with Mathematica 524
23.8 From null directions to points: twistors 529
23.9 Minimal surfaces and null curves I: holomorphic parametriza-
tions 531
23.10 Minimal surfaces and null curves II: minimal surfaces and
visualization in three dimensions 535
Exercises 538

24 Physics in three and four dimensions II 540


Introduction 540
24.1 Laplace’s equation in dimension three 540
24.2 Solutions with an axial symmetry 541
24.3 Translational quasi-symmetry 543
24.4 From three to four dimensions and back again 544
24.5 Translational symmetry: reduction to 2-D 548
24.6 Comments 550
Exercises 551

Bibliograpy 553

Index 558
Preface

Why this book?


Since 1985, I have been fortunate to have taught the theory of complex variables
for several courses in both the USA and the UK. In the USA I lectured a course
on advanced calculus for engineers and scientists at MIT, and in the UK I have
given tutorials on the subject to undergraduate students in mathematics at both
Cambridge and Oxford. Indeed, draft versions of this text have been inflicted on
my students at Balliol and, more recently, at St. Catherine’s over the last fourteen
years. Few topics have given me such pleasure to teach, given the rich yet highly
accessible structure of the subject, and it has at times formed the subject of
my research, notably in its development into twistor theory, and latterly in its
applications to financial mathematics. A parallel thread of my work has been
in the applications of computer algebra and calculus systems, and in particular
Mathematica, R to diverse topics in applied mathematics. This book is in part
an attempt to use Mathematica to illuminate the topic of complex analysis, and
draws on both these threads of my experience.
The book attempts also to inject some new mathematical themes into the topic
and the teaching of it. These themes I feel are, if not actually missing, under-
emphasized in most traditional treatments. It is perfectly possible for students
to have had a formal training in mathematics that leaves them unaware of many
key and/or beautiful topics. If we take the beginning of the historical time-line
to supply our first example, many students will not be aware of how to solve a
cubic equation, despite this procedure being one of the key early developments
in this field. Having invented complex numbers to cope with a general quadratic,
early algebraists found that the cubic could also be solved. This is of paramount
importance, not just for the elegance of the solution, but also because it is the first
indication that the fundamental theorem of algebra might be a possible theorem!
If we take a more recent example, those students that do consider the applications
to basic physics will almost always emerge with the entirely mistaken notion that
complex variable methods are limited to a few very special problems in two-
dimensional electrostatics or fluid dynamics. Similarly, the Möbius transform will
often be presented only as a neat trick for mapping shapes around the complex
plane, and its profound links to relativistic physics, via its equivalence to the
Lorentz transformation, are ignored.
xvi Preface

So in addition to providing illuminations and visualizations with Mathematica,


I have tried to put back and indeed add some of the topics that I feel students
ought to know. In particular, and unusually for a text targeted at undergraduate
mathematicians or graduate students in other disciplines, this book includes a
friendly introduction to the theory of spinors and twistors, thereby unlocking the
applications of complex functions to problems in three and four dimensions.
But you do not have to accept this particular set of views to make good use
of this book. It is perfectly possible to use this text to teach a standard course
in complex analysis, ignore my idiosyncratic additions, and take the Mathematica
elements as purely an embedded tool that has been used to generate some of the
pictures!
Mathematica makes its appearance in many different ways. In several chapters
it is there purely to provide, literally, illustrations. In some places it is used as
a checking tool, for example when calculating residues and integrals. In other
chapters it is fundamental, and indeed in Part II, it is the centre of a set of
investigations into the solving of equations by iteration. In places its rich library
of special functions, the ability to evaluate them over the complex plane, to do
calculus with them, come to the fore. It is particularly valuable when applied
to topics in conformal mapping. Finally, Mathematica’s wonderful graphics are
universally useful.

How this text is organized


It is best to think of the material of this book as being grouped informally into
five parts. These are as follows:

Part I Basic complex number theory and history


Attention will be focused on three topics, each of which constitutes one chapter:

• Chapter 1: Why you need complex numbers;


• Chapter 2: Complex algebra and geometry;
• Chapter 3: Cubics, quartics and visualization of complex roots.

The idea of this part of the book is to explain how and why complex numbers
were introduced, and then to go on to discuss elementary properties of the complex
number system. This material is at a level normally to be found in final year high
school programs or introductory college level. Chapter 3 should be regarded as
optional, but is highly recommended for any students with an interest in the
history of the subject. It covers the treatment of cubics and quartics, which is
not usually taught in modern courses, and also includes some material on the
visualization of roots of polynomials.
Preface xvii

Part II Iterated mappings


Part I showed how to define complex numbers and how to use them to solve low-
order polynomial equations. The methods used to treat the quadratic, cubic and
quartic equations are the classical techniques that have been known for some time
– many hundreds of years in some cases.
Now that computer systems are available, you can explore, either through
this text, or directly yourselves through the use of these Mathematica notebooks,
the rich structure that is obtained by the application of iterative equation-solving
techniques to these same simple polynomial systems. This idea originates with
A. Cayley in the 19th century, who although able to understand quickly the com-
plex structure of Newton–Raphson methods when applied to a quadratic, was
frustrated by the corresponding problem with a cubic. In getting to grips with
Cayley’s problem, we shall quickly encounter some of the most beautiful objects
in modern mathematics – chaotic systems and fractals.
This part of the text consists of material that is not part of a traditional course
on complex analysis. It may be skipped by those using this text to pursue such
a traditional route, who should proceed to Part III. Part III does not rely on any
of the material in Part II.
In Part II, all of the systems that you will see can be regarded as special cases
of the general first-order iterated map:

zn+1 = f (zn )

You will be able to explore how this works for various choices of the function f .
One way or other, f is to be associated with the solution of a low-order polynomial
equation. The association of the iterated map with the polynomial equation can
take place in several ways, and two will be considered here.
The first approach will involve polynomial (or even transcendental) equations
of the form
g(z) = 0
and you will explore the Newton–Raphson iteration scheme given by the choice
g(z)
f (z) = z −
g  (z)
The second scheme will involve a polynomial equation that is already written (for
example, by simply isolating the linear term, if there is one) in the form

z = f (z)

and you will explore the ‘cobwebbing’ solution scheme based on iteration of this
representation.
Attention will be focused on four topics, each of which constitutes one chapter.
Of these four topics, the first is specifically Newton–Raphson. The next two may
be regarded as being associated with the cobwebbing method. The fourth topic
is a complex extension of the cobwebbing method with symmetry. In order of
presentation, the topics are:
xviii Preface

• Chapter 4: Newton–Raphson iteration and complex fractals;


• Chapter 5: A complex view of the real logistic map;
• Chapter 6: The Mandelbrot set;
• Chapter 7: Symmetric chaos in the complex plane.

In Chapter 4 the solution of a low-order polynomial equation will be reconsidered


in the complex plane using Newton–Raphson iteration, as part of an investigation
of Cayley’s problem (Cayley, 1879). This is a standard technique for solving
real non-linear equations – our purpose here is to explore what happens when
Newton–Raphson is applied in the complex plane, and to use the computer to
understand why Cayley was defeated by the cubic!

In this part of the text we will engage occasionally engage in ‘fashionable


number crunching’, as chaos theory was once famously described. The desire
to produce some spectacular pictures is never far from one’s mind. But not all
mathematics has to be useful, and the uncovering of beauty is a worthwhile goal
in itself. So in this part of the book I shall indulge shamelessly in some fash-
ionable number crunching - this is sometimes referred to somewhat pompously
as ‘experimental mathematics’. But good experiments should be designed to test
some theory about what should happen, and we can use complex numbers, to
some extent, to provide a framework for first formulating a hypothesis regarding
what may happen in a simple real non-linear system.

The logistic map, as developed by May (1976), is the place where this experi-
mentation will commence for real, with Chapter 5. This is usually regarded as a
real mapping, so what is it doing here? The point is that we shall not just indulge
in computation, but shall attempt to predict, through the machinery of complex
numbers, what should happen in a certain experiment. It will turn out that the
period-doubling behaviour of the logistic map is in fact a simple and predictable
result that requires nothing more than ‘end of high school’ mathematics. The
experimentation will serve to confirm our hypotheses about it. What is surprising
and fascinating is the transition to chaos that follows, and there are indeed many
properties of the logistic map that are still not properly understood.

It is admittedly very hard to extend this approach to more complicated non-


linear systems, so we shall then rely more substantially on numerical experiments
for our other chapters. In Chapter 6 we shall extend the cobwebbing concept
to the complex plane using the simple quadratic (Mandelbrot) map. Finally, in
Chapter 7, we shall revisit the logistic map again, constructing complex versions of
it possessing various types of symmetry, leading to the recently developed concepts
of symmetric chaos. This leads to some stunning imagery, discovered by Field and
Golubitsky. Their text (Field and Golubitsky, 1992) is one of the most beautiful
books I have ever seen. Here we will see how some of their work can be readily
investigated using Mathematica.
Preface xix

Part III Traditional complex analysis


By the beginning of Part III you will have seen how to define complex numbers and
how to use them to solve simple polynomial equations by both classical solution
methods (and by modern iterative techniques if you have worked through Part II).
In Part III you begin the study of complex functions from a formal point of view.
Your goal is to understand the calculus of complex functions – differentiation,
integration, series (just as in the real case) – and the very special results that
apply to complex differentiable functions, in manifest distinction to the real case.
The plan of this part of the text is as follows:

• Chapter 8: Complex functions;


• Chapter 9: Sequences, series and power series;
• Chapter 10: Complex differentiation;
• Chapter 11: Paths and complex integration;
• Chapter 12: Cauchy’s theorem;
• Chapter 13: Cauchy’s integral formula and its remarkable consequences;
• Chapter 14: Laurent series, zeroes, singularities and residues;
• Chapter 15: Residue calculus: integration, summation and the argument
principle.

There are various ways of presenting and ordering this material, and it is worth
explaining the particular approach taken here. Our approach is to give a first
introduction to standard functions in Chapter 8, by extension of their definitions
for real variables. Next, in Chapter 9, we assume some basic results from real
analysis related to sequences and series. A summary of results about sequences
and series are presented without formal proof. Students of pure mathematics
should consult a good calculus or basic real analysis text for background on this
(a comprehensive text is the book by Rudin, 1976). Then we define power series
for complex functions, and establish their convergence within a circle of conver-
gence. Then, in Chapter 10, differentiability is introduced. The approach to
complex differentiability is based on the notion of a local linear approximation to
a function – equivalent to the notion that there is a tangent to a complex curve.
The definition quite frequently given, based on the quotient formula, is given as
an aside. There are several very good reasons for this approach. First, the quo-
tient formula for the derivative does not work for functions of two or more real or
complex variables, so if we were to take this approach we could not sensibly relate
complex differentiation to differentiation of functions of two real variables, nor
can we make a generalization to functions of several complex (or real) variables
without starting again with the linear approximation approach. I think it is better
to do it properly in the first place. Second, the standard properties of derivatives
such as the product, ratio and chain rules are really easy to write down within the
linear approximation framework. Once differentiability has been defined, the dif-
ferentiability of a power series within the circle of convergence is then established
xx Preface

immediately. We then redefine our standard basic functions in terms of power


series – their differentiability properties are then obvious.
Chapter 10 also includes a discussion of the theorem that the author has ten-
tatively called the ‘Ahlfors-Struble’ theorem. This is the means by which one can
recover a holomorphic function from its real part alone (or from just the imaginary
part) by a purely algebraic method. This idea seems to have been rediscovered
several times over the years. It is a very powerful technique when linked to the
symbolic power of Mathematica and I have also given a discussion of the history,
to justify crediting the result to Ahlfors and Struble, in Section 10.10.
Next, in Chapter 11, paths and integrals along paths are defined. Chapter
12 introduces the key theorem of this section – Cauchy’s theorem – that certain
integrals vanish identically. This is the key to the magic that follows, and a
standard approach to the consequences of Cauchy’s theorem is given in Chapters
13–15, culminating in the evaluation of certain integrals and series by the calculus
of residues. Some of the material here can be augmented by other texts and I would
recommend Rudin (1976), particularly as it also proceeds in a manner that makes
the multi-variable case straightforward. I also suggest that geometrically-minded
students look at Needham’s (1997) beautiful book, Visual Complex Analysis.

Part IV Standard applications


In this part of the book you explore the basic applications of the material. Most
first courses in complex variable theory include at least some of these topics,
though the transform material may also find its way into other applied mathe-
matics courses, and the basic applications to two-dimensional physics could also
be useful in courses on potential theory and/or fluid dynamics. This part begins
with basic conformal mapping – more advanced conformal maps are revisited in
Chapter 21. Similarly, numerical issues with transforms are deferred to Chapter
20. You should note that Chapters 17–18 also discuss more advanced topics in
contour integration, including the development and application of Jordan’s lemma
for semicircles. The plan of this part of the book is as follows:

• Chapter 16: Conformal mapping I: simple mappings and Möbius transforms;


• Chapter 17: Fourier transforms;
• Chapter 18: Laplace transforms;
• Chapter 19: Elementary applications to two-dimensional physics.

The novel features in this part of the book include the use of Mathematica to visu-
alize conformal maps and their applications to potential flow. The generalization
of the convolution theorem for Laplace transforms due to Efros is also presented,
and the discussion of fluid dynamics includes a discussion of viscous flow and the
biharmonic equation in complex form.
Preface xxi

Part V Advanced applications


In this part of the book you may explore material that is not so frequently pre-
sented in introductory complex variable texts. There are five topics:

• Chapter 20: Numerical transform techniques;


• Chapter 21: Conformal mapping II: the Schwarz–Christoffel transformation;
• Chapter 22: Tiling the Euclidean and hyperbolic planes;
• Chapter 23: Physics in three and four dimensions I;
• Chapter 24: Physics in three and four dimensions II;.

The first three of these chapters have been added because the integration of
the presentation with Mathematica allows a full treatment of some issues that
require a combination of numerical/advanced analytical and graphical methods
on a computer. With a computer one can explore the numerical treatment of
transforms, the beautiful applications of the Schwarz–Christoffel transformation,
and produce stunning hyperbolic tilings! Finally, in the last two chapters, you
can see how complex numbers are very useful for doing physics and geometry
in more than two dimensions. For example, you will discover that the Möbius
transformation is not just a dry device for mapping circles and lines, but is really
the mapping at the heart of Einstein’s theory of special relativity. You will discover
how complex numbers may be used to solve non-linear partial differential equations
such as arise for the shape of a soap bubble, in a formalism – Penrose’s theory
of twistors – that links the nineteenth century work of Weierstrass to modern
minimal surface and string theory. In the last chapter you will see at last the true
power of holomorphic functions in solving the 3-D Laplace equation and the wave
equation in four dimensions, again through Penrose’s theory of twistors.

Some suggestions on how to use this text


In the end this is up to you, the reader, whether you are student or teacher. But
in writing this material I have had several possible course threads in my mind.
Let’s look at a few possibilities.

A basic computer-enhanced course on complex numbers and


solving equations
This might consist of Chapters 1–7. The unifying theme is the solution of equa-
tions. In the first few chapters the emphasis is on solving polynomial equations by
traditional attempts at factorization, whereas in Chapters 4–7 we look at iterative
methods of solution and the consequences.
xxii
xxii Preface
Preface

AAtraditional
traditionalmathematics
mathematicscourse
courseon
oncomplex
complexanalysis
analysis
As
Asaaminimum
minimumthis thiswould
wouldconsist
consistofofChapters
Chapters8–15,
8–15,with
withparts
partsofofChapters
Chapters1–3
1–3for
for
less
lesswell
wellprepared
preparedstudents,
students,and
andsome
someportions
portionsofofChapters
Chapters16–19,
16–19,21–22
21–22depending
depending
on
onthe
thescope
scopeofofthe
thepresentation.
presentation.

For
Forphysics
physicsand
andengineering
engineering
Students
Studentstaking
takingaaserious
seriousmathematics
mathematicscomponent
componentcould
coulduse
useChapters
Chapters8–15
8–15to-
to-
gether
getherwith
withmaterial
materialfrom
from16–19
16–19and
and23–24.
23–24.

For
Foraanumerical
numericalprogramme
programme
Students
Studentsstudying
studyingnumerical
numericalmethods
methodscould
coulddraw
drawononmaterial
materialfrom
fromChapters
Chapters4–6,
4–6,
with
with77for
forfun,
fun,aareview
reviewofof17–18
17–18and
andthen
then20–21.
20–21.

Material
Materialfor
forspecific
specificcourses
coursesin
inphysics
physicsand
andengineering
engineering
ItItisishopefully
hopefullyevident
evidentthat
thatsome
sometopics
topicsmay
maybe beuseful
usefulfor forparts
partsofofother
otherpro-
pro-
grammes.
grammes.Obvious
Obviouscases
casesinclude
includecourses
courseson
onpotential
potentialtheory,
theory,whether
whetherininelectro-
electro-
statics,
statics,gravity
gravityororfluids,
fluids,which
whichfrequently
frequentlydip
dipinto
intocomplex
complexvariable
variabletheory.
theory.This
This
material
materialisisavailable
availablehere,
here,notably
notablyininChapter
Chapter19,
19,but
butititisistotobe
behoped
hopedthat
thatthose
those
who
whodipdipinto
intoChapter
Chapter19 19also
alsotake
takeaagood
goodlook
lookatatChapters
Chapters23 23and
and24!
24!

Motivational
Motivationalmathematics
mathematics
Many
Manyofofthe
thetopics
topicsdeveloped
developedhere
herecould
couldalso
alsobe
beused
usedasasmotivational
motivationalmaterial,
material,
perhaps
perhapsfor
forstudents
studentsnot
nottaking
takingspecialist
specialistmathematics,
mathematics,physics
physicsororengineering
engineering
programs,
programs,butbutononmore
moregeneral
generalcourses.
courses. InInmymyview,
view,having
havingananappreciation
appreciationofof
the
thebeauty,
beauty,indeed
indeedthe
theart,
art,ofofmathematics
mathematicsisisaavital
vitalcomponent
componentofofananadvanced
advanced
education.
education. The
Thematerial
materialininPart
PartIIIIcould
couldbebeextensively
extensivelydrawn
drawnononfor
forsuch
suchaa
program,
program,ininaddition
additiontotosnippets
snippetsfrom
fromother
otherchapters.
chapters.

Playing
Playing
Everybody
Everybodyshould
shouldplay!
play!You
Youcan
canhave
havefun
funjust
justtrying
tryingout
outthe
theMathematica
Mathematicaimple-
imple-
mentations
mentationsininmany
manyofofthe
thechapters.
chapters. You
Youcan
canhave
haveeven
evenmore
morefun
funby
bycoming
comingupup
with
withbetter
betterways
waysofofdoing
doingthings
thingsthan
thanthe
theauthor
authorhas
hasdone
donehere
hereand
andletting
lettingthe
the
author
authorknow.
know.

*About the
About theenclosed
enclosed CD
CD
The
Theenclosed
enclosedCD
CDcontains
containsthree
threedirectories,
directories,entitled
entitled‘Notebooks’,
‘Notebooks’,‘MathLink’
‘MathLink’and
and
‘Goodies’.
‘Goodies’.

*A CD-ROM formerly accompanied this publication: the contents of the CD-ROM are
now located at www.cambridge.org/9780521836265
Preface xxiii

The Notebooks directory contains electronic copies of all the chapters of the
text, in the form of Mathematica notebooks. These have been finalized in Mathe-
matica 5.1 and therefore should open directly in V5.1 or later. If you are using an
earlier version you will get a warning that you can ignore and open the file anyway.
If you are using version 4.x or even 3.x you may find that some things do not quite
work as in the text. The results from Integrate have now stabilized but differed
in earlier versions, so you should watch out for that, particularly in the sections
where you check a contour integral or work out a Schwarz–Christoffel map. There
are other minor stylistic issues, such as Conjugate appearing in output form as
the whole word ‘Conjugate’ in older versions, whereas now the output form is a
simple star!
The MathLink directory contains MathLink code in the form of (a) source for
any system, (b) binaries for some systems. The source consists of .tm files and
.c files. A lack of resources prevents me from making immediately useful binaries
for every operating system.
The Goodies directory contains encrypted information pertinent to Mathe-
matica technologies beyond version 5.2 that will be made available once such
technology is officially released. See below for more details on this. First I need
to remark on kernel compatibility issues in general.
The author is unable to offer support on the code or MathLink issues. But I do
wish to receive bug reports on kernel operation. This code started off as working
in Mathematica 2.2, and has been updated for compatibility with 3.x, 4.x, 5.x. As
Mathematica has been updated it has become increasingly difficult to retain total
compatibility with older versions, as noted above. The evolution of the software
has in fact resulted in better code for this book, as I have been driven to write
code that relies less on a trick that might work in one version, and more towards
code that uses the fundamental principles of Mathematica .
Please let me know if you find anything that does NOT work under versions
5.1 or 5.2. You are strongly encouraged to use version 5.x or later, until a new
version is released. I have made an effort to explain where there is a significant
different between the way this book works between major versions. As for Math-
ematica technologies beyond Version 5.2, I cannot comment on any of the details
of unreleased software, but you should see the author’s web site at King’s College
London:

www.mth.kcl.ac.uk/staff/w_shaw.html

and the CUP website for the book at

www.cambridge.org/0521836263

for updates when a new version is released, including a key to unlock the encrypted
material in the ‘Goodies’ section of the CD. If you are using a Mathematica tech-
nology beyond version 5.2, please do not send me bug reports until you have first
checked the CD and then the on-line information, as the author will do his best
to ensure that the book as distributed together with the CD is future-proof.
xxiv Preface

Exercises and solutions


Each chapter ends with a collection of exercises. These consist of some requiring
traditional thought and pen and paper analysis, others where you can addition-
ally check the results with Mathematica and others that are entirely based on
Mathematica. Questions entirely based on Mathematica are indicated by a poly-
hedral Mathematica icon, while those having some partial or optional involvement
of Mathematica have the icon bracketed. Similarly sections of the book based
primarily on the software are prefixed with the same icon.
Some problems are elementary exercises based on the material, while others
are more open-ended investigations that do do not have a ‘correct answer’. The
author intends to make a ‘Solutions to Selected Exercises’ available on-line to
educators at the earliest opportunity, and information of the progress on this will
be available from the web sites noted above.

Acknowledgements
I need to start with the mathematics staff of Manshead School who, during the
1970s, inspired me with a love of mathematics. Then the inspirational teaching
of A. F. Beardon and T. W. Körner at Cambridge got me hooked on complex
analysis, and J. M. Stewart taught me how to apply it. Sir R. Penrose, F.R.S.
showed me what could be done with complex variables and relativistic physics,
and has provided me with more inspiration than anyone has a right to have. M.
Perry set me on the course of looking at twistor models of string theory, and some
of the material in Chapter 23, especially the twistor solution of the relativistic
string (minimal surface) equations, arose from these studies.
Particular topics presented here have benefited from contributions from par-
ticular people. I am particularly grateful to L.N. Trefethen, F.R.S. for providing
me with background material on modern approaches to conformal mapping, and
to Vanessa Thomas for allowing me to use her work on tiling the hyperbolic plane.
In addition, N. Hitchin, F.R.S. taught me how properly to use twistor methods in
3-D. The material of Chapter 7 was inspired by the beautiful book by M. Field
and M. Golubitsky. The material in the final two chapters (23 and 24) owes a
great deal to R. Penrose, who has educated me in all sorts of other matters in-
cluding the hyperbolic tilings of Chapter 22, the fine details of fractals (Chapter
6) as well as everything to do with twistors. I am also grateful to J. Ockendon,
F.R.S. for making me aware of the advanced applications of complex variables to
fluids, so that this text, unusually for a first course, includes a discussion of viscous
(biharmonic) flow. He also provoked me in several ways, most constructively by
suggesting I look into ways of deducing the full structure of holomorphic functions
from a purely algebraic treatment of their real (or imaginary) parts. I published
a short educational note on this method (Shaw, 2004) and requested information
on the history of the method. I am grateful to H. Boas, B. Margolis and others
for responding to this request, and also providing some suggestions that lead to
the improved Mathematica implementation given in Section 10.10.
Preface xxv

Particular thanks go to N. Woodhouse and S. Howison for professional support


during a difficult time coinciding with the latter stages of preparing this book. S.
Howison, B. Hambly, J. Dewynne, A. Ilhan and C. Reisinger have all kept me sane
with their considerable support on my real job of running a graduate programme
in mathematical finance in Oxford.
On the Mathematica side I am indebted to S. Wolfram and the staff of Wolfram
Research for providing this wonderful software, and to C. Wolfram, T. Wickham
Jones and the UK team for particular support on numerous activities. I have used
various programming devices borrowed from several other people over the years,
and I am sure that ideas developed by P. Abbott and R. Maeder have found their
way into several bits of code here and there! I also thank numerous unnamed
individuals in technical support for help over the years, in patiently answering
my questions. Gratitude is expressed to T. Gayley for compiling my MathLink
binaries to run under a certain operating system whose name I shall not speak.
I also have to thank many students of Balliol and St Catherine’s Colleges,
Oxford for using and correcting various versions of this material. There were
too many contributions to name everybody, but special thanks are due to Rosie
Bailey, Robin Oliver-Jones and Elizabeth Lang. I also thank Frances Kirwan and
Keith Hannabuss for allowing me to teach this topic at Balliol.
Several others are mentioned at specific places in the text. I apologize to
anyone I have left out.
There are others I need to thank whose names I do not know. These are the
anonymous reviewers who have patiently and thoroughly commented on this text
during various revisions, and made numerous helpful comments. I think I agreed
with all they said, and were it not for them a few important things would have
been left out, and chapters presented in a more haphazard order.
This text was initially inspired by some discussions with Karen Mosman about
ten years ago. Since then I have taken far too long to finish it. But it is better
for the wait, in part because computer speed has rather changed since I started.
First drafts of chapters were worked out on a 66 MHz machine, and the final
draft was edited on a 1.4 GHz machine (already ‘one-third speed’ by standards as
of late 2005). This means that many ideas for interactive work now work, well,
interactively, rather than over a coffee break. I also learnt a lot from others about
how to do things better in the meantime. Mathematica also got much better
over time, particularly in regard to typesetting and the consistency of symbolic
integration. These comments will hopefully go some way to appeasing my CUP
overall editor, David Tranah, whose patience has been tested, and to whom I am
indebted for his support and views. David Hemsley took on the task of editing
the manuscript, and set me numerous challenges in formatting the book. I have
not managed to do all the things he wished – typesetting glitches that remain are
all my fault. Production was taken on by Jayne Aldhouse’s team at CUP.
To finish this book I have neglected many people, notably my patient wife
Helen and my impatient son Benjamin, who is worryingly interested in numbers.
It is to them that this text is dedicated.
1 Why you need complex numbers

Introduction
The complex number system is now such an accepted part of mathematical analysis that
it requires some adjustment of your point of view just to ask why you need so-called
imaginary or complex numbers. But you should understand that there was, at first,
considerable resistance to their introduction, even amongst those who felt compelled to
invent them! Probably the first person to discuss them was Girolamo Cardano, in his text
Ars magna (The Great Art), published in 1545 (Cardano, 1993). Cardano also was one of
the first Western algebraists to cope with the concept of negative numbers, and to
introduce negative roots. The additional headache involved in dealing with imaginary
numbers was such that he largely kept them out of his book, with the exception of a brief
discussion of the solution of the quadratic equation :

xH10 - xL = 40 (1.1)

Cardano did not cope terribly well with the processes involved in managing this equation
– as he put it: ‘putting aside the mental tortures involved, multiply 5
, ,
+ H-15L by 5 - H-15L, making 25 - H-15L, whence the product is 40’. He went on
to add: ‘So progresses arithmetic subtlety the end of which, as is said, is as refined as it
is useless.’
One view of this book is therefore that it is devoted to a useless topic, but it is
likely that Cardano might have shifted his opinions if he could only have experienced the
outcome of his mental tortures. If you wish to experience Cardano's reservations person-
ally, his text is available in translation. Also, an excellent exposition of the history of
algebra in the sixteenth century is given by Burton (1995). Cardano pushed his luck in
other ways, and through his fascination for astrology he managed to get himself impris-
oned for heresy. The author hastens to add that it was not so much the introduction of
imaginary numbers that got him into trouble – rather more offence was taken at his
publishing a horoscope of Jesus Christ. Controversy surrounded Cardano and others
interested in the solution of polynomial equations – the intense competition to understand
quadratic, cubic and quartic equations generated considerable rivalry!
This book is devoted to explaining why complex numbers and complex analysis
are two of the most useful topics in pure and applied mathematics, physics and engineer-
ing. You need them.

1.1 First analysis of quadratic equations


If you wish to understand how complex numbers arise from simple polynomial equations
with real coefficients, it is sufficient to analyse the following quadratic equation:

ax2 + bx + c = 0 (1.2)
2 Complex Analysis with Mathematica

You can rewrite this in the form

aHx2 + H2 xbL ê H2 aLL + c = 0 (1.3)

If you then ‘complete the square’, you obtain

aHx + b êH2 aLL2 - b2 ê H4 aL + c = 0 (1.4)

Hence, you arrive at:

Hx + bêH2 aLL2 = Hb2 - 4 acLê H2 aL2 (1.5)

As long as x is real, the left side of this equation is the square of a real number, and is
therefore non-negative. The right side is non-negative if and only if

b2 - 4 ac ¥ 0 (1.6)

You can, in this case, take the ordinary square root, to obtain
,
x + bê H2 aL = I Hb2 - 4 acLM ë H2 aL (1.7)
,
x = I-b  Hb2 - 4 acLM ë H2 aL (1.8)

If, on the other hand,

b2 - 4 ac < 0 (1.9)

the square root cannot be taken in the usual way. The introduction of a quantity Â
(Mathematica® uses a double-struck character for the standard mathematical representa-
tion) satisfying

Â2 = -1 (1.10)

resolves the matter, since then you can write


,
x = I-b  Â H4 a c - b2 LMë H2 aL (1.11)

Thus you obtain complex roots of an equation with real coefficients. It is another matter
to understand what happens when the coefficients themselves are complex. At first you
might wonder if you have to extend the number system still further to cope. It is one of
the important results of complex analysis that this is unnecessary. You will discover that
all polynomial equations of degree n, with coefficients that are complex numbers, have n
roots that are complex numbers. In other words: Complex numbers are enough.
Now is a good time to get a grip on the use of Mathematica to solve simple
equations. If you are completely new to Mathematica you may first wish to explore the
booklet Getting Started with Mathematica… (see your Mathematica documentation kit).
If you do not wish to explore the use of Mathematica to solve equations, skip to the next
chapter.
1 Why you need complex numbers 3

1.2 Ÿ Mathematica investigation: quadratic equations


If you are using this text with a computer, start the Mathematica system by clicking (e.g.
in the MacOS X ‘dock’) or double-clicking (on most other systems) on the appropriate
icon on your computer system. This section will give you a brief introduction on using
Mathematica to solve simple quadratic equations. In each case you can just type in the
commands given in bold-face Courier (‘typewriter’) font, and enter the command
using either Shift Return, Á; Enter, Û; or Insert (depending on your operating sys-
tem). If you are viewing this notebook from a CD-ROM or other electronic source, you
can of course just browse the existing material entering some or all of the commands.
Since the solution of equations is one of your main goals, and is a running theme
of this book, now is a good time to explore the Solve function that is built into Mathe-
matica. Although the material of this section is basic, it illustrates an important and basic
point about how Mathematica ‘solves’ equations by returning replacement rules. You
should try the following examples:

mysolution = Solve@x2 - 1 == 0, xD
88x Ø -1<, 8x Ø 1<<

Note that you use a double equal sign when you wish to denote equality in a Mathemat-
ica expression representing an equation. (The use of a single equal sign is reserved for
assignment.) The solution to this quadratic is now contained in the Mathematica expres-
sion mysolution, and we can ask about this expression:

mysolution
88x Ø -1<, 8x Ø 1<<

What we really want are the values of x given the result contained in mysolution. In
Mathematica the English word ‘given’ is expressed by the combination /. (slash dot):

myx = x ê. mysolution

8-1, 1<

This gets you a list of the solutions expressed in the variable myx. This list contains two
elements, and we can extract each one by referring to the position in the list. This is
achieved by the use of double square brackets, containing the position in the list of the
result of interest:

myx@@2DD

1
4 Complex Analysis with Mathematica

‡ Some other real equations with purely real roots


In the following example you go directly to the list of solutions:

myxTwo = x ê. Solve@x2 - 2 == 0, xD
è!!! è!!!
9- 2 , 2 =

We can now ask for any particular result:

myxTwo@@1DD
è!!!
- 2

myxThree = x ê. Solve@x2 + 2 x - 2 == 0, xD
è!!! è!!!
9-1 - 3 , -1 + 3 =

myxFour = x ê. Solve@x2 - x - 1 == 0, xD
1 è!!! 1 è!!!
9 ÅÅÅÅÅ I1 - 5 M, ÅÅÅÅÅ I1 + 5 M=
2 2
If you wish to extract the numerical values of the solution, you use the N[ ] function.
This can be applied by placing the expression to be numericalized in single square
brackets – this is how Mathematica expects to see all arguments to functions, including
N[ ]:

N@myxFourD

8-0.618034, 1.61803<

You can also apply N[ ] ‘afterwards’, using the //N construction:

myxFour êê N
8-0.618034, 1.61803<

‡ Real equations with purely imaginary roots


In the following examples, Mathematica extracts the purely imaginary roots from an
equation with real coefficients:

myxFive = x ê. Solve@x2 + 1 == 0, xD

8-Â, Â<
1 Why you need complex numbers 5

myxSix = x ê. Solve@x2 + 2 == 0, xD
è!!! è!!!
9-Â 2, Â 2=

myxSeven = x ê. Solve@x2 + 12 == 0, xD
è!!! è!!!
9-2 Â 3, 2Â 3=

Note that in Mathematica's standard form and traditional form for expressions, the square
root of -1 is denoted by Â. You can always ask Mathematica for the traditional mathemat-
ical form of an expression by using explicit conversion to TraditionalForm. In most
of this book the traditional form is used for output – it is more elegant than
StandardForm.

StandardForm@myxSixD
è!!! è!!!
9-Â 2, Â 2=

TraditionalForm@%D
è!!! è!!!
9-Â 2, Â 2=

Note that StandardForm uses an upright font and TraditionalForm an italic font.
If you are new to Mathematica, note that the "per cent" symbol % is a useful shortcut to
the last output. In this case there is just some basic tidying up of the spacing. In the
second example there is more tidying to present the output essentially as you would write
it on paper. If you look under the Mathematica Cell Menu you will see that there are
menu commands and keyboard shortcuts for converting between:

InputForm – Mathematica's standard pure text representation of expressions;


StandardForm – A compromise between traditional mathematical notation and an
unambiguous computer representation;
TraditionalForm – Traditional mathematical notation.

‡ Real equations with complex roots


Try the following examples:

myxEight = x ê. Solve@x2 + x ê 2 + 1 == 0, xD
1 è!!!!!! 1 è!!!!!!
9 ÅÅÅÅÅ I-1 - Â 15 M, ÅÅÅÅÅ I-1 + Â 15 M=
4 4

N@myxEightD

8-0.25 - 0.968246 Â, -0.25 + 0.968246 Â<

It is always a good idea to check that your answers regenerate the original quadratic:
6 Complex Analysis with Mathematica

Expand@Hx - HmyxEight@@1DDLL Hx - HmyxEight@@2DDLLD


x
x2 + ÅÅÅÅÅ + 1
2

‡ Complex equations with complex roots


Although you may not yet know how to treat equations that have complex coefficients, it
is perfectly possible (you will read how to deal with this later, in Chapter 2); Mathemat-
ica does not need any further instruction. Here is a good place to note that the ‘Input
Form’ of the square root of -1 is the capital I:

myxNine =
x ê. Solve@H1 + IL x ^ 2 + H2 + IL x + 3 - 2 I == 0, xD
1 Â è!!!!!! 1 Â è!!!!!!
9J ÅÅÅÅÅ + ÅÅÅÅÅ N IH-1 + 2 ÂL + 17 M, J- ÅÅÅÅÅ - ÅÅÅÅÅ N IH1 - 2 ÂL + 17 M=
4 4 4 4
Finally, you can consider the case we started with:

myxTen = x ê. Solve@a x ^ 2 + b x + c == 0, xD
è!!!!!!!!!!!!!!!!!!!! è!!!!!!!! !!!!!!!!!!!!
-b - b2 - 4 a c b2 - 4 a c - b
9 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
2a 2a

‡ Using Factor (more advanced)


You have seen how to use Solve to solve the equation. You can also use Factor to
work on the quadratic (or indeed any polynomial) itself, if you are interested in looking
at factorizations over only the integers:

Factor@2 x ^ 2 - 2D

2 Hx - 1L Hx + 1L

You can get a list of the factors together with their powers as follows:

FactorList@2 x ^ 2 - 2D

ij 2 1y
zz
jj
jj x - 1 1 zzz
j z
k x+1 1 {

However, look what happens when you try the following:

Factor@x ^ 2 + 1D

x2 + 1
1 Why you need complex numbers 7

You can examine the effect of resetting one of the options:

Options@FactorD
8Extension Ø None, GaussianIntegers Ø False, Modulus Ø 0, Trig Ø False<

If we allow Gaussian integers, that is, complex numbers whose real and imaginary parts
are both integers, then a different result is obtained:

Factor@x ^ 2 + 1, GaussianIntegers -> TrueD

Hx - ÂL Hx + ÂL

You can obtain further information about Factor, or indeed any Mathematica function,
by prefixing the function name with a question mark:

? Factor

Factor@polyD factors a polynomial over the integers. Factor@poly, Modulus->


pD factors a polynomial modulo a prime p. Factor@poly, Extension->
8a1, a2, ... <D factors a polynomial allowing coefficients
that are rational combinations of the algebraic numbers ai. …

So, for example, if you try the following, you get nowhere:

Factor@x ^ 2 + 2, GaussianIntegers -> TrueD

x2 + 2

But if you allow an extension, the factorization proceeds:

Factor@x ^ 2 + 2, GaussianIntegers -> True,


Extension -> 8Sqrt@2D<D
è!!! è!!!
I 2 - Â xM IÂ x + 2 M

You can build up lists of suitable extensions very easily. Here you make a list of the
square roots of the first three primes:

mylist = Table@Sqrt@Prime@kDD, 8k, 3<D


è!!! è!!! è!!!
9 2, 3, 5=

This allows you to play with higher-order polynomials:

Factor@Hx ^ 2 - 3L Hx ^ 2 - 5L Hx ^ 2 - 6L, Extension -> mylistD


è!!! è!!! è!!! è!!! è!!! è!!!
-I 3 - xM I 5 - xM I 6 - xM Ix + 3 M Ix + 5 M Ix + 6 M

But now we have jumped to higher-order polynomials. It is time to develop some more
theory. In the next chapter you will see how to define complex numbers properly, and
8 Complex Analysis with Mathematica

you will soon be able to explore the solution of cubic, quartic and other polynomial
equations.

Exercises
1.1 Using pen and paper only (i.e. not using Mathematica) find the solutions of the
following quadratic equations:

x2 - 3 = 0

x2 + 2 x + 1 = 0

x2 + 3 = 0

x2 + x + 4 = 0

1.2 If a > 0, what is the minimum value of the expression

ax2 + bx + c

and for what value of x does it occur? When is this minumum value negative, and what
does this imply about the roots of the quadratic equation

ax2 + bx + c = 0 ?

What happens when this minumum value is zero? What happens when it is positive?
Interpret your results graphically.

1.3 Suppose that x1 and x2 are the roots of the quadratic equation

ax2 + bx + c = 0

By writing this in the form

aHx - x1 LHx - x2 L = 0

show that

x1 x2 = c ê a
x1 + x2 = -b ê a

Hence write down a quadratic equation with roots 3 + 2 Â and 1 - Â.

1.4 Let f be the function given by:

f HxL = lxH1 - xL

Without using Mathematica, find both solutions of the quadratic equation:

x = f HxL

Hence, without using Mathematica, find all the solutions of the quartic equation:
1 Why you need complex numbers 9

x = f H f HxLL

Hint: the solutions of the quadratic equation are necessarily solutions of the quartic
equation.

1.5 Ÿ Use Mathematica's Solve function to solve the quadratic equations in Exercise
1.1, and compare your solutions.

1.6 Ÿ Plot the functions x2 , x2 - 1, and x2 + 1, using the Mathematica Plot function,
For example, the first of these may be plotted with:

Plot@x ^ 2, 8x, -2, 2<D

1.7 Ÿ Repeat the exercise of problem 1.6, but parametrize the constant by a value c.
Explore the use of an animation to see the results, by trying the following:

Do@Plot@x ^ 2 + c, 8x, -2, 2<, PlotRange -> 8-1, 3<D,


8c, -1, 1, 0.2<D

What is the relationship between the quantity b2 - 4 ac in this case, and the location of
the curve?

1.8 Ÿ Use Factor to find the real linear and quadratic factors of the expression x4 - 1,
and hence find all solutions of the quartic equation x4 - 1 = 0.

1.9 Ÿ Using the methods of Exercise 1.8, find all six solutions to the equation x6 - 1 = 0.
2 Complex algebra and geometry

Introduction
In the first chapter you saw why you need imaginary and complex numbers, by consider-
ing the solution of simple quadratic equations. In this chapter you will see how we set up
complex numbers in general, and establish their basic algebraic and geometrical proper-
ties.
We shall assume that you have some understanding of what is meant by a real
number. The exact nature and depth of this understanding will not materially affect the
discussion thoughout most of this book, and this is not a book about the fundamentals of
real analysis. We should, however, take a moment to remind ourselves what a ‘real’
number is, before we start defining ‘imaginary’ and ‘complex’ numbers. Students of pure
mathematics should remind themselves of the details of these matters – there is really
nothing for it but to go for a proper mathematical definition, and experience has shown
that one needs to be slightly abstract in order to get it right, in the sense that the resulting
definition contains all the numbers ‘we need’. For a full exposition, complete with
proofs, you should consult a text on real analysis, such as that by Rudin (1976). For our
purposes it will mostly be sufficient to regard real numbers as being all the points on a
line (which we call the real axis) extending to infinity in both directions. This contains
positive and negative integers, rational numbers, such as 1/2 and 17/15, simple square
roots such as the square root of 2, and other numbers such as p and ‰. When we come to
consider certain results about limits of infinite sequences and series, it will be necessary
to call on more formal results from analysis.

2.1 Informal approach to ‘real’ numbers


For completeness we begin by briefly exploring the necessity of the ‘real’ number
system. In fact, one reason for having ‘real’ numbers at all is the inadequacy of integers
and rationals (ratios of integers) for solving equations. This parallels our need for
introducing complex numbers, but at a more basic level. So we begin by considering
even simpler equations than those considered in Chapter 1. For example, consider the
solution of the following two equations. Although this can be done with ‘pen and paper’,
we carry this out in Mathematica, asking for x given (/.) the results of the Solve
function. First note that this function returns a list of replacement rules:

Solve@2 x == 16, xD

88x Ø 8<<

To get the value of x given this result we ask for:


2 Complex algebra and geometry 11

x ê. Solve@2 x == 16, xD

88<

The first, and here only, element of this list can be picked out using the double square
brackets to indicate position in the list:

x ê. Solve@2 x == 16, xD@@1DD


8

x ê. Solve@2 x == 15, xD@@1DD


15
ÅÅÅÅÅÅÅÅÅ
2
Both of these equations have whole number, or integer, coefficients. In the first case we
obtain an integer solution. In the second case we do not obtain an integer, but we get a
rational. Clearly we need to consider rational numbers if we are to solve simple linear
equations with either integer or rational coeffiecients. Now consider the following two
equations containing rational numbers as coefficients. Here we keep the whole list rather
than asking for the first element:

x ê. Solve@x ^ 2 == 9 ê 4, xD
3 3
9- ÅÅÅÅÅ , ÅÅÅÅÅ =
2 2

x ê. Solve@x ^ 2 == 2, xD
è!!! è!!!
9- 2 , 2 =

The first equation with rational coefficients has a solution that is rational, but for the
second, we have obtained an answer from Mathematica that remains expressed with
square roots. There is in fact no rational number whose square is 2. So clearly we need to
extend the system of rationals to cope with such equations. How do we do so? One might
imagine that one could work through various equations, generating numbers such as the
square roots of 2, 3, etc., to add to our number system. Unfortunately, it is no use just
trying to add, one at a time, various fractional powers such as the square and higher order
roots of the rationals, for we shall miss important irrational numbers such as ‰ and p,
though these numbers can be obtained in terms of limiting processes involving sequences
of rationals. This results in the need for a more abstract approach, as described, for
example, by Rudin (1976).
However, although this process of ‘adding new numbers’ is not adequate for
giving a proper definition of the real numbers, it serves perfectly well as a motivation for
defining complex numbers, and this is the route we shall take.
12 Complex Analysis with Mathematica

2.2 Definition of a complex number and notation


Traditionally there have been several different notations for complex numbers. They are
all equivalent and you should get used to using the three different traditional forms
introduced below. Since we are working with Mathematica, which has a convention of
using capital letters for special symbols (including the square root of -1) in Input-
Form, we need to introduce a fourth notation for our Mathematica investigations.
Throughout this book the normal mathematical notation will be used, except for our
Mathematica expressions, where the Mathematica form will be used.

‡ Ordered pair notation (formal mathematical)


The formal mathematical definition treats a complex number z as an ordered pair Hx, yL,
where x and y are ordinary real numbers. We call x the ‘real part’ and y the ‘imaginary
part’. Note that this slightly awkward terminology implies that the imaginary part is
actually a real number! This is also a convenient representation for when we wish to treat
complex numbers as being vectors in two-dimensional space – then x and y are just the
Cartesian components of the vector.

‡ x + iy notation (‘normal’ mathematics) and Mathematica standard


and traditional forms
In this notation a complex number is represented by an expression of the form x + i y,
where x and y are ordinary real numbers. The quantity x is called the ‘real part’ and y is
the ‘imaginary part’. Complex numbers thus expressed are related to the ordered pair
notation by the relations that x is equivalent to Hx, 0L and i y is equivalent to H0, yL. This
is similar to the use of TraditionalForm notation in Mathematica, except that
Mathematica uses a double-struck letter, Â, instead of an italic i, or as in many texts, a
standard i.

‡ x + jy notation (engineering)
In some branches of engineering, particularly electrical engineering, the symbol j or j is
used instead of i. It can usually be used completely interchangeably, though sometimes
matters of convention (usually in the treatment of time-dependent complex functions)
make it useful to think of j as being -i , in order to make sensible comparisons between
different texts. This slightly odd point arises as the world of applied mathematics,
physics and engineering is divided in many ways. One division arises from whether
time-harmonic functions have a time-dependence of the form ‰-Â wt or ‰+ jwt . Don't blame
this author! Send e-mail to anyone but me, such as to anyone writing a book about
applied electromagnetics that uses a convention opposite to the one you have been taught.
2 Complex algebra and geometry 13

‡ Ÿ x + Iy notation (Mathematica InputForm)


In Mathematica the capital letter I is used instead of i or Â, in InputForm, in order to
conform to Mathematica's conventions of representing all special symbols with capital-
ized names. Similarly p becomes Pi and e or ‰, becomes E. This applies in Mathematica
when using InputForm, though in StandardForm or TraditionalForm it
reverts to the notation of ‘normal’ mathematics, but with double-struck characters. Here
is an example illustrating many of the issues:

expr = Exp@-I 2 Pi f tD;

InputForm@exprD
E^((-2*I)*f*Pi*t)

StandardForm@exprD

‰-2 Â f p t

TraditionalForm@exprD

‰-2 Â f p t

Note that in some older versions of Mathematica the capital I of InputForm is also
used in StandardForm. Another way of converting Mathematica cells between the
different formats is to use the commands under the ‘Cell Menu’. You might want to
explore this now.

2.3 Basic algebraic properties of complex numbers


We define the operations of addition, subtraction, multiplication and division in a
completely natural way. Formally, we obtain a field, though it is important to note that it
is not an ordered field, in contrast to the real field. So addition is defined by

Ha + bÂL + Hc + dÂL = a + c + Hb + dLÂ (2.1)

Multiplication is defined in a similarly straightforward way, bearing in mind that


 µ  = -1:

Ha + bÂL µ Hc + dÂL = ac - bd + Hbc + adLÂ (2.2)

Division of one complex number by another complex number is defined by:


a + b Ha + bÂL Hc - dÂL Hac + bdL + Hbc - adLÂ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (2.3)
c + d Hc + dÂL Hc - dÂL c2 + d 2

Note that for this to work, it cannot be the case that c = d = 0 – in other words, division
is possible by any complex number except zero. Bearing in mind these definitions, it is
14 Complex Analysis with Mathematica

straightforward to verify that standard algebraic properties such as associativity and


commutativity of addition and multiplication apply.

2.4 Complex conjugation and modulus


Given a complex number

z = x + Ây (2.4)

we define its complex conjugate zê , also denoted by z*

zê = x - Ây (2.5)

The modulus †z§ of a complex number is defined by

†z§2 = z zê = x2 + y2 (2.6)
è!!!!!ê!
†z§ = zz (2.7)

From these definitions a number of simple relations follow. First, complex conjugation is
involutory – if we do it twice we arrive back at our original complex number:

zê = z (2.8)

Furthermore, we can extract the real and imaginary parts of a complex number by the use
of conjugation:

2ReHzL = z + zê 2ÂImHzL = z - zê (2.9)

It is important to realize that the imaginary part of a complex number is real – we refer to
the imaginary part as y rather than as Ây. Finally, we can see that the operation of taking
complex conjugates commutes with addition and multiplication:
êêêêêêêêêê êêê ê êêêêêêê ê êêê
Hw + zL = w + z Hz wL = z w (2.10)

2.5 The Wessel–Argand plane


We can regard the real and imaginary parts of a complex number as giving the Cartesian
coordinates of a point in a two-dimensional plane – the Wessel–Argand plane. This
concept was developed independently by C. Wessel in 1797 and J. R. Argand in 1806
(see Penrose, 2004), but has become more commonly known as the Argand plane. We
shall use this terminology from here on. So the complex number z = x + Â y is regarded
as the point with coordinates Hx, yL. We identify the set of all complex numbers  with
the two-dimensional real plane 2 . Furthermore, we can give natural geometrical
interpretations to some of the operations on complex numbers that we have introduced.
We can look at some of these right away – others we shall defer until later.
2 Complex algebra and geometry 15

First, the modulus †z§ gives the length of the vector Hx, yL. Second, the complex
conjugate zê is associated with the point with coordinates Hx, -yL. In the following
diagram the point z = 3 + 2 Â is shown, together with its complex conjugate. The Mathe-
matica code for generating the diagram is also shown – you may ignore it or modify it to
show other complex numbers in Argand form, if you are using the electronic form of this
text with Mathematica.
This is a good point to note how to write the double-struck  in Input Form. It is
obtained by typing: ÂiiÂ

argandata = [email protected], Point@83, 2<D,


Point@83, -2<D, Line@880, 0<, 83, 2<<D,
Line@88-5, 0<, 85, 0<<D, Line@880, -5<, 80, 5<<D,
Text@"3+2Â", 84.5, 2<D, Text@"3-2Â", 84.5, -2<D,
Text@"x", 85, -1 ê 2<D, Text@"y", 8-1 ê 2, 5<D<;
Show@Graphics@argandataD,
PlotRange -> 88-6, 6<, 8-6, 6<<, AspectRatio -> 1D

3+2Â

3-2Â

2.6 Cartesian and polar forms


Given a complex number in the form

z = x + Ây (2.11)

you have already seen how to define the modulus,

r = †z§ (2.12)

Given such a point Hx, yL in the Argand plane, you can describe it in various coordinate
systems. Instead of Cartesian Hx, yL coordinates, you can use polar coordinates, Hr, qL,
related to Cartesian coordinates by the relations
16 Complex Analysis with Mathematica

x = r cosHqL
(2.13)
y = r sinHqL

In these coordinates, the complex number may be written

z = r cosHqL + Â r sinHqL = rHcosHqL + Â sinHqLL (2.14)

This is the polar form of a complex number. The quantity q is called the argument of z.

argandata = [email protected], Point@83, 2<D,


Line@880, 0<, 83, 2<<D,
Line@88-5, 0<, 85, 0<<D, Line@880, -5<, 80, 5<<D,
Circle@80, 0<, 2, 80, ArcTan@2 ê 3D<D,
Text@"3+2Â", 84.2, 2<D,
Text@"q", 83 ê 2, 1 ê 2<D,
Text@"x", 85, -1 ê 2<D, Text@"y", 8-1 ê 2, 5<D<;
Show@Graphics@argandataD, PlotRange -> 88-6, 6<, 8-6, 6<<,
AspectRatio -> 1D

3+2Â

q
x

‡ Issues surrounding the definition of the argument


The argument, q, of a complex number is not uniquely defined by the formula

z = rHcosHqL + Â sinHqLL (2.15)

since you can add any multiple of 2p to q and preserve this relation. This is the simplest
example of a phenomenon that affects functions of complex variables in many important
ways. In the present situation you just need to know how to define the argument unambig-
uously. The first step in doing so is to set a principal range for the argument. Two
principal ranges are in common use, but it is important to understand that others may be
defined. The two most commonly employed are to demand that either
2 Complex algebra and geometry 17

0bq < 2p (2.16)

or that

-p < q b p (2.17)

A value of q satisfying one of these inequalities is called a principal value of the argu-
ment. Such a value can be denoted by a subscript P – you write qP for such a value. If
such a value has been defined through the choice of a principal range, then any other
valid value may be written

q = qP + 2pk (2.18)

for a positive or negative integer k.

‡ Arguments of products and ratios


Suppose you have two complex numbers

z1 = r1 HcosHqL + Â sinHqLL (2.19)

z2 = r2 HcosHfL + Â sinHfLL (2.20)

Consider first the product:

z1 z2 = r1 HcosHqL + Â sinHqLL r2 HcosHfL + Â sinHfLL (2.21)

On expansion of the product, you obtain:

z1 z2 = r1 r2 HcosHqL cosHfL - sinHqL sinHfL + Â HcosHqL sinHfL + sinHqL cosHfLLL (2.22)

or, using a trigonometric formula:

z1 z2 = r1 r2 HcosHq + fL + Â sinHq + fLL (2.23)

So the modulus of the product is the product of the moduli, and the argument of the
product is the sum of the arguments. A similar calculation gives
z1 r1
ÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅ HcosHq - fL + Â sinHq - fLL (2.24)
z2 r2

so that the argument of the ratio is the difference of the arguments.

‡ Ÿ Mathematica functions for Cartesian and polar forms


If you are using Mathematica to manipulate simple complex numbers, you will find it
useful to note the following functions, which are quite obvious in the way they work. To
find the argument of a complex number, you use the Arg function:
18 Complex Analysis with Mathematica

Arg@3 + 2 ID
2
tan-1 J ÅÅÅÅÅ N
3
This leaves the answer in exact trigonometric form, which will be simplified if possible:

Arg@2 + 2 ID
p
ÅÅÅÅÅÅ
4
This function uses the range -p < Arg b p as the principal range. You can check this
by asking for the argument of some values scattered near the negative real axis:

8Arg@-1 - 0.01 ID, Arg@-1D, Arg@-1 + 0.01 ID<

8-3.13159, p, 3.13159<

This is a good place to illustrate the nice way in which many Mathematica functions
behave when acting on lists. A very useful shorthand is to write

Arg@8-1 - 0.01 I, -1, -1 + 0.01 I<D

8-3.13159, p, 3.13159<

This works for any function that has the attribute of ‘being listable’, and this can be
checked by applying the Attributes function:

Attributes@ArgD

8Listable, NumericFunction, Protected<

The modulus of a complex number is found by using the Abs function, an abbreviation
for absolute value:

Abs@3 + 2 ID
è!!!!!!
13

The real and imaginary parts are extracted by use of the functions Re and Im, while
complex conjugates are taken by the use of the Conjugate function:

Re@3 + 2 ID

Im@3 + 2 ID

2
2 Complex algebra and geometry 19

Conjugate@3 + 2 ID

3-2Â

Note that these are the representation of the functions in StandardForm. If you
convert them to TraditionalForm, you obtain a representation that looks more
familiar.

mylist = 8Re@zD, Im@zD, Abs@zD, Arg@zD, Conjugate@zD<;

TraditionalForm[mylist]

8ReHzL, ImHzL, †z§, ArgHzL, z <

Note that older versions of Mathematica do not use the star superscript for complex
conjugates – rather the word ‘Conjugate’ is used in full. (The star was introduced
relatively recently in version 5.1 of the software.)

‡ Ÿ The ComplexExpand function


There is a very useful general purpose function in Mathematica that extracts real and
imaginary parts of expressions on the assumption that all symbols in the expression
represent real variables. You can query Mathematica about its operation in the usual way:

? ComplexExpand

ComplexExpand@exprD expands expr assuming that all variables


are real. ComplexExpand@expr, 8x1, x2, ... <D expands expr
assuming that variables matching any of the xi are complex. …

At first sight, it gives results that are barely distinguishable from the ordinary Expand
function:

ComplexExpand@Hx + I yL ^ 3D

x3 - 3 y2 x + Â H3 x2 y - y3 L

Expand@Hx + I yL ^ 3D

x3 + 3 Â y x2 - 3 y2 x - Â y3

However, the ability to retain some symbols as complex, and to set options to change the
way the function works, gives some useful capabilities. First, we keep z as complex, and
work out the real part of the cube of z:

ComplexExpand@Re@z ^ 3D, 8z<D

ReHzL3 - 3 ImHzL2 ReHzL

It is a good idea to explore the options of this function:


20 Complex Analysis with Mathematica

Options@ComplexExpandD

8TargetFunctions Ø 8Re, Im, Abs, Arg, Conjugate, Sign<<

By changing the target function, you can convert to polar coordinates:

ComplexExpand@Re@z ^ 3D, 8z<,


TargetFunctions -> 8Abs, Arg<D

†z§3 cos3 HArgHzLL - 3 †z§3 cosHArgHzLL sin2 HArgHzLL

Alternatively, the expression can be simplified to a function of z and its complex


conjugate:

ComplexExpand@Re@z ^ 3D,
8z<, TargetFunctions -> ConjugateD
3
z3 Hz L
ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2 2
We shall revisit ComplexExpand later - it is particularly powerful when dealing with
functions of complex variables, as the following simple example illustrates:

ComplexExpand@Sin@x + I yDD
coshHyL sinHxL + Â cosHxL sinhHyL

ü Ÿ Mathematica's internal forms


A technical point that is sometimes useful is to note that Mathematica uses different
names to represent various types of number, or, more generally, expressions. The name
is called the Head:

Head@3 + 2 ID

Complex

Head@Re@3 + 2 IDD

Integer

Head@3. + 2. ID
Complex

Head@Re@3. + 2. IDD

Real

So Mathematica uses different forms of Head for different types of number. This is
related to the way Mathematica represents such quantities internally. The internal
2 Complex algebra and geometry 21

representation may be extracted by the use of FullForm, which reveals a complex


number as an object ‘Complex[x, y]’:

FullForm@2 + 3 ID
Complex@2, 3D

If you work with lists of complex numbers, FullForm reveals still more internal
structure:

FullForm@82 + 3 I, 4 + 5 I<D

List@Complex@2, 3D, Complex@4, 5DD

2.7 DeMoivre's theorem


DeMoivre's theorem is fundamental to understanding how to take powers and roots of
complex numbers. By implication it is central to solving quadratic equations with
complex coefficients, since it is then required to take square roots of a complex number.
The theorem states that for any real number a,

HcosHqL + Â sinHqLLa = cosHa qL + Â sinHa qL (2.25)

Once you understand the exponential form of complex numbers, this theorem will
become completely obvious. However, it is useful to see how to prove and apply it
without such knowledge, in various cases. The simplest and most important case is for
positive integers, where a = n > 1. Once you see the case n = 2 it becomes clear how to
generalize via induction

HcosHqL + Â sinHqLL2
 = cos2 HqL - sin2 HqL + 2 Â sinHqL cosHqL (2.26)
 = cosH2 qL + Â sinH2 qL

where the last line is obtained by application of the elementary trigonometric identities.

‡ Inductive proof for positive integers


Suppose that the theorem is true for n = k:

HcosHqL + Â sinHqLLk = cosHkqL + Â sinHkqL (2.27)

So you deduce that

HcosHqL + Â sinHqLLk+1 = HcosHqL + Â sinHqLL HcosHkqL + Â sinHkqLL (2.28)

 = cosHkqL cosHqL - sinHkqL sinHqL + Â HcosHqL sinHkqL + cosHkqL sinHqLL (2.29)


 = cosHHk + 1LqL + Â sinHHk + 1LqL (2.30)
22 Complex Analysis with Mathematica

by the application of trigonometric addition formulae. So the result is established for


k + 1. Since the result holds for k = 2, it holds for all positive integers, by induction.

‡ Proof for negative integers


The corresponding result for negative integers follows by some elementary manipula-
tions. First, let k be a positive integer, and note that
1 1
HcosHqL + Â sinHqLL-k = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅkÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (2.31)
HcosHqL + Â sinHqLL cosHkqL + Â sinHkqL

Now note that


1 1 Â sinHkqL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ cosHkqL - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (2.32)
cosHkqL + Â sinHkqL cosHkqL + Â sinHkqL cosHkqL - Â sinHkqL

and this, on expanding the denominator and noting that

cos2 HkqL + sin2 HkqL = 1 (2.33)

becomes

cosHkqL - Â sinHkqL = cosH-kqL + Â sinH-kqL (2.34)

So it has been shown that:

HcosHqL + Â sinHqLL-k = cosH-kqL + Â sinH-kqL (2.35)

which establishes the desired result.

‡ Proof for rational powers


Now let p and q be integers, and consider:

pq pq q
JcosJ ÅÅÅÅÅÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅÅÅÅÅÅ NN = cosHpqL + Â sinHpqL = HcosHqL + Â sinHqLL p (2.36)
q q

This is true by DeMoivre's theorem for a positive integer, applied twice, first with q, then
with p. So, taking the qth root of both sides,
pq pq
cosJ ÅÅÅÅÅÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅÅÅÅÅÅ N = HcosHqL + Â sinHqLL pêq (2.37)
q q

You will see shortly that there are other values of the qth roots of a complex number.
2 Complex algebra and geometry 23

‡ Classical trigonometric formulae


There are many applications of DeMoivre's theorem. Two of the most straightforward
concern the development of trigonometric formulae relating trigonometric functions of
multiple angles to powers of trigonometric functions. The arguments can be developed in
two directions.

ü Multiple angles to powers


An example will suffice to illustrate the general principle. How do you express cosH4 qL
in terms of the pair of functions cosHqL and sinHqL, or indeed just in terms of cos(q)? Now,
by DeMoivre's theorem:

cosH4qL + Â sinH4qL = HcosHqL + Â sinHqLL4 (2.38)

Expanding the right side by the binomial theorem gives:

cos4 HqL + 4 Â sinHqL cos3 HqL - 6 cos2 HqL sin2 HqL - 4 Â cosHqL sin3 HqL + sin4 HqL (2.39)

Taking the real parts of this gives

cosH4qL = cos4 HqL + sin4 HqL - 6 cos2 HqL sin2 HqL (2.40)

You can now write sin2 HqL = 1 - cos2 HqL and expand the result, to obtain

cosH4qL = 1 - 8 cos2 HqL + 8 cos4 HqL (2.41)

ü Powers to multiple angles


The question here is how to express a power of cosHqL or sinHqL, or indeed, a polynomial
involving both, to sums of terms of the form cosHkqL and sinHkqL, involving no powers,
and just multiple angles. It is useful to be able to do this, for example, to compute
integrals of polynomials involving trigonometric functions. Some of the manipulations
involved in this will appear later also, when you see how to do integration using contour
integrals and holomorphic functions. For now it is just an algebraic trick.

z = cosHqL + Â sinHqL (2.42)


1 1
ÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = cosHqL - Â sinHqL (2.43)
z cosHqL + Â sinHqL

If you take nth powers of both of these relations, and apply DeMoivre's theorem, you
obtain:

zn = cosHn qL + Â sinHn qL (2.44)


1
ÅÅÅÅnÅÅÅÅ = cosHn qL - Â sinHn qL (2.45)
z
Now, adding and subtracting these results gives, first,
24 Complex Analysis with Mathematica

1
z + ÅÅÅÅÅ = 2 cosHqL (2.46)
z
1
z - ÅÅÅÅÅ = 2 Â sinHqL (2.47)
z
Secondly, you get, for general n:
1
zn + ÅÅÅÅnÅÅÅÅ = 2 cosHnqL (2.48)
z
1
zn - ÅÅÅÅnÅÅÅÅ = 2 Â sinHnqL (2.49)
z
Now consider an example. On the one hand, we have

1 4
Jz + ÅÅÅÅÅ N = H2 cosHqLL4 = 16 cos4 HqL (2.50)
z
By the binomial theorem, we also have

1 4 4 1 1 1
Jz + ÅÅÅÅÅ N = z4 + 4 z2 + ÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅ4ÅÅÅÅ + 6 = Jz4 + ÅÅÅÅ4ÅÅÅÅ N + 4 Jz2 + ÅÅÅÅ2ÅÅÅÅ N + 6 (2.51)
z z z z z
Now, using the results obtain so far, the right side can be written as

2 cosH4qL + 8 cosH2qL + 6 (2.52)

Hence, equating the two forms, we have

16 cos4 HqL = 2 cosH4qL + 8 cosH2qL + 6 (2.53)

or
1
cos4 HqL = ÅÅÅÅÅ H4 cosH2qL + cosH4qL + 3L (2.54)
8
This makes it easy to integrate a function like cos4 HqL, because the right side is a sum of
terms, each of which gives a simple integration problem.

ü Ÿ Mathematica development of trigonometric formulae


There are several functions built into Mathematica that perform operations related to
those just discussed. The conversion of multiple angles to powers can be partially
accomplished using either TrigExpand, or Expand with the option Trig -> True:

TrigExpand@Cos@4 qDD

cos4 HqL - 6 sin2 HqL cos2 HqL + sin4 HqL

The operation can be completed by asking Mathematica to expand the result, given a
supplementary rule about how powers of sin(q) are to be treated:
2 Complex algebra and geometry 25

Expand@% ê. Sin@qD ^ k_ -> H1 - Cos@qD ^ 2L ^ Hk ê 2LD

8 cos4 HqL - 8 cos2 HqL + 1

Expand@Cos@4 qD, Trig -> TrueD

cos4 HqL - 6 sin2 HqL cos2 HqL + sin4 HqL

The opposite operation can be effected with the TrigReduce function. You can apply
this to the two examples considered above:

TrigReduce@1 - 8 Cos@qD ^ 2 + 8 Cos@qD ^ 4D

cosH4 qL

TrigReduce@Cos@qD ^ 4D
1
ÅÅÅÅÅ H4 cosH2 qL + cosH4 qL + 3L
8
Another function that is sometimes useful is TrigFactor:

TrigFactor@Cos@4 qDD

HcosH2 qL - sinH2 qLL HcosH2 qL + sinH2 qLL

? TrigFactor

TrigFactor@exprD factors trigonometric functions in expr. …

2.8 Complex roots


We now come to one of the most important basic topics in the theory of complex num-
bers – how to find the n nth roots of a complex number. That is, the task is, given a
complex number w, to find all n solutions for z of the equation

zn = w (2.55)

Let's begin by starting with a simple case, where n = 2.

‡ Square roots
Suppose that w is a given complex number and we wish to solve the equation

z2 = w (2.56)

for z. First, we write w in polar form:

w = rHcosHqL + Â sinHqLL (2.57)


26 Complex Analysis with Mathematica

DeMoivre's theorem allows us to find one solution for z right away:

è!!! q q
z= r JcosJ ÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅ NN (2.58)
2 2
In the case of the square root, you can probably guess how to find the other root:

è!!! q q
z = - r JcosJ ÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅ NN (2.59)
2 2
But there is another way of thinking about this second solution that allows you to
generalize to nth roots. For any integer value of k, we can use the ambiguity in the
definition of the argument to write

w = rHcosHq + 2 kpL + Â sinHq + 2 kpLL (2.60)

By applying DeMoivre's theorem to this expression, you obtain

è!!! q q
z= r JcosJ ÅÅÅÅÅ + kpN + Â sinJ ÅÅÅÅÅ + kpNN (2.61)
2 2
è!!!!
where r is the ordinary positive square root of the positive real number r. Now, if k is
even, we get the same value of z, whereas if it is odd we get the other root. To see this,
note, for example, that

cosHa + pL = -cosHaL (2.62)

and

sinHa + pL = -sinHaL (2.63)

So it is sufficient to consider the cases k = 0, 1 only, to extract both square roots. This
is the pattern we shall generalize to nth roots.

‡ nth roots
Suppose that w is a given complex number and we wish to solve the equation

zn = w (2.64)

for z. First, we write w in polar form:

w = rHcosHq + 2 kpL + Â sinHq + 2 kpLL (2.65)

where k is any integer. By applying DeMoivre's theorem to this expression, you obtain:
q 2 kp q 2 kp
z = r1ên JcosJ ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ NN (2.66)
n n n n
This time, as you vary k, you can find n distinct complex numbers, all of which are roots
of the number w. It is sufficient to consider

k = 80, 1, 2, ..., n - 1< (2.67)


2 Complex algebra and geometry 27

To get a better feel for how this works, it is a good idea to consider the simplest case
beyond square roots, and where w = 1.

‡ Cube and nth roots of unity


The cube roots of unity are given by the list of possible values of:
2 kp 2 kp
z = JcosJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ NN , k = 0, 1, 2 (2.68)
3 3
Working this out gives
è!!! è!!!
1 Â 3 1 Â 3
91, - ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = (2.69)
2 2 2 2
The first complex element of this list is sometimes treated as special, and given the name
w:
1 è!!!
w = ÅÅÅÅÅ I-1 + Â 3 M (2.70)
2
Note that

w3 = 1 (2.71)

and that, by virtue of the identity

H1 - wLH1 + w + w2 L = 1 - w3 = 0 (2.72)

we have the result that the sum of the three cube roots of unity is zero:

1 + w + w2 = 0 (2.73)

Note also that the modulus of w is unity. The quantity w and its powers lie at the corners
of a triangle in the complex plane, with the vertices of the triangle on the unit circle. You
can easily visualize this, using the following plot:

CPlot@z_ListD :=
Module@8r<, r = Map@8Re@#D, Im@#D< &, zD;
ParametricPlot@8Cos@qD, Sin@qD<, 8q, 0, 2 p<,
AspectRatio -> 1,
PlotRange -> 88-1.1, 1.1<, 8-1.1, 1.1<<,
PlotRegion -> 880.05, 0.95<, 80.05, 0.95<<,
Epilog -> [email protected], Map@Point, rD<DD

1 è!!!!
w = ÅÅÅÅ I-1 + Â 3 M;
2

CPlot@81, w, w2 <D
28 Complex Analysis with Mathematica

0.5

-1 -0.5 0.5 1

-0.5

-1

The behaviour of higher-order roots is similar. Here is a visualization of the n nth roots
of unity, implemented in Mathematica :

ShowNthRoots[n_] := Module[{w = Cos[2*Pi/n] +


I*Sin[2*Pi/n]},
CPlot[Table[w^k, {k, 0, n - 1}]]];

For example, here are the seven 7th roots of unity:

ShowNthRoots@7D

0.5

-1 -0.5 0.5 1

-0.5

-1

Here are the twenty-seven 27th roots of unity!

ShowNthRoots@27D
2 Complex algebra and geometry 29

0.5

-1 -0.5 0.5 1

-0.5

-1

2.9 The exponential form for complex numbers


The purpose of this section is to establish the relationship:

‰Âq = cosHqL +  sinHqL (2.74)

There are a few different ways of understanding how one can arrive at this equation.
Each of them relies on some knowledge from other areas of mathematics. Perhaps the
simplest is to write down the Taylor series for the three functions involved. We may as
well ask Mathematica to generate the relevant series for us, using the Series com-
mand. You might like to use the general Taylor series formula to check the following.
First, let's take a look at the series for the exponential function:

Series[Exp[x], {x, 0, 10}]

x2 x3 x4 x5 x6
1 + x + ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ +
2 6 24 120 720
x7 x8 x9 x10
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHx11 L
5040 40320 362880 3628800
Next, the series for the trig functions:

Series[Cos[x], {x, 0, 10}]

x2 x4 x6 x8 x10
1 - ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHx11 L
2 24 720 40320 3628800
30 Complex Analysis with Mathematica

Series[Sin[x], {x, 0, 10}]

x3 x5 x7 x9
x - ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHx11 L
6 120 5040 362880
Now consider the series for the complex combination:

Series[Cos[x] + I*Sin[x], {x, 0, 10}]

x2 Â x3 x4 Â x5 x6
1 + Â x - ÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅ -
2 6 24 120 720
Âx 7
x 8
Âx 9
x 10
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHx11 L
5040 40320 362880 3628800
This is compared with the series for the exponential function with an imaginary
argument:

Series[Exp[I*x], {x, 0, 10}]

x2 Â x3 x4 Â x5 x6
1 + Â x - ÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅ -
2 6 24 120 720
 x7 x8  x9 x10
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHx11 L
5040 40320 362880 3628800
The terms displayed are identical. Once the pattern of the denominators is seen as
factorials, it becomes clear that the relationship is exact. Another approach is to develop
some differential equations. If we use the rule
d‰y
ÅÅÅÅÅÅÅÅÅÅÅÅÅ = ‰ y (2.75)
dy

together with the chain rule, it follows that

d‰Â q
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =  ‰Â q (2.76)
dq
Differentiating again, if follows that

d‰Â q
ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅ = -‰Â q (2.77)
dq
Now the general solution of the equation

d 2 gHqL
ÅÅÅÅ = -gHqL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (2.78)
dq2
is given by

gHqL = a cosHqL + b sinHqL (2.79)

for some constants a and b. But if we also impose initial conditions of the form
2 Complex algebra and geometry 31

gH0L = 1, g£ H0L = Â (2.80)

it follows that a = 1 and b = Â. In summary, however you derive it, the relationship leads
to the statement that

cosHqL +  sinHqL = ‰Â q (2.81)

and so a general complex number can be written as

z = r HcosHqL +  sinHqLL = r ‰Â q = H†z§L ‰Â ArgHzL (2.82)

This has several consequences. In particular

1 = ‰Â 0 = ‰2p = ‰-2p = ‰4p  (2.83)

and so on. Furthermore, we see that

‰Â p = -1 ó ‰Â p + 1 = 0 (2.84)

This relationship ties together, in one simple and rather mysterious equation, the five
quantities ‰, Â, p, 0, 1!

‡ DeMoivre and roots revisited


Many formulae involving the arguments of complex numbers become ‘obvious’ when
the exponential form is used. You should review, for example, the formulae for the
products and ratios of complex numbers. DeMoivre's theorem bcomes particularly
transparent in the exponential form:
n
HcosHqL +  sinHqLLn = H‰Â q L = ‰Â n q = cosHnqL +  sinHnqL (2.85)

Next, suppose that

w = r ‰Â q = r ‰Â Hq+2kp L (2.86)

Then the n nth roots of w can be constructed in the form:

w1ên = r1ên ‰Â Hqên+2kp ênL (2.87)

With k varying from 0 to n - 1, all n roots are generated.

‡ A first look at the exponential and logarithm functions


You can now see how to define the exponential function for a general complex number,
by requiring that the property

‰z1 +z2 = ‰z1 ‰z2 (2.88)

must hold for complex numbers, as it does for real ones. If we write

z = x + Ây (2.89)
32 Complex Analysis with Mathematica

then

‰z = ‰x+ y = ‰x ‰Â y = ‰xHcosHyL+ sinHyLL (2.90)

You will see a more extensive discussion of the logarithm function and its properties
later. For now, note that we can reorganize the exponential form for a complex number
into the relation

z = †z§ ‰Â ArgHzL = ‰logH†z§L ‰Â ArgHzL = ‰logH†z§L+ ArgHzL (2.91)

So, given z, if we seek a number w such that

z = ‰w (2.92)

one solution for w is

w = logH†z§L + Â ArgHzL (2.93)

This is identified as the logarithm of the complex number z:

logHzL = logH†z§L + Â ArgHzL (2.94)

Note that the logarithm inherits the same ambiguity as the argument. This is the source of
several interesting and useful properties of the log function that you will revisit many
times.

2.10 The triangle inequalities


There are various properties relating to complex numbers that carry over from two-dimen-
sional vector algebra, given the realization of a complex number as a point in the Argand
plane. An important result is the triangle inequality. Geometrically, this is the result that
the length of any one side of a triangle is less than or equal to the sums of the lengths of
the other two sides. We can prove this inequality directly in complex number form.
There are two versions. Both stem from the observation that for any complex number:

ReHzL b †z§ (2.95)

Now apply this to a pair of complex numbers:

ReHz1 zêêê2 L b †z1 êêê


z2 § = †z1 § †z2 § (2.96)

Now consider
êêêêêêêêêêêê
†z1 + z2 §2 = Hz1 + z2 L Hz1 + z2 L = †z1 §2 + †z2 §2 + êêê
z2 z1 + êêê
z1 z 2 =
êêê (2.97)
†z1 § + †z2 § + 2 ReHz1 z2 L b †z1 § + 2 †z2 § †z1 § + †z2 §2 = H†z1 § + †z2 §L2
2 2 2

That is,

†z1 + z2 §2 b H†z1 § + †z2 §L2 (2.98)

so that, since both sides are positive:


2 Complex algebra and geometry 33

†z1 + z2 § b †z1 § + †z2 § (2.99)

This is the fundamental triangle inequality. You can extract another related inequality by
repeating the argument with a minus sign:
êêêêêêêêêêêê
†z1 - z2 §2 = Hz1 - z2 L Hz1 - z2 L = †z1 §2 + †z2 §2 - êêê
z2 z1 + êêê
z1 z 2 =
êêê (2.100)
†z1 § + †z2 § - 2 ReHz1 z2 L r †z1 § + †z2 § - 2 †z2 § †z1 § = H†z1 § - †z2 §L2
2 2 2 2

Now we do not know which modulus is bigger, so the strongest statement we can make
is that

††z1 § - †z2 §§ b †z1 - z2 § (2.101)

2.11 Ÿ Mathematica visualization of complex roots and logs


An elegant way of understanding the behaviour of roots is to consider plotting a root of z
as z wanders through the complex plane. We shall do this by just plotting the real part of
an nth root of z as z varies in a disc around the origin. In polar coordinates, we have a
function
q
f Hr, qL = r1ên cosJ ÅÅÅÅÅ N (2.102)
n
We let q vary from 0 to 2pn to get all values of f . These plots show how a multi-valued
surface is generated. As one loops around the origin in units of 2p, one jumps from one
root to the next.

ViewRootSurface@n_Integer, resolution_IntegerD :=
ParametricPlot3D@8r * Cos@thetaD,
r * Sin@thetaD, r ^ H1 ê nL * Cos@theta ê nD<,
8r, 0, 2<, 8theta, 0, 2 * n * Pi<,
PlotPoints -> 8resolution, resolution * n<,
Boxed -> False, Axes -> False,
AspectRatio Ø 1, ViewPoint -> 8-3, -3, 0<D

Here is the plot for a square root (n = 2), showing the two-valued nature of the square-
root function:

ViewRootSurface@2, 20D
34 Complex Analysis with Mathematica

A similar view of the logarithm function reveals how the function never joins up again.
Here we plot the imaginary part, which is just the argument:

ViewLogSurface@n_Integer, resolution_IntegerD :=
ParametricPlot3D@
8r * Cos@thetaD, r * Sin@thetaD, theta<,
8r, 0, 2<, 8theta, 0, 2 * n * Pi<,
PlotPoints -> 8resolution, resolution * n<,
Boxed -> False, Axes -> False, AspectRatio -> 1 ê 2,
ViewPoint -> 8-3, -2, 3<D

ViewLogSurface@3, 30D

You might like to explore some other functions this way. If you are using Mathematica
technology beyond version 5.2, there may be other options for displaying and viewing
3D graphics. Be sure to check the Front End menus and your documentation for options
available in your current version. Also see the on-line supplement and CD.
2 Complex algebra and geometry 35

2.12 Ÿ Multiplication and spacing in Mathematica


Now, before you attempt the Mathematica exercises below, is a good time to note
Mathematica's conventions on spacing and multiplication. The quantity x µ y, giving the
explicit multiplication of x by y, can be denoted in Mathematica explicitly by x*y or
implicitly by x y, where there is a single space between x and y. Both of these are
different from xy with no space, as the following example shows:

8TraditionalForm@x * yD,
TraditionalForm@x yD, TraditionalForm@xyD<

8x y, x y, xy<

The quantity xy with no space has a meaning all of its own as a new symbol! In this
respect Mathematica's conventions are rather more careful than those of ordinary mathe-
matics. However, there is a downside to this in that TraditionalForm expressions can
result in less than satisfactory layout for typesetting purposes. For example, the output of

TraditionalForm@x * y * z * p * q * rD

pqrxyz

is too widely spaced for most purposes, and the first example above means that omitting
spaces altogether is wrong. Instead, the default spacing can be adjusted by surrounding
each space in the output by a pair of  characters, which creates a thin space as follows:

pqrxyz

Exercises
The reader should note that familiarity with the material exemplified here will be
assumed throughout the rest of this text – it is vital that you work through this entire set,
otherwise later material involving many basic calculations with complex numbers, in
their various forms, will be incomprehensible.

‡ Mathematical, grouped by section topic

ü Algebra
2.1 Express in the form x + Ây each of the following numbers
1
ÅÅÅÅÅ
Â
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
3 - 6Â
36 Complex Analysis with Mathematica

H2 + 3ÂL + H3 - 6ÂL

H2 + 3ÂL - H3 - 6ÂL

H2 + 3ÂL * H3 - 6ÂL
2 + 3Â
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
3 - 6Â
2.2 If z = -2 + 5Â, express in the form x + Ây the quantity
2
3z2 + z + ÅÅÅÅÅ
z
2.3 Express in the form x + Ây each of the following:

Â2 , Â3 , Â4

Hence find in their simplest forms the values of

Â9 , Â43 , Â4002

2.4 Express in the form x + Â y each of the following:

H1 + ÂL2 , H1 + ÂL3 , H1 + ÂL4

ü Conjugate and modulus


2.5 If z = 3 + 2Â, what are the values (in x + Ây terms where appropriate) of
1 1
zê , †z§, ÅÅÅÅÅ , ÅÅÅÅÅ .
z zê
2.6 If » z » = 0 and z = x + Ây, show that x = y = 0.

2.7 If z = x + Ây and z = zê , show that y = 0. If instead z = - zê , show that x = 0. If


instead you have

z2 = zê2

show that either x = 0, or y = 0, or both.

2.8 Let a be any real number and z be any complex number. Show that

†z - a§ = †zê - a§

Hint: write z = x + Ây and consider the square of both sides.

ü The Argand plane


2.9 If z = 3 + 2Â, show the following complex numbers on the Argand plane:
1 1
z, zê, ÅÅÅÅÅ , ÅÅÅÅÅ
z zê
2 Complex algebra and geometry 37

2.10 If z1 = 3 + 2Â and z2 = 1 - Â, show on a drawing of the Argand plane the following


complex numbers:

z1 , z2 , z 1 - z2 , z1 + z2

What is the geometrical meaning of the complex number z1 - z2 and what is the interpre-
tation of the quantity »z1 - z2 »?

2.11 Show on a drawing of the Argand plane the following loci:

8zœ : †z§=2<

8zœ : †z-3§=1<

8zœ : †z+1+§=1<
2.12 Show on a drawing of the Argand plane the following loci:

8zœ : †z-1§=»z+1»<

8zœ : 2 †z-1§=»z+1»<

8zœ : †z-1§=2 »z+1»<


2.13 What is the geometrical interpretation of the result of exercise 2.8?

ü Polar forms
2.14 For each of the following complex numbers
(i) find the modulus;
(ii) find the principal value of the argument;
(iii) express each in the form rHcosHqL + Â sinHqLL.
z=Â

z = -Â

z=1+Â

z = -1 - Â
è!!!
z= 3 +Â
è!!!
z=1+Â 3
è!!!
z = -1 - Â 3

2.15 For each of the following pairs of complex numbers, z1 , z2 , convert each into the
modulus–argument form, and use this to calculate both z1 z2 and z1 ê z2 .
38 Complex Analysis with Mathematica

1+Â 1-Â
z1 = ÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅ , z2 = ÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅ
2 2
è!!!
3 +Â
z1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , z2 = Â
2

ü DeMoivre and trigonometry


2.16 Simplify the following expressions to the form a + bÂ:

HcosH2 qL + Â sinH2 qLL17


p p 3
JcosJ ÅÅÅÅÅÅ N + Â sinJ ÅÅÅÅÅÅ NN
6 6
HcosH3 qL + Â sinH3 qLL4 HcosH2 qL - Â sinH2 qLL6

2.17 Express each of cosH3 qL, cosH4 qL, cosH5 qL, in powers of cosHqL.

2.18 Express each of sinH3 qL, sinH5 qL, in powers of sinHqL.

2.19 Show that

3 tanHqL - tan3 HqL


tanH3 qL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1 - 3 tan2 HqL
4 tanHqL - 4 tan3 HqL
tanH4 qL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1 - 6 tan2 HqL + tan4 HqL

2.20 Show that


1
cos5 HqL = ÅÅÅÅÅÅÅÅÅ H10 cosHqL + 5 cosH3 qL + cosH5 qLL
16
1
sin5 HqL = ÅÅÅÅÅÅÅÅÅ H10 sinHqL - 5 sinH3 qL + sinH5 qLL
16
2.21 Calculate the indefinite integral

‡ sin HqL „ q
5

2.22 Calculate the definite integral


p
ÅÅÅÅ4Å
‡ cos4 HqL „ q
0

ü Roots
2.23 The three cube roots of unity are: 1, w, w2 , where
2 Complex algebra and geometry 39

1 è!!!
w = ÅÅÅÅÅ I-1 + Â 3 M
2
Show that 1 + w + w2 = 0.

2.24 Show that the sum of the n nth roots of unity is zero.

2.25 Find the three cube roots of -1 in the form a + Âb.

2.26 Find the three cube roots of 3, and the four fourth roots of 4, in the form a + Â b.

ü Exponential and log functions


2.27 Find the three cube roots of -1 in the form r ‰Âq .

2.28 Find the three cube roots of 3, and the four fourth roots of 4, in the form r‰Âq .

2.29 Calculate each of the following in the form a + Âb:


Âp
‰3+ ÅÅÅÅ4ÅÅÅÅ
1 3Âp
‰ ÅÅ2ÅÅ - ÅÅÅÅÅ4ÅÅÅÅÅÅÅ

‰logH2L+ ÅÅÅÅ4ÅÅÅÅ

2.30 Calculate all possible values of

log Â
7pÂ
logI‰3+ ÅÅÅÅÅ4ÅÅÅÅÅÅÅ M

logH-4L
è!!!
logIÂ + 3M

in the form a + Âb.

ü Ÿ Mathematica exercises
2.31 Ÿ Apply the format conversion operations InputForm, StandardForm and
TraditionalForm to each of the following expressions:

Pi, E, I, Exp@I PiD, Exp@I Pi Cos@PiDD

2.32 Ÿ Use Mathematica to display on the Argand plane the locations of the four points
equivalent to the complex numbers

1 + Â, -1 + Â, -1 - Â, 1 - Â

2.33 Ÿ Use Mathematica's built-in functions to calculate the modulus, argument and
complex conjugate of each of the following:
40 Complex Analysis with Mathematica

1-Â
3 + 2 Â, ÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅ , 3 + 4 Â
2

2.34 Ÿ Use the Mathematica function ComplexExpand to work out the real and
imaginary parts, with x and y real, of each of the following functions:

Hx + ÂyL4

Hx - ÂyL5

cosHx + ÂyL

coshHx + ÂyL

sinhHx + ÂyL

2.35 Ÿ Use the Mathematica function TrigExpand to re-work Exercise 2.17 (also see
the comment in Section 2.7 about supplementary rules).

2.36 Ÿ Use the Mathematica function TrigReduce to re-work Exercise 2/18.

2.37 Ÿ Show the eight eighth roots of unity in the Argand plane.

2.38 Ÿ Find out what value Mathematica returns for the square and cube roots of
1, -1, Â, -Â. (Use the N function to get a firm grip on the choice made.)

2.39 Ÿ Use Mathematica to check your results for Exercise 2.29.

2.40 Ÿ What does Mathematica return for the values of the log function you were asked
to compute in Exercise 2.30?

2.41 Ÿ Use the function ViewRootSurface to investigate the behaviour of the cube
and fourth-root functions. If you are using Mathematica technology beyond version 5.2,
be sure to investigate both Front End and kernel options for graphics in your current
version of Mathematica. See the on-line supplement and CD.
3 Cubics, quartics and visualization of
complex roots

Introduction
The solution of general quadratic equations becomes possible, in terms of simple square
roots, once one has access to the machinery of complex numbers. The question naturally
arises as to whether it is possible to solve higher-order equations in the same way. In
fact, we must be careful to pose this question properly. We might be interested in
whether we need to extend the number system still further. For example, if we write
down a cubic equation with coefficients that are complex numbers, can we find all the
roots in terms of complex numbers? We can ask similar questions for higher-order
polynomial equations. The investigation of the solution of cubic and quartic equations is
a topic that used to be popular in basic courses on complex numbers, but has become less
fashionable recently, probably because of the extensive manipulations that are required.
Armed with Mathematica, however, such manipulations become routine, and we can
revisit some of the classic developments in algebra quite straightforwardly. These topics
have become so unfashionable, in fact, that the author received some suggestions from
readers of early drafts of this book that this material should be, if not removed altogether,
relocated to an appendix! I have left this material here quite deliberately, having found
numerous applications for the solutions of cubics, at least, in applied mathematics. You
may feel free to skip this part of the material if you have no interest in cubics and higher
order systems.
A further topic that is placed is here is the demonstration of some important
techniques for visualizing the behaviour of roots of equations in the complex plane – root
movies and root locus plots. This will use Mathematica functions for the numerical
solution of polynomial equations.
The formula we shall develop for a cubic is a modern view of one commonly
attributed to one ‘Tartaglia’, more correctly known as N. Fontana, and developed
sometime before 1539. It was a special case for cubics with no quadratic term. A solution
for such cubics was first published by Cardano in the Ars Magna (see Cardano, 1993),
having allegedly being obtained confidentially from Tartaglia, in 1539, with a promise
that it would not be revealed. This led to something of a feud. It is possible that Cardano
was the first to realise that any cubic can be transformed to one where the quadratic term
is absent, but the rest of the work (if not more) appears to be creditable to S. del Ferro.
Cardano published his work mentioning the work by del Ferro and Tartaglia, having
investigated del Ferro's posthumous papers and satisfied himself that del Ferro had a
solution by 1526 (see Penrose, 2004). Tartaglia was not at all pleased. The management
of quartic equations led to an escalation of the arguments between Cardano and Tarta-
glia, as the problem of the quartic was solved by L. Ferrari, a pupil of Cardano, using the
solution of the cubic along the way. It all became terribly heated. As Ferrari said to
42 Complex Analysis with Mathematica

Tartaglia: ‘You have written things that falsely and unworthily slander Signor Cardan,
compared with whom you are hardly worth mentioning.’ In return, Tartaglia referred to
Ferrari as ‘Cardan's creature’. We must of course always be grateful that modern day
scientists never resort to this type of dreadful bickering, or have childish disputes about
who established what result first!
We can approach the management of cubic equations by proceeding historically
and traditionally, or by seeing what Mathematica does and then trying to understand it.
Either way we come to the same conclusion, so we shall in fact begin by seeing what
Mathematica does when presented with a cubic in symbolic form.

3.1 Ÿ Mathematica investigation of cubic equations


Let's take a look a very simple cubic and a general one:

solOne = x ê. Solve@x3 - 1 == 0, xD
è!!!!!!
3 !
91, - -1 , H-1L2ê3 =

solTwo = x ê. Solve@x3 - c x2 - 3 a x - b == 0, xD
c 1 è!!!! è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9 ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅè!!!!
ÅÅÅÅÅÅÅÅÅÅÅÅ II2 c3 + 27 a c + 27 b + 3 3 -108 a 3 - 9 c2 a2 + 54 b c a + 4 b c3 + 27 b2 M ^ H1 ê 3LM -
3 3 2
3

è!!!!
3 è!!!! è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I 2 H-c2 - 9 aLM ë I3 I2 c3 + 27 a c + 27 b + 3 3 -108 a 3 - 9 c2 a 2 + 54 b c a + 4 b c3 + 27 b2 M ^ H1 ê 3LM,
c 1 è!!!! è!!!! è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅè!!!
ÅÅÅÅ
3 !
ÅÅÅÅÅÅ Å II1 - Â 3 M I2 c3 + 27 a c + 27 b + 3 3 - 108 a 3 - 9 c2 a2 + 54 b c a + 4 b c3 + 27 b2 M ^ H1 ê 3LM +
3 6 2
è!!!!
II1 + Â 3 M H-c2 - 9 aLM ë
è!!!! è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I3 2 I2 c3 + 27 a c + 27 b + 3 3 -108 a 3 - 9 c2 a2 + 54 b c a + 4 b c3 + 27 b2 M ^ H1 ê 3LM,
2ê3

c 1 è!!!! è!!!! è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


ÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅè!!!
ÅÅÅÅ
3 !
ÅÅÅÅÅÅ Å II1 + Â 3 M I2 c3 + 27 a c + 27 b + 3 3 - 108 a 3 - 9 c2 a2 + 54 b c a + 4 b c3 + 27 b2 M ^ H1 ê 3LM +
3 6 2
è!!!!
II1 - Â 3 M H-c2 - 9 aLM ë
è!!!! è!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I3 2 I2 c3 + 27 a c + 27 b + 3 3 -108 a 3 - 9 c2 a2 + 54 b c a + 4 b c3 + 27 b2 M ^ H1 ê 3LM=
2ê3

The latter is somewhat hard to interpret. However, a pattern appers to emerge if we


restrict attention to cubics containing no quadratic term, and simplify the results:

solThree = Simplify@x ê. Solve@x3 - 3 a x - b == 0, xDD

è!!! ! "################
è!!!!!!!! ######## ####!#!!### Â Jè!!!
!!!!!!!! ! è!!!! è!!!!!!!!!!!!!!!!!!! 2ê3 è!!!!
2 IÂ + 3 M Ib + b2 - 4 a3 M - 2 I-Â + 3 M aN
3 3
b + b2 - 4 a3
3
2 a
: ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
! ÅÅÅÅÅ ÅÅÅ
Å Å , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å ,
"################
3 è!!!!!!!! ########
!!!!!!!!
########
!!! 3
2 "################
3 è!!!!!!!! ########
!!!!!!!!
########
!!!
b + b2 - 4 a3 2 22ê3 b + b2 - 4 a3
è!!!! è!!!
3 ! è!!!! è!!!!!!!!!!!!!!!!!!! 2ê3
2 Â IÂ + 3 M a + 2 I-1 - Â 3 M Ib + b2 - 4 a3 M
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ >
"################
3 è!!!!!!!! ########
!!!!!!!!
########
!!!
2 22ê3 b + b2 - 4 a3

To get a better grip on this pattern you will need to investigate the cube roots of unity in
some detail. First, however, note that any cubic can be reduced to a cubic with no
quadratic term, by making a simple translation of the coordinates. You can get Mathemat-
ica to do this for you:
3 Cubics, quartics and visualization of complex roots 43

x3 - c x2 - 3 a x - b ê. x -> X + A

HA + XL3 - c HA + XL2 - 3 a HA + XL - b

Expand@%D

A3 - c A2 + 3 X A2 + 3 X 2 A - 3 a A - 2 c X A + X 3 - c X 2 - b - 3 a X

Collect@%, XD

A3 - c A2 - 3 a A + X 3 + H3 A - cL X 2 - b + H3 A2 - 2 c A - 3 aL X

Coefficient@%, X ^ 2D

3A-c

So if you set A = c ê 3 the new cubic has no quadratic term.

‡ The basic cube root of unity


The basic cube root of unity is the quantity:

1 è!!!!
w = ÅÅÅÅ I-1 + I 3 M;
2

Expand@w3 D
1

As a consequence of this we also have the following (which can be stated as the fact that
the sum of the three cube roots of unity is zero):

Expand@w2 + w + 1D

The quantity w and its powers lie at the corners of a triangle in the complex plane. You
can easily visualize this, using the following plot routine, which we recall from Chapter
2:

CPlot@z_ListD :=
Module@8r<, r = Map@8Re@#D, Im@#D< &, zD;
ListPlot@r, PlotStyle -> [email protected],
AspectRatio -> 1,
PlotRange -> 88-1.1, 1.1<, 8-1.1, 1.1<<,
PlotRegion -> 880.05, 0.95<, 80.05, 0.95<<DD

CPlot@81, w, w2 <D
44 Complex Analysis with Mathematica

0.5

-1 -0.5 0.5 1

-0.5

-1

‡ Solving the cubic


Consider the product of the following three quantities:

z1 = x - a - b;
z2 = x - a w - b w2 ;
z3 = x - a w2 - b w;

ü Exercise
Using pen and paper, you should work out for yourself, and simplify, the product of
these three numbers. Here is what Mathematica gives as a check (the Collect function
groups the terms multiplying each power of x):

Collect@Expand@z1 z2 z3 D, xD

x3 - 3 a b x - a3 - b3

Evidently the factorization of the polynomial

x3 - 3ax - b (3.1)

can be done explicitly if a and b can be found such that

a b = a; a3 + b3 = b (3.2)

We now show how this can be done, using Mathematica to develop the argument. Again,
it is a useful exercise to work through this yourself with pen and paper.
3 Cubics, quartics and visualization of complex roots 45

eqn = a3 + b3 - b ê. b -> a ê a

a3
ÅÅÅÅÅÅÅÅÅ + a3 - b
a3
This is now an equation involving a3 , so we substitute accordingly:

sub = eqn ê. 8a3 -> l, 1 ê a3 -> 1 ê l<

a3
ÅÅÅÅÅÅÅÅÅ - b + l
l
This gives a quadratic equation for l, which is readily solved:

Solve@sub == 0, lD
1 è!!!!!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!!!!!
99l Ø ÅÅÅÅÅ Ib - b2 - 4 a3 M=, 9l Ø ÅÅÅÅÅ Ib + b2 - 4 a3 M==
2 2

alpharoots = a ê. Solve@eqn == 0, aD

"################
3 è!!!!!!!!
########
!!!!!!!!
#######
!!
1 "################
è!!!!!!!!
########
! !!!!!!!
# ######
! ! b - b2 - 4 a3
9- $%%%%%%%%%
3
- ÅÅÅÅÅ
3 b - b - 4 a , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2 3
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ ,
2 3
2
"################
3 è!!!!!!!! ########
!!!!!!!!
#######
!!
H-1L2ê3 b - b2 - 4 a3 b 1 è!!!!!!!! !!!!!!!!3!!%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅ , $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅ 3 ÅÅÅÅÅ + ÅÅÅÅÅ %%%%%%%%%%%%%%%%
b2 - 4%%%%%%%
a ,
3
2 2 2

è!!!!!!
! 3 b 1 è!!!!!!!! !!!!!!!!3!! % b 1 è!!!!!!!! !!!!!!!!3!! %
- -1 $%%%%%%%%%%%%%%%%
ÅÅÅÅÅ + ÅÅÅÅÅ %%%%%%%%%%%%%%%%
b2 - 4%%%%%%%
a , H-1L2ê3 $%%%%%%%%%%%%%%%%
3 ÅÅÅÅÅ + ÅÅÅÅÅ %%%%%%%%%%%%%%%%
b2 - 4%%%%%%%
3
a =
2 2 2 2

Superficially, we get six roots, but as our equations are symmetric under the swapping of
a and b, three of the roots are the bs associated with three of the as.The three roots of the
cubic are then just:

a+ b
b w2 + a w (3.3)
a w2 + b w

This, with a little reorganization, results in the formula already given. As noted in the
introduction, the formula given is essentially equivalent to one developed by Tartaglia in
about 1530 for cubics with no quadratic term.

3.2 Ÿ Mathematica investigation of quartic equations


In what follows we shall pursue the general solution of the quartic using Mathematica.
First we shall use Mathematica's Solve function as a blunt tool. Then we shall explore
the cunning intricacies of Ferrari's solution, using Mathematica to do all the algebra.
46 Complex Analysis with Mathematica

If you want to see what the full quartic solution is like, execute the following code. The
output is not given here for reasons that will be obvious if you try it!

solTwo = x ê. Solve@x4 - d x3 - c x2 - 3 a x - b == 0, xD

The output of this is rather hard to interpret. This time, matters are not much simpler if
you restrict attention to quartics containing no cubic term, which can be effected by a
simple translation, as before. This time we shall show the result, suitably reduced:

solThree = x ê. Solve@x4 - c x2 - 3 a x - b == 0, xD
ijj 2 c ijj ijj y yzz
1 1
jj jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 zz
:- ÅÅÅÅ Å . jjj ÅÅÅÅÅÅÅ ÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%%
2
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%bM%%%%%%%% zzz ^ H1 ê 3Lzzz +
2 j 3 3è!!!! jj jj z z
k 3 2 kk { {

3è!!!! ji ji 3 z
y zyzy
J 2 Ic2 - 12 bMN ì jjj3 jjj-2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzzz ^H1 ê 3Lzzzzzzzz -
2
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%%
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
j j z zz
k k { {{

jij jij jij 2 c ii y zy


1 1 jjj 3 z
bM%%%%%%% zzzz ^ H1 ê 3Lzzzz +
2
ÅÅÅÅÅ . jjj -H6 aL ì jjj. jjj ÅÅÅÅÅÅ ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ jjjjjj -2 c 3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c 3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
2 j j j 3 3è!!!! jj z z
k k k 3 2 kk { {
ij ij y yzyz yz
3è!!!! 3 z
J 2 Ic2 - 12 bMN ì jjj3 jjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%% % zzz ^H1 ê 3Lzzzzzz zzz +
2
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
j j z zz z
k k { {{ {
4c 1 jiji 3 z
y zy 3 è!!!!
ÅÅÅÅÅÅ ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jjjjjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzz - J 2 Ic2 - 12 bMN ì
2
I-2 c 3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
3 3è!!!! jj z z
3 2 kk { {

jij jji y
3%%%% zzzz zzy zzy
jj 3 jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M 2%%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
bM%%%% zz
jj jj zz ^H1 ê 3Lzzz zzz,
k k { {{

1 ijj jij jij 2 c 1 jij jij 3 zz


y zyz
ÅÅÅÅ Å . jjj- H6 aL ì jjj . jjj ÅÅÅÅÅÅ ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ jj jj-2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
2
bM%%%%%%%% zzz ^H1 ê 3Lzzz +
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
2 j j j 3 3è!!!! jj jj z z
k k k 3 2 kk { {

3è!!!! ji ji 3 z
y zyzy yzz
J 2 Ic2 - 12 bMN ì jjj3 jjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%% % zzzz ^H1 ê 3Lzzzzzzzz zzz +
2
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
j j z zz z
k k { {{ {
4c 1 i
jijj 3 z
y zzy 3è!!!!
bM%%%%%%%% zzz ^H1 ê 3Lzz - J 2 Ic2 - 12 bMN ì
2
ÅÅÅÅÅÅ ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jjjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c 3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
3 3è!!!! jj z z
3 2 kk { {

jij jij 3 z
y zy zy
bM%%%%%%%% zzz ^H1 ê 3Lzzz zzz -
2
jj 3 jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
j j z zz
k k { {{

1 ij 2 c 1 ijij yz yz
ÅÅÅÅÅ . jjj ÅÅÅÅÅÅ ÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ jjjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M2%%%%%%%%%%%%%%%% bM%%%%3%% % zzz ^ H1 ê 3Lzzz +
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
2 j 3 3è!!!! jjjj z z
k 3 2 kk { {

3è!!!! ji ji y yy
3%%%% zzzz ^H1 ê 3Lzzzzzz
J 2 Ic2 - 12 bMN ì jjj3 jjj-2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M2%%%%%%%%%%%%%%%%
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
bM%%%% zz zzzz ,
j j zz
k k { {{

1 jji 2 c 1 jij jji 2 3 zz


y zzy
ÅÅÅÅ Å . jjj ÅÅÅÅÅÅÅ ÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jj jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
jj jj I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzz +
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
2 j 3 3è!!!! z z
k 3 2 kk { {
ij ij y yzyz
3è!!!! 3 z
J 2 Ic2 - 12 bMN ì jjj3 jjj-2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzzz ^H1 ê 3Lzzzzzzzz -
2
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%%
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
j j z zz
k k { {{

1 ji ji ji 2 c 1 ji ji 3 z
y zy
ÅÅÅÅÅ . jjj H6 aL ì jjj . jjj ÅÅÅÅÅÅÅ ÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jjj jjj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzz +
2
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
2 j j j 3 3 !! j j
è!! z z
k k k 3 2 kk { {

3è!!!! ji ji 3 z
y zy zyzy
J 2 Ic2 - 12 bMN ì jjj3 jjj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzz zzzzzz +
2
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
j j z z zz
k k { { {{

jijjij y y
4c 1 3%%%% zzz ^H1 ê 3Lzzz - J3
è!!!! 2
ÅÅÅÅÅÅ ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jjjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c 3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M2%%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%bM%%%% zz zz 2 Ic - 12 bMN ì
3 3è!!!! jj
3 2 kk { {

jij jji 3 zz
y zzy zzy
jj 3 jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
2
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%bM%%%%%%%% zzz ^H1 ê 3Lzzz zzz,
jj jj z zz
k k { {{

1 jji 2 c 1 ii
jj jj 2 3 zz
y zzy
ÅÅÅÅ Å . jjj ÅÅÅÅÅÅÅ ÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jjj jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%bM%%%%%%%% zzz ^H1 ê 3Lzzz +
2 j 3 3 !! j j
è!! z z
k 3 2 kk { {
ij ji y zyzzyz
3è!!!! 3 zz
J 2 Ic2 - 12 bMN ì jjj3 jjj-2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzzzzz +
- 4 Ic2%%%%%%%%%%%%%%%%
- 12%%%%
j j z zz
k k { {{
ij ij ij 2 c ij ij y yz
1 1 3 z
ÅÅÅÅÅ . jjj H6 aL ì jjj . jjj ÅÅÅÅÅÅÅ ÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å jj jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzz +
2
j I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
2 j j j 3 è!!
3 !! jj j z z
k k k 3 2 kk { {

ji ji y yz zyzy
3è!!!! 3 z
J 2 Ic2 - 12 bMN ì jjj3 jjj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bM%%%%%%%% zzz ^H1 ê 3Lzzz zzzzzz +
2
I- 2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a 2 M %%%%%%%%%%%%%%%%
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%
j j z z zz
k k { { {{
ii y zzy 3
4c 1 jjjjjj 3 zz è!!!!
jjjj -2 c3 - 72 b c + 243 a2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I-2 c 3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
2
ÅÅÅÅÅÅ ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ Å - 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%bM%%%%%%%% zzz ^H1 ê 3Lzzz - J 2 Ic2 - 12 bMN ì
3 3è!!!! jj z z
3 2 kk { {
ijj ijj y yzz yzz
jj 3 jj- 2 c3 - 72 b c + 243 a 2 + $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 zz
I-2 c3 - 72 b%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
c + 243 a2 M %%%%%%%%%%%%%%%%
2
- 4 Ic%%%%%%%%%%%%%%%%
2 - 12%%%%bM%%%%%%%% zzz ^H1 ê 3Lzzz zzz>
jj jj z zz
k k { {{
3 Cubics, quartics and visualization of complex roots 47

‡ Ferrari's approach to solving the quartic


As before, the term of cubic order can be eliminated by a change of variables, so it
suffices to consider quartics with no cubic term

quartic = x4 + p x2 + q x + r;

We can split this object into two pieces:

lhs = x ^ 4 + p x ^ 2;
rhs = -q x - r;

The original quartic equation is just

lhs - rhs == 0

x4 + p x2 + q x + r  0

Alternatively, we rearrange it as follows:

lhs == rhs

x4 + p x2  -r - q x

Let us add p2 + px2 to both sides:

lhsa = lhs + p x2 + p2 ;
rhsa = rhs + p x2 + p2 ;

This makes the left side a perfect square, as is evidenced by:

Factor@lhsaD
2
Hx2 + pL

But the right-hand side is still nothing useful:

rhsa

p2 + x2 p - r - q x

We now add to both sides something that preserves the fact that the left side is a perfect
square, but will give us the flexibility to arrange that the right side is also:

lhsb = lhsa + 2 Hx ^ 2 + pL z + z ^ 2;
rhsb = rhsa + 2 Hx ^ 2 + pL z + z ^ 2;

The left side is still a perfect square:


48 Complex Analysis with Mathematica

Factor@lhsbD
2
Hx2 + p + zL

rhsb

p2 + x2 p + z2 - r - q x + 2 Hx2 + pL z

If we can choose z so that this new right-hand side is a perfect square, we can take square
roots of both sides, leading to two quadratic equations. Now, recall from Chapter 1, that
if we take a quadratic in the form

quad = ax2 + bx + c (3.4)

This is already in the form of a perfect square if

b2 = 4ac (3.5)

So we need to apply this constraint to rhsb to get an equation for z. Let's pull out the
various pieces:

a = Coefficient@rhsb, x ^ 2D

p+2z

b = Coefficient@rhsb, xD
-q

c = Expand@rhsb - a x ^ 2 - b xD

p 2 + 2 z p + z2 - r

Now we organize the resulting equation for z:

Collect@b ^ 2 - 4 a c, zD

-4 p3 - 20 z2 p + 4 r p - 8 z3 + q2 + H8 r - 16 p2 L z

Thus we arrive at a cubic equation, the resolvent cubic, which can be solved by Tarta-
glia's method. In Chapter 39 of the Ars Magna, Cardano considered an example that is
worth investigating. Here we work through it with Mathematica.

lhs = x ^ 4 - 10 x ^ 2;
rhs = -4 x - 8;

lhsa = lhs - 10 x ^ 2 + 100;


rhsa = rhs - 10 x ^ 2 + 100;
8lhsa, rhsa<

8x4 - 20 x2 + 100, -10 x2 - 4 x + 92<


3 Cubics, quartics and visualization of complex roots 49

Factor@lhsaD
2
Hx2 - 10L

lhsb = lhsa + 2 Hx ^ 2 - 10L z + z ^ 2;


rhsb = rhsa + 2 Hx ^ 2 - 10L z + z ^ 2;

Factor@lhsbD
2
Hx2 + z - 10L

rhsb

-10 x2 - 4 x + z2 + 2 Hx2 - 10L z + 92

As before, we want this to be a perfect square, so we construct the b2 - 4 ac term:

a = Coefficient@rhsb, x ^ 2D

2 z - 10

b = Coefficient@rhsb, xD

-4

c = Expand@rhsb - a x ^ 2 - b xD

z2 - 20 z + 92

Now we organize the resulting equation for z:

Collect@b ^ 2 - 4 a c, zD

-8 z3 + 200 z2 - 1536 z + 3696

cubic = Simplify@% ê 8D

-z3 + 25 z2 - 192 z + 462

Now we get rid of the quadratic piece:

reducedcubic = Expand@cubic ê. z -> y + 25 ê 3D


49 y 524
-y3 + ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ
3 27
We can solve this using Tartaglia's method, but let's jump to the answer, as we are more
interested in quartics right now:
50 Complex Analysis with Mathematica

y ê. Solve@reducedcubic == 0, yD
4 1 è!!!!!! 1 è!!!!!!
9- ÅÅÅÅÅ , ÅÅÅÅÅ I2 - 3 15 M, ÅÅÅÅÅ I2 + 3 15 M=
3 3 3
It looks like algebra will be minimized if we take the first root, so let

z = %@@1DD + 25 ê 3

So the resolvent cubic has a solution at z = 7.

lhsb ê. z -> 7

x4 - 20 x2 + 14 Hx2 - 10L + 149

rhsb ê. z -> 7

-10 x2 - 4 x + 14 Hx2 - 10L + 141

Let us define two quantities, which are each side represented as a perfect square:

perflhs = Factor@lhsbD
2
Hx2 - 3L

perfrhs = Factor@rhsbD

H2 x - 1L2

We now define two quadratic equations by taking the square roots of both sides. It is
helpful to use PowerExpand here to force Mathematica to do the job, and note that we
use the double equals to denote equality:

quada = PowerExpand@ Sqrt@perflhsD == Sqrt@perfrhsDD

x2 - 3 ã 2 x - 1

quadb = PowerExpand@ Sqrt@perflhsD == -Sqrt@perfrhsDD

x2 - 3 ã 1 - 2 x

x ê. Solve@quada, xD
è!!! è!!!
91 - 3, 1+ 3=

x ê. Solve@quadb, xD
è!!! è!!!
9-1 - 5 , -1 + 5 =
3 Cubics, quartics and visualization of complex roots 51

As a check on our answer, we can of course just ask Mathematica to do it!

x ê. Solve@lhs == rhs, xD
è!!! è!!! è!!! è!!!
91 - 3 , 1 + 3 , -1 - 5 , -1 + 5 =

3.3 The quintic


Any attempt to discuss this properly would either divert us into a course in Group Theory
or be a poor replacement of some work already done using Mathematica to illuminate the
problem. In the first case it is necessary to study the work of Evariste Galois to under-
stand what specific equations of a given degree admit an algebraic solution, involving
just arithmetic operations and nth roots. In the second case, one should consult the
excellent poster and internet resources associated with the project ‘Solving the Quintic’
(Adamchik and Trott, 1994). This develops the solution for a quintic in terms of special
functions, and contains an excellent bibliography.

3.4 Ÿ Root movies and root locus plots


It is often useful to have a grip on the location of the roots of a polynomial, within the
Complex Plane. Mathematica offers several ways of visualizing the locations of roots. If
the polynomial under investigation has one or more variable parameters, insight can be
gained by allowing one such parameter to vary and looking at the location of the roots.
For example, we can check for what values of a parameter some of the roots are real or
essentially complex. In more complicated problems, the stability of a system can be
influenced by the location of the roots associated with its Laplace transform, and when
the system is parametrized by a feedback or other variable, the effect of the parameter on
the roots is critical. In general we shall need to explore polynomials of degree greater
than four so we shall also employ Mathematica's NSolve function.
There are two simple ways of looking at the roots of a parametrized polynomial
as the parameter varies. In the first case we can just make a movie using Mathematica's
animation functions. In the second case we overlay all the frames of the movie to get a
root locus plot. Both of these rely on some common functions that we introduce first. We
begin by generalizing our Argand plane plotting routine to allow for a plotting range and
a point size:

CRPlot@z_List, range_List, size_D :=


Module@8r<,
r = Map@8Re@#D, Im@#D< &, zD;
ListPlot@r, PlotStyle -> PointSize@sizeD,
AspectRatio -> 1, PlotRange -> 8range, range<,
PlotRegion -> 880.05, 0.95<, 80.05, 0.95<<DD
52 Complex Analysis with Mathematica

Next we define a function that extracts the complex roots of a polynomial equation in list
form. To keep matters simple, we always work with z as our variable.

PolySolver@poly_D := z ê. NSolve@poly == 0, zD

Here is a working example in the form of a simple quintic:

mypoly@z_, l_D := z ^ 5 + z ^ 3 + z ^ 2 + z + l;

When we apply the solver the the example, we get the five roots in numerical form. If
you have done so calculations earlier where a value of z has been assigned you will need
to clear it as follows first:

Clear@zD;
PolySolver@mypoly@z, 3DD

8-1.11682, -0.30271 - 1.18858 Â,


-0.30271 + 1.18858 Â, 0.861121 - 1.0218 Â, 0.861121 + 1.0218 Â<

‡ Movies
This is done in versions 4 and 5 of Mathematica using a simple loop to generate succe-
sive frames of an animation:

Do@CRPlot@PolySolver@mypoly@z, lDD, 8-2, 2<, 0.05D,


8l, 0, 4, 0.2<D

1.5

0.5

-2 -1.5 -1 -0.5 0.5 1 1.5 2


-0.5

-1

-1.5

-2
3 Cubics, quartics and visualization of complex roots 53

You can execute the animation by selecting a group of frames to animate, then applying
‘Animate Selected Graphics’ from the Cell Menu of Mathematica. If you are using
Mathematica technology beyond version 5.2, be sure to investigate the options for your
current version of Mathematica. Also see the on-line supplement and CD.

‡ Root locus plots


In this case a table of values of the complex roots is created. The resulting two-dimen-
sional list is flattened into a one-dimensional list of many complex numbers, then fed to
the plotting routine.

CRPlot@Flatten@
Table@PolySolver@mypoly@z, lDD, 8l, 0, 4, 0.2<DD,
8-2, 2<, 0.015D

1.5

0.5

-2 -1.5 -1 -0.5 0.5 1 1.5 2


-0.5

-1

-1.5

-2

Note that we get a useful measure of the ‘speed’ of the roots as l changes, expressed by
the separation of the dots. Root locus plots are more traditionally given by joining up the
dots to give a smooth curve. This of course discards the velocity information. It is also
sometimes difficult to decide what dots to join up – our approach avoids this problem as
there is no requirement to join anything up.

Exercises
3.1 Let a and b be the roots of the quadratic equation

ax2 + bx + c = 0

By writing the quadratic ax2 + bx + c in the form aHx - aLHx - bL deduce that
54 Complex Analysis with Mathematica

b c
a + b = - ÅÅÅÅÅ , a b = ÅÅÅÅÅ
a a
3.2 Let a, b, g be the roots of the cubic equation

ax3 + bx2 + cx + d = 0

By writing the cubic polynomial ax3 + bx2 + cx + d in the form aHx - aLHx - bLHx - gL
deduce that
b c d
a + b + g = - ÅÅÅÅÅ , a b + ag + bg = ÅÅÅÅÅ , a bg = - ÅÅÅÅÅ
a a a
3.3 Let a, b, g, d be the roots of the quartic equation

ax4 + bx3 + cx2 + d x + e = 0

By writing ax4 + bx3 + cx2 + d x + e in the form aHx - aLHx - bLHx - gLHx - dL deduce that
b
a + b + g + d = - ÅÅÅÅÅ
a
c
a b + ag + ad + bg + bd + gd = ÅÅÅÅÅ
a
d
a bg + a bd + adg + bgd = - ÅÅÅÅÅ
a
e
a bgd = ÅÅÅÅÅ
a
3.4 Using the results of Exercises 3.1 and 3.2, write down
(i) a quadratic equation with roots 2 + Â and 2 - Â;
(ii) a cubic equation with roots 3, 4 - Â, 4 + Â.

3.5 Show that x = -1 is a root of both the following cubic equations

x3 - 2x - 1 = 0
x3 - 3x - 2 = 0

and hence solve each equation for all its roots.

3.6 Use Tartaglia's method to solve the cubic equations:

x3 - 3x + 1 = 0

z3 + H6 - 9ÂLz2 - H18 + 36ÂLz - 51 = 0

3.7 Solve the quartic equation

x4 - 10x2 + 9 = 0

3.8 Show that x = 1 is one solution of the quartic equation


3 Cubics, quartics and visualization of complex roots 55

x4 - 9x2 - x + 9 = 0

Hence find all roots of the equation.

3.9 Show that x2 + x + 1 is a factor of the quntic expression x5 + x + 1, and find the other
(cubic) factor. Hence find all roots of the equation

x5 + x + 1 = 0

3.10 Ÿ Use the Mathematica functions Expand and Collect to re-work Exercises 3.2
and 3.3 on your computer.

3.11 Ÿ Using Mathematica's Expand function, and the approach of Exercises 3.1, 3.2
and 3.3, find
(i) a quadratic equation with roots 3 and 2 + Â;
(ii) a cubic equation with roots 3, 2 + Â, 2 - Â;
(iii) a quartic equation with roots 2, -2, 3 + Â, 3 - Â.

3.12 Ÿ Use Mathematica's Solve function to solve directly the cubic equations given
in Exercise 3.5.

3.13 Ÿ Use Mathematica's Solve function to find the solutions of the cubic equations
given in Exercise 3.6. What do you notice about the way Mathematica presents the
solutions?

3.14 Ÿ Use Mathematica's Solve function to find the solutions of the quartic equation
given in Exercise 3.8.

3.15 Ÿ Use Mathematica's Solve function to find, in exact form, all roots of the quintic
equation

x5 + x + 1 = 0

3.16 Ÿ Using Solve and NSolve, establish two ways of finding approximate numeri-
cal values to all of the complex roots of the quintic equation

x5 + x + 1 = 0

3.17 Ÿ Using the function FindRoot, how many roots can you find of

x5 + x + 1 = 0

Hint: Try experimenting with different starting values of x0 in the solution method:

FindRoot@x ^ 5 + x + 1 == 0, 8x, x0 <D

3.18 Ÿ Build root movie and root locus plots of the following polynomial, with l
varying:

x4 - 4x3 + Hl2 + 5Lx2 - 4xl2 + 5l2


4 Newton–Raphson iteration and complex
fractals

Introduction
You may already have seen how to solve polynomial equations numerically in Chapter 3,
using the NSolve function, or FindRoot. How in general can we solve an equation,
polynomial or otherwise, numerically? There are many schemes for doing this, with one
or perhaps many variables. Given that we cannot solve most polynomials, or indeed
other equations, in an exact analytical form, we need to consider a numerical treatment.
Let's look now at the most important such scheme. It leads naturally to the
consideration of the solution of polynomial equations by iteration of rational functions,
and this chapter is a brief introduction to this theory. Entire books can and have been
written about both the art and mathematics of this. In the view of the author there is none
better than that by Beardon (1991), which should be consulted by anyone serious about
exploring the matter thoroughly. This chapter contains only introductory analytical
comments on the matter, and for the most part we shall focus on exploring the art with
Mathematica!
So here we take a novel route, looking at how the business of equation solving,
which was the motivation for introducing complex numbers in the 16th century, becomes
a whole new area of interest when we combine complex numbers with a computer
system.
Note that in this chapter we shall be producing moderately complicated graphics.
A machine running at 1 GHz or better is recommended for interactive use of the more
complicated examples presented. If you are using an old machine just lower the plot
resolution.

4.1 Newton–Raphson methods


In Newton–Raphson iteration you consider the solution of an equation given in the form

f HxL = 0 (4.1)

The idea is to take a starting value, say x0 , and compute f Hx0 L. Now consider the tangent
to the curve y = f HxL at the point Hx0 , f Hx0 LL, which has slope f £ Hx0 L, and consider
where this tangent intercepts the x axis. We call the value of x at which this happens x1 .
In travelling from x0 to x1 , the increase in x is Hx1 - x0 L, and the increase in y is
H0 - f Hx0 LL. The slope of the tangent line is therefore given by
0 - f Hx0 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (4.2)
x1 - x0
4 Newton–Raphson iteration and complex fractals 57

and this must be equal to f £ Hx0 L. This gives us an equation governing x1 :


0 - f Hx0 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = f £ Hx0 L (4.3)
x1 - x0

which we can solve for x1 , obtaining


f Hx0 L
x1 = x0 - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ (4.4)
f £ Hx0 L

This now defines a new iteration scheme, since we can just repeat this process, defining
f Hxn L
xn+1 = xn - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ (4.5)
f £ Hxn L

This defines the famous ‘Newton–Raphson’ iteration scheme.

4.2 Ÿ Mathematica visualization of real Newton–Raphson


You can use Mathematica to gain a better understanding of the geometry of the Newton–
Raphson scheme. Here is a short program, in the form of a Module, that does the itera-
tion and draws the geometrical picture of the iteration scheme:

NRIter[func_, xzero_, n_:5] :=


Module[{pointlist = {}, x, xold = xzero, xnew, f, df,
xl, xr,k},
f[x_] = func[x];
df[x_] = D[func[x], x];
Do[
(pointlist = Join[pointlist, {{xold, 0}}, {{xold,
f[xold]}}];
xnew = xold - f[xold]/df[xold];
xold = xnew),
{k,1,n}];
xl = Min[First[Transpose[pointlist]]]-0.5;
xr = Max[First[Transpose[pointlist]]] + 0.5;
Plot[f[x], {x, xl, xr}, PlotRange -> All,
PlotStyle -> {{Thickness[0.001], Dashing[{0.005,
0.005}]}},
Epilog -> {Thickness[0.001], Line[pointlist]}]]

The program works by constructing a list, called pointlist, to which is added new
values of the pairs Hxn , 0L, Hxn , f Hxn LL. We then plot the function together with a line
through the final value of pointlist. Here is NRIter applied to a straightforward polyno-
mial, f HxL = x3 + x2 - 3, expressed as a Mathematica pure function, where # is the
argument:

NRIter[(#^3+#^2-3)&, 3.5]
         





     


                         
   

  



      




         

 



   




4 Newton–Raphson iteration and complex fractals 59

ü The FindRoot function


There is a standard kernel function FindRoot that, in its default operation on differentia-
ble functions, does Newton–Raphson automatically:

? FindRoot

FindRoot@lhs==rhs, 8x, x0<D searches for a numerical


solution to the equation lhs==rhs, starting with x=x0. FindRoot@
8eqn1, eqn2, ... <, 88x, x0<, 8y, y0<, ... <D searches for
a numerical solution to the simultaneous equations eqni.

This is a very useful function, but one of the lessons of this chapter is that it must be used
carefully. The following examples make the point. Let's make a list of six starting values,
and apply FindRoot for each one:

xlist = 81.4, 1.413, 1.414, 1.5, 1.57, 1.5708<

81.4, 1.413, 1.414, 1.5, 1.57, 1.5708<

Map@FindRoot@Sin@xD == 0, 8x, #<D &, xlistD

88x Ø -3.14159<, 8x Ø -6.28319<, 8x Ø -9.42478<,


8x Ø -12.5664<, 8x Ø -25.1327<, 8x Ø 28.2743<<

If we choose starting values in the neighbourhood of a stationary value, we converge to


six different multiples of p for the answer!

4.3 Cayley's problem: complex global basins of attraction


Our initial investigations raise various questions. As we vary the starting value, how does
the root eventually found vary? Alternatively, for a given root, which starting values will
lead eventually to that root? From the point of view of numerical analysis, we aim to find
starting values that are sufficiently close to a root. In 1879 A. Cayley formulated this
problem in a rather more interesting global context, set in the complex plane. For a given
function f , define the Newton–Raphson map NR f by
f HxL
NR f HxL = x - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ (4.6)
f £ HxL

and set NR f ,k to be NR f applied k times.

NR f ,1 @xD = NR f @xD (4.7)

NR f ,k+1 @xD = NR f @NR f ,k @xDD (4.8)

Let x* be a root of the equation f HxL = 0. The global basin of attraction of x* is the set

BHx* L = 8x œ  » NRk @xD Ø x* as k Ø ¶< (4.9)


60 Complex Analysis with Mathematica

that is, the set of starting values that will yield the given root after many iterations.
Cayley was interested in finding the geometrical form of BHx* L when f is a simple
polynomial of low degree, and solved the problem completely for quadratic polynomials.
As he said (Cayley, 1879): ‘Throwing aside the restrictions as to reality, we have what I
call the Newton–Fourier Imaginary Problem ... The solution is easy and elegant in the
case of a quadratic equation, but the next succeeding case of a cubic equation appears to
present considerable difficulty.’ This was something of an understatement. Indeed, it
would take about a hundred more years, fast computers, and an appreciation of fractal
geometry, before Cayley's difficulty could properly be appreciated. Our main task in this
chapter (apart from having some fun with the computer graphics) is to explore these
issues.

‡ Cayley's solution for the quadratic


Let's consider the equation arising from solving the quadratic equation

f HzL = z2 - 1 = 0 (4.10)

The Newton–Raphson mapping for this case is easily seen to be


1 1
NR f HzL = ÅÅÅÅÅ Jz + ÅÅÅÅÅ N (4.11)
2 z
The solution for the basins of attraction of this problem will represent an early encounter
for you with the type of mapping known as a Möbius map. These maps will reappear
many times in different applications. Here its role is to make a transformation that makes
it obvious what the basins of attraction are for the Newton-Raphson solution of a qua-
dratic equation. The form of the mapping can be appreciated by noting that what we want
to do is to transform the point z = 1 to the origin, and the point z = -1 to infinity. This
can be achieved by setting
z-1
w = MHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (4.12)
z+1
You can easily check that the corresponding inverse mapping is obtained by setting
1+w
z = M -1 HwL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (4.13)
1-w
What mapping does NRHzL induce in w-coordinates? This is the mapping
è
w Ø NRHwL = MHNRHM -1 HwLLL (4.14)

Some algebra (it is left for you as an exercise) leads to the observation that
è
NRHwL = w2 (4.15)

If you work in w-coordinates, and iterate this mapping, it is obvious that wn Ø 0 if


» w0 » < 1, and that wn Ø ¶ if » w0 » > 1. So in these coordinates, the basins of attrac-
tion are the interior and exterior of the unit circle. Points on the unit circle just get
4 Newton–Raphson iteration and complex fractals 61

mapped around on the unit circle, and the unit circle is the boundary between the two
basins. Now you just have to interpret this in z-coordinates. Clearly, if wn Ø 0, then
zn Ø 1, and if wn Ø ¶, then zn Ø -1, and what is required is an understanding of what
the unit circle, in w-coordinates, is in z-coordinates. If you set

w = ‰if (4.16)

then it is a simple exercise to show that


f
z = Â cotJ ÅÅÅÅÅ N (4.17)
2
so that as f varies the whole of the imaginary axis is obtained. So in z-coordinates the
boundary between the two basins is the imaginary axis. In other words, the basins are
given by two (left and right) half-planes:

BH1L = 8z œ  » ReHzL > 0< (4.18)

BH-1L = 8z œ  » ReHzL < 0< (4.19)

In the case of a general quadratic mapping similar results apply – the plane is divided
into two basins by the perpendicular bisector of the line joining the two roots.

‡ Ÿ Mathematica checks on Cayley's algebra


You can use Mathematica to help check the algebra developed in Cayley's result, as
follows. First, define the Möbius mapping:

M@z_D := Hz - 1L ê Hz + 1L

Now compute and check the inverse:

InverseM@w_D = z ê. Solve@w == M@zD, zD@@1DD


-w - 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
w-1

Simplify@M@InverseM@xDDD
x

Now define the Newton–Raphson mapping:

NR@z_D = 1 ê 2 Hz + 1 ê zL
1 1
ÅÅÅÅÅ Jz + ÅÅÅÅÅ N
2 z

Now compute the mapping induced on w:


62 Complex Analysis with Mathematica

M@NR@InverseM@wDDD
-w-1
ÅÅÅÅ12 H ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅ
w-1
-w-1
ÅÅÅÅÅÅ L - 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
w-1
-w-1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅ2 H ÅÅÅÅÅÅÅÅ
1
w-1
ÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅ
w-1
-w-1
ÅÅÅÅÅÅ L + 1

Clearly, some simplification is required!

Simplify@%D

w2

Finally, note that the parametrization of the imaginary axis in z-coordinates can be seen
to be the unit circle in w-coordinates, as follows:

Simplify@M@I Cot@f ê 2DDD

cosHfL + Â sinHfL

4.4 Ÿ Basins of attraction for a simple cubic


Cayley's attempts to establish a similar result for cubics failed. A full appreciation of the
reasons why is beyond the scope of this book, but you can get a good grip on why
matters are more complicated by simulation using Mathematica. If you want to investi-
gate the matter properly, see the text by Beardon (1991). First, let's construct the Newton–
Raphson mapping:

g[z_] := z^3 - 1

z - g@zD ê g '@zD

z3 - 1
z - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅ
3 z2

Simplify@%D
2z 1
ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ
3 3z

What we want to do is to evaluate the progress of iterates of this mapping to each of the
three roots of the cubic equation. These three roots of unity were discussed in Chapter 2,
and can just as easily be found using Mathematica:

z ê. Solve@g@zD == 0, zD
è!!!!!!
3 !
91, - -1 , H-1L2ê3 =
4 Newton–Raphson iteration and complex fractals 63

N@%D

81., -0.5 - 0.866025 Â, -0.5 + 0.866025 Â<

There are various ways of developing an algorithm to manage this. One approach makes
use of the standard kernel function FixedPoint:

? FixedPoint

FixedPoint@f, exprD starts with expr, then


applies f repeatedly until the result no longer changes.

This will tell us which root has been found, but not how rapid the convergence is. (Look
on MathSource for fractal generators that implement this approach, and see, for example,
Dickau, 1997). Although it requires some more computation, we are interested in
developing a convergence-time algorithm analogous to the escape-time algorithm we
used for the Mandelbrot set. This can also be sorted out by applying the Mathematica
function Length to the function FixedPointList, which generates a list of the
iterates – the length of this list with a suitable termination criteria gives a convergence
time. However, the author's own experiments with this on the Mandelbrot set, as in
Chapter 6, suggests that it is less efficient than the compiled Mathematica approach. It is
left for you to pursue these ideas as programming examples for the Newton–Raphson
case, and draw your own conclusions on efficiency, in the first two exercises. The results
of this may change as the kernel develops!

‡ A convergence-time algorithm
We shall define a function that counts how rapidly progress is made towards a given
root, and that separates the roots by mapping the counter into three distinct intervals
within the set 0 to 255. In order to evaluate this rapidly, the function to evaluate it is
compiled:

NewtonCounter = Compile[{{z,_Complex}},
Module[{counter=0, zold=N[z]+1.0, znew=N[z]},
If[Abs[znew] < 10^(-9), znew = 10^(-9)+0.0*I,
znew=znew];
For[counter = 0,
(Abs[zold-znew] > 10^(-6)) && (counter < 85),
counter++,
(zold = znew;znew = 2*zold/3 + 1/(3*zold^2))];
Which[Abs[znew-1] < 10^(-4), counter,
Abs[znew+0.5-0.866025I] < 10^(-4), 85+counter,
Abs[znew+0.5+0.866025I] < 10^(-4), 170+counter,
True,255]]];
Let's make a quick check to see that it is working:
64 Complex Analysis with Mathematica

[email protected], NewtonCounter@-10 + ID<

82, 105<

Using NewtonCounter, an array of values can be built up for a region of the complex
plane:

NewtonArray[{{remin_, remax_}, {immin_, immax_}},


steps_] :=
{{{remin, remax}, {immin, immax}},
Table[Re[NewtonCounter[x + y I]],
{y, immin, immax, (immax-immin)/steps},
{x, remin, remax, (remax-remin)/steps}]}

‡ Colouring schemes
The next part of our plan is to colour points according to how many iterations is takes to
get to each root. To get nice pictures it is helpful to introduce a capping function that
allows us to amplify colours without breaking Mathematica's rules about the arguments
to functions such as RGBColor[x,y,z], which require that their arguments lie
between 0 and 1.

tr[x_] = Which[x<0,0,x>1,1,True,x];

The first colouring scheme will colour all points in the basins of attraction of complex
roots black, and colour those approaching z = 1 according to the number of iterations.

NewtonColorOne[x_] :=
If[x < 0.333, Hue[6x,1,1], Hue[0,0,0]]

Now we define two other color schemes, based on the use of three different colours, one
for each root:

NewtonColorAll[x_] :=
Which[
x <0.333, RGBColor[tr[5(3x)],tr[5(3x)],tr[5(3x)]],
0.334<x<0.666, RGBColor[tr[5(3x-1)],tr[5(3x-1)],0],
0.667<x<1, RGBColor[0,tr[5(3x-2)],tr[5(3x-2)]],
True, RGBColor[0,0,0]]

NewtonColorRGB[x_] :=
Which[
x <0.333, RGBColor[tr[5*3x],0,0],
0.334<x<0.666, RGBColor[0,tr[5*(3x-1)],0],
0.667<x<1, RGBColor[0,0,tr[5*(3x-2)]],
True, RGBColor[0,0,0]]

The plotting routine now follows:


        

 .,('%(,
111* &$'* &/21$&&$'$&&/22,2
(%(*!-'
$+, '+$,0%(,,
+) ,,$($&&/$&&$'* &/* &$'
 +#%+ *& %+ 
%(,'" 1 2
(%(*-',$('(%(*!-'

     


!*'""*&+"(*"!$('% "(!'&"" #(''"!"(%)&
'"'%+"(''""*!%"('!&'"'!""*"!('"!&'!'"&'%'
*'+%%+""*!' !&"%"*%!'"& ' ,
!&"% (%%%%+

$&$'"* "$('  .,('**011  21  22 

  "! (

 .,('%(,* "$(' .,('(%(*' 

 .,('%(,* "$(' .,('(%(*%%


         

    


4 Newton–Raphson iteration and complex fractals 67

4.5 Ÿ More general cubics


The plots above suggest that given almost any starting value, convergence to a root will
be obtained – there are no regions, except the boundary points, that do not head off to
one of the roots. This is absolutely not the case in general. Consider a family of cubics
still with one zero at z = 1, parametrized by a complex variable r:

p[z_, r_] := z^3 + (r-1) z - r

Factor[p[z,r]]

Hz - 1L Hz2 + z + rL

roots[r_] := z /. Solve[p[z,r]==0,z]

roots@rD
1 è!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!
91, ÅÅÅÅÅ I- 1 - 4 r - 1M, ÅÅÅÅÅ I 1 - 4 r - 1M=
2 2
Although this might look like a special type of cubic, in fact any cubic is equivalent to
one of this family by a linear transformation – so we are dealing with a general cubic
(see the exercises). This time the Newton–Raphson mapping is given by:

NR[z_, r_] = Together[z - p[z,r]/(D[p[z,r], z])]

2 z3 + r
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
3 z2 + r - 1

A simple way of treating this map is to supply the parameter r as an additional argument,
and the value of just one of the two complex roots. In the following we shall treat r as
real.

NewNewtonCounter = Compile[{{z,_Complex}, {r,_Real},


{otherroot, _Complex}},
Module[{counter=0, zold=N[z]+1, znew=N[z]},
If[Abs[znew] < 10^(-9), znew = 10^(-9)+0.0*I,
znew=znew];
For[counter = 0,
(Abs[zold-znew] > 10^(-6)) && (counter < 85),
counter++,
(zold = znew;znew = (r + 2*zold^3)/(-1+r+3*zold^2))];
Which[Abs[znew-1] < 10^(-4), counter,
Abs[znew-otherroot] < 10^(-4), 85+counter,
Abs[znew-Conjugate[otherroot]] < 10^(-4), 170+counter,
True,255]]];
         

#0#0.)(,,2,33,#'%(,#'143%''%(
%''144-.#*-)"/&#3!,)). +,. 
, 4
333,#'%(,#'143%''%(%''144
 &#
##0#0.)()/(.#,12,!,)).
32%''%(%''1%''1%''%(-.#*-4
31,#'%(,#'1,#'1,#'%(-.#*-44

!!   ""!"#

,#$%)(#0#0.)(,,2 33  43  44 

#0.)(&).,#$%)(#0.)()&),

 "      ! 


 "

,#$%)(#0#0.)(,,2  33   43  44



#0.)(&).,#$%)(#0.)()&),
        

       


                              
               

#011=)*,4146&<('
-&:,3!&1446& <''"4146&'
"4146&   ''

#011=)*,4146&<('
%/0*/&
< -&:,3!&1446& <''"4146&'
"4146&86&  <'''
 <-&:,3!&1446& <''
"4146&'"4146&86&  < '''
< -&++!&1446& <''"4146&'
"4146&86&  < '''
$69,"4146&''

)*,,;843 148&>>>6,203(6,2)<(?>02203(022)<(??
+)8)(?*4146-3('
078,3708= 148&",:,67,&$6)37547,&+)8)''
,7/)17,6)2,)17,
148")3.,>  ?75,*8")8049842)80*
414693*8043*4146-3'
         

  "  !  " "! 


 %

    ! "" #"


##

 !

! "  # "  !  $#

 !

!$!"
4 Newton–Raphson iteration and complex fractals 71

4.6 Ÿ Higher-order simple polynomials


We now consider polynomials of higher degree, but restrict attention to the simple case:

f HzL = zn - 1 = 0 (4.20)

for which the Newton-Raphson mapping is just


1 1
J1 - ÅÅÅÅÅ N z + ÅÅÅÅÅÅÅÅÅn-1
ÅÅÅÅÅÅÅÅÅ (4.21)
n nz
We generalize the maps for the simple cubic to treat these mappings:

GenNewtonCounter = Compile[{{z,_Complex},
{n,_Integer}}, Module[{counter=0, zold=N[z]+1,
znew=N[z], k, m},
If[Abs[znew] < 10^(-9), znew = 10^(-9)+ 0.0*I,
znew=znew]; For[counter = 0,
(Abs[zold-znew] > 10^(-6)) && (counter < 85),
counter++,
(zold = znew;znew = zold*(1-1/n) + 1/(n*zold^(n-1)))];
For[k = 0, (Abs[znew - Exp[2*Pi*I*k/n]] > 0.1) && (k <
n), k++, counter = counter + 85]; counter]];

GenNewtonArray[{{remin_, remax_}, {immin_, immax_}},


steps_, n_] :=
{{{remin, remax}, {immin, immax}},
Table[GenNewtonCounter[x + y I, n],
{y, immin, immax, (immax-immin)/(steps-1)},
{x, remin, remax, (remax-remin)/(steps-1)}]}

GenNewtonPlot[
{{{remin_, remax_}, {immin_, immax_}}, data_}, n_,
colorfunc_] :=
ListDensityPlot[data,
AspectRatio -> (immax-immin)/(remax - remin),
Mesh -> False, Frame -> False,
PlotRange -> {0, 85*n},
ColorFunction -> (colorfunc[n, #]&)]

tr[x_] = Which[x<0,0,x>1,1,True,x];

The colour functions are similar to those defined previously, but we also make one
adapted specially to the degree seven case:
         

)/)520/0.01/)$/&6&%
*$6 /3)$ /6% 0.01$   %%

)/)520/0.01!)4)/$/&6&%
#,-(,$6  
0.01$21$ 6%21$ 6%21$ 6%%
 6   
0.01$21$ 6 %21$ 6 % %
  6  
0.01$ 21$ 6 %21$ 6 %%
 6  
0.01$21$ 6 % 21$ 6 %%
 6   0.01$21$ 6 %  %
 6   0.01$ 21$ 6% %
 6   0.01$  21$ 6%%
"13) 0.01$   %%

+)/1)+-0/)/)520/11'7$88  98  99 %

        


   

)/)520/.02$+)/1)+-0/)/)520/0.01/)%

          

)/)520/.02$+)/1)+-0/)/)520/0.01!)4)/%
         

           


  " " !!"!& !""'!! (
&  ! %  ! ! "!     !   !  
!  &"  !     !     " #!  !!   " !  
 ! !      !!#    "!  &"
#"  &)-)$(-, ! ! "!!!!$&
&" "! &   !"& !! $ "   #  
   & ! $!"!#!"&$   
   

+'!-+$&)- 1$(),$(
$(),1 "!)+'
!/-)()&)+!/-)().(-!+0* )- 22
1$$21$2$"#-$(" &,!
)0!  &,!
0!, &,!!( !+&& &,!&)-)$(-, 
1  2
$!/)$(- 1 2%"+).(  )&)+
74 Complex Analysis with Mathematica

This is a picture of the cubic ‘Cayley planet’ (let's call it ‘Cayley 3’) viewed from below
its South pole. You can explore many fractal planets of this class by suitable modifica-
tions for the code. Here, for example, is a view of a corresponding ‘Cayley 7’ viewed
from above the equator:

ParametricPlot3D[
{Sin[q] Cos[f], Sin[q] Sin[f],Cos[q],
{EdgeForm[],
GenNewtonColorSeven[7, GenNewtonCounter[Exp[I f]
Cot[q/2],7]/595]}},
{q, 0.001, Pi-0.001}, {f, 0, Pi},
Lighting -> False, Boxed -> False,
Axes -> False, RenderAll -> False,
PlotPoints -> {400,800},
ViewPoint -> {0,3,0},Background -> RGBColor[0,0,0]]
4 Newton–Raphson iteration and complex fractals 75

‡ Ÿ Modified code showing the entire planet


In you have problems getting the code giving above to work in your current version of
Mathematica, you might like to try the following alternative form:

ParametricPlot3D[{Sin[q] Cos[f], Sin[q]


Sin[f],Cos[q]},
{q, 0.001, Pi-0.001}, {f, 0, 2 Pi},
ColorFunction -> (NewtonColorRGB[NewtonCounter[Exp[I
#5] Cot[#4/2]]/255]&),
ColorFunctionScaling -> False,
Lighting -> True, Boxed -> False, Mesh -> False,
Axes -> False, RenderAll -> False,
PlotPoints -> {50,100},
ViewPoint -> {0,0,-3}, Background -> RGBColor[0,0,0]]
76 Complex Analysis with Mathematica

ParametricPlot3D[
{Sin[q] Cos[f], Sin[q] Sin[f],Cos[q]},
{q, 0.001, Pi-0.001}, {f, 0, 2 Pi},
ColorFunction -> (GenNewtonColorSeven[7,
GenNewtonCounter[Exp[I #5] Cot[#4/2],7]/595]&),
ColorFunctionScaling -> False,
Lighting -> True, Boxed -> False, Mesh -> False,
Axes -> False, RenderAll -> False,
PlotPoints -> {50,100},
ViewPoint -> {0,3,0},Background -> RGBColor[0,0,0]]

In these examples a lower value of PlotPoints has also been chosen initially in order
to get things working on a slower machine. Also, the polar coordinates q and f run over
their full ranges @0, pD and @0, 2 pD respectively, so that you have the entire fractal planet
to view, for example by changing the viewpoint. The value of q is truncated at the North
and South pole to avoid kernel complaints about singular behaviour. Also see the on-line
supplement and CD.

Exercises
4.1 Ÿ Develop a variant of the Newton–Raphson scheme for cubics that uses Fixed-
Point and a simple coloring scheme (i.e. ignore the convergence time issue, and colour
only according to which root is found.) Note that FixedPoint takes an optional
second argument that gives the maximum number of iterations to be used.

4.2. Ÿ Extend the analysis of Exercise 4.1 to use the length of FixedPointList to
generate a colouring scheme for the cubic Newton–Raphson map based on the Length
function, and that colours the plot also according to convergence time Note that Fixed-
PointList takes an optional further argument that gives the maximum number of
iterations to be used. Compare the efficiency with that of the compiled routines used in
this chapter.

4.3. Show that by the use of a suitable linear transformation a cubic polynomial can be
reduced to one of the form

z3 + Hr - 1L z - r

with a complex parameter r.

4.4. Ÿ Show how the definition of NewNewtonCounter can be generalized to cope


with complex r, and explore the resulting pictures for sample complex values of r.

4.5. Ÿ For the case of real r, construct a routine to produce an animation of Newton-
Plot with r playing the role of a frame counter or time coordinate. Try this out first at
low resolution, and when you are happy with the results, increase the number of plot
points. The interval between r = 0 and r = 2 is particularly interesting. Explore this first
and then zoom in on 0.2 < r < 0.3. By examining the factorization of the cubic, explain
4 Newton–Raphson iteration and complex fractals 77

what is special about the point r = 0.25. What happens to the iteration scheme at this
point, and why?

4.6. (To be considered after reading Chapter 5). Show that if z0 is a zero of the function
f : f Hz0 L = 0, and
f H zL
FHzL = z - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
f £ HzL

then z0 is a stable fixed point of F, in the sense of Chapter 5. You may assume that f HzL
may be written as

f HzL = Hz - z0 Lk gHzL

for some differentiable gHzL with gHz0 L non-zero. (If you know about the properties of
holomorphic functions, you should note that this assumption is guaranteed by the Taylor
series, if f is a holomorphic function.)
5 A complex view of the real logistic map

Introduction
You have already read about how to motivate the introduction of complex numbers by
the need to solve quadratic equations, and have seen how to solve higher order polyno-
mial equations both through ‘pen and paper’ analysis and with the help of Mathematica.
In the previous chapter you looked at Newton–Raphson iteration. This is not the only
way of defining an iterative solution method, and there is another approach called
‘cobwebbing’ which is the subject of this chapter.
You are now in a position to perform a basic investigation of some of the most
fascinating topics in modern mathematics: period doubling and transitions to chaos. This
topic can be introduced by considering simple quadratic or cubic functions. However,
rather than solving a simple quadratic or cubic equation, you are now going to be
concerned with applying a function over and over again, given a starting value. Under
certain circumstances, this has the effect of finding the solutions to the original equation,
but in other situations you will be led to the solutions of other polynomial equations.
Hence the need for a complex view.
There are many good reasons for you to investigate these topics. First, you
should appreciate the emergence of complexity and beauty from the iteration (repeated
application) of a simple quadratic or cubic map. Second, you should appreciate that there
is some value in doing ‘experimental mathematics’. However, here and elsewhere in this
book we shall be concerned with appreciating the special role that complex numbers
play. In particular, you should appreciate that on its own ‘experimental mathematics’ is
not particularly useful – understanding why things happen is considerably more useful
than just seeing what happens. It is not enough to just report the results of feeding
non-linear equations to a computer and plotting the (admittedly fascinating) results. This
is not, at least in itself, mathematics, at least in the view of the author (unless it is in the
context of reporting an entirely new phenomenon), but does raise interesting questions.
It is also, however, sometimes fun, and we shall indulge in this later in this chapter and
elsewhere.
You will be encouraged to use the power of Mathematica to understand, given
the theory of complex numbers, why it is likely that certain real iterated maps should
behave in a certain way. When this has been accomplished, you will be encouraged to do
some numerical experiments to check the theoretical expectations. Later in this book
(Chapter 7) you will see how to generalize these real iterated maps to complex iterated
maps. We begin this chapter by exploring the theory of ‘cobwebbing’ as a method for
finding the roots of equations. Then the logistic and odd logistic maps are introduced,
and the relation to cobwebbing explored. You may wonder why the term ‘cobwebbing’
is used – this will emerge from one visualization of the theory, later on.
5 A complex view of the real logistic map 79

‡ The two tracks through this chapter


Some of the material in this chapter is very detailed and may be difficult to take in on a
first read. You have a couple of choices about how to read this chapter. The first, and
rather uncompromising approach, is to work through in the given order of the sections.
The idea of this is that it is possible to predict a lot of what happens with iterated
mappings by doing some careful analysis. However, this analysis could easily put you
off. A second approach is to read Sections 5.1 and 5.2, and then to skip to Section 5.6
and do the experiments first without having a prediction as to what should happen.
Either way, you should work through the exercises at the end to fully appreciate what is
going on.

5.1 Cobwebbing theory


We are interested in solving equations that can be written in the form

x = f HxL (5.1)

The idea is to try to solve such an equation by iteration. We make a starting guess, say
x0 , and keep applying the function over and over again. So we set

x1 = f Hx0 L
x2 = f Hx1 L
(5.2)
...
xn+1 = f Hxn L

Does this work? Under certain circumstances, it does. Suppose the solution is x, and that
our current iterate is xn . The current error is

en = xn - x (5.3)

The error at the next step is

en+1 = xn+1 - x = f Hxn L - f HxL (5.4)

Suppose that xn is close enough to x that we can approximate this last relation, assuming
differentiability, by a Taylor series expansion:

en+1 = f Hxn L - f HxL = Hxn - xL f £ HxL + OHxn - xL2 (5.5)

So to first order, taking absolute values:

†en+1 § = †en § † f £ HxL§ + OH†en §2 L (5.6)

So the errors can only diminish if the absolute value of the derivative is less than unity at
the solution. We need

» f £ HxL » < 1 (5.7)


80 Complex Analysis with Mathematica

We refer to a solution of Eq. (5.1) satisfying this property as a stable solution; otherwise
it is an unstable solution. You will see some examples of stable and unstable solutions in
the next section. Note that the condition of stability does not guarantee the convergence
for any given starting value, it just says that if we are close enough to neglect higher-
order terms, we will get closer to the solution.

5.2 Ÿ Definition of the quadratic and cubic logistic maps


The logistic maps are mappings parametrized by a variable, l. There is a great deal of
analysis, including work involving Mathematica, on the ordinary quadratic logistic map,
defined by the equation:

OrdLogistic@l_, x_D := l x H1 - xL

This is a quadratic mapping of great interest, because it is the simplest system exhibiting
the phenomena of bifurcations, period doubling and transitions to chaos. It also arises
from some fundamental considerations regarding population dynamics. If you wish to
explore where this map comes from, see Field and Golubitsky (1992) and the original
paper by May (1976). You will be encouraged to investigate this map in the exercises,
using methods identical to those given below for a slightly different map. For several
reasons, this chapter will develop the ideas using an interesting cubic variant of the usual
logistic map, which is the cubic or odd logistic map, given by:

Logistic@l_, x_D := l x H1 - x2 L

We shall just use the term Logistic to refer to this odd mapping, throughout the text
of this chapter. So when we apply this to a variable, x, we obtain:

Logistic@l, xD

x H1 - x2 L l

This has the property that it is an odd function of x, so that it possesses a symmetry. This
leads to an additional feature, that of a symmetry-generating bifurcation, not possessed
by the ordinary mapping. This is an effect that is particularly important when you come
to see how to generalize the logistic maps to complex mappings. Furthermore, the
ordinary logistic map has been analysed in detail by several authors working with
Mathematica, including Gray and Glynn (1991), Wagon (1991) and Maeder (1995). You
might like to consult these references if you get stuck on the exercises, but the exercises
should be straightforward if you follow the corresponding arguments for the odd map.
We shall iterate this map on starting values for x. Our goal is to apply cobwebbing
theory to try to predict what will happen. First you will find the fixed points of the
logistic map, by solving a cubic equation. This is easy, but you can also get Mathemat-
ica to sort it out.
5 A complex view of the real logistic map 81

5.3 Ÿ The logistic map: an analytical approach


Note: this section, and 5.4–5.5, contain rather harder material. You may wish to skip to
Section 5.6 on numerical experiments, having just seen the definition of the logistic
map, and return to this material later. In that case you are strongly encouraged to come
back and review these sections, because they establish the point that complex roots of
polynomial equations becoming both real and stable is crucial to a proper understanding
of the behaviour of the logistic map.
We shall iterate the cubic logistic map on starting values for x. Our goal is to
apply cobwebbing theory to try to predict what will happen. First you find the fixed
points of the logistic map, by solving a cubic equation. This is easy, but you can also get
Mathematica to sort it out:

logsol = x ê. Solve@x == Logistic@l, xD, xD


è!!!!!!!!!! è!!!!!!!!!!!
l-1 l-1
90, - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ è!!!ÅÅÅÅÅÅÅÅ =
è!!!ÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
l l

So there are three easy solutions. Are they stable? We just work out the derivative
mapping and apply it to the solutions:

Dlog@l_, x_D = D@Logistic@l, xD, xD

H1 - x2 L l - 2 x2 l

Expand@Dlog@l, logsolDD

8l, 3 - 2 l, 3 - 2 l<

This tells us what we want to know right away. The first solution, at zero, is stable if |l|
è!!!!!!!!!!!!!!!!!
< 1, while the other solutions, at ± 1 - l-1 , are stable provided 1 < l < 2. So if we
iterate the logistic map on a given starting value, we would expect convergence to zero
è!!!!!!!!!!!!!!!!!
if |l| < 1 and convergence to ± 1 - l-1 if l is larger than unity but less than two.
Given that we shall focus attention on positive l, the question therefore arises as to what
happens when l > 2? We no longer expect to obtain a convergent sequence. But there
might be convergent subsequences. It is important to appreciate that when we iterate a
mapping

x = f HxL (5.8)

we are simultaneously iterating an infinite number of compound mappings. Embedded


within the iterates are the iterates of the mappings

x = f H f HxLL = f2 HxL;
x = f H f H f HxLLL = f3 HxL; (5.9)
x = f H f H f H f HxLLLL = f4 HxL;
82 Complex Analysis with Mathematica

and so on. It is very instructive to look also at the sets of stable solutions of the fixed
point equations

x = fn HxL (5.10)

in the same manner as we have done for f1 , which is just f . This is where we bring the
machinery of complex variables into play, since in general we expect to find solutions of
the resulting high-order polynomial equations as complex numbers. We shall look
carefully at f2 , which can be treated analytically. Then we shall inspect f3 , f4 , and so
on, using Mathematica's numerical root finding functions. Then, when we have an idea
about what we think will happen, it will be time to do some numerical experimentation.
We can use Mathematica's Nest function to treat the compound mappings, as illus-
trated by the case n = 2, first on some general function:

Nest@f, x, 2D
f H f HxLL

Our mapping is a function of two variables, and we want to focus the iteration on the
second variable. To iterate the function on the x-argument, we convert the logistic map
to a pure function involving its second argument, retaining l as a parameter

Logistic2 @l_, x_D := Nest@Logistic@l, #D &, x, 2D

Expand@Logistic 2 @l, xDD

l4 x9 - 3 l4 x7 + 3 l4 x5 - l4 x3 - l2 x3 + l2 x

Let's take a look at the fixed points of this mapping. In spite of the fact that this is a
ninth-order polynomial equation, Mathematica has no difficulty in finding the roots!

logsol2 =
FullSimplify@ x ê. Solve@x == Logistic2 @l, xD , xDD

è!!!!!!!!!!!!
$%%%%%%%%%%%%%%%%
1 - ÅÅÅÅÅÅÅÅ ÅlÅÅÅ%%%%%%
l2 -4
ÅÅÅÅÅÅ
l-1 l-1 1 1
$%%%%%%%% % %%%%
90, - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , $%%%%%%%% % %%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅè!!!
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ,
l l "#########l "#########l 2
ÅÅÅÅ
Å
l+1 ÅÅÅ
Å Å ÅÅÅÅ
Å
l+1 ÅÅÅ
Å Å

è!!!!!!!!!!!!
$%%%%%%%%%%%%%%%%
1 - ÅÅÅÅÅÅÅÅ ÅlÅÅÅ%%%%%%
l2 -4
ÅÅÅÅÅÅ è!!!!!!!! !!!!! è!!!!!!!! !!!!!
l2 - 4 %%%%%% 1 l2 - 4 %%%%%% 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅè!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ%%%%%%%%
ÅÅÅÅ + ÅÅÅÅÅ% , $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ%%%%%%%%
ÅÅÅÅ + ÅÅÅÅÅ % =
2 2l 2 2l 2

This is useful – we can see that the fixed points of this mapping contain those of f , as
they should, but we have found several others also. As before, let us investigate the
stability of these fixed points, by considering the derivative map:
5 A complex view of the real logistic map 83

Dlog2 @l_, x_D = Simplify@D@Logistic 2 @l, xD, xDD

H3 x2 - 1L l2 H3 l2 x6 - 6 l2 x4 + 3 l2 x2 - 1L

Now we apply this map to the zeroes, and plot the results as functions of l

der2 @l_D = Simplify@Dlog2 @l, logsol 2 DD

8l2 , H3 - 2 lL2 , H3 - 2 lL2 , H2 l + 3L2 ,


H2 l + 3L2 , 9 - 2 l2 , 9 - 2 l2 , 9 - 2 l2 , 9 - 2 l2 <

There are only four distinct functions in this list, so we boil the list down to just these
four:

relevant@l_D = Union@der2 @lDD

8H3 - 2 lL2 , l2 , H2 l + 3L2 , 9 - 2 l2 <

We see that for some of the solutions, we obtain stability criteria identical to those
associated with Logistic. Let's plot all four functions together:

Plot@Evaluate@relevant@lDD,
8l, 0, 3<, PlotRange -> 8-5, 5<,
PlotStyle ->
[email protected], 0.01<D<, [email protected]<,
[email protected]<, [email protected]<<D

0.5 1 1.5 2 2.5 3


-2

-4

For positive l, one pair of solutions is ruled out completely – this is the pair of solutions
with derivative H3 + 2 lL2 . Matters are clearer if we force the plot range to be in the
interval -1 to 1, in order to see when the various points are stable:

Plot@Evaluate@relevant@lDD,
8l, 0, 3<, PlotRange -> 8-1, 1<,
PlotStyle ->
[email protected], 0.01<D<, [email protected]<,
[email protected]<, [email protected]<<D
84 Complex Analysis with Mathematica

1
0.75
0.5
0.25

0.5 1 1.5 2 2.5 3


-0.25
-0.5
-0.75
-1
It is then evident that the zeroes of the mapping f2 , which are not fixed points of f , are
stable for l > 2 up to a slightly larger value of l, given by solving for the derivative
being -1. We identify this from the plot as being the last element of the relevant list,
with derivative 9 - 2 l2 :

l ê. Solve@9 - 2 l2 == -1D
è!!! è!!!
9- 5 , 5 =

The larger of these two values, and a numerical approximation, is given by:

8%@@2DD, N@%@@2DD, 20D<


è!!!
9 5 , 2.2360679774997896964=

We can finally nail down the expected behaviour by observing the action of the logistic
map on each of the four fixed points of f2 that are associated with the derivative map
being 9 - 2 l2 . These are the last set of four roots:

setoffour = logsol 2 @@86, 7, 8, 9<DD

è!!!!!!!!!!!! è!!!!!!!!!!!!
$%%%%%%%%%%%%%%%%
1 - ÅÅÅÅÅÅÅÅ l2 -4
ÅÅÅÅÅÅ $%%%%%%%%%%%%%%%%
ÅÅÅÅ%%%%%% 1 - ÅÅÅÅÅÅÅÅ ÅlÅÅÅ%%%%%%
l2 -4
ÅÅÅÅÅÅ è!!!!!!!! !!!!! è!!!!!!!! !!!!!
l l2 - 4%%%%%%%%%%%%%% l2 - 4%%%%%%%%%%%%%%
1 % $%%%%%%%%%%%%%%%% 1
9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅè!!!
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅè!!! $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅ % =
2 2 2 l 2 2 l 2

Apply the logistic map to these four, to obtain (this may take a little while):

mapped = FullSimplify@Logistic@l, setoffourDD


è!!! è!!! è!!! è!!!
2 2 2 2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
è!!!!!!!!
!!!! è!!!!!!!!
!!!! è!!!!!!!!
!!!! è!!!!!!!!
!!!!
l $%%%%%%%%%%%%%%%%
ÅÅÅÅ%%%%%%
l -4
l $%%%%%%%%%%%%%%%%
ÅÅÅÅ%%%%%%
l -4
l $%%%%%%%%
l+ %l%%%%%%% -4 %%
l $%%%%%%%%
l+ %l%%%%%%% -4 %%
2 2 2 2
1 - ÅÅÅÅÅÅÅÅl
ÅÅÅÅÅÅ 1 - ÅÅÅÅÅÅÅÅl
ÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
l
ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
l
ÅÅÅÅÅÅÅÅÅ
5 A complex view of the real logistic map 85

This set is actually just a permutation of the original four. We perform a cyclic permuta-
tion of this second set of four values, effectively swapping the first and third elements,
and the second and fourth. The division of the original list setoffour by the list
mapped, suitably permuted, should give us a list of ones. To see this you need to force
Mathematica to use additional simplification rules:

setoffour ê RotateRight@mapped, 2D ê.
Sqrt@x_D Sqrt@y_D -> Sqrt@x yD

è!!!!!!!!!!!!! è!!!!!!!!
l2 -4
!!!! è!!!!!!!!!!!!! è!!!!!!!!
l2 -4
!!!!
Il + l2 - 4 M I1 - ÅÅÅÅÅÅÅÅ
1 &'''''''''''''''''''''''''''''''' ÅlÅÅÅÅÅÅÅÅÅ M 1 Il + l2 - 4 M I1 - ÅÅÅÅÅÅÅÅ ÅlÅÅÅÅÅÅÅÅÅ M
9 ÅÅÅÅÅ l ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ''''''''''''''''
ÅÅÅÅÅÅÅÅ''''''''
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅ' , ÅÅÅÅÅ l &''''''''''''''''''''''''''''''''
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ''''''''''''''''
ÅÅÅÅÅÅÅÅ''''''''
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅ' ,
2 l 2 l

è!!!!!!!!
2 !!!! è!!!!!!!!
2 !!!! è!!!!!!!!
2 !!!! è!!!!!!!!
2 !!!!
l $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I1 - ÅÅÅÅÅÅÅÅ l -4 l%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅ M I ÅÅÅÅÅÅÅÅ
l 2l
ÅÅÅÅÅÅ + ÅÅÅÅ12%%%%M l $%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ÅÅÅÅ-4 I1 - ÅÅÅÅÅÅÅÅ l -4 l%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅ + ÅÅÅÅ12%%%%M
ÅÅÅÅ-4
ÅÅÅÅÅÅÅÅÅÅ M I ÅÅÅÅÅÅÅÅ
l 2l
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
2 2

Now you are almost there:

PowerExpand@FullSimplify@%DD

81, 1, 1, 1<

So root number 5 gets mapped to root 7, 6 to 8, 7 to 5, and 8 to 6. Roots number 6 and 8


are the positive roots. So the logistic map just swaps the elements of each of the two new
pairs of fixed points. We expect the iterates of the logistic map to settle down to an
oscillation between either the positive or negative pair of fixed points of f2 , provided 2 <
è!!!
l< 5.
Now we take a harder look at f2. In particular, we are interested in the fixed
points, that are the set:

setoffour

è!!!!!!!!!!!! è!!!!!!!!!!!!
$%%%%%%%%%%%%%%%%
1 - ÅÅÅÅÅÅÅÅ l2 -4
ÅÅÅÅÅÅ $%%%%%%%%%%%%%%%%
ÅÅÅÅ%%%%%% 1 - ÅÅÅÅÅÅÅÅ ÅlÅÅÅ%%%%%%
l2 -4
ÅÅÅÅÅÅ è!!!!!!!! !!!!! è!!!!!!!! !!!!!
l l2 - 4 %%%%%% 1 l2 - 4 %%%%%% 1
9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅè!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , - $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅè!!! ÅÅÅÅ + ÅÅÅÅÅ% , $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ%%%%%%%% ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ%%%%%%%%
ÅÅÅÅ + ÅÅÅÅÅ % =
2 2 2 l 2 2 l 2

We can inspect these values for various values of l:

lambdalist =
80.001, 0.9, 1.0, 1.1, 1.9, 2.0, 2.1, 3.0<;
86 Complex Analysis with Mathematica

TableForm@
N@Table@Join@8l<, setoffourD ê. l -> lambdalist@@iDD,
8i, 8<DD, TableSpacing Ø 81, 1<D
0.001 -22.3663 + 22.3551 Â 22.3663 - 22.3551 Â -22.3663 - 22.3551 Â 22.3663 + 22.3551 Â
0.9 -0.897527 + 0.552771 Â 0.897527 - 0.552771 Â -0.897527 - 0.552771 Â 0.897527 + 0.552771 Â
1. -0.866025 + 0.5 Â 0.866025 - 0.5 Â -0.866025 - 0.5 Â 0.866025 + 0.5 Â
1.1 -0.839372 + 0.452267 Â 0.839372 - 0.452267 Â -0.839372 - 0.452267 Â 0.839372 + 0.452267 Â
1.9 -0.71635 + 0.114708 Â 0.71635 - 0.114708 Â -0.71635 - 0.114708 Â 0.71635 + 0.114708 Â
2. -0.707107 0.707107 -0.707107 0.707107
2.1 -0.589529 0.589529 -0.807747 0.807747
3. -0.356822 0.356822 -0.934172 0.934172

You can look at the fixed points of f1 in a similar way:

TableForm@
N@Table@Join@8l<, logsol D ê. l -> lambdalist@@iDD,
8i, 8<D, 3D, TableSpacing Ø 81, 1<D
0.001 0 0. µ 10 -2 - 31.607 Â 0. µ 10-2 + 31.607 Â
0.9 0 0. µ 10 -4 - 0.333333 Â 0. µ 10-4 + 0.333333 Â
1. 0 0. 0.
1.1 0 -0.301511 0.301511
1.9 0 -0.688247 0.688247
2. 0 -0.707107 0.707107
2.1 0 -0.723747 0.723747
3. 0 -0.816497 0.816497

You see that setoffour are complex for l < 2. Two of the roots in logsol are
complex for l < 1. In the case l < 1 the only real solution (it is also stable) is x = 0.
As lambda passes through 1 the root at zero becomes unstable (check the derivative
again). Simultaneously the two complex roots become zero and stable. Then the roots
separate and move along the real axis. Each is stable, so one will be chosen by the
iteration, depending on the starting value of x. (This is an example of a symmetry-break-
ing bifurcation, but more of this later.) This continues as l increases to 2, but the two
roots in logsol become unstable at this point. At this stage the roots of the second
iterate become real and stable, then separate, and move off. We can visualize this very
easily using Mathematica's prgramming and graphics tools. First, we make lists contain-
ing both the roots and the absolute values of the derivative:

values@r_D := 8Abs@der2 @rDD, logsol2 ê. l -> r<

Next we make a colouring scheme. Stable roots are large and blue, unstable ones are
smaller and red:

cfunc@x_D :=
If@x <= 1,
[email protected], RGBColor@0, 0, 1D<,
[email protected], RGBColor@1, 0, 0D<D
5 A complex view of the real logistic map 87

We can now make a table of points coloured appropriately:

pts@r_D :=
Map@Flatten@8cfunc@#@@1DDD, Point@8Re@#@@2DDD,
Im@#@@2DDD<D<D &, Transpose@values@rDDD

plotdata = Table@pts@rD, 8r, 0.1, 2.5, 0.1<D;

We can look at the results in various ways. First you can look at the root loci of all
points:

Show@Graphics@[email protected], plotdata<D,
AspectRatio -> 1,
Frame -> True, FrameTicks -> NoneD

The effect is clearer if you produce a movie, and tidy up a bit (the output is not shown in
the printed text). If you have Mathematica 6 or later replace the Do command by
Manipulate to get real-time control of the movie in the notebook.

Do@frame@kD = Show@Graphics@pts@k ê 10DD,


PlotRange -> 88-2, 2<, 8-2, 2<<,
Frame -> True, FrameTicks -> None,
AspectRatio -> 1D, 8k, 1, 25<D
88 Complex Analysis with Mathematica

If you are using a computer, the above graphic can be animated. Some of the frames of
the film that best communicate what is happening are shown here (this does rely on a Do
function in the code above):

Show@GraphicsArray@
88frame@1D, frame@4D, frame@9D<,
8frame@10D, frame@11D, frame@16D<,
8frame@19D, frame@22D, frame@25D<<DD

We now have a very clear picture of the process. There are various stable and unstable
roots of f1 and f2 . If we focus attention on just the stable roots, we obtain the phenome-
non of bifurcation at the values l = 1 and l = 2.
We see that a bifurcation is simply the process whereby a previously real and
stable root becomes unstable, simultaneously with a pair of previously complex roots
becoming both real and stable.
è!!!
Given that the final quartet of roots becomes unstable at l = 5 , we might
5 A complex view of the real logistic map 89

anticipate a further bifurcation there. At l = 1 we get a pair of roots, each of which is a


stable fixed point of the logistic map. At l = 2 we get two pairs of roots of the second
iterate of the logistic map. The elements within each positive or negative pair are
swapped by a single iteration of the logistic map.

5.4 Ÿ What about n = 3, 4, ...?


Logistic@l_, x_, n_D := Nest@Logistic@l, #D &, x, nD;

Let's take a look at the fixed points of the first of these mappings The output of the
following is suppressed here, try it out for yourself if you have Mathematica running!

logsol3 = x ê. Solve@x == Logistic@l, x, 3D , xD;

Unfortunately we no longer have an analytical picture. But instead you can use
NSolve as follows:

Nlogsol@l_, n_D :=
N@ x ê. Solve@x == Logistic@l, x, nD , xDD

Dlog@l_, x_, n_D := D@Logistic@l, x, nD, xD

Dlog3 @l_, x_D = Expand@D@Logistic@l, x, 3D, xDD

-27 l13 x26 + 225 l13 x24 - 828 l13 x22 + 1764 l13 x20 + 63 l11 x20 -
2394 l13 x18 - 399 l11 x18 + 2142 l13 x16 + 1071 l11 x16 - 1260 l13 x14 -
1575 l11 x14 - 45 l9 x14 + 468 l13 x12 + 1365 l11 x12 + 195 l9 x12 -
99 l13 x10 - 693 l11 x10 - 330 l9 x10 + 9 l13 x8 + 189 l11 x8 + 270 l9 x8 +
9 l7 x8 + 9 l5 x8 - 21 l11 x6 - 105 l9 x6 - 21 l7 x6 - 21 l5 x6 +
15 l9 x4 + 15 l7 x4 + 15 l5 x4 - 3 l7 x2 - 3 l5 x2 - 3 l3 x2 + l3

Let's take a look at these stable fixed points of f3 , by tabulating them. What we shall do,
since we are now dealing with a polynomial equation of degree 27, is to count the
è!!!
number of stable real roots, rather than tabulate them. We start from the value l = 5 ,
just tabulating the number of real roots initially:

TableA8l,
Length@Select@Nlogsol@l, 3D, HHead@#D == RealL &DD<,
è!!!!
9l, 5 , 2.5, 0.02=E
90 Complex Analysis with Mathematica

ij 2.23607 3 y
jj zz
jj 2.25607 3 zzzz
jj z
jj 2.27607
jj 3 zzzz
jj z
jj 2.29607
jj 3 zzzz
jj zz
jj 2.31607 3 zzz
jj zz
jj 2.33607
jj 3 zzz
jj zz
jjj 2.35607 3 zzzz
jj z
jj 2.37607
jj 3 zzzz
z
jj 2.39607
jjj 3 zzzz
jj zz
jj 2.41607 3 zzz
jj zz
jj 2.43607
jj 3 zzzz
jj z
jjj 2.45607 15 zzzz
jj zz
jj 2.47607
jj 15 zzz
j zz
k 2.49607 15 {

Clearly the number of real roots jumps between 2.436 and 2.456. Now you can home in
on this region. At the same time you can restrict attention to the number of real and
stable roots:

Table@8l,
Length@Select@Nlogsol@l, 3D,
HHead@#D == Real && Abs@Dlog3 @l, #DD <= 1L &DD<,
8l, 2.436, 2.456, 0.002<D
0y
jij
2.436
zz
jj 2.438
jj 0 zzzz
jj z
jj 2.44
jj 0 zzzz
z
jj 2.442
jj 0 zzzz
jj z
jj 2.444
jj 0 zzzz
z
jj 2.446
jj 0 zzzz
jj z
jj 2.448
jj 0 zzzz
jj zz
jj 2.45 0 zzz
jj zz
jj 2.452
jj 6 zzzz
jj zz
jj 2.454
jj 6 zzz
j zz
k 2.456 6{

By homing in on where these roots come and go, you can establish that the stability
interval is @2.45044, 2.46083D. So there is a very small region, centred on about the
point x = 2.456, where we obtain stable solutions of x = f3 HxL. So what happens in the
è!!!
gap between l = 5 , and 2.45044? This could be investigated along the same lines as
was done for f3 , but is a little messy, since it involves seeking real stable roots of a
polynomial equation of degree 81! It is time for another approach, but first we summa-
rize our findings so far.
5 A complex view of the real logistic map 91

5.5 Ÿ Summary of our root-finding investigations


We have analysed the fixed points of the first three multiple iterates of the logistic map,
using the criteria of reality and stability. The situation as so far analyzed may be summa-
rized as follows, for l real and positive:

l < 1 : x = 0 is the only stable root of x = f1 HxL;


è!!!!!!!!!!!!!!!!! è!!!!!!!!!!!!!!!!!
1 < l < 2: x = 1 - l-1 and - 1 - l-1 are the only stable roots of x = f1 HxL;
è!!!
2 < l < 5 : no stable roots of x = f1 HxL; two pairs of stable roots of x = f2 HxL;
è!!!
5 < l: no stable roots of x = f1 HxL; no stable roots of x = f2 HxL ;
2.45044 < l < 2.46083 : three stable roots of x = f3 HxL.

Just as in the case of the existence of two stable roots, the trio and quartet of stable roots
are permuted by f1 . This gives us a picture of what happens when we iterate the odd
logistic map. For low positive values of l < 2 we expect to converge to one of the two
roots of x = f1 HxL. When we go above 2 we expect the sequence to settle down to an
è!!!
oscillation between the two stable roots of x = f2 HxL, and then when we hit 5 we
might guess, quite reasonably in fact, that the system will settle down to wander among
some set of four roots of x = f4 HxL. What happens next? We might hypothesize that this
bifurcation process continues, moving to 8, 16, 32 roots in ever smaller intervals. But
then something very odd must happen. By the time we get to 2.45044, just three stable
roots of x = f3 HxL emerge. What happens in between is part of the subject of our experi-
ments, and is the topic that is genuinely hard to predict.

5.6 Ÿ The logistic map : an experimental approach


The experimental approach has been considered by a great many people for the standard
logistic map, including Wagon (1991), Gray and Glynn (1991) and, more recently,
Maeder (1995). Further investigations are left to the exercises. If you have skipped
Sections 5.3 to 5.5 you just need to appreciate that we are now going to explore a very
simple question: what happens when we apply the logistic map over and over again?
The key function is NestList:

? NestList

NestList@f, expr, nD gives a list of


the results of applying f to expr 0 through n times.

In the next few sections you can either just do the experiment or note the analytical
hypothesis (given in italics) and then do the experiment. Experiment three in section 5.9
and subsequent plots will also yield the visual justification for the term ‘cobwebbing’.
92 Complex Analysis with Mathematica

5.7 Ÿ Experiment one: 0 < l < 1


(If you have read Sections 5.3 to 5.5 you will expect that the system will converge to
zero, at least if the starting value is close to zero.) We can now explore the behaviour of
the iterated logistic map directly. Let's consider a starting value of x = 0.5, l = 0.9:

NestList@[email protected], #D &, 0.5, 20D

80.5, 0.3375, 0.269151, 0.224688, 0.19201, 0.166438, 0.145645, 0.1283,


0.113569, 0.100894, 0.08988, 0.0802385, 0.0717497, 0.0642423, 0.0575795,
0.0516497, 0.0463607, 0.041635, 0.0374065, 0.0336188, 0.0302227<

Note that there is no need to converge to zero if the initial value is large!

NestList@[email protected], #D &, 10, 10D

810, -891., 6.36612 µ 108 , -2.32203 µ 1026 ,


1.1268 µ 1079 , -1.2876 µ 10237 , 1.921239079075883 µ 10711 ,
-6.38244006177965 µ 102133 , 2.339929347518819 µ 106401 ,
-1.153056909677763 µ 1019204 , 1.379732001224673 µ 1057612 <

It is very illuminating to develop a plot that shows the convergence. The form of these
plots shows why the term ‘cobwebbing’ is used. We can regard the iteration as moving
between the line y = x and the line y = f HxL. We write a function to draw lines between
these points.

CobWeb@l_, it_D := Module@8iter = Logistic@l, itD<,


Line@88it, it<, 8it, iter<, 8iter, iter<<DD

Plotter@l_, xo_, n_D :=


Plot@Logistic@l, xD, 8x, 0, 1<,
PlotRange -> 80, Max@l ê 2 + 0.01, 0.5D <,
Epilog ->
8Line@880, 0<, 81, 1<<D, Map@HCobWeb@l, #D &L,
NestList@HLogistic@l, #D &L, xo, nDD<D

[email protected], 0.5, 10D


5 A complex view of the real logistic map 93

0.5

0.4

0.3

0.2

0.1

0.2 0.4 0.6 0.8 1

5.8 Ÿ Experiment two: 1 < l < 2


(Based on the analysis of Sections 5.3 to 5.5 we expect that the system will converge to
è!!!!!!!!!!!!!!!
1 - l-1 , at least if the starting value is close to zero.) Let's try a starting value of
x = 0.5, l = 9 ê 5:

NestList@[email protected], #D &, 0.4, 20D

80.4, 0.6048, 0.690434, 0.650349, 0.675507, 0.66108, 0.669907, 0.664685,


0.667842, 0.665957, 0.667091, 0.666412, 0.66682, 0.666575, 0.666722,
0.666634, 0.666686, 0.666655, 0.666674, 0.666662, 0.666669<

[email protected], 0.42, 30D

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1

è!!!
5.9 Ÿ Experiment three: 2 < l < 5
(Sections 5.3. to 5.5 suggests that the system will contain a pair of convergent subse-
quences, that is, the system will settle down to oscillating between two values. Let's look
at a starting value of 0.5, l = 2.1, so we expect to converge to the fixed points of f2 that
are not fixed points of f1 . The fixed points of the latter are given by:
94 Complex Analysis with Mathematica

[email protected], 1D

8-0.723747, 0., 0.723747<

So we inspect

[email protected], 2D

8-1.21499, -0.807747, -0.723747,


-0.589529, 0., 0.589529, 0.723747, 0.807747, 1.21499<

Map@Dlog 2 @2.1, #D & , %D

851.84, 0.18, 1.44, 0.18, 4.41, 0.18, 1.44, 0.18, 51.84<

to predict that the system will settle down to an oscillation between 0.589529 and
0.807747.)

Here begins the experiment, where we take a value of l = 2.1:

NestList@[email protected], #D &, 0.1, 50D

80.1, 0.2079, 0.41772, 0.724147, 0.723266, 0.724323, 0.723054,


0.724576, 0.722749, 0.724939, 0.722309, 0.725462, 0.721675,
0.726214, 0.720759, 0.727292, 0.719435, 0.728836, 0.717521,
0.731042, 0.71475, 0.734176, 0.710734, 0.738595, 0.704917, 0.74474,
0.696526, 0.753075, 0.684578, 0.763881, 0.668106, 0.776761,
0.647002, 0.789935, 0.623737, 0.800254, 0.604308, 0.805606,
0.593811, 0.807295, 0.590436, 0.807663, 0.589699, 0.807732,
0.58956, 0.807744, 0.589535, 0.807747, 0.58953, 0.807747, 0.589529<

[email protected], 0.1, 100D

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1


5 A complex view of the real logistic map 95

5.10 Ÿ Experiment four: 2.45044 < l < 2.46083


(Sections 5.3 to 5.5 suggests that the system will contain three convergent subsequences.
Let us test this irst with a starting value o = 0.5, l = 2.46, so we expect to converge
to the fixed points of f3 that are not fixed points of f1 . The fixed points of the latter are
given by:

[email protected], 1D

8-0.770387, 0., 0.770387<

So we inspect the fixed points of the former that are real and stable:

Select@[email protected], 3D,
HHead@#D == Real && Abs@Dlog3 @2.46, #DD < 1 &LD

8-0.946145, -0.564397, -0.243947, 0.243947, 0.564397, 0.946145<

to predict that the system will settle down to an osccilation between 0.243947, 0.946145,
0.564397.)

Here is our experiment:

NestList@[email protected], #D &, 0.17, 50D

80.17, 0.406114, 0.83427, 0.623887, 0.937379, 0.27976, 0.634346,


0.932558, 0.299003, 0.669787, 0.908504, 0.390262, 0.813826,
0.676055, 0.902977, 0.410127, 0.839209, 0.610516, 0.942078,
0.260695, 0.597725, 0.945065, 0.248417, 0.573394, 0.946788,
0.241277, 0.55899, 0.945433, 0.246894, 0.570336, 0.946646, 0.241868,
0.560189, 0.945612, 0.246154, 0.568849, 0.946548, 0.242274,
0.561011, 0.945728, 0.245675, 0.567885, 0.946475, 0.242578,
0.561627, 0.945811, 0.245332, 0.567192, 0.946417, 0.242817, 0.56211<

It is taking its time. Let's iterate 1000 times and extract the last three:

Take@NestList@[email protected], #D &, 0.17, 1000D, -3D

80.564397, 0.946145, 0.243947<

[email protected], 0.17, 100D


96 Complex Analysis with Mathematica

1.2
1
0.8
0.6
0.4
0.2

0.2 0.4 0.6 0.8 1

è!!! è!!!
5.11 Ÿ Experiment five: 5 <l< 5 +e
(Sections 5.3 to 5.5 suggests that the system will contain four convergent subsequences.)
Looking at the last eight elements after 1000 iterations appears to confirm this:
è!!!!
TakeANestListALogisticA 5 + 0.001, #E &, 0.17, 1000E, -8E

80.846929, 0.535636, 0.854468, 0.515885,


0.846929, 0.535636, 0.854468, 0.515885<

è!!!!
PlotterA 5 + 0.001, 0.17, 100E;

1
0.8
0.6
0.4
0.2

0.2 0.4 0.6 0.8 1

è!!!
5.12 Ÿ Experiment six: 5 <l
We need to go fully numerical now:

Sqrt@5D êê N
2.23607
5 A complex view of the real logistic map 97

Take@NestList@[email protected], #D &, 0.17, 1000D, -10D

80.82749, 0.59662, 0.878779, 0.457718, 0.82749,


0.59662, 0.878779, 0.457718, 0.82749, 0.59662<

Take@NestList@[email protected], #D &, 0.17, 1000D, -10D

80.827218, 0.597537, 0.879018, 0.457199, 0.82741,


0.597073, 0.879092, 0.456975, 0.827218, 0.597536<

[email protected], 0.17, 100D

1
0.8
0.6
0.4
0.2

0.2 0.4 0.6 0.8 1


Let's keep increasing l:

[email protected], 0.17, 100D

1
0.8
0.6
0.4
0.2

0.2 0.4 0.6 0.8 1


[email protected], 0.1, 100D
98 Complex Analysis with Mathematica

1.2
1
0.8
0.6
0.4
0.2

0.2 0.4 0.6 0.8 1


We can no longer see what is happening. A new way of proceeding is just to plot the
points that arise after many iterations. We call this the bifurcation diagram.

5.13 Ÿ Bifurcation diagrams


Now we build some functions that extract the final 128 points after 1000 iterations, and
plot them against l:

scatter@l_D :=
Map@Point@8l, #<D &,
Take@NestList@Logistic@l, #D &, 0.1, 1000D, -128DD

bifurpoints@min_, max_, n_D := [email protected],


Table@scatter@lD, 8l, min, max, Hmax - minL ê n<D<;

Show@Graphics@[email protected], 3, 200D, Frame -> TrueDD

0.5

-0.5

-1

1.6 1.8 2 2.2 2.4 2.6 2.8 3


This plot illustrates the behaviour in the region we have been unable to analyse. The
doubling continues for a while. This cannot continue indefinitely, as we know a new
pattern must emerge to generate the triple of stable fixed points. The doubling continues
5 A complex view of the real logistic map 99

for a while and then a transition to chaotic behaviour is made. The double and transition
to chaos reasserts itself in the triple fixed point region. We see this next.

‡ Bifurcation diagram for triple root region


Show@Graphics@
[email protected], 2.47, 200D, Frame -> TrueDD

0.9
0.8
0.7
0.6
0.5
0.4
0.3

2.45 2.455 2.46 2.465 2.47

‡ Bifurcation diagram for first transition to chaos


You can see the appearance of 2, 4, 8 and (just) 16 points if you zoom in on the relevant
region:

Show@
Graphics@[email protected], 2.32, 200D, Frame -> TrueDD

0.9

0.8

0.7

0.6

0.5

2.24 2.26 2.28 2.3 2.32


100 Complex Analysis with Mathematica

5.14 Ÿ Symmetry-related bifurcations


If we zoom out and look at our bifurcation diagams in the large, we can see some other
features related to the symmetry inherent in the odd logistic map. We can identify both
symmetry-breaking and symmetry-generating bifurcations. Suppose that 0 < l < 1, then
the sequences converge to zero – this is a point of symmetry of the mapping. When l
passes through unity, the sequence converges to a positive value, provided a positive
initial value is chosen. This breaks the symmetry. If a negative initial value is chosen
(see the final plot below) the sequence converges to a negative value, again breaking the
symmetry. There then follow a series of bifurcations with no consequences for the
symmetry, until a certain critical value of l = lc , where the plot overflows into negative
values, becoming, once again, symmetric. The same happens with the plot with a
negative starting value. This is a symmetry-generating bifurcation.

‡ Bifurcation diagram for symmetry-generating bifurcations


Show@Graphics@bifurpoints@0, 3, 200D, Frame -> TrueDD

0.5

-0.5

-1

0 0.5 1 1.5 2 2.5 3

scatter@l_D :=
Map@Point@8l, #<D &,
Take@NestList@Logistic@l, #D &, -0.1, 1000D, -128DD

Show@Graphics@bifurpoints@0, 3, 200D, Frame -> TrueDD


5 A complex view of the real logistic map 101

0.5

-0.5

-1

0 0.5 1 1.5 2 2.5 3

‡ Location of the critical point


The value of lc is easily deduced. The final values of the iteration spill over zero when
zero lies in the image of the map, when applied to positive values of x. Recall now the
form of the map:

Logistic@l, xD

x H1 - x2 L l

This can only become zero, for positive x, for x = 1. (Note how the bifurcation plot
spreads out to zero and one at the same time.) So now we argue that unity has to lie in
the image of the logistic map for real positive x. When is this possible? Let's find out:

preimages@l_D = x ê. Solve@Logistic@l, xD == 1, xD

"#####
3 2
ÅÅÅÅ3 l "################################
3 è!!! è!!!!!!!!!!!!!!!! ################
!!!!!!!!##
9 l2 + 3 27 l4 - 4 l6
9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ ,
"################################
3 è!!! è!!!!!!!!!!!!!!!! ################
!!!!!!!!## 3
2 32ê3 l
9 l2 + 3 27 l4 - 4 l6

è!!! è!!! "################################


3 è!!! è!!!!!!!!!!!!!!!! ################
!!!!!!!!##
I1 + Â 3 M l I1 - Â 3 M 9 l2 + 3 27 l4 - 4 l6
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ ,
è!!!
3 "################################
3 è!!! è!!!!!!!!!!!!!!!! ################
!!!!!!!!## 3
2 2 32ê3 l
22ê3 3 9 l2 + 3 27 l4 - 4 l6

è!!! è!!! "################################


3 è!!! è!!!!!!!!!!!!!!!! ################
!!!!!!!!##
I1 - Â 3 M l I1 + Â 3 M 9 l2 + 3 27 l4 - 4 l6
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
è!!!
3 "################################
3 è!!! è!!!!!!!!!!!!!!!! ################
!!!!!!!!## 3
2 2 32ê3 l
22ê3 3 9 l2 + 3 27 l4 - 4 l6

Evidently the form of preimages is influenced by the factor 27l4 - 4l6 , which is zero
è!!!
when l = 3 3 ë 2 . This is indeed the critical value. Let's look at what happens to the
preimages in a neighbourhood of this value:
102 Complex Analysis with Mathematica

N@3 Sqrt@3D ê 2D

2.59808

[email protected]

8-1.1551, 0.57755 - 0.0263199 Â, 0.57755 + 0.0263199 Â<

ComplexExpand@preimages@3 Sqrt@3D ê 2DD


2 1 1
9- ÅÅÅÅÅÅÅÅ è!!!ÅÅÅÅÅ =
è!!!ÅÅÅÅÅ , ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ , ÅÅÅÅÅÅÅÅ
3 3 3

N@%D

8-1.1547, 0.57735, 0.57735<

N@ComplexExpand@preimages@26 ê 10DDD

8-1.15461, 0.590126, 0.564479<

So for values of l just less than this critical value, there are no preimages with positive
real part that are real, whereas on or above this value there are such points. So the
mapping attains the value unity, and hence, on iteration, the value 0, when
è!!!
l = l c = 3 3 ë 2.

5.15 Remarks
Note how much of the behaviour of this system can be extracted merely by looking at
the behaviour of certain associated low-order polynomials, and whether their roots are
real, complex and stable. Such an analysis allows us to predict the phenomenon of
bifurcations, and to appreciate when such a bifurcation is symmetry-generating. We can
also make predictions about the outcomes of numerical experiments, confirm our
predictions and go on to investigate the transition to chaos.
A detailed examination of the transition to chaos takes us outside the scope of
the complex analytical point of view. With enough computer power we could look at
several of the higher order polynomials responsible for the continuation of the bifurca-
tion process, but it becomes more efficient to pursue an essentially numerical approach.
This can also be done with Mathematica, and has been discussed in the Mathematica
Journal by R. Maeder (1995). You are encouraged to consult this article for further
information, particularly regarding the computation of the ‘Feigenbaum number’
governing the locations of the values of l at which bifurcations occur.
5 A complex view of the real logistic map 103

Exercises
In the following exercises your goal is to explore the behaviour of the standard quadratic
logistic function

x Ø lxH1 - xL (5.11)

using methods identical to those used in the text for the corresponding cubic map.
Everything, apart from the symmetry-breaking/generating bifurcation should go through
in a very similar fashion. To get you started, the first two exercises give very explicit
guidance. After that, it is up to you to adapt the material in the text to treat the quadratic
case.

5.1 Ÿ Define the ordinary (quadratic) logistic map by the Mathematica function

Logistic@l_, x_D := l x H1 - xL

(In this and all the other exercises, Logistic now refers to this standard quadratic
mapping.) Find the set of fixed points of this mapping, and identify them with the
Mathematica list logsol. Construct a suitable derivative mapping Dlog and show that
the positive fixed point is zero provided 1 < l < 3.

5.2 Ÿ Construct the first compound mapping f2

Logistic2 @l_, x_D := Nest@Logistic@l, #D &, x, 2D

and find the fixed points of this mapping using

logsol2 = x ê. Solve@x == Logistic2 @l, xD , xD

Next, work out

Dlog2 @l_, x_D = D@Logistic 2 @l, xD, xD

and

der2 @l_D = Simplify@Dlog2 @l, logsol 2 DD

Hence, using plotting techniques similar to that used for the odd logistic map, show that
the fixed points of the first compound mapping f2 (that are not fixed points of the
è!!!
logistic map) are stable provided 3 < l < 1 + 6 . What does the original logistic map
do to the pair of stable fixed points that arise in this interval?

5.3 Ÿ Construct visualizations of the first bifurcation of the logistic map, in the Argand
plane, using methods similar to those employed for the odd logistic map.

5.4 Ÿ Show that, for the approximate interval 3.8284 < l < 3.8415, there are three
stable roots of the thrice-iterated logistic map.
104 Complex Analysis with Mathematica

5.5 Ÿ Show, by some numerical investigations on the fourth-iterated mapping, that


there are four real and stable fixed points of this mapping in the approximate interval
è!!!
1 + 6 < l < 3.55409.

5.6 Ÿ Show that there are no stable real roots of any of the first four iterated mappings
in the approximate interval 3.55409 < l < 3.8284.

5.7 Ÿ Construct bifurcation plots for the quadratic logistic map.

5.8 Ÿ Using the bifurcation plot, zoom in on the doubling region and see how many
doublings you can identify.

5.9 Ÿ Using the bifurcation plot, zoom in on the triple fixed point region and see how
the doubling and transition to chaos reasserts itself.

5.10 ‘I would therefore urge that people be introduced to, say, equation (5.11) early in
their mathematical education. This equation can be studied phenomenologically by
iterating it on a calculator, or even by hand. Its study does not involve as much concep-
tual sophistication as does elementary calculus. Such study would greatly enrich the
student's intuition about nonlinear systems.’ This is a quote (verbatim apart from the
equation reference) from the conclusion of Sir Robert May's original paper (May, 1976)
on the logistic map. Discuss whether you agree with May's view.
6 The Mandelbrot set

Introduction
In Chapter 5 we looked at the logistic map given by the equation

LogisticHx, lL = lxH1 - xk L

for values of k = 1, 2. Although this is a real mapping, considerable insight was gained
into its behaviour by allowing x to be complex and investigating fixed points of the
iterated logistic map. We will now consider the first of two approaches to complexifying
this map, by allowing both x and l to be complex. In the first case we shall consider
k = 1, but consider a general complex quadratic map. In the second case we shall
investigate complex generalizations of the k = 2 case that possess various degrees of
symmetry. We defer this until Chapter 7.
As in Chapter 5, there are two routes you can take through this chapter. If you
really want to understand what is happening, you are encourage to read through in order.
If you just want to see how to use Mathematica to make pictures of the Mandelbrot set
and zoom in to interesting regions, then feel free to skip to Section 6.4.
The author is grateful to Professor Sir Roger Penrose, F.R.S., for encouraging
me to think about the issues involved in computing the Mandelbrot set, within a purist
black and white representation. A brief sketch of the issues involved is given in Section
6.7.

6.1 Ÿ From the logistic map to the Mandelbrot map


Consider first a general quadratic map, for x complex:

quad@x_D := a2 x ^ 2 + a1 x + a0

Superficially it looks like we have a three-parameter family of mappings. In fact there is


only one parameter, since we can make a change of variables to relate all quadratic
mappings to a single simpler family. To see this, let

z@x_D := a2 x + a1 ê 2

sqd = Expand@z@xD ^ 2D

a2
ÅÅÅÅÅ1ÅÅÅÅ + x a2 a1 + x2 a22
4

c = Simplify@z@quad@xDD - sqdD

a2 a1
- ÅÅÅÅÅ1ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + a0 a2
4 2
106 Complex Analysis with Mathematica

So we can write

z@quad@xDD = z@xD ^ 2 + c;

Working in the z-coordinates, we can use

quadc@z_D := z ^ 2 + c

It suffices to consider variations only in the parameter c, to get genuinely different


mappings. This family of maps are called the Mandelbrot maps. All the other quadratic
mappings are obtained from these by a linear transformation. Note that c is easily related
to the l parameter of the quadratic logistic map:

c ê. 8a0 -> 0, a1 -> l, a2 -> -l<

l l2
ÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ
2 4
We can therefore repeat our investigations of the logistic map in these new coordinates,
characterizing the bifurcation behaviour in terms of values of c. We shall not do this in
any detail, but will just check that the iterated map bifurcates where it should. First we
standardize our function name:

Remove@cD;
Quad@z_, c_D := z ^ 2 + c

Quad@z, cD

z2 + c

Then we find the fixed points of Quad itself:

fixeda = z ê. Solve@Quad@z, cD == z, zD
1 è!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!
9 ÅÅÅÅÅ I1 - 1 - 4 c M, ÅÅÅÅÅ I 1 - 4 c + 1M=
2 2
Therefore Quad has a pair of real fixed points provided c < 1 ê 4. What about stability?
The derivative of Quad is just 2 z:

Map@2 # &, fixedaD


è!!!!!!!!!!!!!! è!!!!!!!!!!!!!!
91 - 1 - 4 c , 1 - 4 c + 1=

Clearly the second is excluded for real solutions, and the first works provided
c > -3 ê 4. We expect the fixed points of the first iterated map to become real here, and
they do:
6 The Mandelbrot set 107

fixedb = z ê. Solve@Nest@Quad@#, cD &, z, 2D == z, zD


1 è!!!!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!!!!
9 ÅÅÅÅÅ I- -4 c - 3 - 1M, ÅÅÅÅÅ I -4 c - 3 - 1M,
2 2
1 è!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!
ÅÅÅÅÅ I1 - 1 - 4 c M, ÅÅÅÅÅ I 1 - 4 c + 1M=
2 2
It is an easy matter to check that the first bifurcation appears where it should. Let's take a
starting value of zero for z. We iterate 100 times and then inspect the next four values:

start = Nest@Quad@#, 0.2D &, 0, 100D

0.276393

NestList@Quad@#, 0.2D &, start, 4D

80.276393, 0.276393, 0.276393, 0.276393, 0.276393<

start = Nest@Quad@#, -0.8D &, 0, 100D

-0.276392

NestList@Quad@#, -0.8D &, start, 4D

8-0.276392, -0.723607, -0.276392, -0.723607, -0.276393<

This would lead us down the same path as already described in Chapter 5, so we shall
pursue this particular route no further. But we do ask: what happens if c > 1 ê 4?

NestList@Quad@#, 0.3D &, 0, 20D

80, 0.3, 0.39, 0.4521, 0.504394, 0.554414, 0.607375, 0.668904, 0.747432,


0.858655, 1.03729, 1.37597, 2.19329, 5.11051, 26.4173, 698.175,
487448., 2.37606 µ 1011 , 5.64565 µ 1022 , 3.18734 µ 1045 , 1.01591 µ 1091 <

Clearly rapid progress to infinity is obtained. For large enough » c » we would expect to
see this type of behaviour. But we also know that for small c the system can converge to
a limit, or bounce around periodically or chaotically.

6.2 Ÿ Stable fixed points: complex regions


Recall that the fixed points and their stability are given by looking at the derivative map
applied to the fixed points of the basic map. We rewrite this in a form that allows a
simple generalization to higher iterates:

fixeda = z ê. Solve@Nest@Quad@#, cD &, z, 1D == z, zD


1 è!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!
9 ÅÅÅÅÅ I1 - 1 - 4 c M, ÅÅÅÅÅ I 1 - 4 c + 1M=
2 2
108 Complex Analysis with Mathematica

dmap@z_, c_D = D@Nest@Quad@#, cD &, z, 1D, zD

2z

derivs = Expand@Map@dmap@#, cD &, fixedaDD


è!!!!!!!!!!!!!! è!!!!!!!!!!!!!!
91 - 1 - 4 c , 1 - 4 c + 1=

What we want to do is to characterize the regions where the derivative is less than one in
magnitude. To do this we parametrize the derivative:

c ê. Solve@derivs@@1DD == m, cD@@1DD
1
ÅÅÅÅÅ H2 m - m2 L
4
So the stability region is given parametrically by

1
cstable@m_D := ÅÅÅÅ H2 m - m2 L
4
for |m| < 1. Let's plot this region:

stableregion = ParametricPlot@
Evaluate@Table@8Re@cstable@r Exp@I qDDD,
Im@cstable@r Exp@I qDDD<, 8r, 0, 1, 0.2<DD,
8q, 0, 2 Pi<, AspectRatio -> 1,
PlotStyle -> Hue@6 ê 7D, PlotRange Ø AllD

0.6

0.4

0.2

-0.6-0.4-0.2 0.2 0.4


-0.2

-0.4

-0.6

‡ Stable regions for the once-iterated map


We can do the analysis for the basic mapping again for the first iterate:
6 The Mandelbrot set 109

fixedb = z ê. Solve@Nest@Quad@#, cD &, z, 2D == z, zD


1 è!!!!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!!!!
9 ÅÅÅÅÅ I- -4 c - 3 - 1M, ÅÅÅÅÅ I -4 c - 3 - 1M,
2 2
1 è!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!
ÅÅÅÅÅ I1 - 1 - 4 c M, ÅÅÅÅÅ I 1 - 4 c + 1M=
2 2
Let's take out the fixed points of the basic map:

fixedbonly = Complement@fixedb, fixedaD


1 è!!!!!!!!!!!!!!!!! 1 è!!!!!!!!!!!!!!!!!
9 ÅÅÅÅÅ I- -4 c - 3 - 1M, ÅÅÅÅÅ I -4 c - 3 - 1M=
2 2
Now we construct the derivative of the iterated map and apply it to the fixed points:

dmap2 @z_, c_D = D@Nest@Quad@#, cD &, z, 2D, zD

4 z Hz2 + cL

derivsb = Expand@Map@dmap2 @#, cD &, fixedbonlyDD

84 c + 4, 4 c + 4<

The result is remarkably simple, and it is easy to parametrize the derivative map:

c ê. Solve@derivsb@@1DD == m, cD@@1DD
m-4
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
4
So the stability region is given parametrically by

cstableb@m_D := Hm - 4L ê 4

for |m| < 1. Let's plot this region – it's obviously a circle!

stableregionb = ParametricPlot@
Evaluate@Table@8Re@cstableb@r Exp@I qDDD,
Im@cstableb@r Exp@I qDDD<, 8r, 0, 1, 0.2<DD,
8q, 0, 2 Pi<, AspectRatio -> 1, PlotStyle -> Hue@5 ê 7DD
110 Complex Analysis with Mathematica

0.2

0.1

-1.2 -1.1 -0.9 -0.8

-0.1

-0.2

Unfortunately the higher order-iterates do not have an simple analytic solution allowing
us to parametrize the stable regions in this way, so we take this route no further. But we
can do something else to find out what this map is doing!

6.3 Ÿ Periodic orbits


We shall now look for values of c that generate periodic orbits. First we seek those
containing the origin. What we do is to solve the resulting polynomial equations, using
numerical methods when the degree is high.

fixed@n_D :=
c ê. Solve@Nest@Quad@#, cD &, 0, nD == 0, cD;
Nfixed@n_D :=
c ê. NSolve@Nest@Quad@#, cD &, 0, nD == 0, cD;

one = fixed@1D;
none = N@oneD
80.<

two = fixed@2D

8-1, 0<

Now one of these points is the fixed point (zero) for n = 1, so we pull this out to leave
the fixed point of the iterated map that is not a fixed point of the map itself:

twoonly = Complement@two, oneD;


ntwo = N@twoonlyD
8-1.<

What about the fixed points of the map iterated twice?


6 The Mandelbrot set 111

three = fixed@3D;

We remove the fixed point already found:

threeonly = Complement@three, oneD

1 jij 2 1 è!!!!! ! zyzz


9 ÅÅÅÅÅ jj-2 - $%%%%%%%%%%%%%%%%
3 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅ%Å% - $%%%%%%%%%%%%%%%%
ÅÅÅÅÅÅÅÅ
%%%%%%%% ÅÅÅÅÅ I25 -%%%%%%%%
3 %69%%%%%%%%
M zz,
jj è!!!!!!
3
3 25 - 3 69 2 z
k {
è!!!
2 1 è!!! $%%%%%%%%%%%%%%%%
1 è!!!!! ! 1-Â 3
%%%%%%%%
% %%%%%%%%
- ÅÅÅÅÅ + ÅÅÅÅÅ I1 + Â 3 M ÅÅÅÅÅ I25 - 3 69 M + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
3 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ,
3 6 2 "################
3 ########!
è!!!!!
3 22ê3 25 - 3 69
è!!!
2 1 è!!! $%%%%%%%%%%%%%%%%
1 è!!!!! ! 1+Â 3
%%%%%%%%
% %%%%%%%%
- ÅÅÅÅÅ + ÅÅÅÅÅ I1 - Â 3 M ÅÅÅÅÅ I25 - 3 69 M + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
3 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
3 6 2 "################
3 ########!
è!!!!!
3 22ê3 25 - 3 69

and extract the numerical values:

nthree = N@threeonlyD

8-1.75488, -0.122561 - 0.744862 Â, -0.122561 + 0.744862 Â<

We can now proceed semi-automatically: n = 4 gets new fixed points, and we delete
those already found. Note how the symbolic power of Mathematica allows us to take out
the elements already found without a messy numerical comparison:

four = fixed@4D;
fouronly = Complement@four, one, twoD;
nfour = N@fouronlyD

8-1.9408, -1.3107, -0.15652 - 1.03225 Â,


-0.15652 + 1.03225 Â, 0.282271 - 0.530061 Â, 0.282271 + 0.530061 Â<

five = fixed@5D;
fiveonly = Complement@five, oneD;
nfive = N@fiveonlyD;

six = fixed@6D;
sixonly = Complement@six, one, two, threeD;
nsix = N@sixonlyD;

seven = fixed@7D;
sevenonly = Complement@seven, oneD;
nseven = N@sevenonlyD;

We shall stop here as higher orders strain the computer somewhat!


112 Complex Analysis with Mathematica

data =
8none, ntwo, nthree, nfour, nfive, nsix, nseven<;

Map@Length, dataD

81, 1, 3, 6, 15, 27, 63<

We shall plot the various periodic cycles coloured according to the period. To this end
we attach the periodicity as a list:

aux = Range@1, 7D

81, 2, 3, 4, 5, 6, 7<

plotinfo = Transpose@8aux, data<D;

realplotdata =
Map@8Hue@1 - #@@1DD ê 7D, [email protected],
Map@ Point@8Re@#D, Im@#D<D &, #@@2DDD< &, plotinfoD;

plota = Show@Graphics@realplotdataDD

This graphic will probably start to remind you of some familiar pictures.

‡ The origin as a pre-periodic point


We can also locate the first view values of c where the origin ends up in a periodic orbit
after a few iterations. This is a simple generalization of our map fixed to two variables:

fixed@n_, k_D := c ê. Solve@


Nest@Quad@#, cD &, 0, nD ==
Nest@Quad@#, cD &, 0, n - kD, cD;
Nfixed@n_, k_D := c ê. NSolve@
Nest@Quad@#, cD &, 0, nD ==
Nest@Quad@#, cD &, 0, n - kD, cD;
6 The Mandelbrot set 113

Let's look at the first few values of c so obtained – in each case we delete fixed points
already found:

threeone = fixed@3, 1D;


threeoneonly = Complement@threeone, oneD;
nthreeoneonly = N@threeoneonlyD

8-2.<

fourone = fixed@4, 1D;


fouroneonly = Complement@fourone, one, threeoneonlyD;
nfouroneonly = N@fouroneonlyD
8-1.54369, -0.228155 + 1.11514 Â, -0.228155 - 1.11514 Â<

fourtwo = fixed@4, 2D;


fourtwoonly =
Complement@fourtwo, one, two, threeoneonlyD;
nfourtwoonly = N@fourtwoonlyD

80. - 1. Â, 0. + 1. Â<

If we plot these, we obtain the first few Misiurewicz points – here we colour them black:

datab =
Flatten@8nthreeoneonly, nfouroneonly, nfourtwoonly<D;
plotdatab = [email protected], Map@
Point@8Re@#D, Im@#D<D &, databD<;
plotb = Show@Graphics@plotdatabD,
PlotRegion -> 880.05, 0.95<, 80.05, 0.95<<D

Now we overlay this with our first plot of periodic orbits containing the origin, AND the
plot of the stable regions:

Show@plota, plotb, stableregion, stableregionb,


PlotRegion -> 880.05, 0.95<, 80.05, 0.95<<,
AspectRatio -> 1,
PlotRange -> 88-2, 1 ê 2<, 8-5 ê 4, 5 ê 4<<D
114 Complex Analysis with Mathematica

What we have done is a partial characterization of the Mandelbrot set in terms of


stable regions and periodic orbits. We have carried out our analysis using only root-find-
ing algorithms and stability analyses based on the derivatives of certain polynomial
maps. However, we have stretched the symbolic approach significantly to get this
information. We wish to characterize this set in more detail – at the same time it would
be interesting to characterize the behaviour of the exterior region. Clearly the point at
infinity is a stable attractor for this system – we now turn to a numerical approach based
on the ‘escape-time algorithm’ to investigate further.

6.4 Ÿ Escape-time algorithm for the Mandelbrot set


The idea is to compute how rapidly the iterates of the Mandelbrot map move to infinity.
What one does is to define a large circle (in the following it will be of radius 100,
centred on the origin), and count how many iterations it takes, for a given starting value
of z and a value of c, for the iterated map to get outside this circle. That is all there is to
it!
Well, not quite! This caveat is related to the point that we have not yet defined
6 The Mandelbrot set 115

what ‘the Mandelbrot set’ is. It is the set of values of c for which the iterated map never
reaches infinity. In our initial investigations below we will not dwell on this too much,
but you should appreciate that the nicely coloured illustrations you will develop here,
and that feature in many of the books on the matter, are representations of the escape
time, usually through some colouring scheme. While they give an indication of the shape
of the Mandelbrot set itself, they often give a rather distorted picture. It is actually rather
difficult to draw the pure Mandelbrot set with a computer, and one should also appreci-
ate that a proper picture of it would really just be black and white (or indeed any two
different colours), where black would denote points in the set and white those that are
not. This will be discussed in more detail in Section 6.7.
It is actually quite straightforward to implement the escape-time algorithm, but it
raises some interesting programming issues. We will use the following discussion not
only to illuminate the detailed structure of the Mandelbrot set, but also to show how to
use Mathematica in various different ways. If you follow the coding issues carefully,
you will be in a much better position to understand how to use Mathematica to do other
types of simulation. We shall use Mathematica in three different ways to solve the
problem, based on:

(a) simple interpreted Mathematica;


(b) compiled Mathematica;
(c) use of MathLink with a C-program add-in.

Most of the time we use Mathematica in interpreted mode. Here we shall see
how to compile a numerical operation for efficient evaluation. We shall also show how a
C program can be written to be added in to Mathematica, and look at some of the details
of how Mathematica renders graphics in order to optimize our C further. It should be
noted, however, that most of the benefit comes from just using the Mathematica com-
piler – it is virtually no effort to take a well-written Mathematica expression and com-
pile it, whereas the creation of a separate C program and its linking to Mathematica
requires some effort.
The following discussion follows a similar logic (interpreted, compiled, Math-
Link) to that developed by the author and J. Tigg in Applied Mathematica (Shaw and
Tigg, 1993). However, the following code contains a number of improvements, in that
variables are treated as essentially complex, and the final MathLink version is much
more efficient. In one implementation we have borrowed and extended some interesting
ideas from Tom Wickham Jones' excellent book, (Wickham Jomes, 1994) ‘Mathematica
Graphics, Techniques and Applications’, which is a very useful reference on graphics
generally. His algorithm for fast black and white fractals is generalized here to include
colour management.

‡ Interpreted Mathematica
First we define a function to count the number of iterations it takes to leave a circle of
radius 100. The number of iterations is capped at 100:
116 Complex Analysis with Mathematica

IterationsToLeave[z_, c_] :=
Module[{cnt, nz=N[z], nc=N[c]},
For[cnt=0,
(Abs[nz] <100) && (cnt<100), cnt++,
nz = nz*nz+nc];
N[cnt]];

To define the graphics of interest, we fix a starting value of z and allow c to vary over a
rectangular region in the complex plane:

FracM[z_, {{remin_, remax_}, {immin_, immax_}},


steps_]:=
{{{remin, remax}, {immin, immax}},
Table[IterationsToLeave[z, x+I*y],
{y, immin, immax, (immax-immin)/steps},
{x, remin, remax, (remax-remin)/steps}]};

Next we define a simple function for coloring our plots. The idea is that points that hit
the 100 iteration cap will be coloured black, while all others will be coloured according
to the number of iterations:

FracColor = (If[#==1, Hue[1,1,0], Hue[5 #/6]]&);

FracPlot[{{{remin_, remax_}, {immin_, immax_}},


matrix_},
colorfn_] :=
ListDensityPlot[matrix,
Mesh -> False, Frame -> False,
ColorFunction -> colorfn,
PlotRange -> {0, 100},
AspectRatio -> (immax-immin)/(remax - remin)]

So let's try it out on a small block, with z = 0 as our starting value – you should try
something like this first to make sure things are working. The way the picture and output
statement (including the timing) are combined will depend on the version of Mathemat-
ica you are using.
6 The Mandelbrot set 117

Timing[
FracPlot[FracM[0,{{-2.1,0.5},{-1.2,1.2}},50],
FracColor]
]

81.57 Second, Ü DensityGraphics Ü<

That is great, and we can already see the shape computed previously analytically,
complete with tendrils! However, it is a bit slow. Here and elsewehere the timings have
all been done on a Power Macintosh G4 running at 1.4 GHz. With a GHz-class machine
it is a little time-consuming to make lots of pictures this way. However, it is easy to
make it go much faster, without the need to go out and buy newer hardware, as we shall
see.

‡ Compiled Mathematica
The built-in compiler allows one to produce optimized numerical routines from Mathe-
matica code. We used this without much explanation in Chapter 4. Here is what Com-
pile does in more detail:

? Compile

Compile@8x1, x2, ... <, exprD creates a compiled function which evaluates
expr assuming numerical values of the xi. Compile@88x1, t1<, ... <,
exprD assumes that xi is of a type which matches ti. Compile@88x1, t1,
n1<, ... <, exprD assumes that xi is a rank ni array of objects each of
a type which matches ti. Compile@vars, expr, 88p1, pt1<, ... <D assumes
that subexpressions in expr which match pi are of types which match pti.

So let's make some minor adjustments and implement this operation. We only need to
make small changes to two of our functions:
118 Complex Analysis with Mathematica

FastIter = Compile[
{{z, _Complex}, {c, _Complex}},
Module[{cnt, nz=N[z], nc=N[c]},
For[cnt=0,
(Abs[nz] <100) && (cnt<100), cnt++,
nz = nz*nz+nc];
N[cnt]]];

FracMC[z_, {{remin_, remax_}, {immin_, immax_}},


steps_]:=
{{{remin, remax}, {immin, immax}},
Table[FastIter[z, x+I*y],
{y, immin, immax, (immax-immin)/steps},
{x, remin, remax, (remax-remin)/steps}]};

Timing[
FracPlot[FracMC[0,{{-2.1,0.5},{-1.2,1.2}},50],FracColor
]]

80.19 Second, Ü DensityGraphics Ü<

The calculation is now going nearly ten times faster! Now we can generate some serious
pictures.
6 The Mandelbrot set 119

Timing[
FracPlot[FracMC[0,{{-2.1,0.5},{-1.2,1.2}},200],FracColo
r]]

83.16 Second, Ü DensityGraphics Ü<

At the time of final editing we know that computers running at over 3 Ghz can go at
least twice as fast.

‡ Using FixedPointList
A tempting and compact alternative to FastIter is to use the built-in function Fixed-
PointList and the length of the list it generates subject to termination conditions that
parallel those already used. The following modification to FastIter may be tried, but
it turns out to take at least half as long again. (You might want to revisit this, as with
different versions of Mathematica there are different optimizations of the built-in
functions.)

FastIterFP = Compile@88z, _Complex<, 8c, _Complex<<,


N@Length@FixedPointList@# ^ 2 + c &, z,
100, SameTest -> HAbs@#2D > 100.0 &LDDDD;

FracMC[z_, {{remin_, remax_}, {immin_, immax_}},


steps_]:=
{{{remin, remax}, {immin, immax}},
Table[FastIterFP[z, x+I*y],
{y, immin, immax, (immax-immin)/steps},
{x, remin, remax, (remax-remin)/steps}]};
120 Complex Analysis with Mathematica

Timing[
FracPlot[FracMC[0,{{-2.1,0.5},{-1.2,1.2}},200],FracColo
r]]

84.95 Second, Ü DensityGraphics Ü<

6.5 Ÿ MathLink versions of the escape-time algorithm


The following material assumes that you are able to use the MathLink system, either by
loading the plug-ins supplied (see the enclosed CD for binaries for popular platforms) or
by recompiling the code. If you adopt the latter approach, please consult the MathLink
documentation thoroughly before proceeding. The idea is to create a C program to take
over some of the computation, compile it with a special type of MathLink template file,
and add the resulting program into Mathematica. The template file does the job of
assocating Mathematica variable and function names with associated C variable and
function names.

‡ MathLink version 1
Here is the template file:

:Begin:
:Function: fractalml
:Pattern:
FractalML[a_?NumberQ,b_?NumberQ,{{c_?NumberQ,d_?NumberQ},{e_?NumberQ,
f_NumberQ}},g_Integer]
:Arguments: { N[a],N[b],N[c],N[d],N[e],N[f],g }
:ArgumentTypes: { Real,Real,Real,Real,Real,Real,Integer}
:ReturnType: Manual
:End
6 The Mandelbrot set 121

Here is the C implementation of the escape-time algorithm, as given in the file


mandel.c. It uses the same algorithm as before, just written out in C. Note (a) the
include statement (we use MathLink, not stdio); (b) the MLPut statements to send results
down the link to the Mathematica kernel; (c) the form of the Main block. These are the
ingredients that characterize a MathLink C program.

#include "mathlink.h"

void fractalml(double x0,double y0, double xmin, double xmax, double


ymin, double ymax, int divs)
{
double x, y, dist, xadd, yadd, temp;
int xco, yco, counts;

MLPutFunction(stdlink,"List",divs);

for(yco = 0; yco <divs; yco++){


yadd = ymin + (ymax-ymin)*yco/(divs-1.0);
MLPutFunction(stdlink,"List",divs);

for(xco = 0; xco <divs ; xco++){

x = x0;
y = y0;
xadd = xmin + (xmax-xmin)*xco/(divs-1.0);

dist = x0*x0+y0*y0;
for(counts = 0; counts<100 && dist < 10000; counts++){
temp = x*x-y*y+xadd;
y = 2*x*y+yadd;
x = temp;
dist = x*x+y*y;
}
MLPutInteger(stdlink,counts);
}
}
}

int main(int argc, char *argv[])


{
return MLMain(argc, argv);
}

ü Loading and using the MathLink escape-time program


First we take the executable, called ‘mandel’, and install it into Mathematica. The first
task is to tell Mathematica where the binary MathLink executables are:

SetDirectory@"êBooksêComplexMath2005êMathLinkêbinOSX"D;

Note that this path should be set to wherever you have put them – the above works only
on the author's computer! See the CD notes for location and other information of the
files on the enclosed CD.

Install["mandel"]

LinkObject@.êmandel, 2, 2D
122 Complex Analysis with Mathematica

We can query the operation of the function as with any built-in function, The query
returns information contained in the template file and references to the fact that it is a
LinkObject:

?FractalML

Global`FractalML

FractalML@a_ ?NumberQ, b_ ? NumberQ,


88c_ ? NumberQ, d_ ?NumberQ<, 8e_ ? NumberQ, f_ ?NumberQ<<, g_IntegerD :=
ExternalCall@LinkObject@.êmandel, 2, 2D,
CallPacket@0, 8N@aD, N@bD, N@cD, N@dD, N@eD, N@fD, g<DD

We adapt our previous routine to call this function:

FracML[z_, {{remin_, remax_},{immin_, immax_}},


steps_] :=
{{{remin, remax},{immin, immax}},
FractalML[Re[z], Im[z],
{{remin, remax},{immin, immax}},
steps]}
Finally, for some variety, we define some new colour schemes:

FracColorA := (
If[#==1,
RGBColor[0,0,0],
If[#<=0.5, RGBColor[2#,2#,2#],
RGBColor[2-2#,2-2#,1]]]&)

FracColorB := (
If[#==1,
RGBColor[0,0,0],
If[#<=0.5, RGBColor[1,1-2#,0], Hue[1.5-#]]]&)

FracPlot[{{{remin_, remax_}, {immin_, immax_}},


matrix_},
colorfn_] :=
ListDensityPlot[matrix,
Mesh -> False, Frame -> False,
ColorFunction -> colorfn,
PlotRange -> {0, 100},
AspectRatio -> (immax-immin)/(remax - remin)]

We can now try it out. We not not use a Timing command as this reports kernel time
only, but this routine is about four times faster than the compiled Mathematica:
6 The Mandelbrot set 123

FracPlot[FracML[0,
{{-2.1,0.5},{-1.2,1.2}},200],FracColorA]

It is now a simple matter to switch colour scheme:

FracPlot[FracML[0,
{{-2.1,0.5},{-1.2,1.2}},200],FracColorB]

Note that with the mandel.c code, only the counting of iterations is farmed out to
external code. This means that this code generates fractals that can be coloured as you
choose, as above.
124 Complex Analysis with Mathematica

‡ A Turbo-charged direct PostScriptTM MathLink version!


Having optimized the computation time we are now still waiting for these images to
render. It is time for some dirty tricks to speed things up further, at the price of some
lack of obviousness in our code. There are two places to look for clues as to how to do
this. One is in the notebook file itself, the other is in Tom Wickham Jones’ excellent
book, "Mathematica Graphics, Techniques and Applications", where a fast program for
computing black and white fractals is described in outline. Sadly, Tom provides neither
the C code nor a colour algorithm for his fractals, so we are compelled to do a little
snooping around Mathematica's use of PostScript in order to see what needs to be done.
(This particular implementation is for use with Mathematica 4 and 5 – the author canot
guarantee such low-level tricks will work with Mathematica technology beyond version
5.2. See the on-line supplement and CD for any further information on this.)
Having done so, we find that we can talk ‘native’ to the front end, producing the
image in precisely the format that the front end needs to render. In the following pro-
gram, we wrap a MathLink program that sends a list of six character strings of the form
FF00FF, with Mathematica code that supplies the necessary PostScript sandwich and an
operation to merge all the resulting strings into one large one. (Devotees of TWJ's book
will note that he creates one very large string to send down MathLink. My own attempts
to do this have resulted in code slower than that used here, though this may be due to my
ignorance of issues regarding memory management and MathLink when dealing with
very large strings. Furthermore, we have avoided the use of a temporary local variable to
store the image in Mathematica – leaving it out further reduces computation time, and
we just send the MathLink output straight into the middle of the PostScript!)

Clear[HexaFracPlot];

Install["hexaman"];

?HexaFrac

Global`HexaFrac

HexaFrac@a_ ? NumberQ, b_ ?NumberQ,


88c_ ? NumberQ, d_ ?NumberQ<, 8e_ ? NumberQ, f_ ?NumberQ<<, g_IntegerD :=
ExternalCall@LinkObject@.êhexaman, 3, 3D,
CallPacket@0, 8N@aD, N@bD, N@cD, N@dD, N@eD, N@fD, g<DD
6 The Mandelbrot set 125

HexaFracPlot[z_, {{remin_, remax_},{immin_, immax_}},


steps_]:=
Module[{nstring, tnstring},
nstring = ToString[steps];
tnstring = ToString[3*(steps)];
Show[Graphics[PostScript[
"0 0 translate",
"1 1 scale",
tnstring <> " string",
StringReplace["nn nn 8 [nn 0 0 nn 0 0]","nn" ->
nstring],
"{ currentfile 1 index readhexstring pop } false 3
Mcolorimage",
StringJoin[
HexaFrac[Re[z], Im[z], {{remin, remax},{immin,
immax}}, steps]
],
"pop"],
PlotRange -> {{remin,remax},{immin, immax}},
AspectRatio -> 1]]]

Here is the result of a call to HexaFrac of the type used in the Module.

StringJoin[HexaFrac[0,0, {{-2, 1},{-1.5, 1.5}}, 6]]

FF0000FF00000000FF0000FF0000FFFF0000
0000FF0000FFFF0000FF0000FF00000000FF
0000FFFF0000FF00000000000000FF0000FF
0000FFFF0000FF00000000000000FF0000FF
0000FF0000FFFF0000FF0000FF00000000FF
FF0000FF00000000FF0000FF0000FFFF0000

HexaFracPlot[0, {{-2, 1}, {-1.5,1.5}}, 800]


126 Complex Analysis with Mathematica

We do not report a kernel timing as it is again misleading, as it does not include the time
taken to render the image by the front end. But this method is, overall, significantly
faster than our previous method. The kernel is actually doing very little work by now,
and not much effort is actually required to join the strings together, as the following
computation illustrates:

u = Flatten[Table["AA00FF", {k, 1, 200}, {l, 1,


200}]];
Timing[v = StringJoin[u];]
80.01 Second, Null<

6.6 Ÿ Diving in to the Mandelbrot set: fractal movies


Now that we have a set of efficient tools for drawing our fractals, we can begin to
explore properly. An excellent way of doing so is to ‘dive’ into the fractal. The idea is to
pick a point – a little experimentation at low resolution is useful for locating interesting
points first. Then, you zoom in on this point by drawing a rectangle centred on the point
and adjusting the length of its sides by a contraction factor for each new frame. This is
easily done by the following function:

g[pointx_, pointy_, n_, scale_] :=


Module[{width = scale^n},
{{pointx-width,pointx+width},{pointy-width,pointy+width
}}]
6 The Mandelbrot set 127

‡ Places to visit
The following place to visit was suggested by some guesswork. It is chosen as it demon-
strates the concept of self-similarity, revealing a copy of the Mandelbrot set deep within
itself. In Mathematica 4 and 5 the resulting movie can be animated by selecting the
block of cells and choosing ‘Animate Selected Graphics’ from the Cell Menu. You
should see what options are available in your current version of Mathematica for
animation. (See the on-line supplement and CD.) If you have not already done so, install
the C binary file with the following:

Install["mandel"];

In the printed version you will see one frame from the movie at full resolution. If you
have a computer running at less than 1 GHz you should consider halving the size of the
grid in the arguments of FracML, given below as 288.

ü Making the movie


Here a high-resolution version of a frame from near the middle (n = 10) of the movie is
shown in the output.

Do[
FracPlot[
FracML[0, g[-1.40835915,0.13627737,n,0.8],288],
FracColorB],
{n, -3, 30}]
128 Complex Analysis with Mathematica

‡ A visit to ‘sea-horse valley’


Here a high-resolution version of a frame from near the middle (n = 12) of the movie is
shown in the output.

Do@FracPlot@FracML@0, [email protected], 0.15, n, 0.8D, 288D,


FracColorBD, 8n, -4, 30<D

If you a version of Mathematica compatible with hexaman, you can similarly try the
following:

Install["hexaman"];
Do[
HexaFracPlot[0, g[-0.78,0.15,n,0.8],288],
{n, -4, 30}]

‡ Other ways of coding the set


There are other ways to farm out the processing. One that gives the job of generating the
colours to the C code, but is less painful than producing the Hex output, is embodied in
rasterman. This produces an array that can be shown with the RasterArray
function. If you are using Mathematica technology beyond version 5.2, see the on-line
supplement and CD for further information about the operation of RasterArray
methods.

Install["rasterman"];

This returns a matrix of RGB values:


6 The Mandelbrot set 129

RasterFrac[0,0, {{-2, 1},{-1.5, 1.5}}, 3]

ij RGBColor@1., 0.92, 0.D RGBColor@1., 0.9, 0.D RGBColor@1., 0.92, 0.D yz


jj zz
jj RGBColor@0., 0., 0.D RGBColor@0., 0., 0.D RGBColor@1., 0.9, 0.D zz
j z
k RGBColor@1., 0.92, 0.D RGBColor@1., 0.9, 0.D RGBColor@1., 0.92, 0.D {

and you can see it with, for example,

Show@
Graphics@RasterArray@RasterFrac@0, 0, 88-0.8, -0.75<,
80.1, 0.15<<, 600DDD, AspectRatio Ø 1D

6.7 Ÿ Computing and drawing the Mandelbrot set


If you wish to try to get a better grip on the Mandelbrot itself, you need to confront
several issues:

(1) You are either in the set or out of it, so pretty and detailed colouring schemes are
really rather pointless, and you might as well stick to black and white.
(2) The threshold for the number of iterations is technically infinite, so in practice you
need to compute with larger and larger caps on the iteration, and explore what happens.
(3) The set is composed of very fine elements, which can easily be missed in a black and
white representation at finite resolution. In fact, the highly coloured schemes make it
easier to perceive some aspects of the structure. You should try out some of the movies
above to see this.
130 Complex Analysis with Mathematica

The major difficulty is the coupling between issues (2) and (3). Finally, if you want to
view the results, whether on paper or on a computer screen, you have to deal with the
finite resolution of the viewing device.

‡ A black and white colouring scheme


This is easy to implement. We just take, for example:

FracColorBW = HIf@# ã 1, GrayLevel@0D, GrayLevel@1DD &L;

‡ Parametrizing the cap on iterations


To get a feel for the influence of the cap on iterations we now parametrize it. The radius
at which we stop counting is not a critical parameter – we do in fact have room to lower
it, and take the value of 10.

FastIter = Compile@88z, _Complex<, 8c, _Complex<,


8cap, _Integer<<, Module@8cnt, nz = z, nc = c<,
For@cnt = 0, HAbs@nzD < 10L && Hcnt < capL,
cnt ++, nz = nz * nz + ncD;
N@cntDDD;

FastIter@0, 0.0 + 0.5 I, 500D

500.

FracMC@cap_, z_, 88remin_, remax_<, 8immin_, immax_<<,


steps_D := 888remin, remax<, 8immin, immax<<,
Table@FastIter@z, x + I * y, capD,
8y, immin, immax, Himmax - imminL ê steps<,
8x, remin, remax, Hremax - reminL ê steps<D<;

FracPlot[{{{remin_, remax_}, {immin_, immax_}},


matrix_},
colorfn_, newrange_] :=
ListDensityPlot[matrix,
Mesh -> False, Frame -> False,
ColorFunction -> colorfn,
PlotRange -> {0, newrange},
AspectRatio -> (immax-immin)/(remax - remin)]

Computing a picture of the set in the large can be done as before (we increase the
resolution for this discussion – you should try significantly lower numbers than 2000 to
get started!):

FracPlot@
FracMC@300, 0, 88-21 ê 10, 1 ê 2<, 8-12 ê 10, 12 ê 10<<,
2000D, FracColorBW, 300D
6 The Mandelbrot set 131

If you compare this with the figure computed in the sub-section on compiled Mathemat-
ica, or the figure computed with FixedPointList, it looks like we have ‘misplaced’
some filamental structure joining some of the outlying black regions. This issue is
highlighted very dramatically if we dive deep into the fractal to look at a well-known
region:

g@pointx_, pointy_, n_, scale_D := Module@


8width = scale ^ n<, 88pointx - width, pointx + width<,
8pointy - width, pointy + width<<D

The region of interest is given by the following range of coordinates.

g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D êê N

ij -0.749238 -0.746762 yz
j z
k 0.105762 0.108238 {

Let's take a look a reasonable resolution (2000 µ 2000) computation with caps of 100,
300, 500, 700 and 900:

newcap = 100;
FracPlot@
FracMC@newcap, 0, g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D,
2000D, FracColorBW, newcapD
132 Complex Analysis with Mathematica

newcap = 300;
FracPlot@
FracMC@newcap, 0, g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D,
2000D, FracColorBW, newcapD

newcap = 500;
FracPlot@
FracMC@newcap, 0, g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D,
2000D, FracColorBW, newcapD
6 The Mandelbrot set 133

newcap = 700;
FracPlot@
FracMC@newcap, 0, g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D,
2000D, FracColorBW, newcapD

newcap = 900;
FracPlot@
FracMC@newcap, 0, g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D,
2000D, FracColorBW, newcapD
134 Complex Analysis with Mathematica

If we drop our purist view and go to one of our jollier colouring schemes for this last
region we get a rather different outcome. The reader is left to make their own judgement
about the relative merits!

newcap = 900;
FracPlot@
FracMC@newcap, 0, g@-748 ê 1000, 107 ê 1000, 30, 8 ê 10D,
2000D, FracColorA, newcapD

The reader might like to compare these last few illustrations with Plates 37–39 of
Peitgen and Sauper (1986), The region illustrated here is centred slightly to the ‘left’ of
their plate 38. It is also, with a cap of 200, the region shown by Penrose (2004), Figure
6 The Mandelbrot set 135

1.2d. An alternative representation of parts of the set is given in Chapter 3 of Penrose


(1999).

ü Some purist projects


You might like to explore more cunning ways of visualizing the ‘true’ Mandelbrot set.
One set of approaches involves fixing a display resolution (start with 500 µ 500 and go
up as resources allow), and defining the value of a pixel to be black or white according
to a sub-sampling search algorithm. The idea would be to sample within each pixel k
times, and colour it black if at least one of the k points does not escape. The k sub-sam-
ples could be picked by

(1) placing them on a rectangular or square grid;


(2) Monte Carlo sampling;
(3) sampling using a space-filling algorithm, such as Sobol sequences.

Exercises
6.1 Ÿ Construct and explore compiled escape-time algorithms for each of the following
mappings:

z Ø z3 + c

z Ø sinHzL + c

In each case construct suitable coloured visualizations, find some interesting regions,
and zoom in on them.

6.2 Ÿ Show that, by a linear transformation of coordinates, any cubic polynomial


mapping can be reduced to the standard form:

z Ø z3 + Hl - 1L z - l

Use Mathematica's Solve function to find the fixed points of this mapping, and
establish where these fixed points are stable. Numerical studies are helpful here!

6.3 Ÿ Build a compiled escape-time visualizer for the cubic polynomial of Exercise 6.2,
and identify the stable fixed point zones on your plot.

6.4 Ÿ Construct a compiled escape-time visualizer for the mapping:

ÅÅÅÅ
ÅÅÅÅÅÅ ReHzL ¥ 0
z-1
c
zØ9
ÅÅÅÅ
êêcÅÅÅÅÅÅ ReHzL < 0
z+1

Using the zooming function g, construct an animation of a dive into a neighbourhood of


the point c = 0.4131 + 0.62155 Â, based on a starting value of z = 0. As a tip, one of
your sequence should look roughly like this:
136 Complex Analysis with Mathematica

Appendix: C Code listings

‡ C code for hexaman


#include "mathlink.h"
#include "math.h"
void fractalml(double x0, double y0, double xmin, double xmax, double ymin, double
ymax, int divs)
{double x, y, dist, xadd, yadd, temp;
int xco, yco, counts;
MLPutFunction(stdlink,"List",divs*(divs+1)-1);

for(yco = 0; yco <divs; yco++){


yadd = ymin + (ymax-ymin)*yco/(divs-1.0);

for(xco = 0; xco <divs ; xco++){


x = x0;
y = y0;
xadd = xmin + (xmax-xmin)*xco/(divs-1.0);
dist = x0*x0+y0*y0;
for(counts = 0; counts<100 && dist < 10000; counts++){
temp = x*x-y*y+xadd;
y = 2*x*y+yadd;
x = temp;
dist = x*x+y*y;
}
if(counts==100)
{
MLPutString(stdlink,"000000");
}
else
{
if(counts%2==0)
{
MLPutString(stdlink,"FF0000");
}
else
6 The Mandelbrot set 137

{
MLPutString(stdlink,"0000FF");
}}}
if(yco < divs-1)
{MLPutString(stdlink,"\n");
}
else
{}}
}
int main(int argc, char *argv[])
{return MLMain(argc, argv);}

‡ C code for rasterman


#include "mathlink.h"
#include "math.h"
void fractalml(double x0, double y0, double xmin, double xmax, double ymin, double
ymax, int divs)
{double x, y, dist, xadd, yadd, temp;
int xco, yco, counts;
MLPutFunction(stdlink,"List",divs);

for(yco = 0; yco <divs; yco++){


yadd = ymin + (ymax-ymin)*yco/(divs-1.0);
MLPutFunction(stdlink,"List",divs);

for(xco = 0; xco <divs ; xco++){


x = x0;
y = y0;
xadd = xmin + (xmax-xmin)*xco/(divs-1.0);
dist = x0*x0+y0*y0;
for(counts = 0; counts<100 && dist < 10000; counts++){
temp = x*x-y*y+xadd;
y = 2*x*y+yadd;
x = temp;
dist = x*x+y*y;
}
if(counts==100){
MLPutFunction(stdlink,"RGBColor",3);
MLPutReal(stdlink,0.0);
MLPutReal(stdlink,0.0);
MLPutReal(stdlink,0.0);}
else
{
if(counts<51){
MLPutFunction(stdlink,"RGBColor",3);
MLPutReal(stdlink,1.0);
MLPutReal(stdlink,1.0-counts/50.0);
MLPutReal(stdlink,0.0);}
else
{
MLPutFunction(stdlink,"Hue",1);
MLPutReal(stdlink,1.5-counts/100.0);}
}}}}
int main(int argc, char *argv[])
{return MLMain(argc, argv);}
7 Symmetric chaos in the complex plane

Introduction
The existence of functions such as Nest and NestList, together with extensive
visualization tools, ensure that Mathematica is a natural system for investigating the
iteration of mappings. One favourite is the logistic map that was considered in Chapter
5. Complex numbers play a very natural role, from two quite different points of view.
First, we wish to understand why maps such as the logistic map behave the way they do,
without relying merely on numerical simulation. Second, we wish to extend the use of
numerical simulation to mappings of the complex plane.
You explored the first point in Chapter 5, and the second in Chapters 4 and 6, for
simple polynomial maps. Now you will consider some other mappings of the complex
plane into itself. These mappings are non-holomorphic (in the sense that will be defined
properly in Chapter 10 – for now it suffices to realize that this means the functions
involve complex conjugation in an essential way). Normally, when considering the
theory of complex numbers, one's interest is quite rightly focused on the analytical
properties of holomorphic or meromorphic functions. I hope the constructions described
here will suggest that there is much that is both beautiful and interesting in complex
structures that are not holomorphic. My approach is based on that of Field and Golu-
bitsky (1992), and the use of Mathematica on this topic was first given by the author
(Shaw, 1995). Readers are encouraged (a) to get the original book by Field and Golu-
bitsky, (b) to see M. Field's web site at http://nothung.math.uh.edu/~mike/
and (c) to pay attention to the copyright notices on that web site!
The odd logistic map considered in Chapter 5 can be extended very trivially to
the complex plane, complete with the symmetry of a circle, by introducing

LogisticHl, zL = l z H1 - H†z§L2 L (7.1)

This is symmetric since

LogisticHl, z ‰if L = ‰if LogisticHl, zL (7.2)

if f is real. However, this is not terribly interesting. We will obtain the same dynamics
as the odd logistic map, but along a ray in the complex plane. Matters are significantly
more interesting, if, rather than the symmetry of the circle, we require that maps are
symmetric under the action of the discrete groups Zn (the cyclic group consisting of
rotations by 2p ên and Dn (the dihedral group, consisting of such rotations and a flip). In
this chapter you will explore the simplest possible non-linear maps possessing the
discrete symmetries. For polynomial maps, these take the form

gHz, l, a, b, g, w, nL = g zê n-1 + z Hl + Â w + z a zê + b ReHzn LL (7.3)

with l, a, b, g and w real, and n an integer. These possess the cyclical symmetry
7 Symmetric chaos in the complex plane 139

2p 2pÂ
gI‰ ÅÅÅÅÅnÅÅÅÅÅÅÅ z, l, a, b, g, w, nM = ‰ ÅÅÅÅÅnÅÅÅÅÅÅ gHz, l, a, b, g, w, nL (7.4)

If, in addition, w = 0, they also inherit the additional symmetry expressed by


êêêêêê
gHzê L = gHzL (7.5)

which ensures full dihedral symmetry. There is a simple non-polynomial generalization,


with extra parameters, and this will be given below. The experiments presented here
investigate the structure of the resulting complex attractors, in an attempt to understand
the material presented by Field and Golubitsky (1992). You are strongly advised to first
carry out the simulations with, say, 1/10 the number of iterations used in the supplied
examples, in order to get a feel for the time required. Some of the simulations take some
time – the results are usually worth waiting for! They illustrate the sense in which
symmetry (implying a certain harmony of form) can be consistent with chaos (implying
rather a lack of form).

ü Acknowledgement
I am very grateful to Professors Brian Twomey and Donal Hurley for useful discussions
on these and other topics during a visit to University College, Cork.

7.1 Ÿ Creating and iterating complex non-linear maps


We can make the simulations in a more straightforward way by introducing a function
that automatically compiles our nonlinear map. Note that this function assumes default
values of zero for the parameters w, d and p. These can be omitted unless explicitly
required.

MakeMap[l_, a_, b_, g_, m_, w_:0, d_:0, p_:1] =


Compile[{{z, _Complex}},
((l + a*z*Conjugate[z] + b*Re[z^m] +
d*Abs[z]*Cos[Arg[z]*m*p] + I w)*z +
g*Conjugate[z]^(m-1))];
We can also automate the generation of a starting value and subsequent list. The idea is
to first iterate the map for a while (2000 times) to eliminate the effect of any transients,
then to proceed to further iteration.

makedata[func_, n_] :=
Module[{start=Nest[func, 0.5+0.5I,2000]},
NestList[func,start,n]];

Finally, we make a function that does it all and plots the resulting attractor:
140 Complex Analysis with Mathematica

MakeSymChaos[myfunc_, n_, color_, size_]:=


Module[{data},
data = makedata[myfunc,n];
ListPlot[Map[{Im[#],Re[#]}&, data],
PlotStyle -> {PointSize[size],color},
AspectRatio -> 1, Axes -> None]];

Now we make the compiled maps for some interesting objects.

ü Dihedral group: polynomial

threegadget = MakeMap[1.56, -1.00, 0.10, -0.82, 3];


flint = MakeMap[2.50, -2.50, 0.00, 0.90, 3];
sanddollar = MakeMap[-2.34, 2.00, 0.20, 0.10, 5];
pentagon = MakeMap[2.60, -2.00, 0.00, -0.50, 5];
churwin = MakeMap[2.409, -2.50, -0.20, 0.81, 24];

MakeSymChaos[threegadget, 25000, RGBColor[0,0,1],


0.005]

MakeSymChaos[flint, 25000, RGBColor[0,0.5,0.5], 0.005]

MakeSymChaos[sanddollar, 25000, RGBColor[1,0,0], 0.005]


7 Symmetric chaos in the complex plane 141

MakeSymChaos[pentagon, 25000, RGBColor[1,0,1], 0.005]

MakeSymChaos[churwin, 50000, RGBColor[0.5,0,0.5],


0.005]

What you should appreciate from these pictures is that extensive iteration of the map-
pings, in common with the odd logistic map for some values of its parameters, reinstates
the symmetry in the original mapping – this is shown very dramtically in the pictures.
Later on we shall see more explicitly how the symmetry can be initially broken and then
reinstated.
142 Complex Analysis with Mathematica

‡ Cyclic group: polynomial

Now we break the full dihedral symmetry down to cyclical symmetry only, by introduc-
ing a complex term into the function. This produces some rotation or ‘swirl’ in the
resulting plots. To induce this we supply an extra parameter to our MakeMap function –
previously this assumed its default value of zero.

swirlygig = MakeMap[-1.86, 2.00, 0.00, 1.00, 4, 0.10];


flower = MakeMap[-2.50, 5.00, -1.90, 1.00, 5, 0.188];

MakeSymChaos[swirlygig, 25000, RGBColor[1,0,0], 0.005]

MakeSymChaos[flower, 25000, RGBColor[1,0.5,0], 0.005]

‡ Dihedral group: non-polynomial


As a third variant, we put back the dihedral symmetry but introduce a non-polynomial
term into the mapping:

familiar =
MakeMap[1.00, -2.10, 0.00, 1.00, 3, 0.00, 1.00, 1];
star =
MakeMap[-2.42, 1.00, -0.04, 0.14, 6, 0.00, 0.088, 0];

MakeSymChaos[familiar, 25000, RGBColor[0,0,1], 0.005]


7 Symmetric chaos in the complex plane 143

MakeSymChaos[star, 25000, RGBColor[1,0,0], 0.005]

7.2 Ÿ A movie of a symmetry-increasing bifurcation


All of the plots given above are fully symmetric. Just as in the case of the odd logistic
map discussed in Chapter 5, the symmetric state is only achieved for certain values of
the map parameters. You can explore the creation of the symmetry by creating a movie
of the scatter plots, based on varying a relevant parameter. It is worth exploring this for
any of the maps described above. The code for just one is given here. The Do-loop
creates a movie, while the subsequent graphics array shows several frames of the movie.
If you are using a Mathematica notebook, you can animate the movie using the ‘Ani-
mate Selected Graphics’ command on the Cell menu. If you are using Mathematica
technology beyond version 5.2, you should explore the options provided in your current
version of Mathematica for animation – see also the enclosed CD and on-line
supplement.

ScaledSymChaos[myfunc_, n_, color_, size_, range_:1]:=


Module[{data},
data = makedata[myfunc,n];
ListPlot[Map[{Im[#],Re[#]}&, data],
PlotStyle -> {PointSize[size],color},
AspectRatio -> 1, Axes -> None,
PlotRange -> {{-range, range},{-range, range}}]];
144 Complex Analysis with Mathematica

Do[
(tri = MakeMap[2.16+0.005*k,-1.0, 0.0,-0.5, 3];
frame[k] = ScaledSymChaos[tri, 2000, RGBColor[0,0,1],
0.01, 2.0];),{k, 0, 35}]

For printing purposes, one can just show selected frames that show the overall
increase in symmetry. Note how the movie shows that this process is not in any sense
monotonic. Having gone chaotic once, it collapses to a periodic orbit and then goes
chaotic again – this mirrors the behaviour of the logistic map (islands of periodicity
within chaos) very nicely.

Show@GraphicsArray@88frame@0D, frame@7D, frame@14D<,


8frame@21D, frame@28D, frame@35D<<DD
7 Symmetric chaos in the complex plane 145

7.3 Ÿ Visitation density plots


Some regions in the complex plane are visited significantly more frequently than others.
There are more dots in such regions. How can we quantify this effect? One approach is
to split the complex plane into a large array of neighbourhoods, and count the number of
times the iterates of the map visit each neighbourhood. To do this effectively we need a
significantly larger number of iterations (millions) and an efficient means of identifying
the neighbourhood with which each iterate should be associated.
In the following function, each iterate is computed, used to calculate which
neighbourhood is visited, and then discarded. Thus the only significant memory require-
ment is that needed to store a two-dimensional array used to build up the visitation
density. The value of the iteration is used directly to compute which array element is to
be incremented.

MakeVisitDensity[myfunc_, itmax_, nop_] :=


Module[{d, zold, znew,i,j,m},
d = Table[0, {nop}, {nop}];
znew = Nest[myfunc, -0.1+0.6I,2000];
Do[(zold = znew;
znew = Evaluate[myfunc[zold]];
i =
Min[Max[Floor[nop*(Re[znew]+1)/2],1],nop];
j = Min[Max[Floor[nop*(Im[znew]+1)/2],1],nop];
d[[j,i]] += 1),{m, 1, itmax}];d]
We can do a quick one to make sure it is working:

pdata = MakeVisitDensity[familiar, 20000, 80];

The conjugation symmetry is more easily perceived if we transpose the data so that the
reflection symmetry is about the vertical axis – I therefore transpose before plotting:

ListDensityPlot[Transpose[pdata],
Mesh -> False, Frame -> False]
146 Complex Analysis with Mathematica

7.4 Ÿ High-resolution plots


Once we have a working algorithm, we can try increasing both the number of iterations
and the resolution of our plots. This takes a longer time, but gives tantalizing results! If
you try this on your own computer bear in mind the results and time taken in the previ-
ous example. The timing below is on a 1.4 GHz machine.

Timing[pdata = MakeVisitDensity[familiar,100000,250];]

817.24 Second, Null<

ListDensityPlot[Transpose[pdata],
Mesh -> False, Frame -> False]

7.5 Ÿ Some colour functions to try


While you have pdata stored in the kernel, you may wish to try using some of the
following colour functions to bring out features in the data. This first group adopts a
single background colour, usually black, for neighbourhoods that are not visited, and
then we take a colour directive that is a single continuous function of the number of
visits.

cfunca =
(If[#==0, RGBColor[0,0,0], RGBColor[1-#,1-#,1]]&);
cfunch =
(If[#==0, Hue[0.5,0.5,0], Hue[2#/3]]&);
cfuncb =
(If[#==0, RGBColor[0,0,0], RGBColor[0,0,#]]&);
cfuncr =
(If[#==0, RGBColor[0,0,0], RGBColor[#,0,0]]&);
cfuncrb =
(If[#==0, RGBColor[0,0,1], RGBColor[#,0,0]]&);
gold =
(If[#==0, RGBColor[0,0,0], RGBColor[1,1-#,0]]&);
7 Symmetric chaos in the complex plane 147

The following two functions split the range into two and assigns a separate function to
each range. This is a useful way of arranging that sufficient contrast is applied to ensure
that the detail in infrequently visited regions is not washed out.

metallica =
(Which[#==0, RGBColor[0,0,0],
0<#<0.5, RGBColor[2#,2#,2#],
0.5<=#<=1.0, RGBColor[2-2#,2-2#,1]
]&);

stellartipped =
(Which[#==0, RGBColor[0,0,0],
0<#<=0.5, RGBColor[1,1-2#,0],
0.5<#<=1.0, Hue[1.5-#]
]&);

ListDensityPlot[Transpose[pdata],
Mesh -> False, Frame -> False,
ColorFunction -> stellartipped]

Is it left for you (in Exercise 7.1) to explore what this looks like with other colour
functions.
148 Complex Analysis with Mathematica

7.6 Ÿ Hit the turbos with MathLink!


Our plots so far take some time to compute and the results are somewhat grainy. Clearly
we need to be more efficient, or just faster. An approach that gives very satisfying
results very quickly is to use some heavily customized C code with MathLink to speed
up the computation. Mathematica then does the rendering job. Note that our Mathemat-
ica code is now a useful prototype for the C code – we just have to implement the same
algorithm using C. We have also made some changes in the details, working with real
and imaginary parts, and writing C explicitly for the cases of symmetries of order 3, 4, 5
and 6. The C program and associated template file are given in Appendix 7.
Once this program is compiled and linked, it can be installed in the usual way.
Note that here the author sets a path to the MathLink executables that needs to be
adapted to your own system:

SetDirectory@
"êBooksêComplexMath2005êAAMathLinkêbinMacOSX"D;

Install["symchaos"]

LinkObject@.êsymchaos, 2, 2D

?SymChaos

Global`SymChaos

SymChaos@lambda_? NumberQ, alpha_? NumberQ, beta_? NumberQ,


gamma_?NumberQ, sym_Integer, omega_? NumberQ, delta_?NumberQ,
p_Integer, radius_ ?NumberQ, itmax_Integer, nopoints_IntegerD :=
ExternalCall@LinkObject@.êsymchaos, 2, 2D,
CallPacket@0, 8N@lambdaD, N@alphaD, N@betaD, N@gammaD,
sym, N@omegaD, N@deltaD, p, N@radiusD, itmax, nopoints<DD

The parameters play exactly the role they do in Mathematica. For now we consider
omega = 0 and radius = 1, and now itmax is to be measured in thousands of iterations.
We also supply the extent of the symmetry through a parameter sym. This can take any
integer value, and we have carried out additional C optimization for low values of the
integer parameter sym that gives the degree of symmetry. We can also automate the plot
routines as follows:

SymChaosPlot[object_,colorfunc_] :=
ListDensityPlot[Transpose[object],
Mesh -> False, Frame -> False,
ColorFunction -> colorfunc]
As a test, try the following (on a 1.4 GHz machine, this takes about 1 ê 4 second to
calculate using one million iterations):
7 Symmetric chaos in the complex plane 149

Timing[sanddollar=SymChaos[-2.34,2,0.2,0.1,5,0,0,0,1.0,
100,200];]
80.27 Second, Null<

SymChaosPlot[sanddollar, metallica]

You should experiment with the settings to determine what is practical for your own
system. I suggest computing a few medium resolution samples, based on 60 million
iterations, and a visitation density based on a 400 µ 400 grid. This involves the last two
parameters of SymChaos being set to 6000, 400. Below I have shown, for printing
purposes, plots based on a billion iterations and a 1000 µ 1000 array. The number of
iterations governs the execution time for the C code, while the grid size influences the
time taken by Mathematica to render the image. On a 1.4 GHz G4 machine, the real
elapsed time is less than 1 minute for the calculation of sanddollar with the parame-
ters I suggest you try. Note that the binary files supplied are not optimized – if you are
an expert with compiler settings you may be able to achieve significant speed
improvements!

7.7 Ÿ Billion iterations picture gallery


sanddollar =
SymChaos[-2.34,2,0.2,0.1,5,0,0,0,1.0,100000,1000];

SymChaosPlot[sanddollar,metallica]
150 Complex Analysis with Mathematica

quadgig =
SymChaos[-1.86,2,0.0,1.0,4,0,0,0,1.0,100000,1000];
SymChaosPlot[quadgig,stellartipped]
7 Symmetric chaos in the complex plane 151

pentibug =
SymChaos[-2.32,2.32,0,0.75,5,0,0,0,1.0,100000,1000];
SymChaosPlot[pentibug,gold]
152 Complex Analysis with Mathematica

‡ Using the radius parameter


Depending on the values of the supplied parameters, the iteration may wander out of the
standard square -1 < Re@zD, Im@zD < 1 used by default. It is good practice to do some
sample iterations with the scatter plot technique to see how far out the iterates go in the
complex plane. In the example below we have reset the radius parameter to 1.5 in order
to accommodate a larger attractor.

flintstone =
SymChaos[2.5,-2.5,0,0.9,3,0,0,0,1.5,100000,1000];
SymChaosPlot[flintstone,gold]

familiar =
SymChaos[1,-2.1,0,1,3,0,1,1,1.1,100000,1000];
SymChaosPlot[familiar,gold]
7 Symmetric chaos in the complex plane 153

‡ Breaking the dihedral group to cyclic group


All our examples so far have had full dihedral symmetry. We can break the dihedral
symmetry by introducing a non-zero value to the parameter omega. This gives attractors
with Zn symmetry only. Our visualization below of swirlygig is not reflection
symmetric about the vertical axis.

swirlygig =
SymChaos[-1.86,2.0,0,1,4,0.1,0,0,1.0,100000,1000];
SymChaosPlot[swirlygig,stellartipped]
154 Complex Analysis with Mathematica

flowerv =
SymChaos[-2.5,5.0,-1.9,1.0,5,0.188,0,0,0.75,100000,1000
];SymChaosPlot[flowerv,gold]

ü Cleaning up
Remove the installed routine with:

Uninstall["symchaos"];
Remove[SymChaos]

Ÿ Exercises
7.1 Ÿ Recreate and explore the data set pdata, and view it with various choices of
colour function, such as cfuncx, metallica, stellartipped and gold.
7 Symmetric chaos in the complex plane 155

7.2 Ÿ Load the symchaos C MathLink program, and the definitions of SymChaos-
Plot and the colour functions of Exercise 7.1. Explore the visitation densities of the
following systems, and of those arising from small variations in parameters from those
given here:

washington =
SymChaos[2.6,-2,0,-0.5,5,0,0,0,1.4,6000,400];
SymChaosPlot[washington,metallica];

halloween =
SymChaos[-2.7,5,1.5,1,6,0,0,0,1.0,6000,400];
SymChaosPlot[halloween,metallica];

bracelet =
SymChaos[-2.08,1,-0.1,0.167,7,0,0,0,1.3,6000,400];
SymChaosPlot[bracelet,stellartipped];

glass =
SymChaos[-2.05,3,-16.79,1,9,0,0,0,0.8,6000,400];
SymChaosPlot[glass,gold];
7.3 Ÿ Create the analogs of the symmetry-generating movie of Section 7.2 for some of
the other examples in Section 7.1, using the scatterplot technique.

7.4 Ÿ If you have a fast computer, try to create a movie of the symmetry-generating
process viewed by a visitation density. Use of the symchaos add-in is recommended!

Appendix: C code listings


The following MathLink template and C source code were used to produce the install-
able executables. A few comments are pertient. In general, we recommend the use of the
vector and matrix memory allocation/deallocation routines described in Numerical
Recipes (Press et al. 1992). Indeed, I strongly recommend this book for its discussion of
setting up arrays in C if you have it and use of the nrutil.c utility package for
creating arrays. The authors of Numerical Recipes have kindly put this in the public
domain. Here, however, I wish to use a square array of long integers, in order to ensure
that I don't get integer overflow in any cell when using many millions of iterations. I
have therefore modified and simplified the nrutil.c function imatrix to this end. You
should investigate nrutil.c to see how to treat other cases of vectors and matrices. It
is a fairly standard template file, but note the use of the Manual return type. To return a
list, or, as here, a list of lists down MathLink, it is simpler to use this approach. In the C
code note how this is expressed by sending the List header down the link, and then the
value of each integer in the array describing the visitation density. This is done with
MLPutLongInteger. Note that, for portability, I have used explicit real variables,
and done some optimization for each of the cases 3, 4, 5 and 6. As noted in the code, the
function MLPutLongIntegerArray could be used to clean up a little.
156 Complex Analysis with Mathematica

#include "mathlink.h"
#include <stdlib.h>
#include <math.h>

/* P() is a simple macro defined in mathlink.h that allows function pro-


toypes to be written in the same way for ANSI and K&R C */

long **isqmatrix P((int nsize));


void freeisqmatrix P((long **m, int nsize));
void symchaos P((double lambda, double alpha, double beta, double gamma,
int sym, double omega, double delta, int pee, double radius, int itmax,
int nopoints));
int main P((int argc, char** argv));

long **isqmatrix(nsize)
int nsize;
{int i;
long **mat;
mat = (long **) malloc((unsigned) (nsize + 1)*sizeof(long*));
for(i=0;i<nsize;i++)
{mat[i] = (long *) malloc((unsigned) (nsize + 1)*sizeof(long));
};
return mat;
}

void freeisqmatrix(m, nsize)


long **m;
int nsize;
{int i;
for (i=0;i<nsize;i++) free(m[i]);
free(m);
}

void symchaos(lambda,alpha,beta,gamma,sym,omega,delta,pee,radius,itmax,
nopoints)
double lambda,alpha,beta,gamma,omega,delta,radius;
int itmax,nopoints,sym,pee;
{ double l,a,b,g,w,de,r;
double xold, yold, xnew, ynew, xsq, ysq, xfo, yfo;
double xsqysq, temp, argum, absz, abssq;
int i, n, j, k, p, q, nsym, pe;
long **d;

d = isqmatrix(nopoints);
l = lambda;
a = alpha;
b = beta;
g = gamma;
w = omega;
de = delta;
i = itmax;
n = nopoints;
r = radius;
7 Symmetric chaos in the complex plane 157

nsym = sym;
pe = pee;

for(j = 0; j < n; j++)


{
for(k = 0; k < n; k++)
{
d[j][k] = 0;
}
}
xold = -0.1;
yold = 0.6;

/* Do the iterations, with 10000 to start off to remove transients */


for(q=0; q < 10000; q++)
{
for(j=0; j < i+1; j++)
{ xsq = xold*xold;
ysq = yold*yold;
argum = atan2(yold,xold);
abssq = xsq + ysq;
absz = sqrt(abssq);

switch(nsym)
{ case 3:
temp = l+a*abssq+b*xold*(xsq - 3.0*ysq)+de*absz*cos(3.0*pe*argum);
xnew = xold*temp + g*(xsq - ysq) - w*yold;
ynew = yold*temp - 2.0*g*xold*yold + w*xold;
break;

case 4:
temp=l+a*abssq+b*(abssq*abssq - 8.0*ysq*xsq)+de*absz*cos(4.0*pe*argum);
xnew = xold*temp + g*xold*(xsq - 3.0*ysq) - w*yold;
ynew = yold*temp - g*yold*(3.0*xsq - ysq) + w*xold;
break;

case 5:
xfo = xsq*xsq;
yfo = ysq*ysq;
xsqysq = xsq*ysq;
temp = l+a*abssq+b*xold*(xfo-10*xsqysq+5*yfo)+de*absz*cos(5.0*pe*argum);
xnew = xold*temp + g*(xfo-6*xsqysq+yfo) - w*yold;
ynew = 4*g*xold*yold*(ysq - xsq) + yold*temp + w*xold;
break;

case 6:
xfo = xsq*xsq;
yfo = ysq*ysq;
xsqysq = xsq*ysq;
temp=l+a*abssq+b*(xfo*xsq-15*xfo*ysq+15*xsq*yfo-yfo*ysq)+de*absz*cos(6.0*p
e*argum);
xnew = xold*temp + g*xold*(xfo-10*xsqysq+5*yfo) - w*yold;
ynew = g*yold*(10*xsqysq - 5*xfo -yfo) + yold*temp + w*xold;
158 Complex Analysis with Mathematica

break;

default:
temp=
l+a*abssq+b*pow(absz,nsym)*cos(nsym*argum)+de*absz*cos(nsym*pe*argum);
xnew = xold*temp + g*pow(absz,nsym-1.)*cos((nsym-1.)*argum) - w*yold;
ynew = yold*temp - g*pow(absz,nsym-1.)*sin((nsym-1.)*argum) + w*xold;
}

xold = xnew;
yold = ynew;
if (j > 0)
{
k = floor(0.5*n*(xold+radius)/radius);
p = floor(0.5*n*(yold+radius)/radius);
if ((p < n) && (k < n) && (p > -1) && (k > -1))
{
d[p][k] += 1;
}}}}

/* The following could be simplified by use of MLPutLongIntegerArray*/


MLPutFunction(stdlink,"List", n);
for(j = 0; j < n; j++)
{
MLPutFunction(stdlink,"List", n);
for(k = 0; k < n ; k++)
{
MLPutLongInteger(stdlink,d[j][k]);
}
}
freeisqmatrix(d,nopoints);
}
int main(argc,argv)
int argc; char* argv[];
{return MLMain(argc, argv);}

Here is the template file:


:Begin:
:Function: symchaos
:Pattern: SymChaos[lambda_?NumberQ,alpha_?NumberQ,beta_?NumberQ,gamma_?Num-
berQ, sym_Integer, omega_?NumberQ, delta_?NumberQ, p_Integer, radius_?Num-
berQ,itmax_Integer,nopoints_Integer]
:Arguments: { N[lambda], N[alpha], N[beta], N[gamma], sym, N[omega],
N[delta], p, N[radius],itmax, nopoints}
:ArgumentTypes:{Real,Real,Real,Real,Integer,Real,Real,Integer,Real,
Integer,Integer}
:ReturnType: Manual
:End:
8 Complex functions

Introduction
In this section we give a more precise characterization of complex functions and review
their basic properties. We also introduce some formal concepts, such as neighbourhoods
and open sets, in order to lay the foundations for a discussion of continuity and differen-
tiability. We shall then make a first definition of basic functions such as the exponential
and trigonometric functions, and their inverses, by referring back to real definitions. This
will be revisited in Chapter 9 from a power series perspective. We shall also look at the
concept of branch points, and the extended complex plane or ‘Riemann sphere’.
We shall also explore various ways of visualizing complex functions using
Mathematica. We can build various routines for looking at functions. The first one we
will consider takes a two-dimensional point of view, where functions are regarded as
mappings taking one region of the complex plane to another. The second regards the
function as a pair of functions of two real variables, and we show how to use Mathemati-
ca's three-dimensional plotting routines to view simultaneously both the modulus and
argument of complex functions. Then we shall develop some plot routines tailored to
bring out the folded structure of certain complex functions. Note that, in this chapter, the
output of all Mathematica computations is set to appear in TraditionalForm. If you
are using Mathematica technology beyond version 5.2, you should explore the options
provided in your current version for managing graphics. See also the on-line supplement
and enclosed CD.

8.1 Complex functions: definitions and terminology


Let  be the set of all complex numbers and let U be a subset of . A function f defined
on U is a rule that assigns a complex number w to each z œ U. We write

w = f HzL (8.1)

The set U is called the domain of definition of f , and the set of points

8w œ  » w = f HzL, z œ U< (8.2)

is called the range of f , often simply denoted by f HUL. Such a function will normally be
characterized by supplying a definition of U, such as the upper half-plane Im@zD ¥ 0, and
a formula, such as

f HzL = ‰z (8.3)

Often, however, one leaves out a detailed specification of the set U, and U is to be
somehow, but reasonably, inferred from the formula, as ‘wherever this formula makes
sense’. A good example of this would be the function
160 Complex Analysis with Mathematica

1
f HzL = ÅÅÅÅ3ÅÅÅÅ (8.4)
z
where U would be inferred to be the set of all complex numbers except zero.
It has come to be a standard to describe complex variables using certain variable
names. There is no compulsion to use these lettering schemes, but many books use them.
We set

z = x+ Ây (8.5)

and a function f HzL is often written as a new complex variable w, that is also decom-
posed into real and imaginary parts as

w = f HzL = uHx, yL + Â vHx, yL (8.6)

or, alternatively, as

w = f HzL = fHx, yL + Â yHx, yL (8.7)

The use of one of the choices u and v, or f and y, is almost universal. As an example,
consider

f HzL = zn (8.8)

for n = 2, 3. In the case n = 2, we have

u = f = x2 - y2 ; v = y = 2 x y (8.9)

Then for n = 3 we have

u = f = x3 - 3 x y2 ; v = y = 3 x2 y - y3 (8.10)

‡ Ÿ Using Mathematica to extract real and imaginary parts


This section is quite important, because Mathematica can be rather obstinate about
extracting real and imaginary parts, because of its default assumption that everything is
complex unless informed otherwise. Consider the following:

expr = Expand@Hx + I yL ^ 2D

x2 + 2 Â y x - y2

Re@exprD

ReHx2 - y2 L - 2 ImHx yL

This is true, but not what we want! In general, this operation can be made to do what we
want by doing one of several things, the approach depending on the complexity of the
expression.
8 Complex functions 161

ü ComplexExpand revisited
We already visited this function in Chapter 2, where we looked at it applied to simple
arithmetical functions. It works very well in the extraction of real and imaginary parts:

? ComplexExpand

ComplexExpand@exprD expands expr assuming that all variables


are real. ComplexExpand@expr, 8x1, x2, ... <D expands expr
assuming that variables matching any of the xi are complex.

ComplexExpand@Re@exprDD

x2 - y2

In general, we define a pair of new functions, re and im, that apply ComplexExpand
appropriately, but also reserving z and w as complex expressions.

re@expression_D :=
ComplexExpand@Re@expressionD, 8z, w<D;
im@expression_D := ComplexExpand@
Im@expressionD, 8z, w<D;

8re@exprD, im@exprD<

8x2 - y2 , 2 x y<

re@Hx + I yL ^ 4D

x4 - 6 y2 x2 + y4

re@Hx + I yL ^ 6 + z ^ 3D

x6 - 15 y2 x4 + 15 y4 x2 - y6 + ReHzL3 - 3 ImHzL2 ReHzL

However, this approach is not perfect. In some earlier versions of Mathematica you
might obtain, for example,

re@1 ê Hx + I yLD
x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ
†x + Â y§

In version 5 or later this works just fine:

re@1 ê Hx + I yLD
x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
x + y2
2

Before we explain how to fix this, note the following:


162 Complex Analysis with Mathematica

Timing@re@Hx + I yL ^ 10 DD

80.02 Second, x10 - 45 y2 x8 + 210 y4 x6 - 210 y6 x4 + 45 y8 x2 - y10 <

Our functions operate reasonably quickly! There is a package that boosts the functional-
ity of Re and Im that forces decomposition into the required pieces, but at a price. This
is certainly necssary in older versions of Mathematica, but is less of a necessity in
versions 5 or later.

Needs@"Algebra`ReIm`"D

This package operates by adding a list of rules about real and imaginary parts. The price
that is to be paid is that searching the list and trying the rules takes some time, and the
search may be carried out even when quite simple expressions are supplied.

Timing@re@Hx + I yL ^ 10 DD

80.27 Second, x10 - 45 y2 x8 + 210 y4 x6 - 210 y6 x4 + 45 y8 x2 - y10 <

Whether you are using an older version with this package, or a recent version, we can
manage quite tricky expressions:

exprb = Hx + I yL ^ H-3L Exp@x + I yD * Sin@2 Hx + I yLD

‰ x+Â y sinH2 Hx + Â yLL


ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Hx + Â yL3

parts = 8re@exprbD, im@exprbD<;

Together@partsD
1
9 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ3ÅÅ H‰x HcosHyL coshH2 yL sinH2 xL x3 - cosH2 xL sinHyL sinhH2 yL x3 +
Hx2 + y2 L
3 y coshH2 yL sinH2 xL sinHyL x2 + 3 y cosH2 xL cosHyL sinhH2 yL x2 -
3 y2 cosHyL coshH2 yL sinH2 xL x + 3 y2 cosH2 xL sinHyL sinhH2 yL x -
y3 coshH2 yL sinH2 xL sinHyL - y3 cosH2 xL cosHyL sinhH2 yLLL,
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ3ÅÅ H‰x HcoshH2 yL sinH2 xL sinHyL x3 + cosH2 xL cosHyL sinhH2 yL x3 -
Hx2 + y2 L
3 y cosHyL coshH2 yL sinH2 xL x2 + 3 y cosH2 xL sinHyL sinhH2 yL x2 -
3 y2 coshH2 yL sinH2 xL sinHyL x - 3 y2 cosH2 xL cosHyL sinhH2 yL x +
y3 cosHyL coshH2 yL sinH2 xL - y3 cosH2 xL sinHyL sinhH2 yLLL=

A good working practice is to use our definitions re and im as is unless this fails. Only
then should you load the ReIm package. Other tricks for getting things to work include
liberal applications of PowerExpand, and possibly introducing your own supplemen-
tary rules – use of a subset of the rules given in the ReIm package can be quite efficient.
T. Bahder (1995), in his book Mathematica for Scientists and Engineers, has suggested
8 Complex functions 163

that ReIm be avoided altogether on efficiency grounds, and that your own customized
rules sets be used in preference. I recommend that you consult Section 5.11 of that text
for further information if you find yourself confronted with a problem that the approach
described here cannot treat.

8.2 Neighbourhoods, open sets and continuity


Now we need to add a little extra structure to the complex plane, and define various
important types of sets. The first important type of set is a neighbourhood, also called an
open disc. Given a point a, the -neighbourhood of a is the set:

N HaL = 8z œ  : †z - a§ < < (8.11)

It may also be denoted by DHa; L. Geometrically, it consists of the points that are a
distance strictly less than  from a.
Sometimes, in dealing with functions that are singular at a point, but defined
elsewhere, it will be convenient to deal with a neighbourhood with a hole in it, usually
called a punctured disc or deleted neighbourhood. These are the sets:

8z œ  : 0 < †z - a§ < < (8.12)

There are also structures called closed discs (the term neighbourhood tends to be
reserved for the open objects), where the boundary points are added. These are sets of
the form:
êêê êêê
DHa; L = N  HaL = 8z œ  : †z - a§ b < (8.13)

‡ Open sets
Armed with the concept of an open neighbourhood, we can now define open sets in
general. A set U Õ  is said to be open, if given any z œ U, there is a real positive 
(which can and usually will depend on z), such that N HzL Õ U. That is, there is room to
wander a small distance in any direction and stay within U. An example is the set of
points whose distance from a given point is strictly less than a given radius – this is just
a standard neighbourhood.

ü Closed sets
A set U Õ  is said to be closed, if its complement,  - U = 8z œ  : z – U<, is open.
An example is the set of points whose distance from a given point is less than or equal
to a given radius – this is just a standard closed disk.
164 Complex Analysis with Mathematica

‡ Limits and continuity


Informally, a complex function is continuous at z, if its limiting value approaching z
from any direction agrees with its value at z. Formally, we phrase this in terms of
neighbourhoods and limits. We introduce the formal characterization in two stages:

ü Limits
Suppose that f is a function defined on a set that contains a punctured disk centred on
z0 . We say that the limit of f as z tends to z0 is w0 , or,

lim f HzL = w0 (8.14)


zØz0

if, given any e > 0, there is a positive number d such that 0 < » z - z0 » < d implies that

† f HzL - w0 § < e (8.15)

We can rephrase this as saying that the image of a deleted d-neighbourhood lies within
an e-neighbourhood about w0 .

ü Continuity
Suppose that f is a function defined on a set that contains a disk centred on z0 . So now
f Hz0 L is defined. We say f is continuous at z0 if

lim f HzL = f Hz0 L (8.16)


zØz0

We need these definitions for future reference. There are various basic theorems that can
be proved about limits of sums, products, quotients, and compositions of functions, and
the relationship between the complex forms and corresponding real forms. We shall not
labor the proofs of these points, as they belong in a basic analysis course, but shall just
remark that if f HzL and gHzL are continuous at z0 , then

(1) l f HzL + m gHzL is continuous at z0 for any complex numbers l, m;


(2) f HzL µ gHzL is continuous at z0 ;
(3) f HzL ê gHzL is continuous at z0 provided gHz0 L  0.

Furthermore, if f is continuous at w0 = gHz0 L, then f HgHzLL is continuous at z0 .


Note that when we come to define complex differentiability in Chapter 10, we
shall give proper proofs of the corresponding results for sums, products, quotients and
compositions. Note that it is also true that a complex function f HzL is continuous at z0 if
and only if its real and imaginary parts uHx, yL, vHx, yL are continuous at Hx0 , y0 L, where
z0 = x0 + Â y0 . This is most emphatically not the case for differentiation! We shall see
why in Chapter 10.
8 Complex functions 165

8.3 Elementary vs. series approach to simple functions


How do we define functions of complex variables? Giving a formula and a domain of
definition is how we have set it up. For functions of most interest (the differentiable
ones), the most powerful and general prescription is to write down a power series for the
function. We can then throw results on power series and differentiation (stated or
derived in Chapters 9 and 10) at our series definition. Furthermore, most of the interest-
ing ‘special functions’ of applied mathematics are in fact defined through a series
description. Such series descriptions arise typically from the series solution of some
differential equation associated with a physical problem of practical interest. A good
example would be Bessel functions, defined by a series solution of Bessel's equation,
which arises in connection with various wave and potential problems with cylindrical
symmetry.
In spite of the power and generality of such a series approach to functions, it is
nevertheless useful to first go down a rather more friendly route that builds on our
existing understanding of a subset of corresponding real functions, and some simple
identities, to construct a subset of interesting simple functions of complex variables.
When we finally get a grip on series methods, we can redefine this subset again using
such series, and also extend our supply of functions to include Bessel and Hypergeomet-
ric functions and all sorts of other exotic objects.
It may seem a little inefficient to define things twice, but since it is not actually
necessary to introduce series in order to get a grip on simple exponential, trigonometric
and hyperbolic functions and their inverses, we will take a good look at these first.

‡ The exponential function


We have already done the work to deal with this, in Chapter 2. Recall that we have the
identity

‰Ây = cosHyL +  sinHyL (8.17)

We therefore define

‰z = ‰ x+Ây = ‰x HcosHyL + Â sinHyLL (8.18)

This definition has an important consequence related to the fact that the function is not
1:1 as a mapping. Suppose that

‰z1 = w and ‰z2 = w (8.19)

Then

‰z1 -z2 = 1 (8.20)

Writing

z1 - z2 = x + Ây (8.21)
166 Complex Analysis with Mathematica

it follows that

‰x cosHyL = 1 and ‰x sinHyL = 0 (8.22)

which has solutions given by

x = 0, y = 2kp (8.23)

for k an integer. That is,

z1 - z2 = 2kp (8.24)

The exponential function is not only not 1:1, it is actually periodic in the imaginary
direction.

‡ Trigonometric and hyperbolic functions


The starting point for a definition of trigonometric functions is the following equation,
considered in Chapter 2, for real q:

‰Âq = cosHqL +  sinHqL (8.25)

from which it follows that


1
cosHqL = ÅÅÅÅÅ H‰Âq + ‰-Âq L (8.26)
2
1
sinHqL = ÅÅÅÅÅÅÅÅÅ H‰Âq - ‰-Âq L (8.27)

We therefore define the trigonometric functions, for complex z, by the formulae:
1
cosHzL = ÅÅÅÅÅ H‰Âz + ‰-Âz L (8.28)
2
1
sinHzL = ÅÅÅÅÅÅÅÅÅ H‰Âz - ‰-Âz L (8.29)

It follows that these functions have a periodicity property inherited from that of the
exponential function, given by

cosHz + 2 pL = cosHzL; sinHz + 2 pL = sinHzL (8.30)

This extends the usual real periodicity property into the complex plane. We know that in
the real case, the real zeroes of sinHxL and cosHxL are located at np and Hn + ÅÅÅÅ12 Lp respec-
tively. We can ask where the zeroes are in the complex plane. For example, if

sinHzL = 0 (8.31)

then

‰Âz = ‰-Âz (8.32)


8 Complex functions 167

‰2Âz = 1 (8.33)

which leads us to deduce that, for some integer n,

2Âz = 2np (8.34)


z = np (8.35)

So there are no additional complex zeroes in the complex plane. Similarly, the zeros of
cosHzL are located at z = Hn + ÅÅÅÅ12 L p. The proof of this is left for you as an exercise. In the
case of hyperbolic functions we also make the obvious extension of the real definition to
the complex plane:
1
coshHzL = ÅÅÅÅÅ H‰z + ‰-z L (8.36)
2
1
sinhHzL = ÅÅÅÅÅ H‰z - ‰-z L (8.37)
2
These are periodic in the imaginary direction:

coshHz + 2pÂL = coshHzL; sinhHz + 2pÂL = sinhHzL (8.38)

The hyperbolic cosine now has zeroes at


1
Jn + ÅÅÅÅÅ NÂp (8.39)
2
and the hyperbolic sine has zeroes at

nÂp (8.40)

With any of these functions, some solutions for the zeroes may be found by direct use of
Mathematica, but others may need to be inferred from periodicity properties. You do get
a warning about what solutions are being found:

z ê. Solve@Cosh@zD == 0, zD
— Solve::ifun : Inverse functions are being used by Solve, so some solutions may not be found.

Âp Âp
9- ÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅ =
2 2
We will consider inverse functions shortly.
168 Complex Analysis with Mathematica

‡ Ÿ Simple identities: ComplexExpand and TrigExpand


ComplexExpand works with the simpler transcendental functions as it does with
polynomial functions, and can be used to generate all the standard complex trigonomet-
ric identities for complex arguments. Various standard addition formulas, but in complex
form, can also be generated using TrigExpand. The following lists can all be gener-
ated by referring back to the definitions in terms of exponential functions, but we get
Mathematica to tabulate them. You are strongly recommended to work out some of
these using pen and paper.

ComplexExpand@Exp@x + I yDD

‰x cosHyL + Â ‰x sinHyL

ComplexExpand@Sin@x + I yDD

coshHyL sinHxL + Â cosHxL sinhHyL

ComplexExpand@Cos@x + I yDD

cosHxL coshHyL - Â sinHxL sinhHyL

ComplexExpand@Sinh@x + I yDD

 coshHxL sinHyL + cosHyL sinhHxL

ComplexExpand@Cosh@x + I yDD

cosHyL coshHxL + Â sinHyL sinhHxL

TrigExpand@Sin@z + wDD

cosHzL sinHwL + cosHwL sinHzL

TrigExpand@Cos@z + wDD

cosHwL cosHzL - sinHwL sinHzL

TrigExpand@Sinh@z + wDD
coshHzL sinhHwL + coshHwL sinhHzL

TrigExpand@Cosh@z + wDD

coshHwL coshHzL + sinhHwL sinhHzL

Finally, the reverse identities can be generated by the use of TrigReduce - here we
just invert the last example:
8 Complex functions 169

TrigReduce@%D

coshHw + zL

8.4 Simple inverse functions


For functions that are simple nth powers, the inverse ‘function’ is the nth root function
that we discussed in Chapter 2. We have put the term ‘function’ in quotes as the opera-
tion of taking nth roots yields many answers. This mapping is not strictly a function at
all, but a ‘many-valued function’ or ‘multifunction’. For functions that are simple
polynomials, the corresponding inverse function corresponds to finding the roots of the
equation arising from equating the polynomial with a given complex number. Again this
is many-valued.
In the case of the simple exponential, trigonometric and hyperbolic functions
defined above, we face similar issues related to the many-valued behaviour of the
logarithm function. As discussed in Chapter 2, this is defined by

logHzL = logH†z§L + Â ArgHzL (8.41)

and we must make a choice about what value of the argument is to be taken. This is of
course related to the fact that the exponential function is periodic, i.e. it is many-to-one
as a function. A picture of the log function showing its many-valued character was given
in Section 2.11.
The inverse trigonometric and hyperbolic functions also have this many-valued
property, again arising from the fact that the trigonometric and hyperbolic functions are
periodic. The problem can also be seen by expressing the inverse trigonometric and
hyperbolic functions in terms of logarithms. Let's do an example of this. Suppose first
that

sinhHwL = z (8.42)

Writing this in terms of the exponential function gives

‰w - ‰-w = 2 z (8.43)

Now make the substitution

q = ‰w (8.44)

so that
1
q - ÅÅÅÅÅ = 2 z (8.45)
q

Rearranging, we obtain the quadratic equation

q2 - 2zq - 1 = 0 (8.46)

which has the following pair of solutions:


170 Complex Analysis with Mathematica

è!!!!!!!!
!!!!! è!!!!!!!!!!!!!
9z - z2 + 1 , z + z2 + 1 = (8.47)

Now we demand that z = 0 implies w = 0, and hence that q = 1. This involves picking
the second root. Finally taking logs suggests that we set
è!!!!!!!!
!!!!!
arcsinhHzL = logIz + z2 + 1 M (8.48)

Similar arguments for the other functions lead to


è!!!!!!!!
!!!!!
arccoshHzL = logIz + z2 - 1 M (8.49)

1 1+z
arctanhHzL = ÅÅÅÅÅ logJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N (8.50)
2 1-z
Similarly, for the trigonometric functions
è!!!!!!!!!!!!
!
arcsinHzL = -Â logIÂ z + 1 - z2 M (8.51)
è!!!!!!!!!!!!
!
arccosHzL = -Â logIz + Â 1 - z2 M (8.52)

1 Â+z
arctanHzL = ÅÅÅÅÅ Â logJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N (8.53)
2 Â-z

‡ Ÿ Mathematica description of simple inverse functions


All of the trigonometric, hyperbolic functions and their inverses are available within
Mathematica. Their names are Sin, Cos, Tan, Sinh, Cosh, Tanh, ArcSin, Arc-
Cos, ArcTan, ArcSinh, ArcCosh and ArcTanh. The corresponding names for the
reciprocal functions and their inverses are Csc, Sec, Cot, Csch, Sech, Coth,
ArcCsc, ArcSec, ArcCot, ArcCsch, ArcSech and ArcCoth. We can enquire
about any of them in the usual way:

? ArcSin

ArcSin@zD gives the arc sine of the complex number z.

We will explore some of the interesting properties of this function in Section 8.6.
8 Complex functions 171

8.5 Ÿ Branch points and cuts


For those functions that are many-valued there is a standard approach to forcing them to
be single-valued. The idea is to draw a line or curve in the complex plane, and state that
one cannot cross from one side of this curve to the other. Such a curve is called a branch
cut. It is in part defined by the locations of certain points, called branch points. Such
points have the property that a loop traversed around a branch point leads to a change in
the value of the function as one moves from the beginning to the end of the loop. Branch
cuts are drawn between branch points. There is often an implicit branch point at infinity,
with cuts being drawn from key finite branch points out to infinity.
We have already encountered such phenomena, without actually describing them
in terms of branch structures, in Chapter 2, and again in this chapter. Both the nth root
functions and the log function are many-valued. Traversing any loop around the origin
produces a change in the value of the function. So the origin is a branch point. We draw
a line emanating from the origin for the branch cut. In fact for different purposes we may
consider putting this line at any angle we please, but it has become conventional to place
it along the negative real axis. Let's take a look at the impact of this on the functions of
interest – we draw the square root, cube root and log functions. These also make the
point that Mathematica conforms to the convention of locating the branch cut along the
negative real axis.

Plot3D@Im@Sqrt@Hx + I yLDD, 8x, -3, 3<, 8y, -3, 3<,


PlotPoints -> 40D

1
0 2
-1
0
-2
0 -2
2

Plot3D@Im@Hx + I yL ^ H1 ê 3LD, 8x, -3, 3<, 8y, -3, 3<,


PlotPoints -> 40D
172 Complex Analysis with Mathematica

1
0 2
-1
0
-2
0 -2
2

Plot3D@Im@Log@Hx + I yLDD, 8x, -3, 3<, 8y, -3, 3<,


PlotPoints -> 40D

2
0 2
-2
0
-2
0 -2
2
Other representations of branch cuts can also be given – we defer this until necessary,
when we consider the evaluation of integrals involving multi-valued functions.

‡ Ÿ Other branch cut locations and Mathematica conventions


In general the family of branch points and cuts associated with a given function may be
very complicated. A good working rule is to locate the branch points associated with any
fractional powers and logs in an expression, and to consider how they (and possibly
infinity) can be joined up. As an example, consider the expression for the inverse of the
sine function:
è!!!!!!!!!!!!
!
arcsinHzL = -Â logIÂz + 1 - z2 M (8.54)

Examination of this function reveals that we do not have to worry here about the log
function, as its argument does not vanish, but we take the square roots of both 1 - z and
1 + z. So there are branch points at 1 and -1. How should these, and possibly infinity, be
linked by branch cuts? One might start by guessing that we take the line joining -1 to 1
along the real axis. But this would be foolish, as we would be cutting away precisely that
8 Complex functions 173

region on which arcsin(x) makes sense as a real function! Remember that as a real
function sin(x) attains values between -1 and 1, so ideally we would like to keep a
complex neighbourhood of this region within the domain of the inverse function. An
alternative is to place branch cuts along the intervals H-¶, -1L and H1, ¶L - this is what
is normally done and is also Mathematica's convention. Let's take a look at the imagi-
nary part of the inverse sine function - the branch cuts are clearly visible.

Plot3D@Im@ArcSin@Hx + I yLDD, 8x, -3, 3<, 8y, -3, 3<,


PlotPoints -> 40D

2
1
0 2
-1
-2
0
-2
0 -2
2
This is quite a good example as it illustrates the fact that there is no hard and fast rule for
drawing branch cuts, and that we may be influenced by the real form of the function of
interest. Sometimes we may wish to make other choices that at first sight seem perverse.
For example, there are sometimes good reasons to take the branch cut of the log function
to be along the positive real axis.
Mathematica's conventions for branch cuts for various multi-valued functions
are described in detail in relevant sections of The Mathematica Book (Wolfram, 2003).
In the text for versions 3, 4 and 5, the conventions for the inverse trigonometric and
hyperbolic, as well as nth root and log functions, are given in Section 3.2.7.
It is well worth exploring what Mathematica does when confronted with, for
example, trigonometric functions and their many-valued inverses, as this raises two
interesting issues. In the real setting, we might have got used to the inverse sine function
being relevant only to the interval H-1, 1L, but in the full complex setting the inverse
sine works for general complex arguments, for example,

8ArcSin@12D, [email protected]<

8sin-1 H12L, 1.5708 - 3.17631 Â<

If we take the sine of these two complex numbers, we get

8Sin@ArcSin@12DD, Sin@[email protected]<

812, 12. - 7.32232 µ 10-16 Â<


174 Complex Analysis with Mathematica

For the second result, we can simply Chop it:

Chop@%@@2DDD
12.

or indeed use more precision:

Sin@[email protected] DD

12.000000000000000000 + 0. µ 10-19 Â

But aside from these numerical complications, Sin[ArcSin[z]] returns z for all
complex z. On the other hand, if we apply the single-valued forward function first and
then the multi-valued inverse, we may return to a different branch. This is illustrated by
the following sample calculations:

ArcSin@Sin@12DD

12 - 4 p

StandardForm@Table@8n, ArcSin@Sin@nDD<, 8n, -6, 6<DD

88-6, -6 + 2 p<, 8-5, -5 + 2 p<, 8-4, 4 - p<, 8-3, 3 - p<,


8-2, 2 - p<, 8-1, -1<, 80, 0<, 81, 1<, 82, -2 + p<,
83, -3 + p<, 84, -4 + p<, 85, 5 - 2 p<, 86, 6 - 2 p<<

Plot@ArcSin@Sin@xDD, 8x, -12, 12<D

1.5
1
0.5

-10 -5 5 10
-0.5
-1
-1.5
8 Complex functions 175

8.6 The Riemann sphere and infinity


There is one other type of special point in complex variable theory, called the point at
infinity. This is a point that we add to the complex plane to make it topologically
equivalent to a sphere, called the Riemann sphere. The complex plane so extended is
often called the extended complex plane. Note that there are various different versions
based on different forms of the stereographic projection that is involved – our approach
is tailored to later applications of these ideas.
The simplest route to understanding the geometry is to let Hq, fL be polar
coordinates on a sphere. With our conventions, q = 0 at the north pole, q = p at the south
pole, and is the co-latitude, f is the longitude. You may be used to conventions where f
and q are swapped, in which case they should be interchanged in the formulas in this
section. The precise location and radius of the sphere are intially irrelevant, and we set
q
z = ‰Âf cotJ ÅÅÅÅÅ N (8.55)
2
We use z as our complex variable to avoid confusion with a Cartesian coordinate z
introduced later. The south pole, where q = p, gives the origin. The equator, where q =
p/2, gives

z = ‰Â f (8.56)

which is the unit circle. As we decrease q we obtain values of z of larger modulus, and
with f varying from 0 to 2p we obtain all possible arguments. We can see that points of
the sphere, apart from the north pole, are in 1:1 correspondence with finite points in the
complex plane. The Riemann sphere, or extended complex plane, is obtained by just
adding back the north pole.
We can make the relationship between this hypothetical sphere and the complex
plane more explicit by introducing a sphere of radius R centred at the origin, and to
letting

8x, y, z< = 8R sinHqL cosHfL, R sinHqL sinHfL, R cosHqL< (8.57)

be the standard mapping between the spherical polar and Cartesian coordinates for the
sphere

x2 + y2 + z2 = R2 (8.58)

Then some trigonometric algebra leads to the explicit relation


êê êê
R Hz + z L Â R Hz - z L R H†z§2 - 1L
8x, y, z< = 9 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅ
Å , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = (8.59)
†z§2 + 1 †z§2 + 1 †z§2 + 1

This relation can be interpreted as a stereographic projection from the north pole of the
sphere to a point on the Argand plane viewed as a horizontal plane in three-dimensional
space. Details of this interpretation for the case R = 1 are in the exercises.
176 Complex Analysis with Mathematica

The point at infinity can be treated in a systematic way by introducing reciprocal


coordinates
è 1
z = ÅÅÅÅÅ (8.60)
z

Given any function f , we can ask questions about its behaviour at infinity by asking
corresponding questions about the function
è è
f Hz L = f HzL (8.61)

in a neighbourhood of zero. For example, the question of continuity at infinity is now


è
just posed as a question of continuity at the origin in z coordinates. This notion of a
Riemann sphere and a point at infinity are more than a geometrical and analytical
convenience. This sphere, together with its family of tangent planes, define a complex
space of considerable interest in its own right, with implications for both functions and
surfaces in real three-dimensional space and relativity. See, for example, Chapters 23
and 24.

8.7 Ÿ Visualization of complex functions


There are a host of ways of visualizing a complex function of a complex variable. We
have to bear in mind that we are dealing with two real functions of two real variables –
an essentially four-dimensional problem. We consider the most useful techniques that do
not discard any of the information about the function – clearly other methods become
feasible if one plots only the absolute value, dropping the phase, or if one plots only the
real part, and ignores the imaginary part. We divide our considerations into two-dimen-
sional views and three-dimensional views.

‡ Two-dimensional views of a complex function


In this approach we consider a standard coordinate system for the plane, either Cartesian
or Polar, and either:

(1) plot the images of the coordinate lines or curves under the mapping;
(2) plot pre-images of the coordinate lines or curves under the mapping.

The former can be done with a package supplied with Mathematica. The latter is essen-
tially a pair of overlaid contour plots of either the real and imaginary parts, or the
modulus and phase, of the function. The construction of such a composite plot can be
done directly with the supplied package, if a suitable inverse function can be written
down, or alternatively constructed by hand from Mathematica's built-in contour plotting
routines. This type of plot is often used in control theory, where it is called a Nichols
chart.
8 Complex functions 177

‡ ComplexMap package
This package is supplied with Mathematica and is documented in the packages documen-
tation. It was written by Roman Maeder and he has documented the programming issues
involved extensively in his book ‘Programming in Mathematica’, (Maeder, 1997) where
it is used as an example to illustrate how one builds a Mathematica package. We will not
therefore go into the construction of this package and the reader is referred to Maeder's
text for programming details. In what follows we shall illustrate the use of the plot
routines with two different functions:

(1) the simple built-in trigonometric function Sin;


(2) a simple user-defined function.

We begin by loading the ComplexMap package:

Needs@"Graphics`ComplexMap`"D

We inquire what has been loaded:

? Graphics`ComplexMap`*

Graphics`ComplexMap`
CartesianMap Lines PolarMap $Lines

Let's investigate the first function:

? CartesianMap

CartesianMap@f, 8x0, x1, HdxL<, 8y0, y1, HdyL<D plots the


image of the cartesian coordinate lines under the function
f. The default values of dx and dy are chosen so that the
number of lines is equal to the value of the option Lines.

When you use CartesianMap with a built-in function with a single argument, you
can just supply the name of the function.

SetOptions@ParametricPlot,
PlotStyle Ø [email protected];

CartesianMap@Sin, 8-2, 2, 0.1<,


8-2, 2, 0.1<, PlotRange -> All, PlotPoints Ø 60D
178 Complex Analysis with Mathematica

-3 -2 -1 1 2 3
-1

-2

-3

If you wish to use your own custom functions with this package it is easiest if you
supply them as pure functions, where the variable being plotted is labelled # and the
function is completed by an ampersand (&). If you wish to use a built-in function that
takes several arguments, the same idea applies: use the # for the variable, and set any
other parameters explicitly (e.g. BesselJ[0, #]&). Here are some examples. Be
warned – some of these take a while to generate!

CartesianMap@Exp@-# ^ 2D * Erfc@-I * #D &,


80, 4, 0.1<, 80, 4, 0.1<, PlotPoints Ø 60D

0.6
0.5
0.4
0.3
0.2
0.1

0.2 0.4 0.6 0.8 1

ü Polar version
The package is also set up to treat polar coordinates:

? PolarMap

PolarMap@f, 8r0:0, r1, HdrL<, 8phi0, phi1, HdphiL<D plots the image of the
polar coordinate lines under the function f. The default for the phi
range is 80, 2Pi<. The default values of dr and dphi are chosen so
that the number of lines is equal to the value of the option Lines.
8 Complex functions 179

PolarMap@Sin, 80, 2, 0.1<, 80, 2 Pi, Pi ê 10<,


PlotRange -> All, PlotPoints Ø 60D

-2 -1 1 2
-1

-2

-3

PolarMap@Exp@-# ^ 2D * Erfc@-I * #D &,


80.1, 2, 0.1<, 80, 2 Pi, Pi ê 10<, PlotPoints Ø 60D

75

50

25

-40-20 20 40 60 80 100
-25

-50

-75

Watch out for singularities in the function – sometimes you may have to remove the
origin from the range of polar coordinates, if you do not want Mathematica to complain!
You may be unfamiliar with the definitions of some of the functions used here, and
might consider asking Mathematica for the definition of the Erfc and Zeta functions.
180 Complex Analysis with Mathematica

‡ Pre-image graphics
In this case we wish to see the function the other way round. That is, we wish to locate
the pre-images of a given set of coordinate curves or lines under the mapping. If the
function has an explicit inverse you can feed it to CartesianMap or PolarMap as
before:

CartesianMap@ArcSin, 8-2, 2, 0.1<,


8-2, 2, 0.1<, PlotRange -> All, PlotPoints Ø 60D

1.5
1
0.5

-1.5-1-0.5 0.5 1 1.5


-0.5
-1
-1.5

More frequently, an explicit inverse will not be available and the plot will have to be
constructed differently. Note that now the x and y ranges refer to the plot domain, and
not to the extent of the axes range under consideration:

SetOptions@ContourPlot,
ContourStyle Ø [email protected];

CartesianPreImage@func_,
xrange_, yrange_, options___D :=
Module@8tempa, tempb, xlist, ylist<,
tempa = ContourPlot@
Re@func@x + I yDD, Evaluate@Prepend@xrange, xDD,
Evaluate@Prepend@yrange, yDD,
ContourShading -> False,
DisplayFunction -> Identity, optionsD;
tempb = ContourPlot@Im@func@x + I yDD,
Evaluate@Prepend@xrange, xDD,
Evaluate@Prepend@yrange, yDD,
ContourShading -> False,
DisplayFunction -> Identity, optionsD;
Show@tempa, tempb,
DisplayFunction -> $DisplayFunctionDD
8 Complex functions 181

CartesianPreImage@Sin, 8-1.5, 1.5<,


8-1.5, 1.5<, Contours -> 60, PlotPoints -> 60D

1.5
1
0.5
0
-0.5
-1
-1.5
-1.5 -1 -0.5 0 0.5 1 1.5

Of course, this can also be used with the inverse function:

CartesianPreImage@ArcSin, 8-2, 2<,


8-2, 2<, Contours -> 40, PlotPoints -> 60D

-1

-2
-2 -1 0 1 2
The following three examples are some of the nicer plots that can be extracted this way.
The first one shows the complementary error function and the second explores the
Riemann zeta function. The third looks at the inverse sine function using polar coordi-
nates.

CartesianPreImage@Exp@-# ^ 2D * Erfc@-I * #D &,


8-1.5, 1.5<, 8-1.5, 1.5<,
Contours -> 30, PlotPoints -> 60D
182 Complex Analysis with Mathematica

1.5
1
0.5
0
-0.5
-1
-1.5
-1.5-1-0.5 0 0.5 1 1.5

Let's also look at the Riemann zeta function in this way:

CartesianPreImage@Zeta, 8-1.5, 1.5<,


8-1.5, 1.5<, Contours -> 40, PlotPoints -> 60D

1.5
1
0.5
0
-0.5
-1
-1.5
-1.5-1-0.5 0 0.5 1 1.5

PolarPreImage@func_, xrange_, yrange_, options___D :=


Module@8tempa, tempb, xlist, ylist<,
tempa = ContourPlot@
Abs@func@x + I yDD, Evaluate@Prepend@xrange, xDD,
Evaluate@Prepend@yrange, yDD,
ContourShading -> False,
DisplayFunction -> Identity, optionsD;
tempb = ContourPlot@Arg@func@x + I yDD,
Evaluate@Prepend@xrange, xDD, Evaluate@
Prepend@yrange, yDD, ContourShading -> False,
DisplayFunction -> Identity, optionsD;
Show@tempa, tempb,
DisplayFunction -> $DisplayFunctionDD
8 Complex functions 183

PolarPreImage@ArcSin, 8-2, 2<,


8-2, 2<, Contours -> 60, PlotPoints -> 60D

-1

-2
-2 -1 0 1 2
It is left to the reader to try other PolarPreImage examples. These types of pre-im-
age plots, particularly the Cartesian version, are very useful, not just for seeing what a
complex function looks like, but also for understanding the geometry to which they
relate in applications. We will use them extensively later in this book in applications
such as fluid dynamics. As a foretaste of this, we have superimposed a unit circle on a
plot that will turn out to represent flow around a cylinder (this is discussed in detail in
Chapter 19).

CartesianPreImage@H# + 1 ê #L &, 8-3, 3<,


8-3, 3<, Contours -> 40, PlotPoints -> 60,
Epilog -> [email protected], Circle@80, 0<, 1D<D

-1

-2

-3
-3 -2 -1 0 1 2 3

8.8 Ÿ Three-dimensional views of a complex function


A simple way of using three dimensions to treat a four-dimensional structure is to colour
the function according to the argument, with the height representing the modulus. Before
doing so, in order to avoid an error in the plot routine, we define the argument of zero:
184 Complex Analysis with Mathematica

Unprotect@ArgD; Arg@0D = 0 ;
ComplexPlot3D@func_, xrange_, yrange_, options___D :=
Plot3D@8Abs@func@x + I yDD,
Hue@N@HPi + Arg@func@x + I yDDL ê H2 PiLDD<,
xrange, yrange, optionsD

ComplexPlot3D@Exp@-# ^ 2D * Erfc@-I * #D &,


8x, -2, 2<, 8y, -2, 2<,
PlotPoints -> 30, Mesh -> False, FaceGrids -> All,
ViewPoint -> 82, 2, 1<, PlotRange -> AllD

100
75
50
25
0
-2 -2
-1 -1
0 0
1 1
2
ComplexPlot3D@Sin, 8x, -2, 2<, 8y, -2, 2<,
PlotPoints -> 30, Mesh -> False, FaceGrids -> AllD

3
2
2
1 1
0
-22 0
-1
0 -1
1
2 -2
8 Complex functions 185

ComplexPlot3D@Gamma, 8x, -4, 1<, 8y, -1, 1<,


PlotPoints -> 100,
Mesh -> False, PlotRange -> 80, 20<D

20
15 1
10
5 0.5
0
-4
4 0
-3
-2 -0.5
-1
0
1 -1

‡ Alternative routines
There is nothing to stop you building your own plotting routines, using some custom
colouring functions. The following is particularly dramatic, and is especially effective
when you are limited to a black and white display or printer. The idea is to colour the
function according to its phase, just using two alternating colours – here black and
white. Make up some more of your own!

Whacky@x_D := If@EvenQ@Floor@xDD,
RGBColor@0, 0, 0D, RGBColor@1, 1, 1DD

WhackyComplexPlot3D@8func_, levels_<,
xrange_, yrange_, options___D :=
Plot3D@8Abs@func@x + I yDD,
Whacky@N@levels * HPi + Arg@func@x + I yDDL ê H2 PiLDD<,
xrange, yrange, optionsD

WhackyComplexPlot3D@8Sin, 20<, 8x, -2, 2<,


8y, -2, 2<, PlotPoints -> 100, Mesh -> False,
PlotRange -> All, ViewPoint -> 82, 2, 4<D
186 Complex Analysis with Mathematica

3
2
1
0
-2 -2
-
-1 -1
0 0
1 1

22
Sometimes the limited resolution of the plot routines can be used to generate some
interesting special effects, but this is more for fun than for understanding the function!

WhackyComplexPlot3D@8# ^ 10 &, 20<,


8x, -1, 1<, 8y, -1, 1<,
PlotPoints -> 150, Mesh -> False, PlotRange -> AllD

30
20 1
10 0.5
0
-11 0
-0.5
0 -0.5
0.5
1 -1
8 Complex functions 187

8.9 Ÿ Holey and checkerboard plots


Frequently a complex function of interest may fold over itself several times, and it may
be useful to see the folding. Mathematica's standard plot routines do not allow for
transparency so some special treatment is required. One approach is to use a visualiza-
tion tool, such as ‘Dynamic Visualizer’ (Mathematica Applications Package – Dynamic
Visualizer, 1999), that allows various levels of transparency to be set, in addition to a
host of other real-time manipulation features being enabled. Another approach is to plot
surfaces with many holes in them, so that you can see though the surface. One approach
to this was given by the author (Shaw, 1995b). Another more sophisticated approach has
been developed by M. Trott and V. Adamchik for the ‘Solving the Quintic’ project
(Adamchik and Trott, 1994). The simple approach given below has the advantage that
there is an obvious modification to allow high-contrast checkerboard plots. One might
have imagined that the ‘Whacky’ code given above would give sharp black and white
polygons in the plot. However, Mathematica interpolates the ColorFunction values
to produce intermediate shades of colour - greys in this case. Although this makes nicer
plots in general, it thoroughly undermines attempts to produce sharp colour divisions.
Finally, if you are using Mathematica technology beyond version 5.2, you should see the
CD and on-line supplement.
First, we give a simple routine for plotting surfaces with holes in them:

HoleyPlot3D[{f_,g_,h_},{u_,v_},{c_,d_},{n_,m_},
{cola_}, opts___] :=
Module[{data, plotdata},
data = Table[N[Through[{f, g, h}
[u+x*(v-u)/(n-1),c+y*(d-c)/(m-1)]]],
{x,0,n-1},{y,0,m-1}];
plotdata = Table[{cola,
Polygon[{data[[x,y]],data[[x+1,y]],
data[[x+1,y+1]],data[[x,y+1]]}]},
{x,1,n-1},{y,If[EvenQ[x], 2, 1],m-1, 2}];
Show[Graphics3D[plotdata], opts,
Lighting -> False, Boxed -> False]]

Now we apply it to redraw one of the surfaces given in Chapter 2, showing the real part
of the fourth root of z:

HoleyPlot3D[{((#1)*Cos[#2]&),((#1)*Sin[#2]&),
((#1)^(1/4)*Cos[(#2)/4]&)},
{0.01,1},{0, 8 Pi},{15,120}, {RGBColor[0,0,1]},
ViewPoint -> {-3, -3, 0}]
188 Complex Analysis with Mathematica

By filling in a second colour rather than a hole we obtain the following:

ChekerPlot3D[{f_,g_,h_},{u_,v_},{c_,d_},{n_,m_},
{cola_, colb_}, opts___] :=
Module[{data, plotdata},
data = Table[N[Through[{f, g, h}
[u+x*(v-u)/(n-1),c+y*(d-c)/(m-1)]]],
{x,0,n-1},{y,0,m-1}];
plotdata = Table[{If[EvenQ[x+y], cola, colb],
Polygon[{data[[x,y]],data[[x+1,y]],
data[[x+1,y+1]],data[[x,y+1]]}]},
{x,1,n-1},{y,1, m-1}];
Show[Graphics3D[plotdata], opts,
Lighting -> False, Boxed -> False]]

Here is a filled-in checkerboard plot of the (real part of the) cube root function:

ChekerPlot3D[{((#1)*Cos[#2]&),((#1)*Sin[#2]&),
((#1)^(1/3)*Cos[(#2)/3]&)},
{0.01,1},{0, 6 Pi},{15,120}, {RGBColor[1,1,1],
RGBColor[0, 0, 0]},
ViewPoint -> {-3, -3, 0}]
8 Complex functions 189

Such routines can often make the folds and intersections of a complex surface much
clearer.

8.10 Ÿ Fractals everywhere?


This section makes the point that iteration of some of our elementary transcendental
functions can also produce interesting fractal structures. This example is inspired by
Chapter 8 of the wonderful book by Gray and Glynn (1991), which I thoroughly encour-
age you to consult for details. You can try out examples such as the following by
combining ComplexPlot3D with generalizations of the escape-time algorithm to
special functions. In the following we just iterate Sin first twice and then three times.
Note the fluted structure that is suggestive of early fractal development/

ComplexPlot3D@HSin@Sin@#DD &L,
8x, -Pi, Pi<, 8y, -Pi, Pi<,
PlotPoints -> 50, PlotRange -> 80, 100<D
190 Complex Analysis with Mathematica

100
80
60
40 2
20
0
0
-2

0
-2
2

ComplexPlot3D@HSin@Sin@Sin@#DDD &L,
8x, -Pi, Pi<, 8y, -Pi, Pi<,
PlotPoints -> 60, PlotRange -> 80, 10 ^ 6<D

6
1µ 10
800000
600000
400000 2
200000
0
0
-2

0
-2
2
8 Complex functions 191

It is a simple matter to modify the escape-time algorithm to treat the case of the sine
function, or any other that you choose:

SinIter = Compile[{{z, _Complex}},


Module[{cnt, nz=N[z]},
For[cnt=0,
(Abs[nz] <100) && (cnt<100), cnt++,
nz = Sin[nz]];
N[cnt]]];

SinFrac[z_, {{remin_, remax_}, {immin_, immax_}},


steps_]:=
{{{remin, remax}, {immin, immax}},
Table[SinIter[x+I*y],
{y, immin, immax, (immax-immin)/steps},
{x, remin, remax, (remax-remin)/steps}]};

FracColor = (If[#==1, Hue[1,1,0], Hue[2 #]]&);


FracPlot[{{{remin_, remax_}, {immin_, immax_}},
matrix_},
colorfn_] :=
ListDensityPlot[matrix,
Mesh -> False, Frame -> False,
ColorFunction -> colorfn,
PlotRange -> {0, 100},
AspectRatio -> (immax-immin)/(remax - remin)]

Now we can make the development of a periodic fractal manifest:

FracPlot[SinFrac[0,
{{-1.5 Pi,1.5 Pi},{-1.5 Pi,1.5 Pi}},600],FracColor]
192 Complex Analysis with Mathematica

Exercises
8.1 Show that the zeroes of cosHzL are located at Hn + ÅÅÅÅ12 L p.

8.2 Using the definition of the sine and cosine functions in terms of the exponential
functions, show that for all complex z,

cos2 HzL + sin2 HzL = 1

8.3 Using the definition of the sinh and cosh functions in terms of the exponential
functions, show that for all complex z,

cosh2 HzL - sinh2 HzL = 1

8.4 Using the definition of the sine and cosine functions in terms of the exponential
functions, show that for all complex z and w,

sinHw + zL = cosHzL sinHwL + cosHwL sinHzL

cosHw + zL = cosHwL cosHzL - sinHwL sinHzL

8.5 Using the definition of the sinh and cosh functions in terms of the exponential
functions, show that for all complex z and w,

sinh Hw + zL = coshHzL sinh HwL + coshHwL sinh H zL


coshHw + zL = coshHwL coshHzL + sinhHwL sinhHzL

8.6 Work out the real and imaginary parts of the following functions, assuming that x
and y are real:

Hx + ÂyL5

cos Hx + ÂyL

sin Hx + ÂyL

cosh Hx + ÂyL

sinh Hx + Â yL

8.7 (Stereographic Projection) Let S denote the unit sphere x2 + y2 + z2 = 1. Let P be a


point on S with coordinates Hx, y, zL, and let P' denote the point on the plane z = 0
obtained by drawing a line from the north pole of S through P and extending it to the
plane z = 0. (P' is its intersection) Let P' have coordinates Hx', y', 0L and let

z = x£ + Ây£

Show that
x + Ây
z = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1-z
8 Complex functions 193

Deduce that
êê êê
Hz + z L Â Hz - z L H†z§2 - 1L
8x, y, z< = 9 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅ
Å ÅÅ , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ =
†z§2 + 1 †z§2 + 1 †z§2 + 1

If polar coordinates are introduced according to the rule

8x, y, z< = 8 sinHqL cosHfL, sinHqL sinHfL, cosHqL<

show also that


q
z = ‰Âf cotJ ÅÅÅÅÅ N
2
8.8 Where are the branch points of the following functions:

cos-1 HzL

cosh-1 HzL

tanh-1 HzL

Hint: use the logarithmic form of the inverse function. What branch cuts are possible for
these functions? Which choices make sense given the behaviour of these functions when
z is real?

Before trying out the following Mathematica examples, enter these definitions into the
kernel:

re@expression_D :=
ComplexExpand@Re@expressionD, 8z, w<D;
im@expression_D := ComplexExpand@
Im@expressionD, 8z, w<D;

8.9 Ÿ Use Mathematica to work out the real and imaginary parts of

Hx + ÂyL5

cos Hx + ÂyL

sin Hx + ÂyL

cosh Hx + ÂyL
sinh Hx + Â yL

8.10 Ÿ Use Mathematica to plot the inverse functions cos-1 HzL, cosh-1 HzL and tanh-1 HzL.
Where do these plots suggest the branch cuts are? Do the plots reflect the answers you
have given for Exercise 8.8?
9 Sequences, series and power series

Introduction
In this chapter we introduce the concepts of sequences and series, and explore their
convergence properties. We also look briefly at how elementary functions can be
defined by series. We begin by reviewing basic concepts of convergence. This is
intended to be a review only, and to supply statements of a number of key definitions
and theorems without the proofs that would be traditionally the domain of a rigorous
course in real analysis, where the extension of results to complex numbers is a largely
trivial matter. We focus our attention, when it comes to supplying proofs, on matters
related to power series, since it is such series that are of critical interest to complex
analysis. Students of pure mathematics should ensure that they are aware of the back-
ground material, whereas more applications-oriented people can just take note of the
results. The main result of this section, on the radius of convergence of a power series, is
of critical importance to all.

9.1 Sequences, series and uniform convergence

‡ Sequences of complex numbers


A sequence of complex numbers is respresented by prescribing a mapping from the
positive integers into . That is, we have a set of complex numbers

z1 , z2 , …, zn , … (9.1)

We need to describe various properties of sequences. We say that such a sequence is


bounded if there is a real number M such that

†zn § < M (9.2)

for all n. We say that such a sequence has a limit a, or is convergent to a, if, given any
e > 0, we can find an integer N such that, for all n > N,

†zn - a§ <  (9.3)

‡ Sequences of functions and uniform convergence


A sequence of complex functions is represented by prescribing a mapping from the
positive integers into the set of mappings from  to . That is, we have a set of complex
functions

f1 HzL, f2 HzL, …, fn HzL, … (9.4)


9 Sequences, series and power series 195

We say that such a sequence is convergent to f HzL, if, for each z, given any e > 0, we can
find an integer N such that, for all n > N,

† fn HzL - f HzL§ < e (9.5)

In general, we may need to choose a different e for each z. If we can find one that will do
for all z, we say that the sequence is uniformly convergent. More formally, we say that
such a sequence is uniformly convergent to f HzL, if, given any e > 0, we can find an
integer N such that, for all z, and all n > N,

† fn HzL - f HzL§ <  (9.6)

‡ Series of functions and uniform convergence


We obtain a series of functions by considering the partial sums

S1 HzL = f1 HzL (9.7)

S2 HzL = f1 HzL + f2 HzL (9.8)

Sn HzL = f1 HzL + f2 HzL + … + fn HzL (9.9)

Such a series is said to be convergent if the sequence Sn HzL is convergent. We write this
limit as

SHzL = ‚ fn HzL (9.10)
n=1

Similarly, we say that the series is uniformly convergent if the partial sums are uni-
formly convergent as a sequence.

‡ Absolute convergence
The series

SHzL = ‚ fn HzL (9.11)
n=1

is said to be absolutely convergent if the series



AHzL = ‚ † fn HzL§ (9.12)
n=1

is convergent. Note that the convergence of the absolute values implies the convergence
of the original series. If the series itself converges, but the corresponding series of
absolute values does not, we say that the series is conditionally convergent.
196 Complex Analysis with Mathematica

9.2 Theorems about series and tests for convergence


These results are really the province of a course on basic analysis. We list them here for
completeness, but refer the reader to a text such as Rudin (1976) for proofs.

ü Theorem 9.1: The terms of a convergent series tend to zero


If the series

SHzL = ‚ fn HzL (9.13)
n=1

is convergent then fn HzL Ø 0 as n Ø ¶.

ü Theorem 9.2: A bounded sequence has a convergent subsequence


A subsequence is defined by a set of integers

n1 < n2 < n3 < … < nk < … (9.14)

Then the theorem takes the following form. If the sequence

z1 , z2 , …, zn , … (9.15)

is bounded then there is a subsequence

zn1 , zn2 , …, znk , … (9.16)

that converges to a limit.

ü Theorem 9.3: Monotone bounded real sequences converge


Let an be a real sequence that is bounded, i.e. » an » < M. Then if the bounded sequence
an satisfies either the condition that it is monotone increasing:

an b an+1 (9.17)

or, that it is monotone decreasing:

an r an+1 (9.18)

then the sequence converges.

ü Theorem 9.4: Cauchy's convergence criterion


Suppose that given e > 0, we can find an N such that p > N › q > N implies

†a p - aq § <  (9.19)
9 Sequences, series and power series 197

then the sequence an is convergent. Note the use of › to indicate that both inequalities
have to be satisfied.

ü Operations with absolutely convergent series


The terms of an absolutely convergent series may be reorganized without affecting the
sum of the terms. Furthermore, two absolutely convergent series may be added, sub-
tracted and multiplied to obtain new absolutely convergent series whose limits are the
sum, difference and product of the two. Multiplication is not necessarily possible with
conditionally convergent series.

‡ Basic tests for convergence

ü Theorem 9.5: The comparison test


If

‚ †an § (9.20)
n=1

converges and †bn § b †an §, then



‚ bn (9.21)
n=1

is absolutely convergent.

ü Theorem 9.6: The ratio test


If
an+1
lim À ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ À = L (9.22)
nض an

then

‚ an (9.23)
n=1

converges absolutely if L < 1 and diverges if L > 1. No information is available (the test
fails) if L = 1.

ü Theorem 9.7: The nth root test


If

lim †an §1ên = L (9.24)


nض
198 Complex Analysis with Mathematica

then

‚ an (9.25)
n=1

converges absolutely if L < 1 and diverges if L > 1. No information is available (the


test fails) if L = 1.

ü Theorem 9.8: Dirichlet's test


If br is a real, monotone-decreasing sequence, with br Ø 0 as r Ø ¶, and an is a
complex sequence with the property that
n
‚ ar (9.26)
r=1

is bounded for all n, then



‚ ar br (9.27)
r=1

is convergent.

ü Theorem 9.9: The integral test for convergence


Suppose that f HxL is non-negative and decreases monotonically for

x r x0 (9.28)

Then

‚ f HnL (9.29)
n=1

is convergent (divergent) if
M
lim ‡ f HxL „ x (9.30)
Mض x0

is convergent (divergent).

ü Theorem 9.10: The alternating series test


If an r 0 and an r an+1 and an Ø 0, then

‚ H-1L an
n
(9.31)
n=1
9 Sequences, series and power series 199

converges. Note that this is a special case of Dirichlet's test. The alternating series test
can often be used to check the behaviour of a power series at z = -1, whereas the
Dirichlet test can be used to test behaviour elsewhere on the unit circle – we shall look at
this later in Section 9.3.

‡ Review of results on uniform convergence


The property of a sequence or series of functions that they are uniformly convergent is
of particular importance. First a reminder:

A sequence of functions fn HzL is uniformly convergent on a subset U Õ , to f HzL, if,


given any e > 0, we can find an integer N such that, for all z, and all n > N,
† fn HzL - f HzL§ < .

A number of results follow from this. A full statement and proof of some of them must
wait until we have defined complex integration and differentiation properly, but it is also
convenient to group them here.

ü Theorem 9.11: Uniform convergence and continuity


Suppose fn HzL Ø f HzL uniformly on U. If fn HzL is continuous for all n, then f HzL is
continuous. Proof: Given e > 0, we can find an N such that n > N implies

† fn HzL - f HzL§ < e (9.32)

for all z œ U. Let w œ U. Then, since fn is continuous at w, we can find a d such that
» z - w » < d fl » fn HzL - fn HwL» < e ê 3. Then, using the triangle inequality, given that

f HzL - f HwL = H f HzL - fn HzLL + H fn HzL - fn HwLL + H fn HwL - f HwLL (9.33)

we can see that

» f HzL - f HwL » b » f HzL - fn HzL » + » fn HzL - fn HwL » + » fn HwL - f HwL »


(9.34)
b eê3 +eê3 +eê3 = e

Hence f is continuous on U.
This is a good place to remind you that in constructing any sort of ‘e - d’ proof
of this type, it is not necessary to pull ‘out of a hat’, in advance, convenient factors such
as e ê 3. The point is to show that » f HzL - f HwL » can be made as small as you like. This
often involves many applications of the triangle inequality.

ü Theorem 9.12: Uniform convergence and integration or differentiation


We have not officially defined complex integration and differentiation yet, so we cannot
yet state this properly. It will be revisited in Chapters 10 and 11. However, the result is
easy to state informally: suppose that fn HzL is continuous and fn HzL Ø f HzL uniformly.
Then
200 Complex Analysis with Mathematica

‡ fn HzL „ z Ø ‡ f HzL „ z (9.35)

This can be applied to a series just as easily as to a sequence. This then says that we can
integrate a uniformly convergent series term by term. The corresponding differentiation
theorem for series is slightly weaker. Suppose that each fn HzL is differentiable and that
the series of derived terms

£
‚ fn HzL (9.36)
n=1

is uniformly convergent, and that



‚ fn HzL (9.37)
n=1

is convergent on a set U. Then




ÅÅÅÅÅÅÅÅÅ ‚ fn HzL (9.38)
z n=1

exists and equals ⁄¶ £


n=1 fn HzL. This follows by applying the theorem on integration to the
derived series. Note that the form of the theorem as stated here is the weak form of the
differentiation theorem that also applies in the case of real functions. There is a stronger
form of the theorem, known as Weierstrass's Theorem, which asserts that the limit of a
uniformly convergent sequence of holomorphic functions is holomorphic, and that the
derivative sequence converges to the derivative of the limit. A discussion of this is
beyond the scope of this text. For a discussion, see for example Ahlfors (1979), Section
5.1.

‡ Theorem 9.13: The Weierstrass M-test


This result is best stated as the following theorem. Suppose that » fn HzL » b Mn on a set
U where Mn is independent of z within U, and that

‚ Mn (9.39)
n=1

is convergent. Then

‚ fn HzL (9.40)
n=1

is uniformly convergent in U. The proof is straightforward, and proceeds by considering


the remainder
9 Sequences, series and power series 201


RN = ‚ fn HzL (9.41)
n=N+1

ƒƒ ¶ ƒƒ ¶ ¶
ƒƒ ƒƒ
†R N § = †ƒ ‚ fn HzL§ƒ b ‚ † fn HzL§ b ‚ Mn (9.42)
ƒƒƒn=N+1 ƒƒƒ n=N+1 n=N+1

Now since the series of Mn is convergent, given e > 0, we can find an N0 such that
N > N0 implies

‚ Mn < e (9.43)
n=N+1

Since N0 is clearly independent of z, the series of fn is manifestly uniformly convergent.


Note that by the comparison test the series is also absolutely convergent.

‡ Uniform convergence counter examples


It is important to understand that the conditions of the results just stated are necessary.
This is made clear by the following examples, which use real variables.

ü Continuity failure example


Investigate the uniform convergence of
1
fn HxL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (9.44)
nx+1
(i) on a region defined by x > a > 0; (ii) on the region x r 0.

ü Integration failure example


Let f HxL be defined by:

l
o 0 if x = 0
o
o
o n2 x if 0 < x b 1 ê n
fn HxL = m
o (9.45)
o
o n - n2 Hx - 1 ê nL if 1 ê n < x b 2 ê n
o
n 0 if x > 2 ê n

To what function of x does fn HxL converge pointwise? Is the convergence uniform? What
is the integral of fn HxL over positive x? What is the integral of the limit function over
positive x? Try the following Mathematica input to investigate matters visually:

plotf@x_, n_D := Which@x == 0, 0,


0 < x <= 1 ê n, n ^ 2 * x,
1 ê n < x <= 2 ê n, n - n ^ 2 Hx - 1 ê nL, True, 0D
202 Complex Analysis with Mathematica

plotn@n_D :=
Plot@plotf@x, nD, 8x, 0, 2<, PlotRange -> 80, 20<D;

Have a look at plotn[3], plotn[7] to get yourself going.

9.3 Convergence of power series


The basic property of a power series that is of interest is the concept of a radius of
convergence. This is so important we make it into a Theorem:

ü Theorem 9.14: Existence of a radius of convergence


Given a series

‚ a n zn (9.46)
n=0

one of three things happens:

(1) the series converges for z = 0 only;


(2) the series converges for all (finite) z;
(3) there is a real number R such that the series is convergent for all z with » z » < R
and divergent for all z with » z » > R.

Note that no information is available about what happens when » z » = R. In fact,


anything can happen, as discussed below. The key to understanding the existence of a
disk inside which the series converges is the following result. Suppose that the series

‚ a n zn (9.47)
n=0

converges for z = z1  0. Then the series is absolutely convergent at each point in the
open set defined by

†z§ < †z1 § (9.48)

To prove this, note that the terms in the series with z1 are bounded :

†an zn1 § b M (9.49)

for some positive real number M. Now suppose that

†z§ < †z1 § (9.50)

and let
z
r = ¢ ÅÅÅÅÅÅÅÅ ¶ (9.51)
z1
9 Sequences, series and power series 203

then
z n
†an zn § = †an zn1 § ¢ ÅÅÅÅÅÅÅÅ ¶ b M rn (9.52)
z1

with r < 1. This allows us to use the comparison test with a convergent series to infer
that

‚ †an zn § (9.53)
n=0

is convergent. Hence the series is absolutely convergent when †z§ < †z1 §. What we want
for R is the largest value of †z1 § for which this works. We define it by the following:


R = sup 9 †z§ : ‚ †an zn § converges= (9.54)
n=0

We find the radius by using simple tests such as the ratio test.

ü Examples of differing radii of convergence


We can give explicit examples of the various types of behaviour. You should check,
using the ratio test, that

‚ zn n ! (9.55)
n=1

has radius of convergence zero, that



zn
‚ ÅÅÅÅÅÅÅÅÅ (9.56)
n=1
n!

has radius of convergence infinity, and that



z n
‚ J ÅÅÅÅÅ N (9.57)
n=1
4

has radius of convergence 4.

‡ What happens on the boundary circle?


The family of power series:

zn
sHk, zL = ‚ ÅÅÅÅÅkÅÅÅÅ (9.58)
n=1
n
204 Complex Analysis with Mathematica

is instructive in this respect.We can use the ratio test to demonstrate that the radius of
convergence is 1 for all k. If k = 0 then the terms do not go to zero anywhere on the
boundary, so that the series is not convergent anywhere on the boundary. This occurs in
spite of the fact that
1
sH0, zL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (9.59)
1-z
for

†z§ < 1 (9.60)

and this function may be evaluated everywhere in the complex plane except z = 1.
When k = 1 matters are more complicated. If z = 1 the series is divergent (to see this
use the ‘old trick’ of grouping the terms in pieces, each of which is greater than 1 ê 2).
For other z on the unit circle, we can use the Dirichlet test to show that the series is
convergent. When k = 2, we use the fact that

1
‚ ÅÅÅÅÅ2ÅÅÅÅ (9.61)
n=1
n

is convergent to infer that sH2, zL is absolutely convergent on » z » = 1. On the boundary,


the series may converge everywhere, nowhere, or on a strict subset of the boundary. The
convergence of these types of series can be visualized with Mathematica (see below).

ü Theorem 9.15: Uniform convergence of power series


Suppose that a power series

‚ a n zn (9.62)
n=1

converges for z = z0 . Then it converges uniformly for » z » b » z1 », where » z1 » < » z0 ».


The proof uses the Weierstrass M-test in a very simple way. Set

†z1 §n
Mn = ÅÅÅÅÅÅÅÅÅÅÅÅnÅÅ (9.63)
†z0 §

and note that ⁄¶


n=1 Mn converges by the geometric series property. Now, since

‚ a n z0 n (9.64)
n=1

converges, then

lim an z0 n = 0 (9.65)
nض

and so, for large enough n, we must have


9 Sequences, series and power series 205

1
†an § < ÅÅÅÅÅÅÅÅÅÅÅÅnÅÅ (9.66)
†z0 §

It follows that

†an zn § < Mn (9.67)

for » z » b » z1 », so by the M-test, ⁄¶ n


n=1 an z is uniformly convergent. Therefore a power
series is uniformly convergent in any disc entirely inside the circle of convergence.

9.4 Functions defined by power series


We can write down series definitions of many common functions. Here are a few:

zn z2 z3
expHzL = ‚ ÅÅÅÅÅÅÅÅÅ = 1 + z + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + ... (9.68)
n=0
n! 2! 3!

H-1Ln-1 z2 n-1 z3 z5
sinHzL = „ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = z - ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ - ... (9.69)
H2 n - 1L ! 3! 5!
n=1


H-1Ln-1 zn z2 z3
logH1 + zL = „ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = z - ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅ - ... (9.70)
n 2 3
n=1

Finding the radii of convergence of these and related series is left to you as an exercise.

9.5 Ÿ Visualization of series and functions


The behaviour of the convergence of power series, suitably truncated, can be explored
with Mathematica. First, load a package to help with plotting:

Needs@"Graphics`ParametricPlot3D` "D

Next, define a family of truncated power series and a plot routine:

UnitCoefPowerSeries[z_, a_, N_Integer] :=


Sum[z^k/k^a, {k, 1, N}]

plot[n_, ptsr_, ptsang_, trunc_] :=


ParametricPlot3D[{r*Cos[theta], r*Sin[theta],
Abs[UnitCoefPowerSeries[r*Exp[I*theta], n, trunc]],
Hue[Arg[UnitCoefPowerSeries[r*Exp[I*theta], n,
trunc]]/Pi]},
{r, 0.001, 0.99}, {theta, 0, 2 Pi},
PlotRange -> All, ViewPoint -> {-2, -2, 2},
Lighting -> False, Axes -> False,
PlotPoints -> {ptsr, ptsang}];
206 Complex Analysis with Mathematica

Finally, try it out for n = 2 and 1, and explore other parameters.

plot@2, 30, 60, 20D

plot@1, 30, 60, 30D


9 Sequences, series and power series 207

Exercises
9.1 Use the ratio test to show that the radii of convergence of each of the series (in
powers of z) for expHzL, sinHzL, cosHzL, logH1 + zL, are, respectively, ¶, ¶, ¶, 1.

9.2 Let m be a posititve integer. Expand the function


1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅmÅÅÅÅÅ
H1 - zL

in a power series about the point z = 0. What is the radius of convergence of this series?
Repeat this exercise by expanding about the point z = -1. What is the radius of conver-
gence of this new series. (Note that to expand about z = -1 you write the function in
terms of w = z + 1 and expand in powers of w.)

9.3 What is the radius of convergence of the series



‚ n ! zn ?
n=1

9.4 What is the radius of convergence of the series



‚ n 4 zn ?
n=1

9.5 Bessel functions Jn HzL are defined for n real and non-negative by the power series
¶ 2n+n
H-1Ln H ÅÅÅÅ2z L
„ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
n ! Hn + nL!
n=1

What is the radius of convergence of this series?

9.6 Ÿ Use the definition of the function UnitCoefPowerSeries to explore the


behaviour of this function with a = 0, 1, 2, using ParametricPlot3D.

9.7 Ÿ Mathematica can generate power series using the Series function. Try, e.g.,

Series@Exp@zD, 8z, 0, 7<D

Explore the power series for sinHzL, coshHzL and J0 HzL in terms of powers of z. Use
?Series to find out how Series works, and find series of these functions about z = 1.

9.8 Ÿ Sometimes you can generate series about infinity also. Explore the action of

Series@Exp@zD, 8z, Infinity, 2<D

with Exp[z] replaced in turn by Sin[z], Cosh[z] and BesselJ[0,z].


10 Complex differentiation

Introduction
In this chapter we introduce the concept of differentiation of a complex function of a
complex variable. There are several ways of approaching this topic, and we shall
consider at least two. Given that a complex number may be regarded as a pair of real
numbers, we need to make very clear the distinction between differentiability of a
function that has two real arguments and differentiability of a function with a single
complex argument, and shall take as our starting point a review of the differentiation of
functions of two real variables. This approach has the merit of generalizing in a straight-
forward way to functions of many real or complex variables. We shall also consider
another simple approach to differentiation based on the limit of a ratio. This latter
approach is perhaps more familiar if you have taken a course in one-variable real
calculus, but does not generalize to functions of several real or complex variables. A key
result that we will establish is that a complex function is differentiable in the complex
sense if (a) it is differentiable when considered as two real functions of two real vari-
ables and also (b) the Cauchy–Riemann equations (partial differential equations) apply.
These equations link the real and imaginary parts of the function. After proving some
basic results about complex differentiability, e.g., the product, quotient and chain rules,
we then derive one of the principal results of basic complex analysis – that power series
are differentiable within their radius of convergence. This establishes the differentiabil-
ity of a large class of functions and explains why, as in Chapter 9, we like to think about
functions in terms of power series.
In this chapter you will also see traditional and novel ways of recovering a
holomorphic function from either its real or its imaginary part. This is accomplished
traditionally by solving the Cauchy–Riemann equations. You will see here, in Section
10.10, how this can be accomplished algebraically by considering holomorphic func-
tions of two complex variables. This is another good reason for approaching differentia-
tion in a way that can be applied to two or more variables. This result has a rather
intriguing history. The author uncovered some of the details of the history as a result of
an appeal for information in an article published in SIAM Review (Shaw, 2004) where a
Mathematica implementation of the main result was first given. The author wishes to
expresses his thanks to Prof. Harold Boas and others for responding and submitting
information leading to the discussion in Section 10.10. The title of that section is ‘The
Ahlfors–Struble(?) Theorem’, the ? reflecting the nagging feeling that the result might
be older than the original text by Ahlfors (1953). Further information on the result, as
given, predating Ahlfors’ 1953 text, would be appreciated.
Our first task, to which we now turn, is to define what it means for a complex
function to be differentiable at a point.
10 Complex differentiation 209

10.1 Complex differentiability at a point

‡ Differentiation of functions of two real variables


Since a complex number can be viewed as a pair of real numbers, a complex function of
a complex variable is at once a pair of functions of two real variables:

f HzL = f Hx + ÂyL = uHx, yL + ÂvHx, yL (10.1)

Let's define differentiability of a real function of two real variables. We say that a
function uHx, yL is differentiable at Hx, yL if we can write, for some pair of real numbers
A, B
uHx + h, y + kL = uHx, yL + Ah + Bk + rHh, k, x, yL (10.2)
è!!!!!!!!
!!!!!!!
for all Hh, kL with h2 + k2 < e, subject to the condition that
ƒƒ ƒƒ
ƒ r ƒ
†ƒ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å Å §ƒ Ø 0 (10.3)
ƒƒ è!!!!!!!!
h2 + k2 ƒƒ
! !!!!!!

as Hh, kL Ø H0, 0L. This says that we can find a linear approximation to the function in
the neighbourhood of the point of interest. This is the proper definition of differentiabil-
ity, and it says, geometrically, that the surface defined by f has a tangent plane at the
point in question. It is related in quite a subtle way to the existence of ordinary partial
derivatives, as the following two observations will point out.

ü Differentiability implies the existence of partial derivatives


uHh+x, yL-uHx, yL
We can ask the question: does the limit: limhØ0 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
h
ÅÅÅÅÅÅÅÅÅÅÅÅ exist? Using our formula,
we see that in a neighbourhood of the point Hx, yL
uHx + h, yL - uHx, yL r
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = A + ÅÅÅÅÅ (10.4)
h h
so that the limit can be taken, revealing that
uHx, yL
A = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.5)
x
Similarly, it follows that the partial derivative with respect to y exists and equals B.

ü Existence of partial derivatives does not imply differentiability


In fact, matters are rather worse than the title of this section might imply, for it is
possible for partial derivatives to exist at a point (or even everywhere) without a func-
tion even being continuous at that point. The following exercise makes this clear:

Exercise: Let uH0, 0L = 0, and for other values of x and y, let


210 Complex Analysis with Mathematica

xy
uHx, yL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ (10.6)
x2 + y2

Show that both the partial derivatives


uHx, yL uHx, yL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.7)
x y

exist everywhere. [Hint: At the origin you need to apply the basic definition.] By
considering uHr cosHqL, r sinHqLL , show that u is not continuous at the origin. [Hint: Look
at what happens to the function as you approach the origin from various directions.] At
the end of this chapter, Exercise 10.16 gives another nicely perverse example, illustrat-
ing the fact that having one-dimensional differentiability in all directions (not just the x-
and y-axis directions) is still not sufficient to guarantee differentiability in the two-dimen-
sional sense!

ü Ÿ Visualization of discontinuous function with partial derivatives


The following plots help to illuminate the somewhat hazardous relationship between the
existence of partial derivatives and differentiability. The function considered in the
previous exercise is plotted, first in Cartesian coordinates, then, more smoothly, in its
polar form. In each case it is clear that there is a discontinuity at the origin. But the
function is zero along both axes – so the partial derivatives exist at the origin.

Plot3D@x y ê Hx ^ 2 + y ^ 2L,
8x, -1, 1<, 8y, -1, 1<, PlotPoints -> 50D

0.5
0.25 1
0
-0.25 0.5
-0.5
-11 0
-0.5
0 -0.5
0.5
1 -1

ParametricPlot3D@8r Cos@qD, r Sin@qD, Sin@2 qD ê 2<,


8r, 0, 1<, 8q, 0, 2 p<, PlotPoints -> 820, 40<D
10 Complex differentiation 211

0.5
0.25
0 1
-0.25 0.5
-0.5
-1 0
-0.5
0 -0.5
0.5
-1
1

10.2 Real differentiability of complex functions


Now suppose that we have a complex function related to a pair of real functions as
follows:

f HzL = f Hx + ÂyL = uHx, yL + ÂvHx, yL (10.8)

We say that the pair of real functions u v are differentiable at Hx, yL if there are real
numbers A, B, C, D such that we can write, with u and v defined in a neighbourhood of
Hx, yL
uHx + h, y + kL = uHx, yL + Ah + Bk + rHh, k, x, yL (10.9)

vHx + h, y + kL = vHx, yL + Ch + Dk + sHh, k, x, yL (10.10)

for all Hh, kL in an -neighbourhood of H0, 0L, subject to the conditions that
ƒƒ ƒƒ ƒƒ ƒƒ
ƒ r ƒ ƒ s ƒ
†ƒ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅÅÅÅÅ
! Å ÅÅÅ
!!!!!!Å Å § Ø 0, †ƒ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅÅÅÅÅ
! Å ÅÅÅ
!!!!!!Å Å §Ø0 (10.11)
ƒƒ h2 + k2 ƒƒƒ ƒƒ h2 + k2 ƒƒƒ

as Hh, kL Ø (0,0). This again says that we can find a linear approximation to each real
function in the neighbourhood of the point of interest. This is the proper definition of
differentiability of mappings 2 Ø 2 . So far so good. We see that the differentiability
of such a map relies in part on the existence of numbers A, B, C and D, which may be,
and usually will be, independent. This approach allows us to define differentiation of
vector-valued functions of vectors using a matrix formalism, since we can write

ij uHh + x, k + yL yz uHx, yL A B ij h yz r
j z=J N+ J N.j z + J N (10.12)
k vHh + x, k + yL { vHx, yL C D k k { s
212 Complex Analysis with Mathematica

The matrix with components A…D is a linear map that we call the derivative of the
mapping 2 Ø 2 . It should now be obvious what the derivative of a mapping m Ø n
is – it is a matrix, as here in the case m = n = 2.

10.3 Complex differentiability of complex functions


Now suppose, precisely as before, that we have a complex function and a pair of real
functions defined through the relation

f HzL = f Hx + ÂyL = uHx, yL + ÂvHx, yL (10.13)

We write z = x + Ây, w = h + Âk, and suppose that f is defined in a neighbourhood of z.


We say that f is differentiable at z, considered as a complex function, if there is a
complex number E such that we can write

f Hz + wL = f HzL + Ew + sHw, zL (10.14)

for all w in an -neighbourhood of zero, subject to the condition that


s
¢ ÅÅÅÅÅÅ ¶ Ø 0 (10.15)
w
as w Ø 0. This again says that we can find a linear approximation to the function in the
neighbourhood of the point of interest. This is the proper definition of differentiability of
mappings  Ø . So just how does it differ from that we have written down for two real
functions of two real variables? It's easy to find out. We just write

E = a + Âb (10.16)

s = r + Âs (10.17)

and expand our definition:

uHh + x, k + yL + ÂvHh + x, k + yL
(10.18)
= uHx, yL + ÂvHx, yL + Ha + bÂL Hh + ÂkL + r + Âs

When we take the real and imaginary parts, we obtain

uHx + h, y + kL = uHx, yL + ah - bk + r (10.19)

vHx + h, y + kL = vHx, yL + bh + ak + s (10.20)

This is just like the pair of real equations, except that the four independent numbers A,
B, C, D, have been replaced, respectively, by a, - b, b, a. So there is a constraint
between the partial derivatives of u and v. If we write this in conventional form, we see
that
u v
ÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅ (10.21)
x y
10 Complex differentiation 213

u v
ÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅ (10.22)
y x

These relations are very important and are given a special name: ‘The Cauchy–Riemann
equations’. This analysis has established the following important result:

‡ Theorem 10.1: differentiability of complex functions


A complex function is differentiable as a mapping  Ø  if and only if:

(1) the Cauchy–Riemann equations hold, AND,


(2) the function is differentiable in the real sense, as a mapping 2 Ø 2 .

The number E = a + Âb, is called the complex derivative of the map, and is usually
referred to simply as f £ HzL.

10.4 Definition via quotient formula


The approach we have taken so far makes clear the relationship between real and
complex differentiation, and has the advantage of generalizing nicely to functions of
several real or complex variables – we just assume that the function has a linear approxi-
mation in the neighbourhood of a point. However, within the confined scope of just
considering one complex function of one complex variable, a simpler approach can be
used. We can say that f HzL is differentiable at z, if f is defined in a neighbourhood of z,
and the limit
f Hw + zL - f HzL
lim ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.23)
wØ0 w
exists, and is independent of the manner in which w Ø 0. If this limit exists, it is denoted
f £ HzL, as before.
You should carry out the following two-part exercise:

(1) Show that this definition is equivalent to the one we have given.
(2) By considering w real, and then imaginary, derive the Cauchy–Riemann equations
from this definition.

Note that the definition by the quotient method is very popular in elementary texts, but
does not, for obvious reasons (how do you divide by a vector?) generalize to many
variables. For this reason this test will develop the theory within the approach of Section
10.3.
214 Complex Analysis with Mathematica

10.5 Holomorphic, analytic and regular functions


We use the word ‘differentiable’ to denote behaviour at a single point. If a function is
differentiable at every point in an open set U Õ , we say that it is ‘holomorphic’ on U,
or ‘analytic’ (or, less frequently, ‘regular’) on U. These terms will be regarded as
synonymous - different books and papers may use different terminology. We shall use
the terms holomorphic and analytic essentially interchangeably. The important thing is
to remember that differentiability refers to the behaviour of a function at a point,
whereas holomorphic/analytic/regular refers to the behaviour of a function on a speci-
fied open set.
Some books, with which I have no serious argument, prefer use the word
‘analytic’ to refer to functions having a convergent power series expression, with
‘holomorphic’ being reserved for differentiability on an open set. These terms become
synonymous once one has the theorems expressing the equivalence of (a) being differen-
tiable on an open set and (b) having a power series. The fact that power series are
differentiable where they converge is proved in Section 10.8, and the converse is
discussed in Section 13.2. In order to make sure that one has terminology and other
matters under control, you are recommended to try Exercises 10.2 and 10.3 at the end of
this chapter.

10.6 Simple consequences of the Cauchy–Riemann


equations
There are a few basic consequences of the Cauchy–Riemann equations that are easily
derived, and that have very important consequences, especially in the development of
applications in applied mathematics.

‡ Orthogonality of curves of constant u and v


Consider the curves uHx, yL = constant, vHx, yL = constant. The normal to the curve
uHx, yL = constant is the vector grad u with components:

ij ÅÅÅÅ
u
ÅÅ y
x z
j
grad u = jj u zzzz
j (10.24)
k ÅÅÅÅ
ÅÅ
y {

and similarly for v. The Cauchy–Riemann equations imply that

u 2 u 2 v 2 v 2
J ÅÅÅÅÅÅÅÅÅ N + J ÅÅÅÅÅÅÅÅÅ N = J ÅÅÅÅÅÅÅÅÅÅ N + J ÅÅÅÅÅÅÅÅÅÅ N (10.25)
x y x y

and that
u v u v
ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅ = 0 (10.26)
x x y y
10 Complex differentiation 215

so that the normals to the two curves have the same length, and are, by the second
relation, orthogonal.

‡ Laplace's equation and harmonic functions


If we can differentiate again, and also swap the order of differentiation (and we shall
show later that this is the case), we can use the Cauchy–Riemann equations to derive an
important result.
v u
2 u I ÅÅÅÅ u
xÅÅÅÅ M
I ÅÅÅÅ y
ÅÅ M I ÅÅÅÅ v
xÅÅÅÅ M
I ÅÅÅÅ y
ÅÅ M 2 u
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ (10.27)
x x x y y y

Hence we see that

2 u 2 u
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = 0 (10.28)
x y

so that u satisfies Laplace's equation. Such a function is said to be ‘harmonic’. We leave


it to you to show that the same holds for v. This leads to some very practical applications
of analytic functions to any application of potential theory, including special types of
fluid flow, electro- and magnetostatics, and two-dimensional gravity models.

10.7 Standard differentiation rules


All the basic rules that apply to differentiation of real functions extend to complex
functions. Suppose that we have two functions f and g, each satisfying, in a neighbour-
hood of z,

f Hz + wL = f HzL + Ew + sHwL (10.29)


è HwL
gHz + wL = gHzL + Fw + s (10.30)

We shall prove all the basic rules, using the ‘approximate linear mapping’ definition of
differentiability. Within this framework the proofs are all easy. Note the order of the
proofs of the rules: sum, product, chain, 1 ê z, 1 ê f , quotient. As long as one can write
down the rule for 1 ê z, it is not necessary to do much else to establish the quotient rule.

ü Sum rule
Let h = f + g, then
è HwL
hHz + wL = f Hz + wL + gHz + wL = f HzL + Ew + sHwL + gHzL + Fw + s
= f HzL + gHzL + HE + FLw + Hs + s èL (10.31)
£
= hHzL + h HzL w + S

where S = s + s è and h£ HzL = E + F = f £ HzL + g£ HzL. Hence h is differentiable and the


derivative is the sum of those of f and g.
216 Complex Analysis with Mathematica

ü Product rule
To make the operation of multiplication rather more explicit, we temporarily use the
‘times’ symbol μ rather than an implicit multiplicative space.

Let h = f μ g, then

hHz + wL = f Hz + wL μ gHz + wL
= H f HzL + Ew + sHwLL μ HgHzL + Fw + s è HwLL (10.32)
= f HzL μ gHzL + H f HzL μ F + gHzL μ ELw + R

where the remainder R is given by:


è HwL + HgHzL + FwL μ sHwL + EFw2 + sHwL s
R = H f HzL + EwL μ s è HwL (10.33)

This clearly satisfies » R ê w » Ø 0 as w Ø 0, so h is differentiable and

h£ HzL = F μ f HzL + E μ gHzL = gHzL μ f £ HzL + f HzL μ g£ HzL (10.34)

ü Chain rule
Let p = f HzL and suppose that f is differentiable at z and that g is differentiable at p, i.e.

f Hz + wL = f HzL + Ew + sHwL (10.35)


è HqL
gHp + qL = gHpL + Fq + s (10.36)

Let hHzL = gH f HzLL. Then

hHz + wL = gH f Hz + wLL = gH f HzL + Ew + sHwLL = gHp + qL (10.37)

where p = f HzL and q = Ew + sHwL.


è HEw + sHwLL
hHz + wL = gHpL + FHEw + sHwLL + s
(10.38)
= gH f HzLL + FEw + S

where the remainder


è HEw + sHwLL
S = FsHwL + s (10.39)

It is easily checked that » S ê w » Ø 0 as w Ø 0, so h is differentiable and

h£ HzL = EF = f £ HzL g£ H f HzLL (10.40)

ü 1 ê z rule
The quotient rule is best derived by working with the function f = 1 ê z and applying the
rules already developed. First let's do some basic algebra:

1ê Hz + wL= 1 ê z + H1 ê Hz + wL - 1 êzL
= 1 ê z + Hz - Hz + wLL ê Hz * Hz + wLL
= 1 ê z - w ê Hz * Hz + wLL
(10 41)
10 Complex differentiation 217

= 1 ê z - w ê z2 + Hw ê z2 - w ê Hz * Hz + wLLL
= 1 ê z - w ê z2 + Hw ê zL * H1 ê z - 1 ê Hz + wLL
= 1 ê z - w ê z2 + w2 ê Hz2 Hz + wLL

That is, with s = w2 ê Hz2 Hz + wLL, we have

1 êHz + wL = 1 ê z + H-1 ê z2 L w + s (10.42)

so, provided z  0, 1 ê z is differentiable with derivative -1 ê z2 , which is a familiar result


in other contexts.

ü 1 ê f rule
The rule for differentiating 1 ê f HzL now follows by the result for 1 ê z and the chain rule,
applied as above with f given and gHpL = 1 ê p. So the derivative of 1 ê f HzL exists
provided f HzL  0 and equals
f £ HzL
- ÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ (10.43)
f HzL

ü f ê g rule
The quotient rule follows from the product rule and the result for 1êg. The derivative is
g£ HzL f HzL f £ HzL
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2 ÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.44)
gHzL gHzL

which is usually written in the more familiar form


f £ HzLgHzL - g£ HzL f HzL
H f HzL êgHzLL£ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.45)
gHzL2

10.8 Polynomials and power series

‡ Powers and polynomials


Note that given what we know already, it suffices to check that zn is differentiable for all
positive integers n in order to establish differentiability of any polynomial. This is
because (a) the product rule applied to a * zn , for any constant a ensures a * zn is differen-
tiable, (b) the sum rule applied to any linear combination of such functions then shows
that any polynomial is differentiable. So let's deal with simple powers. By the binomial
theorem, we can make the expansion

Hw + zLn = zn + nwzn-1 + w2 gHz, wL (10.46)

where g is a polynomial in z and w. Hence zn is differentiable with derivative

nzn-1 (10.47)
218 Complex Analysis with Mathematica

You probably expected this from the corresponding real result.

‡ Theorem 10.2: differentiability of power series


The corresponding results for power series are a major step up in both the form of the
proof and significance of the result. Here is a statement of the result. Informally it says
that power series are differentiable provided they converge, and the result is the sum of
the derivatives of each term differentiated as though it is a simple one-term polynomial.
Formally, we have

Let f HzL = ⁄¶
n=0 an z have radius of convergence R > 0. Then within the circle of
n

convergence f HzL exists and is given by ⁄¶


£
n=1 nan z
n-1
.

It is a good idea to prove this in two parts, and to first consider the origin.

ü Proof at the origin


Consider f in a neighbourhood of the origin. We can clearly write

f HzL = a0 + a1 z + SHzL (10.48)

where

SHzL = ‚ an zn (10.49)
n=2

Consider

SHzL
ÅÅÅÅÅÅÅÅ2ÅÅÅÅÅ = ‚ an zn-2 (10.50)
z n=2

Now, within the circle of convergence of f HzL, the series for f HzL is absolutely conver-
gent, so by setting » z » = Rê 2, we can see that

R n
‚ †an §J ÅÅÅÅÅÅ N (10.51)
n=0
2

is convergent, and so is

R n-2
M = „ †an §J ÅÅÅÅÅÅ N (10.52)
2
n=2

If we call this last sum M, then, for » z » < R ê 2


ƒƒ ƒƒ ƒƒ ¶ ƒƒ ƒ
¶ ƒƒƒ
ƒƒ ¶
ƒƒ ƒ ƒƒ ƒƒ ƒƒ
ƒƒ SHzL ƒƒƒ ƒƒ ƒƒ ƒƒ ƒƒ R n-2
ƒƒ ÅÅÅÅÅÅÅÅÅÅÅÅÅ ƒƒ b †z§ ƒƒ ‚ an z ƒƒ b †z§ ‚ ƒƒ an z ƒƒ b †z§ „ †an § J ÅÅÅÅÅÅ N
n-2 n-2
b M†z † (10.53)
ƒƒ z ƒƒ ƒƒ ƒƒ ƒƒ ƒƒ
ƒƒ ƒƒ ƒƒ n=2 ƒƒ ƒƒ ƒƒ 2
ƒƒ ƒƒ ƒƒ ƒƒ n=2 ƒƒ ƒƒ n=2
10 Complex differentiation 219

Hence » SHzL ê z » Ø 0 as z Ø 0. Hence f is differentiable at the origin, and its derivative is


given by

f £ H0L = a1 (10.54)

ü Proof at other points


To prove the result at a general point within the circle of convergence, we do some
reorganization with the binomial theorem to reduce the general case to the one we have
just proved. So now suppose that » w » < R. We consider w close enough to z such that

†z - w§ < R - †w§ (10.55)

It follows that

†z - w§ + †w§ < R (10.56)

and hence that



‚ †an § H†w§ + †z - w§L
n
(10.57)
n=0

is convergent. Now we use the binomial theorem to deduce that



ij n n rz
y
„ †an § jjj‚ J N †w§ †z - w§ zzz
n-r
(10.58)
r
n=0
k r=0 {

is convergent. Now consider our original series with z = w + Hz - wL. The binomial
theorem gives us


ij n n rz
y
‚ an z = „ an jjj‚ J N wn-r Hz - wL zzz
n
(10.59)
r
n=0
n=0
k r=0 {

We now know that this series is absolutely convergent, so we can rearrange it to give
¶ ¶
‚ an zn = ‚ br Hz - wL
r
(10.60)
n=0 r=0

where

n
br HwL = ‚ J N wn-r an (10.61)
r
n=r

Now we can use our previous result to infer differentiability at w, with



f £ HwL = b1 = ‚ nwn-1 an (10.62)
n=1
220 Complex Analysis with Mathematica

‡ Obvious special functions


It follows from Theorem 10.2 that a great many well-known functions are differentiable,
including the exponential, trigonometric and hyperbolic functions discussed previously.

10.9 A point of notation and spotting non-analytic functions


It is often convenient to use another notation for complex differentiation, based on the
chain rule. We have, using the bar notation for complex conjugate,

z = x + Ây (10.63)

zê = x - Ây (10.64)
1
x = ÅÅÅÅÅ Hz + zê L (10.65)
2

y = ÅÅÅÅÅÅÅÅÅ Hz - zê L (10.66)
2
f  f x  f y 1 f f
ÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅ - Â ÅÅÅÅÅÅÅÅÅ N (10.67)
z x z  y z 2 x y
f  f x  f y 1 f f
ÅÅÅÅÅÅÅÅêÅ = ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅêÅ + ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅêÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅ +  ÅÅÅÅÅÅÅÅÅ N (10.68)
z x z  y z 2 x y

Hence we can use the alternative forms:


 1  
ÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ - Â ÅÅÅÅÅÅÅÅÅÅ N (10.69)
z 2 x y
 1  
ÅÅÅÅÅÅÅÅêÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ +  ÅÅÅÅÅÅÅÅÅÅ N (10.70)
z 2 x y

Exercise 10.3 at the end of this chapter confirms that the Cauchy–Riemann equations are
equivalent to
f
ÅÅÅÅÅÅÅÅêÅ = 0 (10.71)
z
This is more than just a notational convenience – it also gives a handy way of spotting
when a simple function is or is not holomorphic. If the formula involves zê the function is
f
not holomorphic, since then ÅÅÅÅ
ÅÅÅ  0. Now since
zê

†z§2 = zzê (10.72)


1
ReHzL = ÅÅÅÅÅ Hz + zê L (10.73)
2
1
ImHzL = ÅÅÅÅÅ H-ÂLHz - zê L (10.74)
2
10 Complex differentiation 221

it is easy to see why functions involving the modulus, real or imaginary parts in some
way cannot be holomorphic, as they all involve zê in some way.

10.10 The Ahlfors–Struble(?) theorem


The ? in the title of this section will be discussed in due course! First we will explain the
situation that this result applies to. Suppose that you are given a function uHx, yL and are
required to find out what holomorpic function it came from. How do you do this? A
good first step is to check that u satisfies Laplace's equation as discussed in Section 10.6.
The next step is to solve the Cauchy–Riemann equations. A simple example will make it
clear how this works. Let u = x2 - y2 . The Cauchy–Riemann equations give us
u v
ÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅ = 2x (10.75)
x y
u v
ÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅ = -2y (10.76)
y x

You can integrate each of these equations for v to obtain

v = 2xy + gHxL (10.77)

v = 2xy + hHyL (10.78)

where g and h are arbitrary functions of their arguments. Consistency demands that both
of these functions must be the same constant, say c. So v = 2xy + c for some real
constant c, and furthermore

f HzL = x2 - y2 + 2Âxy + c = Hx + ÂyL2 + c = z2 + c (10.79)

This procedure can be summarized as follows: (i) differentiate u; (ii) integrate the
Cauchy–Riemann equations for v, picking arbitrary functions for consistency; (iii)
identify f HzL.
You should try this out yourself for the function uHx, yL = x3 - 3 x y2 , and some
further examples are given in Exercise 10.17. If you persevere with Exercise 10.17 you
will rapidly come to the conclusion that an easier route would be helpful. The following
theorem, believed to be due to Ahlfors and Struble (see later) is very useful.

‡ Theorem 10.3: the holomorphic extraction formula


Let f HzL be holomorphic in a neighbourhood of the point a, and let us suppose that f HzL
has a real part uHx, yL and imaginary part vHx, yL, where z = x + Ây. Then the Ahlfors–
Struble (holomorphic extraction) theorem states that
z + êê a z - êê a êêêêêê z + êê a z - êê a êêêêêê
f HzL = 2uJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N - f HaL = 2Â vJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N + f HaL (10.80)
2 2Â 2 2Â
222 Complex Analysis with Mathematica

This result for the case a = 0 was given by Ahlfors (1953) and given as an exercise by
Spiegel (1981). A full discussion and a simple proof of the general case has been given
by this author (see Shaw, 2004 and ‘a simple view’, below). In the proof of this we will
make use of the holomorphic reflection of f , given by
` êêêêêê
f HzL = f Hzê L (10.81)
`
You might like to satisfy yourself that if f is holomorpic on U Õ  then f is holomor-
êêê
phic on U Õ . This is the reflection of U in the real axis (not its closure).

ü A simple view of the proof


Let's consider the relationship between u and f . Consider the function U of two complex
variables w1 and w2 given by
1 `
UHw1 , w2 L = ÅÅÅÅÅ I f Hw1 + Âw2 L + f Hw1 - Âw2 LM (10.82)
2
This function is a holomorphic function of the two complex variables w1 , w2 , in the
sense of equation (2) with x, y, h, k now all complex. Observe that if w1 = x and
w2 = y with x, y real, then
1 `
U Hx, yL = ÅÅÅÅÅ I f Hx + ÂyL + f Hx - ÂyLM
2
(10.83)
1 êêêêêêêêêêêêê
= ÅÅÅÅÅ H f Hx + ÂyL + f Hx + ÂyLL = uHx, yL
2
so that U is the same as u, but considered now as a function of two complex variables.
We now identify U as u and we set
z + êê a
w1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.84)
2
z - êê a
w2 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.85)

and observe that Eqs. (10.82), (10.84) and (10.85) combine to tell us that
z + êê a z - êê a 1 ` êê
uJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N = ÅÅÅÅÅ I f HzL + f Ha LM (10.86)
2 2Â 2
from which the relation
z + êê a z - êê a êêêêêê
f HzL = 2 uJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N - f HaL (10.87)
2 2Â
follows. The link between v and f follows by considering a similar route, with
1 `
VHw1 , w2 L = ÅÅÅÅÅÅÅ I f Hw1 + Âw2 L - f Hw1 - Âw2 LM (10.88)

10 Complex differentiation 223

ü An example
A good illustration of the method is to consider the function
x
uHx, yL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ (10.89)
x + y2
2

The application of Theorem 10.3 says that we double u, and replace x by


z + êê a
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.90)
2
and y by
z - êê a
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (10.91)

êê. So our function f is given by
This implies that we replace x2 + y2 by za
z + êê a 1 êêêêêê 1 1 êêêêêê
f HzL = 2J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N J ÅÅÅÅÅêê
ÅÅÅÅÅ N - f HaL = ÅÅÅÅÅ + ÅÅÅÅ
êêÅ - f HaL (10.92)
2 za z a
If we inspect this relation at z = a, we deduce that the real part of f HaL is the real part of
1 ê êê
a , so we deduce that, for some real constant b,
1
f HzL = ÅÅÅÅÅ + Â b (10.93)
z

ü Some further examples for you to try


For each of the following functions, considered as the real part u of some holomorphic
f , find f . Consider carefully what base point to use – a good initial guess is to try a = 0,
but consider carefully what you need to do when the origin is not a point at which the
functions make sense.

x2 - y2
4 x y Hy2 - x2 L
‰x cosHyL
2
+y2 L y
‰xêHx cosJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ N
x + y2
2 (10.94)
1
ÅÅÅÅÅ logHx2 + y2 L
2
è!!!!!!!!!!!!!!! 1
x2 + y2 cosJ ÅÅÅÅÅ tan-1 Hx, yLN
4

2
You can check the answers against an automatic calculation with Mathematica, the code
for which is given below.
224 Complex Analysis with Mathematica

ü Uniqueness of the complexification


When the argument given above was published by the author (Shaw, 2004) I received
numerous comments, including one from B. Margolis (BM below) that I did not spell
out the precise conditions under which the complexification U of u is uniquely defined.
Ahlfors was careful to restrict attention to functions that are rational in x and y, probably
because of this issue. The first thing to point out is that given f , the natural complexifica-
tions, U, V of u, v are indeed uniquely defined, having being constructed explicitly as
in the simple proof above. The issue is whether, for example, given only ‘some formula’
for uHx, yL, whether we can uniquely specify its complexification. I did not address this
in the paper (Shaw, 2004) or indeed above, but my view on this is that the answer is ‘yes’
once u has been specified in real analytic form, i.e. expressed as a real power series in x
and y about the relevant base point, or, more usefully, in terms of real functions that are
expressible as such power series. Since it turns out that any complex function that is
holomorphic on an open set containing the base point is then analytic (i.e. it has a power
series) in a neighbourhood of that base point (by Taylor's Theorem as discussed in
Chapter 13, Section 13.2) then any u can be so expressed, so this is not a restriction at
all. However, you do have to write it in real analytic form. The Mathematica code given
below now forces this, in contrast to what was originally published by the author (Shaw,
2004). If one does not work in this representation one can end up with different complexi-
fications. Of course, if one restricts attention to power series then one can give an
alternative direct and constructive proof (see below), but this does not make clear the
elegant role of the reflection principle embodied in the ‘simple view’.
To see why this matters, consider the following example (kindly supplied by
BM). Let's suppose we start with the formula uHx, yL = x. We can write u in various
ways. Let's consider

uHx, yL = x (10.95)
1
uHx, yL = ÅÅÅÅÅ HHx + Â yL + Hx - Â yLL (10.96)
2
1
uHx, yL = ÅÅÅÅÅ HHx + Â yL + Hx + Â yL L (10.97)
2
1
uHx, yL = ÅÅÅÅÅ HHx - Â yL + Hx - Â yL L (10.98)
2
The first two work out fine, while Eqs. (10.97) and (10.98) give x and 0 respectively if
you just blindly apply the extraction formula for f ! So it is important that you first
simplify to the real analytic form of u. Another way of looking at this problem is that
one can contrive a zero u to have a non-zero complexification, but not if you limit
attention to the real analytic case. This is related to the reason why Mathematica's
ComplexExpand function has to have its target functions set to Re and Im, (see
below), in order to provide a purely real characterization of u.
10 Complex differentiation 225

ü The power series version of the proof


Bearing in mind that the ‘simple view’ tells us what we should we aiming for, it is
possible to give a now very simple argument based on power series, which shows that
we can specify U uniquely, up to an imaginary constant. (This also makes it clear why
Eqs. (10.95–96) above are right for complexification and Eqs. (10.97–98) are wrong.)
This does involve bringing forward the results of Chapter 13.
So suppose that uHx, yL is the real part of a holomorphic function f HzL with the
property that f is holomorphic in a neighbourhood of z = a = a1 + Â a2 . Then, by
Taylor's Theorem (see Section 13.2), there is a unique power series

f HzL = ‚ cn Hz - aLn . (10.99)
n=0

It follows that we can write:


¶ ¶
1 1
uHx, yL = ÅÅÅÅÅ ‚ cn Hx + Â y - aLn + ÅÅÅÅÅ ‚ êê
c n Hx - Â y - êê
a Ln . (10.100)
2 n=0 2 n=0

We also note that given a knowledge of uHx, yL alone, on the assumption that it is real
anaytic about (a1 , a2 ) and a solution of Laplace's equation, such a representation must
exist and be unique (apart from Im@c0 D). This is because the Laplace condition is just

2 u
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅê = 0 ñ u = gHzL + hHzê L. (10.101)
z  z
and reality constrains h to be expressed in terms of the conjugate of g. Then the exist-
ence of a series supplies Eq. (10.100) uniquely, apart from the imaginary part of c0 .
Now define UHw1 , w2 L uniquely, up to the imaginary part of c0 , by
¶ ¶
1 1
UHw1 , w2 L = ÅÅÅÅÅ ‚ cn Hw1 + Â w2 - aLn + ÅÅÅÅÅ ‚ êê
c n Hw1 - Â w2 - êê
a Ln , (10.102)
2 n=0 2 n=0

and observe that, first




1 1
UHx, yL = ÅÅÅÅÅ ‚ cn Hx + Â y - aLn + ÅÅÅÅÅ ‚ êê
c n Hx - Ây - êê
a Ln = uHx, yL , (10.103)
2 2 n=0
n=0

and second,

z + a z - êê

a 1 1
UJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N = ÅÅÅÅÅ ‚ cn Hz - aL + ÅÅÅÅÅ ‚ êê
n êê - êê
c n Ha a Ln =
2 2Â 2 n=0 2
n=0 (10.104)
1 1 1 1 êêêêêê
ÅÅÅÅÅ f HzL + ÅÅÅÅÅ êê
c 0 = ÅÅÅÅÅ f HzL + ÅÅÅÅÅ f HaL
2 2 2 2
226 Complex Analysis with Mathematica

The result then follows. This is essentially the same argument as that given by Cartan
(1961) for the case a = 0.

ü Mathematica implementation of the extraction formula


This is now a straightforward purely algebraic operation so is easily implemented. Let's
do the automation for the extraction of f from its real part. We use ComplexExpand
with the option TargetFunctions Ø {Re, Im} to get the right form of the
function for complexification.

RealToHolo@expr_, anum_, 8xsym_, ysym_, zsym_ <D :=


Module@8abar = Conjugate@anumD, exprf<,
exprf =
ComplexExpand@expr, TargetFunctions Ø 8Re, Im<D;
func =
2 * exprf ê. 8xsym Ø Hzsym + abarL ê 2,
ysym Ø Hzsym - abarL ê H2 * IL<; basecorr =
- exprf ê. 8xsym Ø Re@anumD, ysym Ø Im@anumD<;
FullSimplify@func + basecorr + I * bDD

Here are all the functions given for you to try in the previous sub-section, expressed as a
Mathematica list:

TestUSet = 8x ^ 2 - y ^ 2, 4 x y Hy ^ 2 - x ^ 2L, Exp@xD Cos@yD,


Exp@x ê Hx ^ 2 + y ^ 2LD Cos@y ê Hx ^ 2 + y ^ 2LD,
1 ê 2 Log@x ^ 2 + y ^ 2D,
Hx ^ 2 + y ^ 2L ^ H1 ê 4L Cos@1 ê 2 ArcTan@x, yDD<;

Let's try this first with the origin playing the role of the base point a (you will get some
warnings that are not shown here).

Map@RealToHolo@#, 0, 8x, y, z<D &, TestUSetD

8z2 + Â b, Â Hz4 + bL, Â b + ‰z , Indeterminate, Indeterminate, Â b + Interval@80, 0<D<

The extraction is failing when the origin is not a point at which the functions are defined.
If we shift the base point to, for example, a = 1, then all is well:

Map@RealToHolo@#, 1, 8x, y, z<D &, TestUSetD


1 è!!!
9z2 + Â b, Â Hz4 + b - 1L, Â b + ‰z , Â b + ‰ ÅÅzÅÅ , Â b + logHzL, Â b + z=

Let's see if we can induce any non-uniqueness by writing down u in various different
ways.
10 Complex differentiation 227

PerverseUSet = 8x, 1 ê 2 HHx + I yL + Hx - I yLL,


1 ê 2 HHx + I yL + Conjugate@Hx + I yLDL,
1 ê 2 HHx - I yL + Conjugate@Hx - I yLDL<
1 1
9x, x, ÅÅÅÅÅ Hx + Â y + Hx + Â yL L, ÅÅÅÅÅ Hx - Â y + Hx - Â yL L=
2 2

Map@RealToHolo@#, 0, 8x, y, z<D &, PerverseUSetD


8z + Â b, z + Â b, z + Â b, z + Â b<

The corresponding formula for obtaining the holomorphic function from its imaginary
part is:

ImToHolo@expr_, anum_, 8xsym_, ysym_, zsym_ <D :=


Module@8abar = Conjugate@anumD, exprf<,
exprf =
ComplexExpand@expr, TargetFunctions Ø 8Re, Im<D;
func =
2 * I * exprf ê. 8xsym Ø Hzsym + abarL ê 2,
ysym Ø Hzsym - abarL ê H2 * IL<; basecorr =
-I * exprf ê. 8xsym Ø Re@anumD, ysym Ø Im@anumD<;
FullSimplify@func + basecorr + bDD

We test it with the following set of test problems:

TestVSet = {2*x*y, x^4 + y^4 - 6*x^2*y^2,


Exp[x]*Sin[y], (-E^(x/(x^2 + y^2)))*
Sin[y/(x^2 + y^2)], ArcTan[x,y], (x^2+y^2)^(1/4)
Sin[1/2 ArcTan[x,y]]};

Map@ImToHolo@#, 1, 8x, y, z<D &, TestVSetD


1 è!!!
9z2 + b - 1, Â z4 + b, b + ‰z - ‰, b + ‰ ÅÅzÅÅ - ‰, b + logHzL, b + z - 1=

ü The inverse of ComplexExpand[Re[]]


The extraction of the holomorphic function from just its real part can be seen as an
inversion of the composite operation given by ComplexExpand[Re[]]. The follow-
ing examples make this clear – you might like to try some more of your own. The
important thing is to make sure ComplexExpand generates an expression just involv-
ing x and y. We do this with:

SetOptions@ComplexExpand, TargetFunctions Ø 8Re, Im<D;

Of course, this is also done within RealToHolo, but we also wish to exhibit the
expressions in the right form here. Now consider the following:

ComplexExpand@Re@1 ê Hx + I yLDD
228 Complex Analysis with Mathematica

x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
x2 + y2

RealToHolo@%, 1, 8x, y, z<D


1
 b + ÅÅÅÅÅ
z

ü Some more exotic examples

ComplexExpand@Im@Exp@1 ê Hx + I yL ^ 2DDD
x -y
2 2
i 2xy y
sinjjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ zzz
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ2ÅÅÅÅÅ2Å Å
-‰ Hx 2 +y L

k Hx2 + y2 L {

ImToHolo@%, 1, 8x, y, z<D


1
b + ‰ ÅÅÅÅz ÅÅÅ - ‰ 2

ComplexExpand@Re@Hx + I yL ^ H1 ê nLD,
TargetFunctions Ø 8Re, Im<D
1
i tan-1 Hx, yL y
Hx2 + y2 L 2 n cosjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zz
ÅÅÅÅÅÅ Å

k n {

RealToHolo@%, 1, 8x, y, z<D

"######
1 logHzL
 b+2 z ÅÅnÅÅ coshJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N - 1
2n

ü Some history
This approach to reconstructing f from its real or imaginary part has an interesting
history, and for much of the following information I wish to thank Prof. Harold Boas
(‘HB’ in further comments below). First, it is interesting to note that this result has been
rediscovered several times over the years! Indeed, the author's interest in this method
stemmed from an observation by John Ockendon that the result for the case a = 0 holds,
and he issued a challenge to explain it and figure out what happens if f is singular at the
origin. This and the desire to find a Mathematica implementation resulted in the paper
(Shaw, 2004).
I am grateful to Bill Margolis for e-mailing me to let me know that Theorem
10.3 with a = 0, was given as an exercise (Exercise 3 of Chapter III) by J. D'Angelo in
his monograph (D'Angelo 2002). HB asked J. D'Angelo about his source and D'Angelo
recalls discovering the formula for himself in 1988.
10 Complex differentiation 229

Moving a step further back into history, the book by R.P. Boas (Boas, 1987), has
a statement and proof of the result and some other short-cut methods (see pages 158-
164). One of these short-cut methods is particularly interesting from a historical point of
view as its development is curiously interwined with the extraction theorem. The result
is that, if one already knows uHx, yL and vHx, yL then

f HzL = uHz, 0L + ÂvHz, 0L (10.105)

From my point of view this result is rather less interesting, as you do need to know both
u and v, whereas the extraction result allows the construction of f from just one of u and
v. However, the historical link is very interesting. Let's call Eq. (10.105) the ‘alternative
method’ for getting f HzL. So far as I am aware, and according to E.V. Laitone (Laitone,
1977), this alternative method was first given by L.M. Milne-Thomson (Milne-Thom-
son, 1937) and it also appeared in the first edition of his ‘Theoretical Hydrodynamics’
(Milne-Thomson, 1938). It also appeared in the second (1949) and third (1955) editions.
In the fourth (1962) and later editions Milne-Thomson dropped the alternative method
and replaced it with the algebraic extraction theorem in the style of Ahlfors, and did so
far as I can tell, without comment or attribution (see note 5.32 on pp. 130-131 of the
fourth edition). The story of Milne-Thomson's contribution was discussed up by Laitone
(1977). Laitone's emphasis was on the alternative method, and he describes the extrac-
tion theorem as ‘a very dubious procedure that utilized the complex conjugate’!
All of these discussions refer to the theorem with a = 0, where the base point is
the origin. Indeed, the note by Laitone (1977) goes on to say that ‘Milne-Thomson's
method (i.e. in his 4th ed) cannot be justified in general since it results in Hx2 + y2 L = 0
so that any f HzL containing z-n cannot be obtained from any combination of u and v’. So
the issue, at least in this particular thread of papers, of how to cope with a general
base-point, was not properly understood in 1977.
My best understanding, based on papers to which I have had access, is that the
issue of the base point was resolved by R.A. Struble (Struble, 1979). It should be noted
however that an outline discussion of the result with a general base point has also been
given by Volkovyskii et al (1960). Struble gave a proof of what I called Theorem 10.3
based on Taylor series, and made the point that the identities ‘should be better known
than they appear to be’. He also made the explicit comment that (in the context of fluid
dynamics, for which further discussion is given in Chapter 19) ‘each stream function can
be expressed algebraically in terms of the potential function, and vice versa.’ On the
basis of Ahlfors (1953) being the first to shed light on the matter, and Struble (1979)
sorting out the general base point, I have called this result the Ahlfors–Struble theorem.
However, this is only on the basis of information received by the author thus far! Some
may view the contribution of Cartan (1961) as being more critical. It has also been
suggested that the ideas are implicit in the work of I.N. Vekua from the 1940s. Work on
polar representations has also been done (Huilgol, 1981; Shaw, 2004).
This, for now, is the end of the historical discussion. We now turn back to other
things you can do with this result and Mathematica.
230 Complex Analysis with Mathematica

ü Checking the Laplacian


Note that as defined, neither of the functions described above care about whether the u
or v you supply to them are the real or imaginary parts of a holomorphic function. They
return results whatever you give them. For example,

RealToHolo@x ^ 2 + y ^ 2, 0, 8x, y, z<D

Âb

RealToHolo@x ^ 2 + y ^ 2, 1, 8x, y, z<D

2z+Â b-1

Note the dependence on the base point. It is far from clear whether such transformations
have any useful interpretation, and they certainly do not serve as an inverse to Complex-
Expand. For example

ComplexExpand@Re@% ê. 8z Ø x + I y, b Ø 0<DD

2x-1

So it is a good idea to include a check to exclude this case. In the following extended
code we include an explicit check that the Laplacian operator gives zero. Note that this
check involves (a) invoking FullSimplify to boil down the Laplacian as much as
possible, having used Together to put things over a common denominator, (b) the use
of the ‘identically equals’ within Mathematica, given by ===.

RealToHoloCheck@expr_,
anum_, 8xsym_, ysym_, zsym_ <D :=
Module@8abar = Conjugate@anumD, exprf,
H*This may need improving to stop false negatives *L
laplacian = FullSimplify@Together@
D@expr, 8xsym, 2<D + D@expr, 8ysym, 2<DDD<,
exprf = ComplexExpand@expr,
TargetFunctions Ø 8Re, Im<D;
If@laplacian === 0,
func =
2 * exprf ê. 8xsym Ø Hzsym + abarL ê 2,
ysym Ø Hzsym - abarL ê H2 * IL<; basecorr =
- exprf ê. 8xsym Ø Re@anumD, ysym Ø Im@anumD<;
FullSimplify@func + basecorr + I * bD,
Print@"This expression is not the
real part of a holomorphic function -
its Laplacian is "D; laplacianDD
10 Complex differentiation 231

ImToHoloCheck@expr_, anum_, 8xsym_, ysym_, zsym_ <D :=


Module@8abar = Conjugate@anumD, exprf,
H*This may need improving to stop false negatives *L
laplacian = FullSimplify@Together@
D@expr, 8xsym, 2<D + D@expr, 8ysym, 2<DDD<,
exprf = ComplexExpand@expr,
TargetFunctions Ø 8Re, Im<D;
If@laplacian === 0,
func =
2 * I * exprf ê. 8xsym Ø Hzsym + abarL ê 2,
ysym Ø Hzsym - abarL ê H2 * IL<; basecorr =
-I * exprf ê. 8xsym Ø Re@anumD, ysym Ø Im@anumD<;
FullSimplify@func + basecorr + bD,
Print@"This expression is not the
imaginary part of a holomorphic
function - its Laplacian is "D; laplacianDD

Note that the output is a message together with the Laplacian if the check fails, so you
do at least have the chance to do further manual simplifications of the Laplacian if you
really think the input is harmonic, and then use the non-checking code to finalize
matters.

ImToHoloCheck@Hx ^ 2 - y ^ 2L ^ 4, 1, 8x, y, z<D

This expression is not the imaginary part of a holomorphic function - its Laplacian is

2
48 Hx2 - y2 L Hx2 + y2 L

Map@RealToHoloCheck@#, 1, 8x, y, z<D &, TestUSetD


1 è!!!
9z2 + Â b, Â Hz4 + b - 1L, Â b + ‰z , Â b + ‰ ÅÅzÅÅ , Â b + logHzL, Â b + z=

Map@ImToHoloCheck@#, 1, 8x, y, z<D &, TestVSetD


1 è!!!
9z2 + b - 1, Â z4 + b, b + ‰z - ‰, b + ‰ ÅÅzÅÅ - ‰, b + logHzL, b + z - 1=

Comments on how to improve these functions are very welcome, especially if you, the
reader, find cases where the Laplacian check fails.

ü Finding harmonic conjugates


This is now a matter of sticking together our new function (now with the check) with
ComplexExpand. We do not need to introduce a complex variable here in the
arguments, so it is just used internally.
232 Complex Analysis with Mathematica

HarmonicConjugate@expr_, anum_, 8xsym_, ysym_<D :=


Module@8abar = Conjugate@anumD, zsym,
exprf, laplacian = FullSimplify@Together@
D@expr, 8xsym, 2<D + D@expr, 8ysym, 2<DDD<,
exprf = ComplexExpand@expr,
TargetFunctions Ø 8Re, Im<D;
If@laplacian === 0,
func =
2 * exprf ê. 8xsym Ø Hzsym + abarL ê 2,
ysym Ø Hzsym - abarL ê H2 * IL<; basecorr =
- exprf ê. 8xsym Ø Re@anumD, ysym Ø Im@anumD<;
ComplexExpand@Im@FullSimplify@
Hfunc + basecorr + I * bL ê. zsym Ø xsym + I * ysymDDD,
Print@"This expression is not the real
part of a holomorphic function -
its Laplacian is "D; laplacianDD

ComplexExpand@Re@Hx + I yL ^ 4DD

x4 - 6 y2 x2 + y4

ComplexExpand@Im@Hx + I yL ^ 4DD

4 x3 y - 4 x y3

HarmonicConjugate@p * Hx ^ 4 - 6 x ^ 2 y ^ 2 + y ^ 4L, 0, 8x, y<D

4 p y x3 - 4 p y3 x + b

Map@HarmonicConjugate@#, 1, 8x, y<D &, TestUSetD

92 x y + b, x4 - 6 y2 x2 + y4 + b - 1, b + ‰ x sinHyL,
x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅ y è!!!!!!!!
!!!!!!! 1
ÅÅÅÅÅÅ N, b + tan-1 Hx, yL, b + x2 + y2 sinJ ÅÅÅÅÅ tan-1 Hx, yLN=
b - ‰ x +y sinJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2 2
4

x2 + y2 2

TableForm@Transpose@8TestUSet, %<DD

x2 - y2 2xy+ b
4 x y Hy - x L 2 2
x4 - 6 y2 x2 + y4 + b - 1
‰x cosHyL b + ‰x sinHyL
x x
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ2ÅÅ y ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ2ÅÅ y
‰x 2 +y
cosI ÅÅÅÅÅÅÅÅ
x2 +y2
ÅÅÅÅÅÅ M b-‰x 2 +y
sinI ÅÅÅÅÅÅÅÅ
x2 +y2
ÅÅÅÅÅÅ M
ÅÅÅÅ12 logHx2 + y2 L b + tan-1 Hx, yL
è!!!!!!!! !!!!!!! è!!!!!!!!
!!!!!!!
x2 + y2 cosH ÅÅÅÅ12 tan-1 Hx, yLL b + x2 + y2 sinH ÅÅÅÅ12 tan-1 Hx, yLL
4 4

You can use other variables if you want:


10 Complex differentiation 233

HarmonicConjugate@a ^ 4 + b ^ 4 - 6 a ^ 2 b ^ 2, 0, 8a, b<D

4 b a3 - 4 b3 a + b

You will not get anywhere if the function is not harmonic:

HarmonicConjugate@a ^ 4 + b ^ 4, 0, 8a, b<D

This expression is not the real part of a holomorphic function - its Laplacian is

12 Ha2 + b2 L

Exercises
10.1 Show that

f HzL = †z§2

is differentiable as a mapping 2 Ø 2 everywhere, and differentiable as a mapping 


Ø  at the origin. Show further that the Cauchy–Riemann equations are satisfied at the
origin, but nowhere else. Deduce that there is no open set U Õ  on which f is
holomorphic.

10.2 (Harder!) Show that the function given by f H0L = 0, and otherwise

z5
f HzL = ÅÅÅÅÅÅÅÅ4ÅÅÅ
†z§

satisfies the Cauchy–Riemann equations at z = 0 but is not holomorphic anywhere.

10.3 By taking real and imaginary parts, show that the Cauchy–Riemann equations are
equivalent to
f
ÅÅÅÅÅÅÅÅêÅ = 0
z
10.4 An ‘anti-holomorphic’ function f is defined by the condition
f
ÅÅÅÅÅÅÅÅÅ = 0
z
Derive the analogue of the Cauchy–Riemann equations for such a function, by taking
real and imaginary parts of this condition.

10.5 A ‘double number’ is defined as a formal pair

p = x + ¸y

subject to the multiplication rule obtained by requring that the symbol ¸ satisfies

¸2 = +1
234 Complex Analysis with Mathematica

Derive the analogue of the Cauchy–Riemann equations for functions


f HpL = uHx, yL + ¸ vHx, yL that are ‘holomorphic’ functions of such double numbers,
and show, assuming as much differentiability as you require, that the ‘real’ and
‘imaginary’ parts u and v both satisfy the wave equation, e.g., for u,

2 u 2 u
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ
x y

10.6 Calculate the complex derivatives of the following functions, explaining which
properties of complex differentiation you are using:

f HzL = 4z4 + H3 + 2ÂL z2 + H1 - ÂLz - 2Â + 3


1
gHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ5ÅÅÅ
Hz2 + 4L

z3 + 4
hHzL = ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ
z2 - 7
10.7 Where, if anywhere, are the functions f , g, h defined in Exercise 10.6 not differentia-
ble?

10.8 By making direct use of the definition of differentiability, prove L'Hospital's rule: if
f HzL and gHzL are differentiable at z0 and f Hz0 L = gHz0 L = 0, but g£ Hz0 L  0, show that
f HzL f £ Hz0 L
lim ÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ
zØz0 gHzL g£ Hz0 L

10.9 By using the result of Exercise 10.8, evaluate

z2 + 1
lim ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ
zØÂ z6 + 1

Note: in questions 10–12 you may assume that U is an open disc or neighbourhood. If
you know the term connected, this will also suffice – it is defined in this book in Section
12.1. You might like to consider what happens, for example, if U is the disjoint union of
two neighbourhoods.

10.10 If f HzL is holomorphic in an open set U and is real-valued in U, show that f is


constant.
êêêêêê
10.11 If f HzL and f HzL are both holomorphic in an open set U, show that f is constant.

10.12 If f HzL is holomorphic in an open set U and † f HzL§ is constant, show that f is
constant. (Hint: differentiate † f HzL§2 .)

10.13 If f = u + Âv is written as a function of polar coordinates Hr, qL, show that the
Cauchy–Riemann equations become:
10 Complex differentiation 235

u 1 v
ÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅ
r r q
v 1 u
ÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅ
r r q
and hence derive the Laplace equation in polar form:

2 u 1 u 1 2 u
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅ2ÅÅÅÅ ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = 0
r r r r q
and similarly for v.

10.14 What are the real and imaginary parts of the function

 log(z)

expressed in terms of Cartesian coordinates? Check that these satisfy Laplace's equation.
Repeat the exercise with the real and imaginary parts expressed in polar coordinates.

10.15 Show in two different ways that the functions

rn cosHn qL and rn sinHn qL

satisfy Laplace's equation.

10.16 (Harder) Show that the function f given by f H0, 0L = 0, and otherwise

x3
f Hx, yL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
x + y2
2

is continuous at H0, 0L, and, by considering the function

gHsL = f Hs cosHtL, s sinHtLL

for fixed t, show that g is differentiable at s = 0 for all t. By establishing this you are
showing that f is differentiable in a ‘one-dimensional’ sense along any line through the
origin. Show, nevertheless, that f is not differentiable. (Hint: try writing f in approxi-
mate linear form, using the partial derivatives as coefficients, and see what goes wrong.)

10.17 Given the following functions u, find the corresponding imaginary functions v and
hence find the holomorphic f HzL whose real part is u:

uHx, yL = 4 x y Hy2 - x2 L
2
+y2 y
uHx, yL = ‰xêx cosJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ N
x2 + y2
è!!!!!!!!
!!!!!!! 1 y
uHx, yL = x2 + y2 cosJ ÅÅÅÅÅ tan-1 J ÅÅÅÅÅ NN
4

2 x
10.18 Ÿ Produce a surface plot (i.e. use Plot3D) of the function discussed in Exercise
10.1.
236 Complex Analysis with Mathematica

10.19 Ÿ Produce a surface plot (i.e. use Plot3D) of the function discussed in Exercise
10.3.

10.20 Ÿ Use Mathematica's D and Simplify functions to calculate the derivatives of


the functions defined in Exercise 10.7, and compare with your pen and paper
calculations.

10.21 Ÿ Use the Mathematica function ContourPlot, with the option Contour-
Shading -> False, to visualize and overlay the contours of the following pairs of
functions:

u = x2 - y2 ; v = 2xy
1
u = ÅÅÅÅÅ logHx2 + y2 L; v = tan-1 Hx, yL
2
To what holomorphic function do each of these function pairs correspond? (Hint: You
may need to increase the value of PlotPoints to obtain a good plot, and you should
note for the last example that Mathematica has a special ArcTan function that accounts
for the precise location of x and y in the complex plane.)

10.22 Ÿ Use Mathematica's D and Simplify functions to show that each of the four
functions defined in Exercise 10.19 satisfy Laplace's equation.

10.23 Ÿ Use Mathematica's Limit function to evaluate

z2 + 1
lim ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ
zØÂ z6 + 1

(Use ?Limit to find out how this function works if you need to.)

10.24 Ÿ Use Mathematica to check your results for Exercise 10.17, including a check
that the given examples of u are harmonic.

10.25 Ÿ Use Mathematica to find the harmonic conjugates of the examples of u given in
Exercise 10.17.
11 Paths and complex integration

Introduction
In this chapter we introduce the concept of integration of a complex function of a
complex variable. This relies on understanding what is meant by a ‘path’ in the complex
plane, because integrals are defined with respect to a path. This chapter is mostly
concerned with defining integration by referring back to the real case. You will also see
how to generalize the fundamental theorem of calculus to the complex setting. Through-
out this chapter we will refer to complex functions of a real variable, and refer to them
as being, respectively, continuous or differentiable. All this means is that the real and
imaginary parts are, respectively, continuous or differentiable in the ordinary real sense.

11.1 Paths
A path f is a continuous mapping from a segment of the real axis into the complex
numbers:

f : @a, bD Õ  Ø  (11.1)

The square brackets indicate that the domain of definition of f contains end-points, i.e.
fHxL is defined for

abxbb (11.2)

A path is said to be simple if it is 1:1 as a mapping. That is, fHxL = fHyL fl x = y. It is


said to be closed if fHaL = fHbL. If f is closed, and is simple except at a and b, f is a
simple closed path. As a point of notation, the image of the path is denoted f* . Thus

f* = 8fHtL : a b t b b< (11.3)

A path f is a differentiable path if its real and imaginary parts are differentiable in the
usual sense for t œ Ha, bL, i.e. a < t < b and one-sided derivatives exist at the end-
points a and b.

ü Theorem 11.1: Mean value theorem for the modulus


Let f : @a, bD Ø  be differentiable, then

†fHbL - fHaL§ b Hb - aL sup †f£ HtL§ (11.4)


tœHa,bL

Remark 1: If you have not taken a formal course in real analysis, you can think of sup,
short for supremum, as being the maximum value along the path. More formally, the
supremum S of a set of reals A is the smallest number such that x œ A fl x b S.
238 Complex Analysis with Mathematica

Remark 2: Note that the ‘obvious’ generalization, to complex numbers, of the real mean
value theorem

fHbL - fHaL = Hb - aL f£ HtL (11.5)

for some t œ Ha, bL is simply untrue. You might like to check this by considering the path
fHtL = ‰Ât for 0 b t b 2 p.

Proof of theorem: Suppose that fHbL  fHaL, for otherwise there is nothing to prove, and
let m = fHbL - fHaL, yHtL = êê
m fHtL. Clearly, y£ HtL = êê
m f£ HtL, and

yHbL - yHaL = m êê
m = †fHbL - fHaL§2 (11.6)

which is real. So if we write yHtL = y1 HtL + Â y2 HtL,

†fHbL - fHaL§2 = y1 HbL - y1 HaL = Hb - aL y£1 HcL (11.7)

for some c œ Ha, bL, by the real mean value theorem. But

Hb - aL y£1 HcL b Hb - aL » êê
m »» f£ HcL » (11.8)

and so

†fHbL - fHaL§2 b Hb - aL » êê
m »» f£ HcL » (11.9)

Now divide the result by » êê


m » to obtain

†fHbL - fHaL§ b Hb - aL » f£ HcL » b Hb - aL sup †f£ HtL§ (11.10)

‡ Smooth and piecewise smooth paths


A path f is said to be smooth if it is a differentiable path, and furthermore, the derivative
map: f£ : @a, bD Ø  is continuous. So in this case the tangent to the path is a continuous
function. It is frequently useful to consider paths that consist of several smooth pieces,
but where there may be finitely many points where the tangent is discontinuous, that is,
the path may have corners. Formally, a path is piecewise smooth if there is a finite set of
real numbers, a0 , a1 , … , an , with a = a0 < a1 < a2 < ... < an = b, such that

f : @ai-1 , ai D Ø  (11.11)

is smooth, for i = 1 … n. A simple example of a piecewise smooth path would be a


polygonal path, consisting of just a collection of straight lines. Such a path is piecewise
linear. Another word for a piecewise smooth path is a contour.

ü Ÿ Drawing piecewise linear paths in Mathematica


It is useful to define a standard form representing a piecewise smooth path consisting of
a bunch of straight lines, which you can use to both draw the path and carry out
integration:
11 Paths and complex integration 239

PlotPath@path_ , options___D :=
Module@8argand = Map@8Re@#D, Im@#D< &, pathD<,
grdata = 8Line@argandD,
[email protected], Map@Point, argandD<<;
Show@Graphics@grdata, AspectRatio -> 1,
Axes -> True, optionsDDD

psp = 81, I, -1, -I<; PlotPath@pspD

0.5

-1 -0.5 0.5 1

-0.5

-1
cpsp = 81, I, -1, -I, 1<; PlotPath@cpspD

0.5

-1 -0.5 0.5 1

-0.5

-1
Here is a piecewise linear path that gives a polygon that tends to a circle as its argument
n gets large:

path@n_D := Table@Exp@2 * I * Pi * k ê nD, 8k, 0, n<D


240 Complex Analysis with Mathematica

PlotPath@path@30DD

0.5

-1 -0.5 0.5 1

-0.5

-1

11.2 Contour integration


Let U be an open subset of  and let f : @a, bD Ø U be a smooth path. Let f : U Ø  be
continuous. Then the integral of f over the path f is defined by the following equation.
Note the notation – the function defining the path appears where the lower limit might
usually be placed in the real case:
b
‡ f HzL „ z = ‡ f @fHtLD f£ HtL „ t (11.12)
f a

The real and imaginary parts of the integrand are now manifestly continuous functions
of t, and so are integrable. Note that this looks a great deal like the ordinary substitution
rule for changing variables in real integration. Indeed, this is a good way of remember-
ing the formula! But here it is a definition of the integral over the path. Also, in complex
analysis, we often tend to refer to integration over ‘contours’. Remember - you should
think of the word contour as synonymous with ‘piecewise smooth path’. For a piecewise
smooth path you just add up the integrals associated with each smooth piece.

‡ Powers of z integrated around a circle centred on the origin


The best way of getting a grip on the definition of integration is to do a simple example.
The example that will follow is at the same time one of the simplest and one of the most
important that we can give. Let f HzL = zn and let fHtL = r‰Ât , for t œ @0, 2 pD. The
integer n can be positive, negative or zero. Then

f HfHtLL = rn ‰Ânt (11.13)

f£ HtL = Âr‰Ât (11.14)


2p
‡ f HzL „ z =  ‡ rn+1 ‰ÂHn+1L t „ t (11.15)
f 0
11 Paths and complex integration 241

But the integral on the right side is zero unless n = -1, because the exponential function
is periodic, with period 2 p, and the values of the indefinite integral at the limits of
integration cancel. When n = -1, the integral is  µ 2 p. So around any circle centred on
the origin, parametrized by the function f,
1
‡ ÅÅÅÅÅ „ z = 2p (11.16)
f z

The fact that this is non-zero, while all other powers give zero, is surprisingly important,
as you will see later.

11.3 Theorem 11.2: The fundamental theorem of calculus


This is stated as follows. Let U be an open subset of  and let f : @a, bD Ø U be a
contour (piecewise smooth path). Let f : U Ø  be continuous. Suppose that there is a
function : U Ø  that is holomorphic on U and F£ HzL = f HzL. Then

‡ f HzL „ z = FHfHbLL - FHfHaLL (11.17)


f

Proof: First note that we just need to consider smooth paths, as the result for piecewise
smooth paths follows by adding up the pieces, and noting cancellations of intermediate
terms (you might like to check this!). The rest follows by reducing the problem to the
corresponding real fundamental theorem of calculus, applied to the real and imaginary
parts of the second line of the following:
b b
‡ f HzL „ z ª ‡ f @fHtLD f£ HtL „ t = ‡ F '@fHtLD f£ HtL „ t
f a a
(11.18)
b
d
=‡ ÅÅÅÅÅÅÅÅÅÅ F@fHtLD „ t = FHfHbLL - FHfHaLL
a dt

There is one very important consequence: if there is such a function and f is closed, so
that fHbL = fHaL, then

‡ f HzL „ z = 0 (11.19)
f

‡ The trouble with 1 ê z


We have already noted that
1
‡ ÅÅÅÅÅ
z
„ z = 2p  0 (11.20)

when the path is any circle centred on the origin. It follows that there is no holomorphic
function F defined on  - 80< with the property that F£ HzL = 1 ê z. This is related to the
242 Complex Analysis with Mathematica

many-valued nature of the logarithm function, and you will see this discussed more fully
in the next chapter.

11.4 The value and length inequalities


There are two inequalities that are fundamental to further analysis of integration. The
value inequality states that if gHtL is a continuous complex-valued function of the real
variable t, then
ƒƒ b ƒƒ
ƒ ƒ b
†ƒ‡ gHtL „ t§ƒ § ‡ †gHtL§ „ t (11.21)
ƒƒ a ƒƒ a

The proof is easy, for by setting


b
Âq
‡ gHtL „ t = R ‰ (11.22)
a

where R is real and positive, we have, using the fact that Re@zD b » z »,
ƒƒ b ƒƒ
ƒ ƒ b b
†ƒ‡ gHtL „ t§ƒ = R = ‡ ‰- q gHtL „ t = ‡ Re@‰-Âq gHtLD „ t
ƒƒ a ƒƒ a a
(11.23)
b b
-Âq
b ‡ †‰ gHtL§ „ t = ‡ †gHtL§ „ t
a a

Next, the length of a smooth path f is defined to be


b
LHfL = ‡ †f£ HtL§ „ t (11.24)
a

The length is the sum of several such terms if the path is piecewise smooth. There is an
‘almost obvious’ inequality that relates the size of an integral to the length of the path
and a bound on the function being integrated. The length inequality is the following
theorem: Let

M f = sup 8† f HzL§ : z œ f* < (11.25)

That is, M f is the smallest real number such that

† f HzL§ § M f (11.26)

for all z œ f* . Then


ƒƒ ƒƒ
ƒ ƒ
†ƒ‡ f HzL „ z§ƒ § M f LHfL (11.27)
ƒƒ f ƒƒ

Proof: By the value inequality, and the definition of the path length:
11 Paths and complex integration 243

ƒƒ ƒƒ ƒƒ b ƒƒ
ƒ ƒ ƒ ƒ
†ƒ‡ f HzL „ z§ƒ = †ƒ‡ f HfHtLL f£ HtL „ t§ƒ
ƒƒ f ƒƒ ƒƒ a ƒƒ
(11.28)
b b
£ £
b ‡ † f HfHtLL§ †f HtL§ „ t b ‡ M f †f HtL§ „ t = M f L HfL
a a

11.5 Theorem 11.3: Uniform convergence and integration


Now that we have a definition of integration, and are armed with the length inequality, a
proper statement and proof about the integral of a uniformly convergent series of
functions can be given. We have the following theorem. Suppose that the sequence of
functions fn HzL is continuous on a set U and that the series

SHzL = ‚ fn HzL (11.29)
n=1

is uniformly convergent. Then the series can be integrated term by term, over a piece-
wise smooth path f œ U, i.e.

‡ SHzL „ z = ‚ ‡ fn HzL „ z (11.30)


f n=1 f

Proof: Write the sum SHzL as a partial sum and a remainder:


N ¶
SHzL = ‚ fn HzL + ‚ fn HzL = Sn HzL + Rn HzL (11.31)
n=1 n=N+1

Since SHzL is continuous, so are Sn HzL (it is a finite sum of continuous functions) and
Rn HzL (it is then the difference of a pair of continuous functions), so they can be inte-
grated. Furthermore, we can expand out the integral in Sn , since it consists of finitely
many terms:
N

‡ SHzL „ z = ‡ Sn HzL „ z + ‡ Rn HzL „ z = ‚ ‡ fn HzL „ z + ‡ Rn HzL „ z (11.32)


f f f n=1 f f

Since the series is uniformly convergent, given any e > 0, we can find an integer N,
independent of z, such that n > N fl » Rn HzL » < e. Now let L be the length of f, then, by
the length inequality, we have
ƒƒ ƒƒ
ƒƒ ƒ
ƒƒ ‡ Rn HzL „ z ƒƒƒ < e L
ƒƒ ƒƒ (11.33)
ƒ f ƒ

So
ƒƒ ƒƒ
ƒƒ N
ƒ
ƒƒ SHzL „ z - ‚ f HzL „ z ƒƒƒ
ƒƒƒ ‡ ‡ n ƒƒ
ƒƒ
(11.34)
ƒƒ f n=1 f ƒ
244 Complex Analysis with Mathematica

can be made as small as we like, by taking N large enough. Hence the result. Theorem
11.2 will be used elsewhere. Note that uniform convergence is necessary, as the exam-
ples given in Chapter 9 made clear. A weaker statement of the theorem can also be given
by mimicking the proof of the Weierstrass M-test and assuming some bounds on fn ,
without mentioning the words ‘uniform convergence’ at all, but the statement and proof
within the framework of uniform convergence are by far the cleanest.

11.6 Ÿ Contour integration and its perils in Mathematica!


Recall our definition of two piecewise linear paths in Mathematica, given by psp and
cpsp:

8psp, cpsp<

881, Â, -1, -Â<, 81, Â, -1, -Â, 1<<

These lists can also be used to supply information to Mathematica's contour integration
routine. In the complex plane, the Mathematica functions Integrate and NInte-
grate expect to receive a list consisting of the variable of integration and points on the
contour. This makes use of the Prepend function

? Prepend

Prepend@expr, elemD gives expr with elem prepended.

ContourIntegral@expr_, vbl_, contour_D :=


Integrate@expr, Prepend@contour, vblDD

NContourIntegral@expr_, vbl_, contour_D :=


NIntegrate@expr, Evaluate@ Prepend@contour, vblDDD

NContourIntegral@1 ê z, z, cpspD

1.11022 µ 10-16 + 6.28319 Â

Chop@%D

6.28319 Â

% ê H2 Pi IL

1.

Here's another integral with the same result:

Chop@NContourIntegral@Sin@zD ê z ^ 2, z, cpspDD

6.28319 Â
11 Paths and complex integration 245

Imortant Warning: this type of integration is most reliably done by doing the calculation
both symbolically and numerically in Mathematica, so that the path is explicitly fed in to
the numerical integrator. When using symbolic integration, Mathematica will attempt to
find a definite integral and apply the fundamental theorem of calculus to the end points
of the contour. For closed contours where the integrand has a singularity within the
contour, this can lead to problems, especially in older versions of Mathematica, such as
the following pair, neither of which are correct:

N@ContourIntegral@Sin@zD ê z ^ 2, z, cpspDD

0. + 0 Â

N@ContourIntegral@1 ê z, z, cpspDD

0.

In version 5, these do return the correct results, both numerically and symbolically.

N@ContourIntegral@Sin@zD ê z ^ 2, z, cpspDD

0. + 6.28319 Â

N@ContourIntegral@1 ê z, z, cpspDD

0. + 6.28319 Â

ContourIntegral@Sin@zD ê z ^ 2, z, cpspD

-CiH-1L + CiH-1L

ContourIntegral@1 ê z, z, cpspD

2Âp

The lesson of this is to keep up with version upgrades, but always check the numerics
against the analytics!

Exercises
11.1 Evaluate the integral

ê
‡ z„z

over a circle of radius r centred on the origin. Is the integrand a holomorphic function of
z?

11.2 Construct a parametrization of the perimeter of the square with vertices


1 + Â, -1 + Â, -1 - Â, 1 - Â. Calculate the length of this path using the definition given
246 Complex Analysis with Mathematica

in Section 11.4. Does this agree with your intuition? Evaluate the integral of z and of zê
around this path.

11.3 What is the geometrical interpretation of the closed path given by

z = fHqL = a cos q + b  sin q

for 0 § q § 2 p? Evaluate the integrals

ê
‡ z „ z and ‡ z „ z

over this path.

11.4 Evaluate the integral of 3 z2 + 2 over each of the following paths:


(i) The semi-circular arc of radius 1 from +1 to -1 in the upper half-plane;
(ii) The straight line from +1 to -1.
(iii) The union of the three line segments from (a) +1 to +1 + Â, (b) from +1 + Â to
-1 + Â, (c) from -1 + Â to -1.
What do you notice about these three answers? By considering the function z3 + 2 z
relate your answers to the Fundamental Theorem of Calculus.

11.5 Let PHzL be a polynomial of degree n ¥ 2 with leading term a0 zn . By writing PHzL in
the form

PHzL = a0 zn QHzL

show that for » z » large enough we can ensure that


1
†PHzL§ ¥ ÅÅÅÅÅ †a0 zn §
2
Now let GR be the semicircle in the upper half-plane extending from z = R to z = -R.
Use the length inequality to show that as R Ø ¶,
1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z Ø 0
GR PHzL

11.6 Let G be a path from the point z1 = 2 to the point z2 = Â. Using the Fundamental
Theorem of Calculus, calculate each of the following integrals:

‡ sin z „ z
G

‡ ‰ sin z „ z
z

‡ cos HzL sin z „ z


2
G

11.7 Let PHzL be any polynomial of degree n. Using the Fundamental Theroem of
Calculus, show that
11 Paths and complex integration 247

‡ PH zL „ z = 0
G

for any piecewise smooth closed path G.

11.8 Ÿ Use Mathematica to evaluate the integral of z over the square with vertices
1 + Â, -1 + Â, -1 - Â, 1 - Â. How does the result compare with your answer from
exercise 11.2?

11.9 Ÿ Use Mathematica to evaluate the integral of 3 z2 + 2 over each of the following
polygonal paths:
(i) The straight line from +1to -1.
(ii) The union of the three line segments from (a) +1 to +1 + Â, (b) from +1 + Â to
-1 + Â, (c) from -1 + Â to -1.
How do your answers compare with those you calculated for Exercise 11.4?

11.10 Ÿ Use Mathematica to calculate each of the integrals given in Exercise 11.6.

11.11 Ÿ Recall the following definitions:

path@n_D := Table@Exp@2 * I * Pi * k ê nD, 8k, 0, n<D

NContourIntegral@expr_, vbl_, contour_D :=


NIntegrate@expr, Evaluate@ Prepend@contour, vblDDD

ContourIntegral@expr_, vbl_, contour_D :=


Integrate@expr, Prepend@contour, vblDD

Calculate the values of

ContourIntegral@z, z, path@nDD

and

NContourIntegral@Conjugate@zD, z, path@nDD

for a variety of increasing values of n. Useful starting choices might be n = 5, 20, 100.
To what value does the latter appear to converge as n becomes very large?
12 Cauchy's theorem

Introduction
In this chapter we discuss the integration of holomorphic functions around closed paths.
The main result, Cauchy's theorem, is that such integrals vanish when the function is
holomorphic on and inside the path. This superficially null result has astonishing
consequences when fully developed – in particular it will ultimately focus our attention
on functions with singularities (i.e. functions that fail to be holomorphic at certain
points), in order to get interesting results from integration. First, however, we need to
explain Cauchy's theorem. There are several levels of explanation of this result, depend-
ing on how general one wishes to make the conditions of the theorem. At one level, the
theorem can be explained by reference to Green's theorem in the plane (the planar form
of Stokes' theorem), from elementary vector calculus, and this will be considered first.
But the theorem can be stated and proved using fewer assumptions than are involved in
the Stokes'/Green's theorems, and we shall consider such a case also.
The first part of this chapter assumes a basic familiarity with real line integrals
of the form

‡ A„x + B„y (12.1)

defined on suitable curves in two real dimensions.

12.1 Green's theorem and the weak Cauchy theorem


To state these theorems properly we need a few topological definitions. Recall first that
a ‘contour’ is shorthand for a piecewise-smooth path.

‡ Topological preliminaries
An open set U is said to be connected if every pair of points in U can be joined by a
polygonal path that lies entirely in U. An open connected set is called a domain. A
simply connected domain D is a domain with the property that if C is any simple closed
contour lying in D, then the domain interior to C is entirely within D. We may visualize
simply connected domains as being open sets of the complex plane consisting of a single
piece with no holes. A contour C with domain interior to C, called D£ , is understood to
be ‘traversed in the positive sense’ if a hypothetical observer travelling along C always
has D£ to her left.
12 Cauchy's theorem 249

‡ Theorem 12.1: Green's theorem in the plane


Let AHx, yL and BHx, yL be continuous and have continuous partial derivatives in a
simply connected domain R of . Let C be a simple closed contour within R that is
traversed in the positive sense. Furthermore, let D£ be the domain interior to C. Then
the following real line integral

‡ A „x + B „y (12.2)
C

obtained by traversing C in a positive sense, is equal to the following area integral over
D£ :
B A
‡ J ÅÅÅÅÅÅÅÅxÅÅ - ÅÅÅÅÅÅÅÅyÅÅ N „ x „ y (12.3)

We take this result from elementary vector calculus, texts on which should be consulted
for a proof.

‡ Theorem 12.2: Green's theorem for a complex function


Suppose that a complex function f HzL = uHx, yL + ÂvHx, yL is integrated over such a
curve C, traversed in the positive sense. Then we can rewrite the left side of Green's
theorem as follows.

‡ f HzL „ z = ‡ Hu + ÂvL H„ x + Â „ yL = ‡ Hu + ÂvL „ x + H-v + ÂuL „ y (12.4)


C C C

We set A = u + Âv, B = -v + Âu, and so, by Green's theorem applied to the real and
imaginary parts, this is equal to
H-v + ÂuL  Hu + ÂvL
‡ J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N „ x„ y
y

HÂv + uL  Hu + ÂvL
= Â ‡ J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + Â ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N „ x„ y (12.5)
x y

  f
=  ‡ J ÅÅÅÅÅÅÅÅÅÅ +  ÅÅÅÅÅÅÅÅÅÅ N Hu + ÂvL „ x„ y = 2 ‡ ÅÅÅÅÅÅÅÅêÅÅ „ x„ y
x y z
D£ D£

where we have used the notation introduced in Chapter 10. So, to summarize, if f HzL is
continuous with continuous partial derivatives, then
f
‡ f HzL „ z = 2  ‡ ÅÅÅÅÅÅÅÅzêÅÅ „ x „ y (12.6)
C D£
250 Complex Analysis with Mathematica

‡ Theorem 12.3: The weak form of Cauchy's theorem


Suppose that C, D£ and f HzL satisfy the conditions of Green's theorem and, furthermore,
f HzL is holomophic. Since
f
ÅÅÅÅÅÅÅÅêÅ = 0 (12.7)
z
it follows that

‡ f HzL „ z = 0 (12.8)
C

12.2 The Cauchy–Goursat theorem for a triangle


The form of Cauchy's theorem that we have stated, based on Green's theorem, requires
that f £ HzL exists and is continuous. However, the requirement of continuity on the
derivative is superfluous, and one can give a proof without this assumption. This stron-
ger form is often called the Cauchy–Goursat theorem.

‡ Relation to Green's theorem


The relationship of the Cauchy–Goursat theorem to the version based on Green's
theorem is rather subtle. It will turn out that one can show that if a function is holomor-
phic, then it is in fact infinitely differentiable! This means that if a function is holomor-
phic, its derivatives are necessarily continuous. So why can't one use the version based
on Green's theorem? The answer is that the result, that a function is infinitely differentia-
ble provided it is holomorphic, and in particular, that the first derivatives are continuous,
is a consequence of the full Cauchy–Goursat result. So the Cauchy–Goursat theorem is a
stronger result than Green's theorem, which requires continuity of the first patial deriva-
tives.
We shall now consider the proof of the stronger form of Cauchy's theorem. Note
that we have not actually given a proof of Green's theorem – most elementary texts on
vector calculus give one, and it is superseded by the following argument. A common
proof of Green's theorem really just involves integrating the continuous functions
 B ê  x and  A ê  y, given in the statement of the theorem, along horizontal and vertical
strips within the area of interest, and applying the real fundamental theorem of calculus.
The proof below is a much more interesting exercise. We do it first for triangular
contours, and then we elevate this result to one for more general ‘star-shaped’ regions.

‡ Theorem 12.4: Cauchy–Goursat theorem for triangles


First we need some notation. Suppose that a, b, c œ . The triangle Ta,b,c is defined by

Ta,b,c = 8z : z = al1 + bl2 + cl3 , li ¥ 0, l1 + l2 + l3 = 1< (12.9)


12 Cauchy's theorem 251

Suppose that f : U Ø  is holomorphic on the open set U, and that Ta,b,c Õ U. This
triangle has a boundary given by the piecewise smooth path

l
o a + tHb - aL 0btb1
fa,b,c HtL = m
o b + Ht - 1LHc - bL 1btb2 (12.10)
n c + Ht - 2LHa - cL 2 b t b 3
Then the Cauchy–Goursat Theorem for a triangle states that, given that f : U Ø  is
holomorphic on the open set U, with Ta,b,c Õ U,

‡ f HzL „ z = 0 (12.11)
fa,b,c

ü Proof by contradiction
To prove this result, we assume that the result is not true, so we set

J = ‡ f HzL „ z  0
(12.12)
fa,b,c

and we aim to show that this leads to a contradiction. To prove this first requires some
basic geometry. The length of the path fa,b,c is

L = †b - a§ + †c - b§ + †a - c§ (12.13)

We define the mid-points of the three sides by


b+c a+c a+b
a1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; b1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; c1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (12.14)
2 2 2
In this way the original triangle is split into four similar triangles, as shown below (the
Mathematica routines for generating plota, etc., are given at the end of this chapter):

Show@plotaD

Now consider adding up the four contour integrals obtained by proceeding around each
sub-triangle in a positive sense. Since there are two integrals around each interior line,
one in each direction, these integrals over interior lines cancel, leaving just the integrals
around the exterior lines. Hence we can write
252 Complex Analysis with Mathematica

J = ‡ f HzL „ z
fa,b,c
(12.15)
= ‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z
fa,c1 ,b 1 fc1 ,b,a 1 fa1 ,c,b 1 fa1 ,b1 ,c1

By appplying the triangle inequality to this expression, and picking the sub-integral that
is largest in magnitude – we call its boundary points aH1L , bH1L , cH1L – we have con-
structed a sub-triangle TaH1L ,bH1L ,cH1L satisfying the following three conditions:

TaH1L ,bH1L ,cH1L Õ Ta, b, c (12.16)


ƒƒ ƒƒ
ƒƒ ƒƒ
ƒƒ ƒƒ †J§
ƒƒ f HzL „ z ƒƒƒƒ r ÅÅÅÅÅÅÅÅÅ
ƒƒ ‡ (12.17)
ƒƒ ƒƒ 4
ƒƒ f ƒƒ
ƒ a ,b ,c
H1L H1L H1L ƒ
L
L faH1L ,bH1L ,cH1L = ÅÅÅÅÅ (12.18)
2
We can repeat this process, subdividing more finely:

Show@GraphicsArray@88plotb, plotc<, 8 plotd, plote<<DD

In each case we pick the triangle where the integral is that of the four obtained with the
largest magnitude. This defines a sequence of triangles Tn = TaHnL ,bHnL ,cHnL with boundaries
given by the images f*n of the mappings fn HtL, with the properties that

TaHnL ,bHnL ,cHnL Õ TaHn-1L ,bHn-1L ,cHn-1L (12.19)


ƒƒ ƒƒ
ƒƒ ƒƒ
ƒƒ ƒƒ †J§
ƒƒ f HzL „ z ƒƒƒƒ r ÅÅÅÅÅnÅÅÅÅ
ƒƒ ‡ (12.20)
ƒƒ ƒƒ 4
ƒƒ f ƒƒ
ƒ a ,b ,c
HnL HnL HnL ƒ
12 Cauchy's theorem 253

L
L faHnL ,bHnL ,cHnL = ÅÅÅÅÅnÅÅÅÅ (12.21)
2
This sequence of triangles has a limiting point contained in all the triangles of the
sequence. This can most easily be seen by exploiting the Cauchy convergence criteria
discussed in Chapter 9, Section 9.2. Note first that if n < p < q, and aq œ Tq , then
aq œ T p Õ Tn , so that if aq œ Tq also, the distance between aq and a p satisfies
L
†a p - aq § b L fn = ÅÅÅÅÅnÅÅÅÅ (12.22)
2
The same holds if n < q < p. So a p is a Cauchy sequence, and there must be a limit
point a such that a p Ø a. Furthermore, note that
L
†a p - a§ b L f p = ÅÅÅÅÅpÅÅÅÅ (12.23)
2
Finally the fact that the function f HzL is differentiable at a is used to obtain a contradic-
tion. Note that the differentiability condition can be written as

f HzL = f HaL + Hz - aL f £ HaL + sHz - aL


 1 (12.24)
= ÅÅÅÅÅÅÅÅÅ Jz f HaL + ÅÅÅÅÅ f £ HaLHz - aL2 N + sHz - aL
z 2
so we deduce, from the Fundamental Theorem of Calculus, that when we integrate f
around the closed triangle, the first two terms on the right side of this last equation
integrate to zero, leaving us with

‡ f HzL „ z = ‡ sHz - aL „ z (12.25)


fn fn

Now we apply the length inequality


ƒƒ ƒƒ ƒƒ ƒƒ
ƒƒ ƒƒ ƒƒ ƒƒ
ƒƒ ƒ ƒƒ ƒƒ
ƒƒ f HzL „ z ƒƒƒ = ƒƒ ƒ
ƒƒ ‡ ƒƒ ƒƒ ‡ sHz - aL „ z ƒƒƒ b L fn sup* †sHz - aL§ (12.26)
ƒƒƒ ƒƒ ƒƒ ƒƒ
ƒ fn ƒƒ ƒƒ fn ƒƒ zœfn

Now, given e > 0, there is a d > 0 such that if †z - a§ < d then †sHz - aL§ < e » z - a ».
Next pick n such that L ê 2n < d:
ƒƒ ƒƒ
ƒƒ ƒƒ
ƒƒ ƒ
ƒƒ f HzL „ z ƒƒƒ b Lfn e L ê 2n = e L2 ê 4n
ƒƒ ‡ ƒƒ (12.27)
ƒƒ ƒƒ
ƒƒ fn ƒƒ

If we make the convenient choice e = » J » êH2L2 L > 0, we obtain


ƒƒ ƒƒ
ƒƒ ƒƒ
ƒƒ ƒ 1 †J§
ƒƒ ‡ f HzL „ z ƒƒƒ b ÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅ
ƒƒ ƒƒ (12.28)
ƒƒ ƒƒ 2 4n
ƒƒ fn ƒƒ
254 Complex Analysis with Mathematica

which contradicts the inequality that the integral has been constructed so that it is larger
than †J§ ê 4n . So we cannot have that » J » > 0. Hence J = 0 and the result is proved.

12.3 The Cauchy–Goursat theorem for star-shaped sets


To elevate the result for a triangle to more general sets we need to make some suitable
definitions. We have already seen that if there is a function FHzL whose derivative is f ,
then the fundamental theorem of calculus tells us that the integral around any closed
contour is zero. The converse is also true, as can be shown by actually constructing F as
an integral of f . The details depend on what one assumes about the shape of the region
of the complex plane under consideration. It is convenient to define a ‘star-shaped’
region as follows. Let U be an open subset of . We say that U is star-shaped about z0
if, for all z œ U, the straight line

@z0 , zD ª 8z0 + tHz - z0 L » 0 b t b 1< Õ U (12.29)

For example, a convex open set is, by definition, star-shaped about any of its points. So
suppose that U is star-shaped about a, and that z œ U. We define (bear in mind w is just
a dummy integration variables)

FHzL = ‡ f HwL „ w (12.30)


@a,zD

We can now state the theorem – note that we do not need all possible contours – all
triangles will do.

‡ Theorem 12.5: Existence of indefinite integral for star-shaped sets


Let f be a continuous complex valued function on U, open and star-shaped
about a, and suppose that the integral of f around any triangle vanishes. Then FHzL is
holomorphic on U, with F£ HzL = f HzL.

Proof: Fix z œ U, and let r be such that » h » < r fl z + h œ U. So the line segments
@a, zD, @a, z + hD, @z, z + hD are all within U. So consider the closed triangular contour T
from a to z to z + h to a. The Cauchy–Goursat Theorem for a triangle establishes that:

0 = ‡ f HwL „ w = ‡ f HwL „ w + ‡ f HwL „ w + ‡ f HwL „ w


T @a,zD @z,z+hD @z+h,aD
(12.31)
= FHzL - FHz + hL + ‡ f HwL „ w
@z,z+hD

That is,
12 Cauchy's theorem 255

FHz + hL - FHzL = ‡ f HwL „ w (12.32)


@z,z+hD

Also, we can write

f HzL = H1 ê hL ‡ f HzL „ w (12.33)


@z,z+hD

FHz + hL - FHzL 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - f HzL = ÅÅÅÅÅ ‡ @ f HwL - f HzLD „ w (12.34)
h h
@z,z+hD

and then
ƒƒ ƒƒ
ƒ ƒƒ
FHh + zL - FHzL 1 ƒƒƒƒ ƒƒ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ - f HzL¶ = ÅÅÅÅÅÅÅÅÅ ƒƒƒ ‡ @ f HwL - f HzLD „ w ƒƒƒƒ
¢ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
h †h§ ƒƒ ƒƒ
ƒƒ @z,z+hD ƒƒ
(12.35)
1
b ÅÅÅÅÅÅÅÅÅ †h§ sup † f HwL - f HzL§ = sup † f HwL - f HzL§
†h§ wœ@z,z+hD wœ@z,z+hD

which can be made as small as we wish by continuity of f . Hence the result.

‡ Cauchy–Goursat theorem for star-shaped and convex domains


We have actually done all the work necessary. The result is proved for triangles. Trian-
gles were in fact all we needed to show the existence of a holomorphic function FHzL
with the property that F£ HzL = f HzL. By the Fundamental Fheorem of Falculus applied to
a simple closed path C within a star-shaped domain, the integral around C of f HzL is
zero. End of proof! Note that since any convex set is star-shaped about any of its points,
the result has been proved for convex domains also.
One can consider making other proofs based on different assumptions. However,
we have proved the theorem without assuming continuity of the derivatives, and the
form of the theorem involving triangles is very direct and straightforward – differentiabil-
ity leads directly to a contradiction unless the integral around a triangle is zero. Then the
FTC elevates this to domains of a very general character. This therefore is as far as we
shall go with relaxation of the conditions for Cauchy's theorem. Now it is time to look at
some of the consequences of the result.

12.4 Consequences of Cauchy's theorem


It is useful to look at simple consequences of the result, and equivalent statements. The
most important basic points are:

(1) Whether we can deform the contour defining an integral between two points A and B
without changing the result for the integral.
256 Complex Analysis with Mathematica

(2) Whether we can shrink simple closed contours to integrals around a circle. (This is
useful to do some explicit calculations.)

Consider the first point. Suppose we have two piecewise smooth paths C and C£ from A
to B, as shown below:

$DefaultFont = 8"Helvetica ", 12<; a = 81, 1<; b = 85, 5<; c = 83, 3<;
l = Line@8a, b<D; c = Circle@c, 2 Sqrt@2D, 8Pi ê 4, 5 * Pi ê 4<D;
pts = 8PointSize @0.04D, Map@Point, 8a, b<D<;
labels = 8Text@"A", 81.4, 1<D,
Text@"B", 85.4, 5<D, Text@"C", 83.4, 3<D, Text@"C£ ", 81.4, 5<D< ;
Show@Graphics @8pts, l, c, labels <D, AspectRatio -> 1D

C£ B

A
Let D denote the contour obtained by traversing C from A to B and then traversing
backwards along C£ from B to A. Clearly D is a closed contour, so that

‡ f HzL „ z = 0 (12.36)
D

But

0 = ‡ f HzL „ z = ‡ f HzL „ z - ‡ f HzL „ z (12.37)


D C C'

Hence the integral from A to B is independent of the route taken. This of course links in
to the notion that f possesses an ‘anti-derivative’ F.

‡ Deformation to a circle
The last basic consequence of Cauchy's theorem involves seeing that we may replace
quite complicated contours by circles around points of interest. Such points may arise
quite naturally as points where the function being integrated may actually fail to be
holomorphic.
12 Cauchy's theorem 257

Suppose that we have a piecewise smooth, positively traversed, simple, path fHtL within
an open set U Õ , and that f is holomorphic on U - 8a<, where a is inside f* . To keep
the proof straightforward we shall assume further that U is actually star-shaped about a.
Note that we do not exclude the possibility that f is holomorphic on all of U – we just
want to allow for the possibility of non-differentiability at a. Since U is open there is a
number r such that the open disk

DHa, rL = 8z œ  : » z - a » < r< (12.38)

is contained entirely within U. Suppose that R < r and let g be the positively traversed
smooth path given by the circle radius R centred on a. What we want to establish is that

‡ f HzL „ z = ‡ f HzL „ z (12.39)


f g

Note first that the fact that the path f is simple means it cannot intersect itself, so it loops
around a just once. Now take a line L through a that intersects f* at c and d, and inter-
sects g at p and q. This line lies entirely within U because U is star-shaped about a. The
geometry is as shown below:

$DefaultFont = 8"Times", 14<;


f@t_D := 82 Cos@tD + 0.6 Sin@4 tD, 2 Sin@tD + 0.6 Sin@2 tD<;
g@t_D := 8Cos@tD, Sin@tD<;
data = 88AbsoluteThickness @0.1D, Line@88-2, -2<, 82, 2<<D<, 8PointSize @0.03D,
Point@8-1 ê Sqrt@2D, -1 ê Sqrt@2D<D,
Point@8 1 ê Sqrt@2D, 1 ê Sqrt@2D<D,
[email protected], -1.4<D, Point @8 1.83, 1.83<D<,
Text@"g", 81.2, 0<D, Text@"f", 82.2, 0<D,
Text@"p", 8-0.7, -1.0<D, Text@"q", 80.7, 1.2<D,
Text@"c", 8-1.7, -1.4<D, Text@"d", 82.2, 1.9<D<;
ParametricPlot @Evaluate @8f@tD, g@tD<D, 8t, 0, 2 Pi<, AspectRatio -> 1,
PlotRange -> 88-3, 3<, 8- 3, 3<<,
PlotStyle Ø AbsoluteThickness @0.1D, Axes -> False, Epilog -> dataD

d
q

g f
p
c

Now focus attention on one part of this geometry as shown below, where the line
segment from q to d is split into two neighbouring lines L and L£ as shown:
258 Complex Analysis with Mathematica

$DefaultFont = 8"Times", 14<;


f@t_D := 82 Cos@tD + 0.6 Sin@4 tD, 2 Sin@tD + 0.6 Sin@2 tD<;
g@t_D := 8Cos@tD, Sin@tD<;
shift = 0.03;
data = 88AbsoluteThickness @0.1D, Line@
88 1 ê Sqrt@2D + shift , 1 ê Sqrt@2D - shift<, 81.83 + shift, 1.83 - shift<<D,
Line@88 1 ê Sqrt@2D, 1 ê Sqrt@2D<, 81.83, 1.83<<D<,
8PointSize @0.01D,
Point@8 1 ê Sqrt@2D, 1 ê Sqrt@2D<D, Point @8 1.83, 1.83<D<,
Text@"g", 81.2, 0<D, Text@"f", 82.2, 0<D,
Text@"L", 81.6, 1.0<D, Text@"L £ ", 81.3, 1.6<D,
Text@"q", 80.7, 1.2<D, Text@"d", 82.1, 2.0<D<;
ParametricPlot @Evaluate @8f@tD, g@tD<D, 8t, 0, 2 Pi<, AspectRatio -> 1,
PlotRange -> 88-3, 3<, 8- 3, 3<<,
PlotStyle Ø AbsoluteThickness @0.1D, Axes -> False, Epilog -> dataD

d

q L

g f

Consider the contour C defined by starting at L£ › f, and traversing f counter-clockwise


until L › f is reached. Then move along the line segment L from L › f to L › g, then
around g in a negative sense to L£ › g, then along L£ from L£ › g to L£ ›f. This is a
closed contour and so

‡ f HzL „ z = 0 (12.40)
C

but

‡ f HzL „ z = ‡ f HzL „ z + ‡ f HzL „ z - ‡ f HzL „ z + ‡ f HzL „ z


(12.41)
C f L:dØq g £
L :qØd

Since the integrals along L and L£ cancel, we deduce that

‡ f HzL „ z = ‡ f HzL „ z (12.42)


f g

So we can replace quite complicated contours by circles as long as they are simple and
closed.
12 Cauchy's theorem 259

12.5 Ÿ Mathematica pictures of the triangle subdivision


The production of iterated graphics in a straightforward manner can be done particularly
elegantly in Mathematica. In particular, we can give a particularly elegant picture of the
repeated subdivision of a triangle used in the proof of Cauchy's theorem:

Triangle@8a_, b_, c_<D :=


Module@8edge = 88Re@aD, Im@aD<, 8Re@bD, Im@bD<,
8Re@cD, Im@cD<, 8Re@aD, Im@aD<<<,
88Hue@Random@DD, Polygon@edgeD<,
[email protected], Line@edgeD<<D

Subdivide@8a_, b_, c_<D :=


88a, Ha + bL ê 2, Ha + cL ê 2<,
8Ha + bL ê 2, Hb + cL ê 2, Ha + cL ê 2<,
8Ha + bL ê 2, b, Hb + cL ê 2<, 8Hb + cL ê 2, c, Ha + cL ê 2<<

Subdivide@ h_ ? MatrixQD := Flatten@Map@Subdivide, hD, 1D

RepeatedSubdivide@8a_, b_, c_<, n_D :=


Nest@Subdivide, 8a, b, c<, nD

checka = RepeatedSubdivide@80, 2, 1 + I<, 1D

ij 0 1 ÅÅÅÅ12 + ÅÅÅÅ2Â yz
jj zz
jj z
jj
jj 1 ÅÅÅÅ32 + ÅÅÅÅ2Â ÅÅÅÅ12 + ÅÅÅÅ2Â zzzz
jj zz
z
jj
jj 1 2 ÅÅÅÅ32 + ÅÅÅÅ2Â zzzz
jjj zzz
k ÅÅÅÅ2 +
3
ÅÅÅÅ2Â 1 + Â ÅÅÅÅ12 + ÅÅÅÅ2Â {

checkb = RepeatedSubdivide@80, 2, 1 + I<, 2D;


checkc = RepeatedSubdivide@80, 2, 1 + I<, 3D;
checkd = RepeatedSubdivide@80, 2, 1 + I<, 4D;
checke = RepeatedSubdivide@80, 2, 1 + I<, 5D;

ViewDivision@data_D :=
Show@Graphics@Map@Triangle, dataDDD;
260 Complex Analysis with Mathematica

plota = ViewDivision@checkaD

plotb = ViewDivision@checkbD

plotc = ViewDivision@checkcD

plotd = ViewDivision@checkdD
12 Cauchy's theorem 261

plote = ViewDivision@checkeD

Exercises
12.1 Use Green's theorem in the plane for the case f HzL = zê to show that if C has interior
D£ , then

£
‡ f HzL „ z = 2ÂAHD L
C

where AHD£ L is the area of the interior.

12.2 (The last part needs an understanding of moments of inertia in mechanics.) Use the
complex form of Green's theorem in the plane for the case

f HzL = ÅÅÅÅÅÅÅÅÅ zê 2 z
4
to show that if C has interior D£ , then

‡ f HzL „ z = ‡ †z§ „ x „ y
2

C D£

Hence show, by evaluating a suitable integral around the unit circle, that the moment of
inertia of a circular disk of radius r, and mass per unit area r, with respect to an axis
normal to the disk through its centre (the polar moment), is
pr
ÅÅÅÅÅÅÅÅÅ r4
2
If the total mass is M, deduce that the polar moment of inertia is M r2 ê2.

12.3 A two-dimensional vector field êvê = Hv1 Hx, yL, v2 Hx, yL, 0L is said to be irrotational
if


êê ä êvê = ê0ê
Show that this reduces to the constraint that
v2 v1
ÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅ
x y
262 Complex Analysis with Mathematica

12.4 A two-dimensional vector field êvê = Hv1 Hx, yL, v2 Hx, yL, 0L is said to be divergence-
free, or solenoidal, if


êê . êvê = 0
Show that this reduces to the constraint that
v1 v2
ÅÅÅÅÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅ
x y

12.5 Show that if f = v1 - Âv2 is holomorphic, then the two-dimensional vector field
corresponding to f is both irrotational and divergence-free.

12.6 If a two-dimensional vector field has the property that its line integrals are indepen-
dent of the path taken, then vector calculus theory tells us that there is a potential F with
the property that

êê F
êvê =“
How is this related to the existence of an anti-derivative for the corresponding function
f ? How do we interpret Cauchy's theorem in this context?

12.7 Calculate the integral


1
z +2z+2
2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ

over the square with corners at H0, 0L, H-2, 0L, H-2, -2L, H0, -2L, to be traversed
counter-clockwise. (Hint: factorize and do a partial fraction expansion on the denomina-
tor, and deform the square to a small circle around -1 - Â.)

12.8 Ÿ Explore the integrals of the following functions around a unit square centred on
the origin, using Mathematica's NIntegrate function. What is the pattern in the
answers? What special cases are there?
1 1
z , †z§ , ConjugateHzL , J0 HzL , J0 H†z§L , ÅÅÅÅÅ , ÅÅÅÅ2ÅÅÅÅ
z z
13 Cauchy's integral formula and its
remarkable consequences

Introduction
In this chapter we introduce and prove the Cauchy integral formula and look at one part
of the remarkable chain of consequences that results from it. The Cauchy integral
formula is itself almost obvious from the deformation of an integral to a small circle, but
its consequences are truly astonishing. First one establishes Taylor's theorem – in this
case expressed as the fact that if a function is holomorphic, it is in fact infinitely differen-
tiable, and can be represented as a power series involving all its derivatives. Formulae
are also available for the derivatives. This is in manifest distinction to the real case,
where being differentiable once is no guarantee of further differentiability, and being
infinitely differentiable is no guarantee of having a power series! The formulae for the
derivatives can be converted into useful inequalities (the Cauchy inequalities) for the
scale of the derivatives, which allows a quick proof of the remarkable theorem of
Liouville – that any bounded function that is holomorphic everywhere must be constant.
Again, we explore the manifest distinctions with the real case of this odd result, and use
it to establish a neat proof of the fundamental theorem of algebra – that any non-constant
polynomial with complex coefficients has a root (and hence all its roots) in . This
finally justifies the remark made in Chapter 1, Section 1.1 – that ‘complex numbers are
enough’ – so we do not need to extend the number system any further to solve polyno-
mial equations. Then we establish Morera's theorem, which is the converse to Cauchy's
theorem.

13.1 The Cauchy integral formula


There are many levels of the statement of this result, depending on the type of contour
one wishes to admit into the formula that results. We begin by establishing the simplest
result, which is in fact sufficient for subsequent developments.

ü Theorem 13.1: The Cauchy integral formula


Let U be an open subset of  and let f be analytic on U. Let a œ U and suppose that
Nr HaL Õ U. Let R < r and let

fR @tD = a + R‰Â t (13.1)

for 0 b t b 2 p be a circular path of radius R centred on a. Then


1 f HzL
f HaL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p z-a (13.2)
fR
264 Complex Analysis with Mathematica

Henceforth we shall abbreviate the name of this result to the ‘CIF’.

ü Proof
We apply our deformation results from Chapter 12 to argue that if 0 < s < R, we may
replace our original circle by a smaller one of radius s:
f HzL f HzL
‡ ÅÅÅÅÅÅÅÅ
z-a
ÅÅÅÅÅÅÅÅ „ z = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
z-a (13.3)
fR fs

Now f HzL is differentiable at a, so given any e > 0, there is a d : 0 < d < R such that, if
» z - a » < d, then
f HzL - f HaL e
¢ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - f £ HaL¶ < ÅÅÅÅÅÅ (13.4)
z-a R
(This is just the statement that the remainder term in the definition of differentiability
goes to zero). So choose s such that 0 < s < d. Then using the length inequality
ƒƒ ƒƒ
ƒƒ ƒƒ
ƒ f HzL - f HaL £
ƒ e 2pd
†ƒ‡ J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - f HaLN „ z§ƒ b ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ b 2 pe (13.5)
ƒƒƒ z-a ƒƒ
ƒƒ
R
ƒfs
But also, we have that

£
‡ f HaL „ z = 0 (13.6)
fs

f HaL
‡ ÅÅÅÅÅÅÅÅ
z-a
ÅÅÅÅÅÅÅÅ „ z = 2p f HaL (13.7)
fs

ƒƒ ƒƒ
ƒƒ ƒƒ
ƒ 1 f HzL ƒ
†ƒ ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z - f HaL§ƒ b e (13.8)
ƒƒ 2p z-a ƒƒ
ƒƒ fs ƒƒ

Since we can make e as small as we wish, the result is proved.

‡ Generalizations and winding numbers


First of all note that we can replace the circular path by a simple closed path, using the
deformation theorem given in Chapter 12. Of particular importance is the case of a
circle not necessarily centred on the point of interest.
We can also ask what happens for a path that is not necessarily simple. Suppose
first that our original path is replaced by

fR, n @tD = a + R ‰Â t (13.9)


13 Cauchy's integral formula and its remarkable consequences 265

for 0 b t b 2np. Then a simple extension of the argument given above shows that
f HzL
2pÂn f HaL = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
z-a (13.10)
fR,n

More generally still, given a path f, we can define its winding number about a, nHf, aL,
by the integral
1
2pÂnHf, aL = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
z-a (13.11)
f

It can be shown that this is well-defined, and obtain a result generalizing the CIF in the
form
f HzL
2pÂnHf, aL f HaL = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
z-a (13.12)
f

We shall not go into details about such winding numbers in our main discussion – they
are beyond the scope of this book.

13.2 Taylor's theorem


The following result gives Theorem 13.2: Taylor's theorem. Let f be analytic on an
open set U Õ . Then the following are true:

(i) f has derivatives of all orders at all points of U.


êêê
(ii) Suppose that a œ U, r > 0 and N r HaL Õ U, then
n! f HzL
f HnL HaL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ „ z (13.13)
2p Hz - aLn+1
fr,a

where fr,a @tD = a + r‰Ât , 0 b t b 2p.


(iii) If » h » < r,

hn 1
f Ha + hL = ‚ ÅÅÅÅÅÅÅÅÅ f HnL HaL = f HaL + h f £ HaL + ÅÅÅÅÅ h2 f ££ HaL + … (13.14)
n=0
n! 2

and the series converges absolutely and uniformly for h œ Nr H0L . Before looking at the
proof some remarks are in order.
This result goes some way to explaining our early interest in power series. It has
turned out that any holomorphic function can be locally represented as a power series.
We also know, from Chapter 9, that power series converge and are differentiable within
their radius of convergence. Once one knows this result it is tempting to regard
‘holomorphic’ and ‘power series’ as synonymous. The term ‘analytic’ is used by some
to mean ‘having a power series’, irrespective of whether the context is real or complex.
266 Complex Analysis with Mathematica

‡ Differences from the real case


The theorem as stated is remarkable in the differences it implies between the conse-
quences of real differentiability compared to complex differentiability. Consider first a
function f :  Ø  defined by
0 x<0
f HxL = : (13.15)
x2 x r 0

This function can be differentiated everywhere, including the origin (a first-principles


application of the limit formula works there) to yield the function
0 x<0
f £HxL = : (13.16)
2x x r 0

This new function is not differentiable at the origin. The following plots of the function
(on the left) and its derivative (on the right) show the reason why one cannot differenti-
ate twice:

plotf = Plot@If@x < 0, 0, x ^ 2D, 8x, -1, 1<,


DisplayFunction -> Identity, PlotRange -> 80, 1<,
PlotStyle -> [email protected];
derplot = Plot@If@x < 0, 0, 2 xD, 8x, -1, 1<,
DisplayFunction -> Identity, PlotRange -> 80, 1<,
PlotStyle -> [email protected];
Show@GraphicsArray@8plotf, derplot<D,
DisplayFunction -> $DisplayFunctionD

1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
-1 -0.5 0.5 1 -1 -0.5 0.5 1
Another function illustrates the failure of the power series representation even when the
function is infinitely differentiable. Let gHxL be defined by
l
o 0 x=0
gHxL = m
o ‰-1êx2 (13.17)
n x0

It requires some work to see what is happening here, and the proofs of the following are
discussed in the exercises. It turns out that gHxL is infinitely differentiable everywhere,
including the origin, but

gHnL H0L = 0 (13.18)


13 Cauchy's integral formula and its remarkable consequences 267

for all values of n. The function is incredibly flat in a neighbourhood of the origin:

Plot@If@x == 0, 0, Exp@-1 ê x ^ 2DD, 8x, -5, 5<,


PlotRange -> 80, 1<, PlotPoints -> 100,
PlotStyle -> [email protected]

0.8

0.6

0.4

0.2

-1 -0.5 0.5 1
It is hopeless trying to make analogues of these functions that are differentiable at the
origin. The function

gHzL = ‰-1êz
2
(13.19)

actually possess one of the nastiest types of singularity, known as an essential singular-
ity, at the origin. Not only does it blow up badly along the imaginary axis, but it also
attains any non-zero value infinitely often in a neighbourhood of the origin! A demonstra-
tion of this is in one of the exercises. We will define and discuss this and other types of
singularity in Chapter 14.

‡ Proof of Taylor's theorem parts (i) and (ii)


How do we prove this result? First of all note that if f is once differentiable in U, we
have the Cauchy integral formula. So parts (i) and (ii) are certainly true for n = 0. So we
shall adopt an inductive approach, and assume that the result is true for a value of n, for
all a œ U, and for each a we can find a range of values of r for which the result is true.
Let h be such that h b r ê 2. So by our inductive hypothesis, we can write
n! f HzL
f HnL Ha + hL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (13.20)
2p Hz - Ha + hLLn+1
frê2, a+h

where frê2,a+h @tD = a + h + Hr ê 2L‰Ât , 0 b t b 2p. Why do we do this? Well, the point
a + h is at most rê 2 from a, and a circle of radius rê2 centred on a + h is therefore within
268 Complex Analysis with Mathematica

Nr HaL. So this expression is over a circular contour lying entirely within U. We now
deform this contour to the original circular contour of radius r centred on a, to write
n! f HzL
f HnL Ha + hL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z (13.21)
2p Hz - Ha + hLLn+1
fr, a

It does not hurt to remind the reader why such a deformation is allowed – we apply
Cauchy's theorem to the contour g shown here. We have drawn it using Mathematica
with illustrative values of a and h.

a = 80, 0<; h = 81 ê 4, 0<;


phione@t_D := 8Cos@tD, Sin@tD<; phitwo @t_D := h + 0.5 * phione@tD;
gamma@t_D := 1.05 * phione @Pi ê 160 + 0.9875 * tD;
delta@t_D := h + 0.55 * phione @Pi ê 160 + 0.9875 * tD;
ParametricPlot @Evaluate @8phione @tD, phitwo @tD, gamma@tD, delta@tD<D,
8t, 0, 2 Pi + 0.01<, AspectRatio -> 1, Axes -> False, Compiled -> False,
PlotStyle ->
8Thickness @0.005 D, Thickness @0.005D, Thickness @0.01D, Thickness @0.01D<,
Epilog -> 8PointSize @0.03D, Point@aD, Point @a + hD,
Text@"a", 80, -0.1<D, Text@"a+h", h + 80, -0.1<D,
Thickness @0.015 D, Line@8gamma @2 PiD, delta@2 PiD<D,
Line@8gamma @0D, delta@0D<D<D

a a+h

The outer circle is fr,a and the inner is fa+h,rê2 . The contour g first traverses almost all of
the outer circle anticlockwise, jumps to the inner circle, traverses it clockwise, then
jumps back out to the outer circle. By Cauchy's theorem, we have
f HzL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z = 0 (13.22)
Hz - Ha + hLLn+1
g

Given that we can deform the contour to the same one used for f HnL (a), we consider the
definition of differentiability of f HnL , with the proposed integral expression for f Hn+1L , by
examining
Hn + 1L ! f HzL
s = f HnL Ha + hL - f HnL HaL - h ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ „ z
2p Hz - aLn+2 (13.23)
fr, a
13 Cauchy's integral formula and its remarkable consequences 269

To show that the nth derivative is differentiable, with f Hn+1L given by the same integral
formula, it is sufficient to show that s is OHh2 L, so that s ê h Ø 0, as h Ø 0. But we can
write
ÅÄÅ hHn + 1L ÑÑÑÑ
É
s = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HzLÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
n! 1 1
ÅÅÅÅÅÅÅÅ
Å ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÑÑ „ z
2p ÅÅÇ Hz - Ha + hLLn+1 Hz - aLn+1 Hz - aLn+2 ÑÑÖ (13.24)
fr, a

So we need to estimate the bracketed term in the integrand. The astute reader may well
have noticed by now that the fact that the bracketed term is of the right order is nothing
more than the observation that 1 êHz - aLn+1 is differentiable, with the obvious derivative,
but we can check it explicitly. First, putting it all over a common denominator, we have
1 1 Hn + 1Lh
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ ÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ =
Hz - Ha + hLL n+1
Hz - aL n+1
Hz - aLn+2
(13.25)
Hz - aLn+2 - Hz - Ha + hLLn+1 Hz - a + Hn + 1LhL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Hz - aLn+2 Hz - Ha + hLLn+1

Next, by the binomial theorem, we can write

Hz - Ha + hLLn+1 = Hz - aLn+1 - Hn + 1L h Hz - aLn + R (13.26)

where R is OHh2 L. On insertion of this the term in the numerator in Hz - aLn+2 is can-
celled, leaving us with
2
Hz - aLn h2 Hn + 1L - Hz - a + hHn + 1LLR
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (13.27)
Hz - aLn+2 Hz - Ha + hLLn+1

So everything in the numerator is OHh2 L. Hence we have shown that f HnL is differentia-
ble, with f Hn+1L also given by the integral formula. This proves parts (i) and (ii) of the
theorem, by induction.

‡ Proof of Taylor's theorem part (iii)


êêê
Now we know that N r HaL Õ U. In fact, we can stretch this closed disk a little, and state
that there is an s with s > r and Ns HaL Õ U. This follows from the fact that there is a
certain minimum non-zero distance from a point on the circle fr HaL to points not in U.
This is proved properly in the appendix (to this proof) on the disk-stretching lemma and
requires some results from formal analysis. This lemma can be used to extend the scope
of the Cauchy integral formula somewhat, but for no real gain. Here, however, the
lemma is needed, so we first assume it and then prove it.
Proceeding on this assumption, let r < q < s, and suppose that » h » b r. By the
CIF, bearing in mind that, having stretched the disk, a + h is inside fq , and applying an
expansion to the denominator,
270 Complex Analysis with Mathematica

1 f HzL
f Ha + hL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p Hz - Ha + hLL
fs
ÄÅ ÉÑ
1 ÅÅ 1 hn hn+1 ÑÑ
= ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HzLÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ... + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅ ÑÑ „ z
Ñ
2p ÅÅÇ Hz - aL Hz - aL n+1
Hz - aL Hz - a - hL ÑÑÖ
n+1
fq
(13.28)
hn
= f HaL + h f £ HaL + … + ÅÅÅÅÅÅÅÅÅ f HnL HaL
n!
ÄÅ ÉÑ
n+1
Å ÑÑ
+ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HzLÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
h 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅ ÑÑ „ z
2p ÅÅÇ Hz - aLn+1 Hz - a - hL ÑÑÑÖ
fq

So let's look at the size of the remainder term. Suppose that » f HzL » b M on the path
over the image of fq . Then
ƒƒƒ 1 ÄÅ ÉÑ ƒƒ
Å ÑÑ ƒ
†ƒ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ hn+1 ‡ f HzLÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ ÅÅÅÅ ÅÅÅ ÑÑ „ z§ b
ƒƒ 2 p  ÅÅÇ Hz - aL H-a - h + zL ÑÑÑÖ ƒƒƒ
n+1

n (13.29)
rn+1 M M r I ÅÅÅÅqr M
ÅÅÅÅÅÅÅÅÅÅÅÅÅ B ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅn+1
ÅÅÅÅÅÅÅÅÅ F 2 pq = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2 p Hq - rL q q-r

and this tends to zero as n Ø ¶.

ü Absolute and uniform convergence


The establishment of this result is based on an analysis similar to that established for the
remainder. The Hn + 1Lth term in the series is
hn hn f HzL
ÅÅÅÅÅÅÅÅÅ f HnL HaL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ „ z
n! 2p Hz - aLn+1 (13.30)
fq

so taking absolute values,


hn rn M r n
À ÅÅÅÅÅÅÅÅÅ f HnL HaL À b ÅÅÅÅÅÅÅÅÅÅ B ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ F 2ps = MJ ÅÅÅÅÅ N (13.31)
n! 2p q n+1 q

and by comparison with a geometric series, this is absolutely convergent, and. by the
Weierstrass M-test, is uniformly convergent.

ü Appendix to Taylor's theorem: the disk-stretching lemma


Let U Õ , U open, but U  , and let dHzL denote the shortest distance from z to a point
not in U. Formally, we let

dHzL = inf 8†z - w§; w – U< (13.32)

This is a continuous function on , and is only zero if z – U, because if z œ U, then, by


the definition of an open set, Ne HzL Õ U, for some e, hence dHzL r e. Now suppose the
13 Cauchy's integral formula and its remarkable consequences 271

êêê
closed disk N r HaL lies within U. This closed disk is a closed and bounded subset of ,
and we assume a result from basic analysis that a continuous function defined on such a
subset is bounded on such a subset and attains its bounds. In particular, dHzL attains its
êêê
lower bound on N r HaL. This value is necessarily greater than zero, we call it dmin . It then
it follows that Nr+dmin HaL Õ U.
All we have done is to prove carefully that, along the circle, the minimum
distance to a point not in U is greater than zero, so we can stretch the circle out a little.

13.3 The Cauchy inequalities


If we take the estimate used to establish the uniform convergence of the Taylor series:
hn r n
À ÅÅÅÅÅÅÅÅÅ f HnL HaL À b MJ ÅÅÅÅÅ N (13.33)
n! q

and set h = r, we obtain the Cauchy inequalities:


M n!
À f HnL HaL À b ÅÅÅÅÅÅÅÅÅnÅÅÅÅÅÅÅÅ (13.34)
q

Recall that M is the maximum value of » f HzL » on the image of fs .

13.4 Liouville's theorem


Theorem 13.3: Suppose that f is holomorphic on all of . Liouville's theorem states that
if f is bounded on  then f is constant.
The proof of this involves a simple application of the n = 1 Cauchy inequality.
Suppose that » f HzL » < m for all z œ . Let a œ , and suppose that s > 0. Let M be the
maximum value of » f HzL » on a circle of radius s centred on a. Then, choosing the n = 1
case from the Cauchy inequalities gives:
M m
† f £ HaL§ b ÅÅÅÅÅÅÅÅÅ b ÅÅÅÅÅÅ (13.35)
s s
Now since s is arbitrary, and so can be as large as we choose, it follows that

f £ HaL = 0 (13.36)

This is true for all a, so f £HzL = 0. So f HzL is constant.

‡ Differences from the real case


A reminder about the real case is in order here, to make the point about just how surpris-
ing Liouville's theorem is! There are plenty of differentiable, indeed infinitely differentia-
ble functions, that are bounded on all of . For example, if we consider one of the
simple trigonometric functions, we have, for all x œ ,

†sinHxL§ b 1 (13.37)
272 Complex Analysis with Mathematica

But if we extend this function into the complex plane, the function sinHzL grows in the
imaginary direction, and is unbounded as one approaches  ¶. It is nicely frustrating to
play this game with any bounded real function. As a second example, consider
1
f HxL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ (13.38)
a + x2
2

This again is bounded for x real, but if we extend this function (holomorphically) into
the complex, by considering
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ (13.39)
a + z2
2

it inevitably blows up at z =  Âa. This notion can be neatly extended to prove the next
important result, about roots of polynomials.

13.5 The fundamental theorem of algebra


Theorem 13.4: Suppose that PHzL is a non-constant polynomial. Then there is a complex
number w such that PHwL = 0.
The idea of the proof is very simple, now that we are armed with Liouville's
theorem, for we just consider
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅ (13.40)
PHzL

and suppose that there are no points w where PHwL = 0. Under this assumption f is
continuous. We have to show carefully that we get a contradiction unless P is constant.
We do this by demonstrating that, under our assumptions, f is bounded, and this begins
by writing out P in the form
an-1 a0
PHzL = a0 + a1 z + … + an zn = zn Jan + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + … + ÅÅÅÅÅnÅÅÅÅ N (13.41)
z z
Let's consider the absolute value of that part of the bracketed term not involving an . This
is just
an-1 a0
À ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + … + ÅÅÅÅnÅÅÅÅÅ À (13.42)
z z
By choosing a sufficiently large value for R, we can arrange that if » z » > R, then
an-1 a0 an
À ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + … + ÅÅÅÅnÅÅÅÅÅ À b ¢ ÅÅÅÅÅÅÅÅÅ ¶ (13.43)
z z 2
It follows by the triangle inequality that if » z » > R, then
1
†PHzL§ r ÅÅÅÅÅ Rn †an § (13.44)
2
and hence that
13 Cauchy's integral formula and its remarkable consequences 273

2
f HzL b ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ (13.45)
R †an §
n

So we have shown that f is bounded on » z » > R. Since it is continuous on the closed


and bounded set » z » b R, it is bounded there also. Hence it is bounded for all z. Hence,
by Liouville, it must be a constant. This contradicts the assumption that P is non-con-
stant. This finally justifies the remark made in Chapter 1, Section 1.1 – that ‘complex
numbers are enough’ – so we do not need to extend the number system any further to
solve polynomial equations.

‡ Ÿ Remarks and visualization


Once one has found one root the fact that there are n roots follows by factorization. A
careful analysis is given in Exercise 13.3. There may be multiple roots at a given point.
At this stage you may wish to revisit the discussion in Chapter 1. Remember that a
polynomial, indeed linear, equation with integer coefficients requires a number system
larger than the integers. A general linear equation will have a solution that is rational. A
quadratic equation with rational coefficients may have solutions that are rational or real,
but in general has a complex solution. A general polynomial equation with complex
coefficients always has all its solutions within the set of complex numbers – we do not
need to extend our concept of numbers any further. Of course, people have invented
higher-order number systems – the Quaternions of Hamilton being a classic example.
But the requirement of polynomial equation solving does not necessitate their introduc-
tion.
There is a particularly neat way of visualizing the roots in the complex plane
with Mathematica, which provides an informal view of the fundamental theorem of
algebra. The idea is to plot minus the log of the absolute value of the polynomial. The
following plot is a variant of an approach that was originally given in the ‘Solving the
Quintic’ poster (Adamchik and Trott, 1994). For example, consider the polynomial
qHzL = z5 - 1. We can plot the logarithm of its absolute value:

q@z_D := z ^ 5 - 1; Plot3D@-Log@Abs@q@x + I yDDD,


8x, -1.5, 1.5<, 8y, -1.5, 1.5<, PlotPoints Ø 50D

2
0
-2 1
0
-1
0 -1
1
The five zeroes stand out as peaks in this plot.
274 Complex Analysis with Mathematica

13.6 Morera's theorem


This is the converse to Cauchy's theorem, and states that if, given a function f , its
integral around all suitable closed paths is zero, then the function is holomorphic. It
hinges critically on the first part of Taylor's theorem. What we do is to build a function
F that is the integral of the given function f , and show that it is differentiable on a
suitable region, provided that certain integrals vanish, with a derivative that is our
original function f . It follows, from the fact that we can differentiate as often as we
wish, that f is itself differentiable.

ü Theorem 13.5: Morera's theorem


Let f be a continuous function defined on an open set U Õ . Suppose that

‡ f HzL „ z = 0 (13.46)
f

for any piecewise-smooth closed curve f. Then f is holomorphic in U.

Proof: It is sufficient (as in our proof of the Cauchy–Goursat Theorem), to consider


triangular paths fa,b,c for triangles Ta,b,c Õ U . With this in mind, let z œ U, and suppose,
given that U is open, that Nr HzL Õ U, and w œ Nr HzL. Let cw be the straight-line path
from z to w, and define F by the integral

FHwL = ‡ f HzL „ z
(13.47)
cw

Now let y be the straight line joining w and w + h, for w + h œ Nr HzL. Clearly,

FHw + hL - FHwL = ‡ f HzL „ z (13.48)


y

and, making a subtraction that will lead to the right expression for the derivative

FHw + hL - FHwL - h f HwL = ‡ @ f HzL - f HwLD „ z (13.49)


y

The right side of this is an integral over a path of a length that goes to zero, of a function
that goes to zero, and hence is oH » h »L – to prove this formally, given e > 0, we can find a
d > 0 such that » f HzL - f HwL » < e for » z - w » < d. So if » h » < d,
ƒƒ ƒƒ
ƒƒ ƒƒ
ƒƒ ƒ
ƒƒ @ f HzL - f HwLD „ z ƒƒƒ < e †h§
ƒƒ ‡ ƒƒ (13.50)
ƒƒ ƒƒ
ƒƒ y ƒƒ
13 Cauchy's integral formula and its remarkable consequences 275

The remainder is oH » h »L, so F is differentiable with derivative f . Since we can differenti-


ate again, f must be analytic.

13.7 The mean-value and maximum modulus theorems


Let's now go back to the CIF in the form
1 f HzL
f Hz0 L = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p z - z0 (13.51)
fR

We can deduce some other important results directly from the CIF. These other results
do not rely on Taylor's Theorem. To establish the main result we first rewrite the CIF
using an explicit parametrization on the circle:

z = z0 + R‰Â t

Then Eq. (13.51) becomes


2p
1
f Hz0 L = ÅÅÅÅÅÅÅÅÅÅ ‡ f Hz0 + R‰Ât L „ t (13.52)
2p
0

and we have established Theorem 13.6 (the mean-value theorem): the value of a
holomorphic function f at a point is the average of its values on a circle centred at that
point. We can deduce from this that
2p
1
† f Hz0 L§ § ÅÅÅÅÅÅÅÅÅÅ ‡ † f HR‰Ât + z0 L§ „ t (13.53)
2p 0

It follows that we can deduce Theorem 13.7 (maximum modulus theorem): for a
non-constant function f , » f Hz0 L » cannot be a maximum of the modulus of f . The proof
relies on the fact that if the result is not true then Eq. (13.53) leads to a contradiction (see
Exercise 13.4 for details). This observation is the starting point for a chain of theorems
involving the maximum of the modulus.

Exercises
13.1 (Harder) Consider the function defined by:
l
o 0 x=0
gHxL = m
o ‰-1êx2 x  0
n
Show, using the first-principles definition of differentiability, that g has derivatives of all
orders at x = 0, and that gHnL H0L = 0 for all positive integers n.

13.2 Consider the complex function defined for z  0 by


276 Complex Analysis with Mathematica

1
gHzL = ‰- ÅÅÅÅz ÅÅÅ 2

Find all solutions, with w  0 specified, of the equation

w = gH zL

in the set » z » < , where  is given. (Hint: use the multi-valued nature of the logarithm
function to analyse this problem.) Does this function tend to a limit as z Ø 0? Does it
tend to infinity?

13.3 Suppose that PHzL is a polynomial of degree n and that PHwL = 0. By considering
the identity

zk - wk = Hz - wLHzk-1 + zk-2 w + … + zwk-2 + wk-1 L

for 1 b k b n show that PHzL can be written as Hz - wLQHzL for some polynomial Q of
degree n - 1. Deduce that P has exactly n zeroes, counting repeated roots as making
multiple contributions.

13.4 Suppose that f is holomorphic and that » f HzL » has a maximum at z = z0 . Show that
Eq. (13.53) implies that » f » must be constant. Deduce from the Cauchy–Riemann
equations, and the constancy of » f »2 , that if this holds on any open disk or connected
set, f must be constant on such a set.

13.5 Use the formula for the derivatives supplied by Taylor's theorem (Eq. 13.13) to
deduce the value of

‰6z
‡ ÅÅÅÅÅÅÅÅ
z4
ÅÅ „ z

where the integral is taken over a unit circle centred on the origin.

13.6 Use Taylor's theorem to give a rigorous proof of the fact that if f HzL is holomor-
phic, then, if we write f HzL = uHx, uL + Â vHx, yL

2 u 2 u
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = 0
x y

and similarly for v.

13.7 Let PHzL be a polynomial of degree n and suppose that its zeroes are at z = zk for
k = 1, …, n. Show that

P£ HzL
n
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ‚ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
PH zL k=1
z - zk

13.8 Let C be a simple closed positively traversed contour, and suppose that PHzL is a
polynomial of degree n with no zeroes on C. Use the result of Exercise 13.7 to show that
the number of zeroes of P inside C, counting multiplicities, is
13 Cauchy's integral formula and its remarkable consequences 277

1 P£ HzL
ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p P HzL

13.9 For each of the following real differentiable and bounded functions explain how the
complex generalization shown fails to satisfy the conditions for Liouville's theorem:

cos HxLö cos HzL


1 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ ö ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ
Ha + x L
2 2 Ha + z2 L
2

1 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ ö ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ
Ha + x L
2 2 Ha + » z »2 L
2

13.10 Ÿ By replacing the function Plot3D in Section 13.5 with ContourPlot,


establish another method by which the locations of roots may be identified graphically
and hence give approximate numerical values for all the roots of

q@z_D := z ^ 5 - 3 z - 1

13.11 Ÿ Using the values you found in the previous exercise as starting values for
FindRoot, find accurate values for all roots of qHzL = 0. Check your results using
NSolve.

13.12 Ÿ Use Exercise 13.8 and a polygonal approximation to a circle to calculate the
number of zeroes of the polynomial

8z3 + 46z - 36z2 - 15

inside each of the three circles » z » = 1, 2, 3.


14 Laurent series, zeroes, singularities and
residues

Introduction
In this chapter we introduce the generalization of a Taylor series to the Laurent series,
and discuss the consequences of the existence of a Laurent series. We also makes some
definitions that allow us to get a grip on the concept of a singularity of a complex
function, and introduce a definition and classification of isolated singularities. The
notion of a reside at an isolated singularity is introduced, and various devices for calculat-
ing residues are introduced for simple functions of interest. This chapter is fundamental
to the development of the theory of integration, and the evaluation of Fourier and
Laplace transforms and their inverses. It also highlights the importance of seeking out
and investigating singularities.

14.1 The Laurent series


Taylor's theorem relates to functions holomorphic on a disk within some open set. Now
we make a hole in the disk and consider functions holomorphic on an annulus. So let U
be the annulus

U = 8z : d1 < †z - z0 § < d2 < (14.1)

where

0 b d1 < d2 b ¶ (14.2)

Note that the annulus can have a hole that is just the point z0 , and its outer limit can be
infinity. Now we can state the theorem:

‡ Theorem 14.1: The Laurent series


Suppose that f is holomorphic on the annulus U. Then

f HzL = ‚ an Hz - z0 Ln (14.3)
n=-¶

a-2 a-1
= … + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + a0 + a1 Hz - z0 L + a2 Hz - z0 L2 + … (14.4)
Hz - z0 L z - z0

where the second line is just there to emphasize that the series contains negative powers
of Hz - z0 L. Furthermore, if d1 < r1 < r2 < d2 , the series converges absolutely and
14 Laurent series, zeroes, singularities and residues 279

uniformly in the set 8z : r1 b †z - z0 § b r2 <, and the coefficients are all given by the
formula
f HzL
2p an = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅn+1
ÅÅÅÅÅÅÅÅ „ z (14.5)
Hz - z0 L
fr

where d1 < r < d2 , fr = z0 + r ‰Â t , for 0 b t b 2p. In particular, note that the constant
term is given by what would be the Cauchy Integral Formula (CIF) for f Hz0 L, if the
function were holomorphic ‘all the way in’:
f HzL
2pÂa0 = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
Hz - z0 L (14.6)
fr

and also, for the negative terms:

2pÂa-1 = ‡ f HzL „ z (14.7)


fr

2pÂa-n = ‡ f HzL Hz - z0 Ln-1 „ z (14.8)


fr

Note that these all vanish if the function is holomorphic in a disk, rather than just an
annulus – then the result reduces to Taylor's theorem, with the corresponding formula
for the coefficients.

ü Proof of the theorem


Suppose that z œ U can be written as z = z0 + h, and pick r1 , r2 such that

0 b d1 < r1 < †h§ < r2 < d2 (14.9)

How we proceed depends a little on which version of Cauchy's theorem we use. Given
that we have the Cauchy–Goursat result for star-shaped regions, it is logical to divide up
the annular region into n blocks, each of which is star-shaped, so that we can apply the
result.

a = 80, 0<;
phione@t_D := 8Cos@tD, Sin@tD<; phitwo @t_D := 2 * phione @tD;
inner@t_D := 0.5 * phione @tD; outer @t_D := 2.5 * phione @tD;
lines = Table @Line@88Cos@qD, Sin@qD<, 82 Cos@qD, 2 Sin@qD<<D,
8q, Pi ê 16, 31 Pi ê 16, Pi ê 8<D;
ParametricPlot @Evaluate @8phione @tD, phitwo @tD, inner@tD, outer@tD<D,
8t, 0, 2 Pi<, AspectRatio -> 1, Axes -> False, Compiled -> False ,
PlotRange Ø 88- 3, 3<, 8-3, 3<<, PlotRegion -> 880., 1<, 80., 1<<,
PlotStyle -> 8Thickness @0.01D, Thickness @0.01D,
Thickness @0.005 D, Thickness @0.005D<,
Epilog -> 8PointSize @0.03D, Point@aD, Point @81.5, 0<D,
Text@"z0 ", 80, -0.2<D, Text@"z", 81.7, -0.1<D,
Text@"d1 ", 80, -0.6<D, Text@"r1 ", 80, -1.1<D,
Text@"r2 ", 80, -2.1<D, Text@"d2 ", 80, -2.6<D,
Thickness @0.01D, lines<D
280 Complex Analysis with Mathematica

z0 z

d1

r1

r2

d2

Let the anticlockwise contour bounding each block be denoted gi , for i = 1, …, n, with
i = 1 giving the block containing z. By the CIF, using w as the integration variable, we
have
1 f HwL
f HzL = f Hz0 + hL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w
2p Hw - Hz0 + hLL (14.10)
g1

and by applying Cauchy's theorem to each of the other blocks, if i > 1,


1 f HwL
0 = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w
2p Hw - Hz0 + hLL (14.11)
gi

Now we add together all these results. The integrals over radial lines cancel in pairs,
leaving two integrals:
1 f HwL 1 f HwL
f Hz0 + hL = ÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w - ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w
2 p Hw - Hz0 + hLL 2p Hw - Hz0 + hLL (14.12)
f r2 f r1

We have dealt with one of these already, in Taylor's theorem. The integral over fr2 can
be expanded precisely as in part (ii) of Taylor's theorem in Section 13.2, with coeffi-
cients given by the same formula. This leaves us to deal with
14 Laurent series, zeroes, singularities and residues 281

-1 f HwL 1 f HwL
 = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w
2p Hw - Hz0 + hLL 2p Hh - Hw - z0 LL (14.13)
fr1 f r1

We treat the denominator in the integrand by writing it, with v = Hw - z0 L êh, as


1 1 - vn vn 1 vn
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅ H1 + v + v2 + vn-1 L + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.14)
hH1 - vL hH1 - vL hH1 - vL h hH1 - vL

Putting this back in terms of Hw - z0 Lê h gives

1 w - z0 Hw - z0 L2 Hw - z0 Ln-1 Hw - z0 Ln
ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Å ÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ + ... + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÅÅÅ
ÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.15)
h h2 h3 hn hn Hh - Hw - z0 LL

Insertion of this expansion gives


n
1 f HwLHw - z0 L j-1 1 f HwLHw - z0 Ln
 = „ ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å Å „ w + ÅÅÅÅÅÅÅÅ
Å ÅÅ
Å ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w (14.16)
2p hj 2p hn Hh - Hw - z0 LL
j=1 f r1 f r1

With a- j as defined in the statement of the theorem, we can write this as


n
a- j
 = ‚ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅjÅ + Rn HhL (14.17)
j=1
Hz - z0 L

For the remainder, we have


ƒƒ ƒƒ
ƒƒ ƒƒ
ƒƒ 1 f HwL Hw - z L n ƒƒ
ƒ
ƒ 0
» Rn HhL » = ƒƒ ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÅÅ
Å „ ƒƒ
w ƒƒ (14.18)
ƒƒ 2p hn Hh - Hw - z0 LL ƒƒ
ƒƒ ƒƒ
ƒ fr 1 ƒ

Suppose that d1 < s < r1 and that » f HzL » < M on the path fr1 . Then
1 M sn Ms s n
†Rn H hL§ § ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ 2ps = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅÅÅÅ N (14.19)
2p r1 Hr1 - sL
n
r 1 - s r1

which tends to zero uniformly as n Ø ¶, for » z » r r1 . By a similar analysis, looking at a


general terms in the series, it follows that
a-n s n
¢ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅnÅÅ ¶ b MJ ÅÅÅÅÅÅÅÅ N (14.20)
Hz - z0 L r1

and so the convergence is absolute.

ü Uniqueness of the coefficients


The fact that the convergence is uniform leads to a simple proof that the coefficients in
the Laurent expansion are unique. Suppose that we have some other expansion
282 Complex Analysis with Mathematica


f HzL = ‚ bn Hz - z0 Ln (14.21)
n=-¶

that applies within the annulus. Inspection of the positive and negative n terms in this
expansion reveals that each is a power series, in Hz - z0 L and 1 ê Hz - z0 L respectively, and
hence is uniformly convergent in the interior and exterior of a pair of disks that overlap
in the annulus. Now take the formula
1 f HzL
an = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅn+1
ÅÅÅÅÅÅÅÅ „ z (14.22)
2p Hz - z0 L
fr

and insert the expansion in terms of bm . Uniformity of the convergence implies that we
can swap the order of integration and summation. Evaluation of the integral of each term
then gives

an = bn (14.23)

14.2 Definition of the residue


The residue is just the term a-1 , with n = -1 in the Laurent series. Note that

2pÂa-1 = ‡ f HzL „ z (14.24)

so that the residue measures the extent to which Cauchy's theorem fails. In fact, there is
rather more to it than that – by getting a value for a-1 , using independent methods, we
can actually evaluate contour integrals with very little work – more on this later!

14.3 Calculation of the Laurent series


The uniqueness result for the coefficients in the Laurent series may seem to be some-
thing of a formal dead end, but it is in fact very useful. It means that if we can find some
method of extracting the coefficients, we know we have found the right ones. There is
no one right way of getting a Laurent series. Usually we just need to know a few terms
(for residue applications – see below), and it may often be a matter of identifying a
handful of the negative terms, or perhaps bolting together known Taylor or binomial
expansions with other functions or changes of variable. The following examples are
illustrative of the kind of approaches generally taken. TraditionalForm is used for
Mathematica output.

‡ Ÿ Laurent example 1
In this case we take a simple function and multiply it by a negative power of z. We
consider
14 Laurent series, zeroes, singularities and residues 283

sinHzL
f HzL = ÅÅÅÅÅÅÅÅÅ3ÅÅÅÅÅÅÅÅ (14.25)
z
In this case the route is plain – we take the known Taylor series for sinHzL and divide it
by z3 . The series for sinHzL is well known, and can be written down without or with any
help from Mathematica:

Series[Sin[z],{z,0,9}]

z3 z5 z7 z9
z - ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHz10 L
6 120 5040 362880
We just divide this by z3 , leading to the following, which can also be obtained directly
with Mathematica:

Series@Sin@zD ê z ^ 3, 8z, 0, 4<D

1 1 z2 z4
ÅÅÅÅ2ÅÅÅÅ - ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHz5 L
z 6 120 5040

‡ Ÿ Laurent example 2
Frequently, in dealing with rational functions, the binomial theorem can be applied to
get expansions about various different points. Depending on the point chosen for the
centre of the annulus, we may get a Laurent expansion or just a Taylor expansion.
Consider
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.26)
zH1 - zL

A good start here is to do a partial fraction expansion, either through pen and paper
algebra or with the Mathematica function Apart, with some tidying up of signs by use
of Cancel:

? Apart

Apart@exprD rewrites a rational expression as


a sum of terms with minimal denominators. Apart@expr,
varD treats all variables other than var as constants.

Cancel@Apart@1 ê Hz H1 - zLLDD
1 1
ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z 1-z

The binomial theorem can be applied to the second term, to get the expansion
1
ÅÅÅÅÅ + 1 + z + z2 + z3 + ... (14.27)
z
284 Complex Analysis with Mathematica

We can proceed directly with Mathematica to obtain:

Series@1 ê Hz H1 - zLL, 8z, 0, 3<D


1
ÅÅÅÅÅ + 1 + z + z2 + z3 + OHz4 L
z

This series has a radius of convergence of one. We can also apply the binomial theorem,
or Mathematica, at other points. For example, expanding this expression about z = 2
leads to:

Series@1 ê Hz H1 - zLL, 8z, 2, 6<D


1 3 Hz - 2L 7 15
- ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅ Hz - 2L2 + ÅÅÅÅÅÅÅÅÅ Hz - 2L3 -
2 4 8 16
31 63 127
ÅÅÅÅÅÅÅÅÅ Hz - 2L4 + ÅÅÅÅÅÅÅÅÅ Hz - 2L5 - ÅÅÅÅÅÅÅÅÅÅÅÅÅ Hz - 2L6 + OHHz - 2L7 L
32 64 128
This also has a radius of convergence of one. We can also expand about infinity. If we
put z = 1 ê w, we obtain

w2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.28)
w-1
which we can expand in powers of w using the binomial theorem, for » w » < 1, to obtain:
1 1 1
-w2 - w3 - w4 - … = - ÅÅÅÅ2ÅÅÅÅ - ÅÅÅÅ3ÅÅÅÅ - ÅÅÅÅ4ÅÅÅÅ - … (14.29)
z z z
which is valid for » z » > 1. This latter series can also be obtained directly with
Mathematica:

Series@1 ê Hz H1 - zLL, 8z, Infinity, 6<D

1 2 1 3 1 4 1 5 1 6 i 1 7y
-J ÅÅÅÅÅ N - J ÅÅÅÅÅ N - J ÅÅÅÅÅ N - J ÅÅÅÅÅ N - J ÅÅÅÅÅ N + OjjjJ ÅÅÅÅÅ N zzz
z z z z z k z {

‡ Ÿ Laurent example 3
Sometimes it may be convenient to combine a known Taylor series with the binomial
expansion, especially if just a few terms are required. For example, consider
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = cosecHzL (14.30)
sin z
The series for sin HzL begins

z3 z5
z - ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ... (14.31)
6 120
14 Laurent series, zeroes, singularities and residues 285

We can write its reciprocal in the form


1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z4
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.32)
z I1 - ÅÅÅÅ6ÅÅ + ÅÅÅÅ ÅÅÅÅÅ + ...M
120

Now we make a binomial expansion of the denominator, obtaining

1 i z2 7 z4 y 1 z 7 z3
ÅÅÅÅÅ jj1 + ÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ...zz = ÅÅÅÅÅ + ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ... (14.33)
z k 6 360 { z 6 360

A direct approach with Mathematica leads to the same result:

Series@Csc@zD, 8z, 0, 3<D

1 z 7 z3
ÅÅÅÅÅ + ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHz4 L
z 6 360

‡ Ÿ Laurent example 4
Here is a more interesting example:
1
f HzL = ‰ ÅÅzÅÅ (14.34)

We know the series for ‰w in the form

w2 w3 w4
1 + w + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + OHw5 L
2 6 24
We just substitute w = 1 ê z:

1 1 1 2 1 1 3 1 1 4 i 1 5y
1 + ÅÅÅÅÅ + ÅÅÅÅÅ J ÅÅÅÅÅ N + ÅÅÅÅÅ J ÅÅÅÅÅ N + ÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅ N + OjjjjJ ÅÅÅÅÅ N zzzz
z 2 z 6 z 24 z k z {
A similar approach is also required in managing Mathematica. The obvious attempt
fails, with an interesting message:

Series@Exp@1 ê zD, 8z, 0, 3<D


1
— Series::esss : "Essential singularity encountered in ‰ ÅÅzÅÅ +O Hz L .
4

1
‰ ÅÅÅÅzÅ

So we proceed as before:

Series@Exp@wD, 8w, 0, 4<D

w2 w3 w4
1 + w + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + OHw5 L
2 6 24
Now we make a substitution:
286 Complex Analysis with Mathematica

% ê. w -> 1 ê z

1 1 1 2 1 1 3 1 1 4 i 1 5y
1 + ÅÅÅÅÅ + ÅÅÅÅÅ J ÅÅÅÅÅ N + ÅÅÅÅÅ J ÅÅÅÅÅ N + ÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅ N + OjjjjJ ÅÅÅÅÅ N zzzz
z 2 z 6 z 24 z k z {
and recover the same result. Note that this last series has infinitely many negative terms.
This is related to Mathematica's complaint about essential singularities and will be
discussed in Section 14.5.

14.4 Definitions and properties of zeroes


The Laurent series allows us to get a formal grip on various types of singularity in a
complex function. However, before exploiting this fully we need to get a grip on various
global properties of complex functions, and we need to develop some definitions and
theorems to do so. It is illuminating to explore not just singularities, but zeroes also, in
order to see the similarities and differences between the two types of object. Naively,
one might imagine that a function f becomes singular whenever 1 ê f has a zero, but
matters are rather more complicated than this. We shall see, eventually, that certain
types of singularity are indeed so associated with zeroes, but not all are.

‡ Connected sets and domains revisited


We have already met one definition of a connected (open) set, in Section 12.1. A result
we shall take from topology gives us an equivalent characterization: An open subset U Õ
 is connected if it cannot be written as

U = U1 ‹ U2 (14.35)

where U1 › U2 = f (the sets are disjoint), with U1 and U2 non-empty and open. A
domain is a connected open set in . Note that this is distinct from the elementary notion
of the domain of definition of a function. On domains we can make some useful state-
ments about the behaviour of functions. So let U be a domain, and let f be holomorphic
on U and not identically zero. Then, for each z œ U, there is a value of n such that
f HnL  0. (Note that this is not true for the infinitely differentiable real case, as the
example f HxL = e-1êx makes clear.)
2

To prove this result, let

A = 8z œ U : f HnL = 0 for all n = 0, 1, 2, 3, …< (14.36)

Now if z œ A, we can find a neighbourhood Nr HzL Õ U. If w œ Nr HzL, then f HwL = 0 on


using the Taylor series expansion about z. So Nr HzL Õ A, so A is open. Now let

B = 8z œ U : there is an n such that f HnL HzL  0< (14.37)

Now B is open by the continuity of f HnL . So we have written


14 Laurent series, zeroes, singularities and residues 287

U = A ‹ B, A › B = f (14.38)

Since f is not identically zero, B is non-empty, so by connectedness A must be empty.

‡ Theorem 14.2: The zeroes of a holomorphic function are isolated


The previous result allows us to prove an important theorem, that the zeroes of a func-
tion holomorphic on a domain, and not identically zero, are isolated. We state this
carefully thus: Let N = 8z : f HzL = 0<. Then if z œ N, there is a d > 0 such that

Nd HzL › N = 8z< (14.39)

That is, we can find a neighbourhood around z on which the function is non-zero except
at z itself.

Proof: Suppose that f HzL = 0, and pick the smallest n such that f HnL  0. There is a
neighbourhood of z on which there is a Taylor series

f H jL HzLHw - zL j
f HwL = „ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
j!
j=n
(14.40)

f Hn+ jL HzLHw - zL j
= Hw - zLn „ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = Hw - zLn gHwL
Hn + jL !
j=0

where gHwL is holomorphic (it is defined by a power series), and gHzL = f HnL HzL ên !  0.
By continuity of g, there is a neighbourhood of z on which gHwL  0, and hence on which
f HwL  0.

14.5 Singularities
A function can fail to be holomorphic in a variety of ways. A large class of interesting
cases can be managed by exploring those singularities that are isolated in the same sense
è!!!
that zeroes are necessarily isolated. This excludes cases such as LogHzL or z near the
origin, where we have to introduce branch cuts just to have a well-defined function, but
does include a large and very important set of possibilities.

‡ Definition of an isolated singularity


Suppose that we have an open U Õ  and that z œ U. We define U * = U - 8z<. We say
that a function f that is holomorphic on U * has an isolated singularity at z. Since U is
open, Nr HzL Õ U for some r, and we define Nr * HzL = Nr HzL › U * . This is just a punc-
tured disk, which is a special case of an annulus, so we can write down a Laurent
expansion:
288 Complex Analysis with Mathematica

-1 ¶
f HzL = ‚ an Hz - z0 Ln + ‚ an Hz - z0 Ln (14.41)
n=-¶ n=0

‡ Classification of isolated singularities


The Laurent series allows us to classify isolated singularities into three types:

(1) The point z is said to be a removable singularity if a-n = 0 for all n > 0.
(2) If a-N  0 but a-n = 0 for all n > N then z is a pole of order N.
(3) If infinitely many negative terms are present, then z is an isolated essential
singularity.

The first situation may seem puzzling – students often argue that it is not really a
singularity in this case! The reason we introduce this case is that there may be very good
reasons for excluding the centre of the annulus from the domain of definition of the
function, in terms of the way we write down the form of the function. It may only turn
out on close inspection that the excluded point is actually OK, and that we may then
extend the domain of definition to include the centre. An excellent example of this is the
function
1 1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ (14.42)
Hz + pLsinHzL pz

Clearly the origin z = 0 is a bad point from the point of view of working out this defini-
tion. But this point is in fact a removable singularity. Work it out yourself by computing
the Laurent series for this function in an annulus centred on the point z = 0.

‡ Characterizations of isolated singularity types


The three types of isolated singularity may be characterized in other ways besides the
behaviour of the terms in the Laurent expansion. One of these has a special name:

ü Theorem 14.3: Riemann removable singularities theorem


This may be stated as follows. If z is an isolated singularity of f HzL then it is a removable
singularity if and only if there is an r > 0 such that f HzL is bounded on Nr * HzL. Note that
one way is obvious - if the function indeed has a Taylor series it is bounded on a neigh-
bourhood of z. For the other way, consider the negative terms in the Laurent series:
1
a-n = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HzLHz - z0 Ln-1 „ z (14.43)
2pÂ
fr

Now f is bounded on a circle centred on z0 of radius s, for any s with 0 < s < r, so
suppose that » f » < M for » z » < r.
14 Laurent series, zeroes, singularities and residues 289

1
†a-n § b ÅÅÅÅÅÅÅÅÅÅ M sn-1 2ps = M sn (14.44)
2p
Since s can be as small as we wish, a-n = 0.

ü Characterization of poles and essential singularities


We can also assert that:

(1) f HzL has a pole at z0 if and only if » f HwL » Ø ¶ as w Ø z0 ;


(2) z0 is an isolated essential singularity if and only if for each W and each e > 0, there is
a value of z such that » z - z0 | and » f HzL - W » < e.

It is easiest to discuss these together. Suppose first that f has a pole of order k. Then the
Laurent series is

f HwL =
a-k a-k+1 1 (14.45)
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅkÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ + … = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅkÅÅÅÅ H a-k + a-k+1 Hw - zL + …L
Hw - zL Hw - zL k-1
Hw - zL

where a-k  0. This can be written as


hHwL
f HwL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅkÅÅÅÅ (14.46)
Hw - zL

where h has a removable singularity. We remove it, defining hHzL = a-k  0. Then as
w Ø z, hHwL Ø a-k and » f » Ø ¶. Now suppose that the conditions of (2) apply. Then f
is not bounded, nor does » f » Ø ¶, so f does not have a removable singularity nor does
it have a pole. It must therefore have an isolated essential singularity.
Now suppose that f has an isolated essential singularity and that the result of (2)
fails. Therefore there is a W for which the result fails, and an e > 0 such that if
0 < » z - z0 » < e, then » f HzL - W » r e. We can make up a new function
1
gHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.47)
f HzL - W

that is holomorphic on the punctured disk, and we know that » gHzL » b 1 ê e. So by the
Riemann removable singularity theorem, g can be extended holomorphically to the
whole disk. It has a Taylor series, and can therefore be written as

gHzL = Hz - z0 Lk hHzL (14.48)

where k r 0 and hHz0 L  0. Reorganizing, we get f as


1 1
f HzL = W + ÅÅÅÅÅÅÅÅÅÅÅÅÅ = W + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅkÅÅÅÅ (14.49)
gHzL hHzLHz - z0 L

If k = 0, f has a manifest removable singularity, whereas if k > 0 it has an explicit pole,


which is a contradiction with f having an isolated essential singularity. So there is no W
290 Complex Analysis with Mathematica

for which the result fails.


What this result says is that f gets close to any given point. Sometimes you can
be more explicit, as in the example of f HzL = ‰1êz . Suppose that

W = ‰1êz (14.50)

then
1
z = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.51)
 I2 p k + Arg p @wDM + logH†W§L

and, except for W = 0, we see that there are infinitely many solutions of Eq. (14.50) in
an arbitrarily small neighbourhood of the origin.

‡ Ÿ Pictures of singularities
We can use Mathematica's three-dimensional plot routines to get a better grip on the
behaviour of the singular functions and the way they are characterized. For a removable
singularity there is nothing to see, as we merely fill in the hole where the function is
defined. For poles and isolated essential singularities there is more to it. We begin by
recalling the definition of ComplexPlot3D:

ComplexPlot3D@func_, xrange_, yrange_, options___D :=


Plot3D@
8Abs@func@x + I yDD, Hue@N@HPi + Arg@func@x + I yDDL ê H2 PiLDD<,
xrange, yrange, optionsD

You will find the following more interesting if you view the material in colour, and you
might like to turn off the mesh by setting it to False! In the following examples we
shall use Mathematica's pure function notation, where # stands for the argument of the
function, and the function is terminated by &. If you are using Mathematica technologies
beyond version 5.2, see the enclosed CD and on-line supplement.

ü Simple pole
In this case the function f HzL = 1 ê z blows up at the singularity at the origin, and there is
a variation of phase (colour) in the function of 2p as one loops around the singularity:

ComplexPlot3D@1 ê # &, 8x, -1, 1<, 8y, -1, 1<,


PlotRange -> 80, 40<, PlotPoints -> 40, Mesh -> TrueD
14 Laurent series, zeroes, singularities and residues 291

40
30 1
20
10 0.5
0
-1
1 0
-0.5
0 -0.5
0.5
1 -1

ü Double pole
In this case the function f HzL = 1 ê z2 blows up more strongly at the singularity, and
there is a variation of phase (colour) in the function of 4 p as one loops the singularity:

ComplexPlot3D@1 ê # ^ 2 &, 8x, -1, 1<, 8y, -1, 1<,


PlotRange -> 80, 80<, PlotPoints -> 40, Mesh -> TrueD

80
60 1
40
20 0.5
0
-1
1 0
-0.5
0 -0.5
0.5
1 -1

ü Isolated essential singularity


Now the function ‰-1êz jumps all over, with rapid variations in phase around the singular
2

point:
292 Complex Analysis with Mathematica

ComplexPlot3D@HExp@-1 ê # ^ 2D &L, 8x, -1, 1<,


8y, -1, 1<, PlotRange -> 80, 80<, PlotPoints -> 60,
ViewPoint -> 82, 0, 1<, Mesh -> TrueD

-1
-0.5
0

0.5

80 1

60

40
0

20
0
0
-1 -0.5 0 0.5 1

14.6 Computing residues


To get a value for a contour integral we shall need an independent way of calculating
a-1 . The following results are immensely useful. There are standard results for poles of a
given order, but for isolated essential singularities we have to try a variety of approaches.

‡ Residues for poles


Let f HzL have a pole of order m at z = z0 . Then the residue of f HzL at z0 is given by

dm-1 HHz - z0 Lm f HzLL


Hm - 1L! a-1 = lim ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.52)
zØz0 dzm-1

In particular, for a simple pole (a pole of order one)

a-1 = lim HHz - z0 L f HzLL (14.53)


zØz0

And, for a pole of order two


d
a-1 = lim ÅÅÅÅÅÅÅÅÅ HHz - z0 L2 f HzLL (14.54)
zØz0 dz

ü Proof
If f HzL has a pole of order m then
14 Laurent series, zeroes, singularities and residues 293


f HzL = ‚ an Hz - z0 Ln (14.55)
n=-m

so that

Hz - z0 Lm f HzL = ‚ an Hz - z0 Ln+m (14.56)
n=-m

By relabelling the summation we have



Hz - z0 Lm f HzL = ‚ ak-m Hz - z0 Lk (14.57)
k=0

Now we just differentiate m - 1 times, to obtain

Hm - 1L! a-1 + m! a0 Hz - z0 L + O Hz - z0 L2 (14.58)

Taking the limit gives the desired result.

‡ Rational and related functions


To identify the order of the pole of a function f HzL = PHzL ê QHzL, we first make sure that
P and Q have had any common factors cancelled, and then we locate the zeroes of the
denominator Q. If Q is a polynomial, the order of each pole is then the multiplicity of the
zeroes of Q. For more general denominators, we do a Taylor series expansion. If
QHz0 L = 0 but Q£ Hz0 L  0, then z0 is a simple pole. If QHz0 L = Q£ Hz0 L = 0 but
Q££ Hz0 L  0, it is a double pole, etc. Note also that for a simple pole, if we can pull out a
linear factor in the denominator, writing
PHzL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.59)
Hz - z0 L qHzL

with PHz0 L  0  qHz0 L, then the residue is just


PHz0 L PHz0 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅ£ ÅÅÅÅÅÅÅÅÅÅÅÅ (14.60)
qHz0 L Q Hz0 L

which amounts to a useful application of L'Hospital's rule.

14.7 Examples of residue computations

‡ Residue example 1
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ (14.61)
a + z2
2

In this case the denominator factorizes explicitly as


294 Complex Analysis with Mathematica

Hz - ÂaLHz + ÂaL (14.62)

Now the simple pole formula can be applied directly. For example, working at z = Âa,
multiplying by the factor Hz - ÂaL just amounts to covering up the term Hz - ÂaL in the
denominator generating the singularity, leaving
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.63)
z + Âa
to be evaluated in the limit as z Ø Âa, which now amounts to just substituting z = Âa in
what is left, yielding 1 ê H2ÂaL = -Â ê H2aL. Similarly, the other singularity at z = -Âa
gives a residue of 1ê H-2ÂaL = Â êH2aL.

ü Ÿ Mathematica-assisted calculation
There are two ways of using Mathematica to extract values of residues. The first is to
apply the Residue function, and the other is to use Limit. We shall explore both of
these in subsequent examples, beginning here with a direct application of Residue:

? Residue

Residue@expr, 8x, x0<D finds the residue of expr at the point x = x0.

Clear@a, fD;
1
f@z_D := ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a2 + z2

Residue@f@zD, 8z, I a<D


Â
- ÅÅÅÅÅÅÅÅÅÅ
2a

Residue@f@zD, 8z, -I a<D


Â
ÅÅÅÅÅÅÅÅÅÅ
2a

‡ Residue example 2
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ (14.64)
Ha2 + z2 L

In this case the denominator factorizes explicitly as

Hz - ÂaL2 Hz + ÂaL2 (14.65)

So we see a pair of double poles. Again, working first at z = Âa, we multiply by the
square of the factor z - Âa, and we must calculate
14 Laurent series, zeroes, singularities and residues 295

d 1 2
ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ3ÅÅ (14.66)
d z Hz + ÂaL HÂa + zL

at the point z = Âa. This evaluates to - ê H4 a3 L. The other pole's residue is  ê H4 a3 L.

ü Ÿ Mathematica-assisted calculation

1
f@z_D := ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Ha2 + z2 L2

Residue@f@zD, 8z, I a<D


Â
- ÅÅÅÅÅÅÅÅÅÅÅÅ3Å
4a

Residue@f@zD, 8z, -I a<D


Â
ÅÅÅÅÅÅÅÅÅÅÅÅ3Å
4a

‡ Residue example 3
Next we consider a more complicated rational function:

z2 - 2 z
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.67)
Hz + 1L2 Hz2 + 4L

In this case the denominator factorizes explicitly as

Hz + 1L2 Hz + 2 ÂLHz - 2 ÂL (14.68)

and we have a double pole at -1, and a pair of simple poles at 2Â. To deal with the
double pole, first cover up the singular factor, leaving

Hz2 - 2zL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ (14.69)
Hz2 + 4L

The derivative of this is

2z - 2 2zHz2 - 2zL
ÅÅÅÅÅÅÅÅ
Å ÅÅÅÅÅÅÅ
Å ÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅ (14.70)
z2 + 4 Hz2 + 4L

and evaluation of this at z = -1 gives us -14 ê 25. For the simple pole at z = 2Â, we
cover up the term Hz - 2ÂL in the denominator, leaving

z2 - 2z
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.71)
Hz + 1L2 Hz + 2ÂL

and evaluation of this at z = 2Â gives (7 + Â)/25. The other value is H7 - ÂLê 25.
296 Complex Analysis with Mathematica

ü Ÿ Mathematica-assisted calculation

Clear@fD;
f@z_D := Hz ^ 2 - 2 zL ê HHz + 1L ^ 2 Hz ^ 2 + 4LL

We can use the Residue function, or take limits using the formulae for single and
double poles:

Residue@f@zD, 8z, -1<D


14
- ÅÅÅÅÅÅÅÅÅ
25

Residue@f@zD, 8z, 2 I<D


7 Â
ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ
25 25

Residue@f@zD, 8z, -2 I<D


7 Â
ÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ
25 25
As an alternative, we can use the built-in Limit function (you might like to check the
other two limits):

Limit@D@Hz + 1L ^ 2 f@zD, zD, z -> -1D


14
- ÅÅÅÅÅÅÅÅÅ
25

‡ Residue example 4
1
f HzL = ‰ ÅÅzÅÅ (14.72)

This time there is no alternative but to use the known series for the exponential function:
1 1 1
‰1êz = 1 + ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ3ÅÅÅÅ + … (14.73)
z 2z 6z
We just extract the coefficient of 1 êz as the residue, which is therefore 1.

ü Ÿ Mathematica-assisted calculation
Residue is not happy at essential singularities:

Residue@Exp@1 ê xD, 8x, 0<D


1
resI‰ ÅÅxÅÅ , 8x, 0<M
14 Laurent series, zeroes, singularities and residues 297

But you can use Series to extract the term in 1 ê z directly:

Series@Exp@wD, 8w, 0, 3<D

w2 w3
1 + w + ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + OHw4 L
2 6

% ê. w -> 1 ê z

1 1 1 2 1 1 3 i 1 4y
1 + ÅÅÅÅÅ + ÅÅÅÅÅ J ÅÅÅÅÅ N + ÅÅÅÅÅ J ÅÅÅÅÅ N + OjjjjJ ÅÅÅÅÅ N zzzz
z 2 z 6 z k z {
Another option is to compute the residue by numerical integration using the NResidue
function that is in the NumericalMath package:

Needs@"NumericalMath`NResidue`"D

This is best used by controlling the radius of the circle used to do the integration:

NResidue@Exp@1 ê zD, 8z, 0<, Radius Ø 1D

1. + 4.16334 µ 10-17 Â

At an essential singularity the small radius used by default, 1 ê 100, can produce numeri-
cal errors:

NResidue@Exp@1 ê zD, 8z, 0<D


— NIntegrate::ploss :
"Numerical integration stopping due to loss of precision. Achieved neither the requested
PrecisionGoal nor AccuracyGoal; suspect one of the following: highly oscillatory
integrand or the true value of the integral is 0. If your integrand is oscillatory on
a Hsemi-Linfinite interval try using the option Method->Oscillatory in NIntegrate.

-4.37399 µ 1025 - 1.60089 µ 1024 Â

Less extreme singularities are happy with the default radius employed by NResidue:

NResidue@1 ê z, 8z, 0<D

1.

This is all fine provided there is no other singularity very close to the one under investiga-
tion. Careful analysis is then needed. You might like to consider the example of

Exp@1 ê zD + 1 ê Hz - 1 ê 1000L

to see the difficulties that can arise.


298 Complex Analysis with Mathematica

‡ Residue example 5
The following example raises a number of issues. Consider the function
‰z
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ (14.74)
sin2 HzL

The denominator is periodic, and vanishes at z = np. Its periodicity, given that it is the
square of sinHzL, is also p. We let z = np + w, and note that
‰pn+w
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ‰np f HwL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (14.75)
sin2 Hpn + wL

It is sufficient to work out the residue at z = 0, since the residues elsewhere are given by
the residue at 0 multiplied by ‰np . At z = 0, we have a double pole, as sin2 HzL ~ z2 near
the origin. In contrast to our previous examples, we do not have an explicit factor we can
pull out before the differentiation. We can now proceed in one of two ways — apply the
formula anyway, or do a manual series approach. In this case the latter is easier, for we
can write
‰z ‰z ‰z
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ ÅÅ
Å = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ
sin2 HzL Iz - ÅÅÅÅ z3
Å6 Å + ..M
2
z2 I1 - ÅÅÅÅ z2
Å6 Å + ..M
(14.76)
2 2
I1 + z + ÅÅÅÅ z
2
ÅÅ + ..M I1 + ÅÅÅÅ z
3
ÅÅ + ....M 1 1
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ = ÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅ + ...
z z z
and identify the residue at z = 0 as +1. So at z = np the residue is ‰np . Note the manner
in which we have treated the function sinHzL. We look at a special point that is easy to
manage (z = 0) and about which we have a known series. Then the behaviour elsewhere
is deduced from the periodic character of the function. This type of analysis extends to
functions such as cosHzL, sinhHzL and coshHzL.

ü Ÿ Mathematica-assisted calculation
Care must be taken here. There is no problem in identifying what happens at the origin:

Clear@fD;
Exp@zD
f@z_D := ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Sin@zD2

Residue@f@zD, 8z, 0<D

Other specific values can be checked, by either method:


14 Laurent series, zeroes, singularities and residues 299

Residue@f@zD, 8z, Pi<D

‰p

Limit@D@Hz - 2 PiL ^ 2 Exp@zD ê Sin@zD ^ 2, zD, z -> 2 PiD

‰2 p

But you must not substitute general values of n, as Mathematica does not know that n is
necessarily an integer, and fails to spot the singularity in sinHzL:

Limit@D@Hz - 3 PiL ^ 2 Exp@zD ê Sin@zD ^ 2, zD, z -> 3 PiD

‰3 p

Residue@f@zD, 8z, n Pi<D ê. IntegerQ@nD Ø True

What you can do, and what may be very helpful, is to get Mathematica to help you spot
a pattern:

Table@Residue@f@zD, 8z, n * Pi<D, 8n, -3, 3<D

8‰-3 p , ‰-2 p , ‰-p , 1, ‰p , ‰2 p , ‰3 p <

Exercises
14.1 Suppose that f and g are functions that are holomorphic in a punctured disc centred
on z = a, and that they have poles of order m and n respectively at z = a. State the nature
of the singularity of the following functions:

f HzL + gHzL; f HzL µ gHzL; f HzLê gHzL

Take care to include all possibilities. What, if anything, can be said about the case when
both have essential singularities at z = a? (For this last part you may find it helpful to
consider the function expH1 ê zL and variations of it.)

14.2 Locate and classify all the singularities of the following functions:
1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Hz + 2LHz + 1L Hz - 1L3
2

1 1
gHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ
Hz + pLsinHzL pz
1
hHzL = ‰ ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ ÅÅ
z Hz-1L
300 Complex Analysis with Mathematica

1
kHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅ
zI‰ ÅÅzÅÅ + 1M

What is special about the origin z = 0 in the last of these four examples?

14.3 For each of the following functions:

(i) locate all the singularities;


(ii) classify each of the singularities;
(iii) calculate the residues at each of the singularities.
1 1
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; gHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ
Ha + z LHb2 + z2 L
2 2
Ha2 + z2 L Hb2 + z2 L
2

1 ‰z 1
hHzL = ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ ; kHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; mHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z6 + 1 cosHzL coshHzL
‰z cotHzLcothHzL 1
p HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ ; qHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ ; rHzL = z3 ‰ ÅÅÅÅz ÅÅÅ 2

sinh2 HzL z3

14.4 Prove, using the Laurent series and the formula for the coefficients, that

1
‰ ÅÅ2ÅÅ aHz-1êzL = ‚ Jn HaL zn
n=-¶

where
2p
1
Jn HaL = ÅÅÅÅÅÅÅÅÅ ‡ cosHnq - a sinHqLL „ q
2p 0

(Hint: use a unit circle in the formula for the coefficients.)

14.5 Find all of the zeroes of the polynomial

z4 + 3z3 - 15z - 7z2 + 18

enlisting Mathematica's help if you get stuck. Hence calculate the residues of the
function

z2 + 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ
z + 3z - 15z - 7z2 + 18
4 3

at each of its singularities.

14.6 Ÿ Using the functions Residue, Series, Limit and NResidue, find as many
ways as you can of using Mathematica to check your answers to Exercise 14.3. In the
case of the functions containing a periodic component, such as cosHzL, you should restrict
attention to considering particular points, and try to infer the general pattern from those,
in accordance with the comments made at the end of Example 5 in Section 14.7.
14 Laurent series, zeroes, singularities and residues 301

14.7 Ÿ Use the function ComplexPlot3D to visualize the functions of Exercise 14.3.

14.8 Ÿ Although it does not distinguish between singularities and zeroes so effectively,
the function ContourPlot used in conjunction with Abs gives a very revealing
picture of singularities. For example, try out:

ContourPlot@Abs@1 ê Cosh@Hx + I yL DD,


8x, -2, 2<, 8y, -20, 20<, PlotPoints -> 120D;

and explore the other functions in Exercise 14.3 in a similar way.

14.9 Ÿ Use Mathematica to find out what the function Jn is in Exercise 14.4 (Hint:
consider the cases n = 0, 1).
15 Residue calculus: integration,
summation and the argument principle

Introduction
In this chapter we introduce the methods by which certain types of definite integral may
be evaluated. Similar methods may be used to sum certain types of infinite series. The
approach has many applications, and will be considered again in Chapter 16, in applica-
tions to Fourier transforms, and in Chapter 17, on Laplace transforms. We begin by
establishing the Residue theorem, which relates a contour integral to the residues of the
integrand at its various singularities. Then we explore how various types of real integral
can be transformed into contour integrals, and then evaluated by an analysis of their
singularities. Finally we take a brief look at the summation of series by residue methods.
Mathematica can play various roles in this part of the theory related to the
evaluation of integrals by the calculus of residues. It can just be there to help with the
algebra in calculating residues. You can use the functions Residue and NResidue to
work out the residues directly. Finally you can use Integrate and NIntegrate to
do a direct calculation of the answer. In this last case considerable care is required. The
symbolic treatment of general integrals is an evolving (black) art and the results, mostly
in the way they are displayed and the full details of conditions for the results to hold,
will vary from version to version of the software. This matters particularly when the
integrand contains parameters. In general, the most recent version is the most reliable,
but not necessarily the quickest. In all cases it is safest to use Mathematica to evaluate
the integrals in various different ways and check for consistency. This author's advice is
to compare the results from:

(1) Integrate with GenerateConditions -> True (the default setting);


(2) Integrate with specific Assumptions about parameters;
(3) Integrate with parameters set to be specific exact values;
(4) NIntegrate with parameters set to be specific exact values.

You must not make the mistake of trying to cut corners by setting GenerateCondi-
tions -> False, as this may give misleading answers.

15.1 The residue theorem


Theorem 15.1. Let S = 8z1 , z2 , ..., zn < be a set of points in an open convex subset U of
. Suppose that f HzL is holomorphic on U - S. Let f be a piecewise smooth path whose
image is contained in U - S, i.e. it avoids the singularities, and let nHf, zi L be the
winding number of the path about zi . Then
15 Residue calculus 303

‡ f HzL „ z = 2p ‚ nHf, zi L ResH f , zi L (15.1)


i=1
f

ü Proof for simple case


Suppose first that there is just one singularity at z = a, and that our contour winds around
a just once. We consider a contour as shown inside which the function is holomorphic:

h = 81 ê 2, 0<; phione @t_D := 8Cos@tD, Sin@tD<;


gamma@t_D := phione @Pi ê 160 + 0.9875 * tD;
delta@t_D := h + 0.15 * phione @Pi ê 40 + 0.95 * tD;
ParametricPlot @Evaluate @8gamma @tD, delta @tD<D, 8t, 0, 2 Pi + 0.01<,
AspectRatio -> 1, Axes -> False , Compiled -> False,
PlotStyle -> 8Thickness @0.01D, Thickness @0.01D<,
Epilog -> 8PointSize @0.03D, Point@hD, Text@"a", h + 80, -0.07<D,
Thickness @0.01D,
Line@8gamma@2 PiD, delta @2 PiD<D, Line@8gamma @0D, delta@0D<D<D

Cauchy's theorem tells us that the integral around the entire contour is zero. Hence we
can relate the integral around the outer boundary to that around a small circle centred on
the singular point. Now we use the Laurent expansion about a, and the formula

2pÂa-1 = ‡ f HzL „ z (15.2)

applied on the small circle. When there are several singularities we make as many
indentations in our original contour as there are singularities, and we add up the results.
When the contour winds around any singularity more than once, the contribution is
multiplied by the winding number for that singularity.
304 Complex Analysis with Mathematica

15.2 Applying the residue theorem


We proceed directly to exploring the means by which this result can be used to evaluate
integrals. We shall explore 3 routes to the evaluation:

(1) Traditional mathematical approach;


(2) Mathematica-assisted approach;
(3) Direct evaluation within Mathematica.

Several examples will be considered that illustrate many different choices of contour.
The examples considered are chosen to cover most of the basic cases of interest.

ü Ÿ Aside: a graphical definition


In order to draw our contour integrals in Mathematica, we shall need some definitions of
graphical objects frequently encountered. We introduce symbols for poles of various
orders.

SimplePole@8x_, y_<, r_D :=


8Disk@8x, y<, 0.6 * rD, Circle@8x, y<, rD<;
DoublePole@8x_, y_<, r_D := 8Disk@8x, y<, 0.6 * rD,
Circle@8x, y<, rD, Circle@8x, y<, 0.8 * rD<;
TriplePole@8x_, y_<, r_D :=
8Disk@8x, y<, 0.6 * rD, Circle@8x, y<, rD,
Circle@8x, y<, 0.8 * rD, Circle@8x, y<, 0.9 * rD<;
HighPole@8x_, y_<, r_D := 8Disk@8x, y<, 0.6 * rD,
Table@Circle@8x, y<, H0.6 + k ê 20L * rD, 8k, 1, 8<D<
EssSing@8x_, y_<, r_D := Disk@8x, y<, rD

Show@Graphics@
8SimplePole@81, 1<, 1D, DoublePole@85, 1<, 1D,
TriplePole@81, 5<, 1D, HighPole@85, 5<, 1D,
EssSing@83, 3<, 1D<, AspectRatio -> 1DD
15 Residue calculus 305

15.3 Trigonometric integrals


We are interested here in integrals of the form
2p
‡ GHcosHtL, sinHtLL „ t (15.3)
0

The integration from 0 to 2p suggests a circular contour that may be parametrized by t.


What we wish to do is to reverse the process by which a complex contour integral is
reduced to a standard real integral by the introduction of a parametrization. We wish to
take the given real integral and represent it by a contour integral.
This particular example illustrates the need to take care that the mapping into the
complex plane is holomorphic – a common mistake is to represent the trigonometric
functions as obvious non-holomorphic functions.

‡ Example 1
2p
1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ t (15.4)
0 8 cos HtL + 1

In this case, we introduce a circular contour parametrized by t, obtained by setting


1
z = ‰Ât , cosHtL = ÅÅÅÅÅ H‰Ât + ‰-Ât L (15.5)
2
The cosine function can be represented in two ways, when z is on the unit circle:
1 1 1
cosHtL = ÅÅÅÅÅ Hz + zêL = ÅÅÅÅÅ Jz + ÅÅÅÅÅ N (15.6)
2 2 z
It is vital that the second and holomorphic form is chosen for the mechanics of the
residue theorem to operate properly. Also, do not worry that the singular function 1 ê z
has been introduced – in this context ‘singularities are good’ – they are what help us
evaluate the integral! For subsequent manipulations with Mathematica we introduce the
following function:

cosof@zD := Hz + 1 ê zL ê 2

Next, we need to make the change of variable t Ø z under the integral, obtained by
mapping the differential according to the rule:
„ z
„ t Ø - ÅÅÅÅÅÅÅÅÅÅÅÅ (15.7)
z

ü Traditional mathematical approach


By multiplying the integrand top and bottom by z, and then expanding the denominator,
the integrand reduces to:
306 Complex Analysis with Mathematica

Âz
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ (15.8)
2z + 5z2 + 2
4

The denominator is a quadratic in z2 , and by application of the formula for a quadratic,


or by factorization by inspection, the roots are easily found to be -1 ê2 and -2. We do
not care about the square roots of -2, since they are outside the unit circle, but we do
want the other two square roots of -1 ê 2. These are
 Â
è!!!ÅÅÅÅÅ =
è!!!ÅÅÅÅÅ , ÅÅÅÅÅÅÅÅ
9- ÅÅÅÅÅÅÅÅ (15.9)
2 2

There are four roots on the imaginary axis, as shown here, together with the contour that
is the unit circle:

ci =
8SimplePole @80, Sqrt@2D<, 0.1D,
SimplePole @80, -Sqrt@2D<, 0.1D,
SimplePole @80, 1 ê Sqrt@2D<, 0.1D,
SimplePole @80, -1 ê Sqrt@2D<, 0.1D,
Thickness @0.01D, Circle @80, 0<, 1D<;
cplot = Show@Graphics @ci, AspectRatio -> Automatic ,
Axes -> True, Ticks -> None, PlotRange -> 88- 2, 2<, 8-2, 2<<DD

Since we know the roots of the denominator, the integrand can be factorized about the
two roots of interest and the residues computed by the method of covering up the
singular factor. Here it is easy to use the differentiation formula for a simple pole. So set

PHzL = -Âz ; QHzL = 2z4 + 5z2 + 2 (15.10)

The function giving the residues of the function PHzL ê QHzL is then just:
PHzL Âz
ResfuncHzL = ÅÅÅÅÅÅÅÅ£ ÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.11)
Q HzL 8z3 + 10z
15 Residue calculus 307

Evaluating this at the two poles gives

i  yz Â
Resfuncjjj- ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ zz = - ÅÅÅÅÅ (15.12)
k 2 { 6

i  yz Â
Resfuncjjj ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ zz = - ÅÅÅÅÅ (15.13)
k 2 { 6

so that the value of the integral is just


  2p
2p J- ÅÅÅÅÅ - ÅÅÅÅÅ N = ÅÅÅÅÅÅÅÅÅ (15.14)
6 6 3

ü Ÿ Mathematica-assisted approach
First we define the integrand for Mathematica and ask for its simplification:

integrand = -(I/(z*(8*cosof[z]^2 + 1)))


Â
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
2
ÅÅÅÅÅÅÅÅÅÅÅ
z I2 Hz + ÅÅÅÅ1z L + 1M

simp = Simplify@integrandD
Âz
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ
2 z + 5 z2 + 2
4

The singularities of the integrand are given by the zeroes of the polynomial denomina-
tor, so the denominator is defined as a polynomial expression, and its roots found:

poly = Denominator@simpD

2 z4 + 5 z 2 + 2

z ê. Solve@poly == 0, zD
  è!!! è!!!
è!!!ÅÅÅÅÅ , ÅÅÅÅÅÅÅÅ
9- ÅÅÅÅÅÅÅÅ è!!!ÅÅÅÅÅ , -Â 2 , Â 2 =
2 2

Note that the denominator is a fourth-order polynomial and we have found four distinct
roots – there are no multiple roots. So the four roots give four simple poles. Two are
obviously inside the unit circle. We can use the differentiation method used above, or
take limits directly. We shall ask Mathematica to do the latter. For each of these, we
multiply by the singular factor and take the limit using the Limit function:
308 Complex Analysis with Mathematica

i
j I z y I
resone = SimplifyALimitAj
jz + ÅÅÅÅÅÅÅÅÅÅ z integrand, z Ø - ÅÅÅÅÅÅÅÅÅÅ
j è!!!! z z è!!!! EE
k 2 { 2
Â
- ÅÅÅÅÅ
6

restwo = Simplify@
Limit@Hz - I ê Sqrt@2DL integrand, z -> I ê Sqrt@2DDD
Â
- ÅÅÅÅÅ
6
The value of the integral is given by 2 p  times the sum of the residues:

2 p I Hresone + restwoL
2p
ÅÅÅÅÅÅÅÅÅÅ
3
You might like to look at using Residue as another method.

ü Ÿ Direct Mathematica evaluation check


This can be done directly using Mathematica's definite integration routine. Here the
Mathematica input is shown in InputForm:

Integrate[1/(8*Cos[t]^2 + 1), {t, 0, 2*Pi}]


2p
ÅÅÅÅÅÅÅÅÅÅ
3
In some older versions of Mathematica you might have got a more complicateed answer.
In such circumstances you should use Simplify or FullSimplify to boil the result
down to simplest form.

ü Ÿ Use of Mathematica's numerical residue function


When residues are tricky, perhaps because of a very high order pole or essential singular-
ity, there is a numerical function available as a package, which we now load:

Needs@"NumericalMath`NResidue`"D

Here is a reminder of how to find what functions have been added:


15 Residue calculus 309

? NumericalMath`NResidue`*

NumericalMath`NResidue`
NResidue Radius

Here is how to find out what each one does:

? NResidue

NResidue@expr, 8x, x0<D uses NIntegrate to


numerically find the residue of expr near the point x = x0.

? Radius

Radius is an option to NResidue that specifies the


radius of the circle on which the integral is evaluated.

Let's apply this to the problem at hand:

nresone = NResidue@integrand, 8z, I ê Sqrt@2D<D

-1.43928 µ 10-17 - 0.166667 Â

nrestwo = NResidue@integrand, 8z, -I ê Sqrt@2D<D

-9.45966 µ 10-18 - 0.166667 Â

2 Pi I * Hnresone + nrestwoL

2.0944 - 1.49869 µ 10-16 Â

Chop@%D

2.0944

2 Pi ê 3 êê N

2.0944

Sometimes, because of the numerical method used, very small numbers may appear in
the final or, as here, intermediate results. Mathematica does a numerical integration
around a small circle to work out the residue! It is often useful to use the Chop function
to remove machine-precision glitches:

Chop@nresoneD

-0.166667 Â
310 Complex Analysis with Mathematica

This example illustrates that you have many options involving varying degrees of
intervention by Mathematica.

‡ Another trigonometric example with double pole


It is worth doing another example of this type, to see explicitly how to cope with an
appearance of the sine function and how to manage double poles. In this case we shall
do a standard mathematical evaluation and just check the result against that arising from
the Mathematica integrator. The integral of interest is, for a > b > 0,
2p
sin2 HtL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ t (15.15)
0 a + b cosHtL

The ingredients we need are:

z = ‰Ât (15.16)
1 1
cosHtL = ÅÅÅÅÅ Jz + ÅÅÅÅÅ N (15.17)
2 z
1 1
sinHtL = ÅÅÅÅÅÅÅÅ Jz - ÅÅÅÅÅ N (15.18)
2Â z
 „z
„ t = - ÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.19)
z
The integrand is therefore
2
ÂHz - ÅÅÅÅ1z L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.20)
4zHa + ÅÅÅÅ12 bHz + ÅÅÅÅ1z LL

and, after a little simplification, this becomes


2
 Hz2 - 1L
integrand = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.21)
2 z2 Hb z2 + 2 a z + bL

There is manifestly a double pole at the origin, and a pair of poles at the roots of the
polynomial

poly = bz2 + 2az + b (15.22)

These roots are the list:


è!!!!!!!!!!!!!!! è!!!!!!!! !!!!!!!
-a - a2 - b2 a2 - b2 - a
9 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = (15.23)
b b
Clearly the first of these lies outside the unit circle, since a > b. Inspection of the
quadratic reveals that the product of the roots is one, so the second must be inside. So let
15 Residue calculus 311

è!!!!!!!!!!!!!!!
-a - a2 - b2
z1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.24)
b
è!!!!!!!! !!!!!!!
a2 - b2 - a
z2 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.25)
b
As an example, with a = 2, b = 1, the roots are as shown:

ci = 8DoublePole @80, 0<, 0.1D,


SimplePole @8-2 - Sqrt@3D, 0<, 0.1D,
SimplePole @8-2 + Sqrt@3D, 0<, 0.1D,
Thickness @0.01D, Circle@80, 0<, 1D<;
cplot = Show @Graphics @ci, AspectRatio -> Automatic ,
Axes -> True, Ticks -> None, PlotRange -> 88-4, 4<, 8-2, 2<<DD

The residue at zero is given by the double-pole differentiation formula. First we differenti-
ate the integrand times the singular factor:
2
dHz2 integrandL 2ÂzHz2 - 1L ÂH2a + 2bzLHz2 - 1L
deriv = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.26)
dz bz2 + 2az + b 2Hbz2 + 2az + bL2

Now the limit at the double pole at the origin is taken:


Âa
lim deriv = - ÅÅÅÅÅ2ÅÅÅÅ (15.27)
zØ0 b
For the other simple pole at z2 we can use the polynomial-ratio formula, or cover up the
factor and take limits:
2
i Iè!!!!!!!! !!!!!!
y
2
a 2 -b2 - aM
Âb2 jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - 1zz
b2
lim @Hz - z2 L integrandD = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ k
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ { ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.28)
zØz2 è!!!!!!!! !!!!!!! 2 è!!!!!!!! !!!!!!!
2I a - b - aM I2 a + 2 I a - b2 - aMM
2 2 2

This simplifies to
è!!!!!!!!!!!!!!!
 a2 - b2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ (15.29)
b2
312 Complex Analysis with Mathematica

Adding this to the residue at the origin and multiplying by 2p gives the value of the
integral as:

ij Âa è!!!!!!!!!!!!!!!
j  a2 - b2 yzz
2Â jj- ÅÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ zz p (15.30)
k b b2 {
and this simplifies to
è!!!!!!!!!!!!!!!
2pIa - a2 - b2 M
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.31)
b2

ü Ÿ Checks against Mathematica


A Mathematica-assisted calculation can be done along the same lines as considered
previously. In this case we look at just checking the results against Mathematica's
symbolic integrator. Now in our example we were assuming that a > b > 0. Just using
Integrate without feeding in these assumptions leads to the following, where we
have added a timing calculation and are using a fresh kernel session. This sort of result
can drive Mathematica beginners crazy!

Timing[Integrate[Sin[t]^2/(a + b*Cos[t]), {t, 0,


2*Pi}]]

944.1 Second, IfAb  a Ì a + b  0 Ì


a a a a+b
JReJ ÅÅÅÅÅ N ¥ 1 Î ReJ ÅÅÅÅÅ N + 1 § 0 Î JImJ ÅÅÅÅÅ N  0 Ì ImJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N  0NN,
b b b b
è!!!!!!!! !!!!!!! è!!!!!!!! !!!!!!!
2 Ip a - b - a logI ÅÅÅÅÅÅÅÅ2 2 ÅÅÅÅÅÅÅÅ
a-b
è!!!!!!!! ÅÅÅÅÅ M + b - a logI ÅÅÅÅÅÅÅÅ
!!!!!!!
2 2 ÅÅÅÅÅÅÅÅ
b-a
è!!!!!!!! !!!!Å!ÅÅÅÅ
! MM
b 2 -a 2 b 2 -a2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅ ,
b2
sin2 HtL
IntegrateA ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , 8t, 0, 2 p<, Assumptions Ø
a + b cosHtL
a a a a+b
JReJ ÅÅÅÅÅ N + 1 > 0 Ì ReJ ÅÅÅÅÅ N < 1 Ì JImJ ÅÅÅÅÅ N  0 Î ImJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N  0NN Î
b b b b
b  a Î a + b  0EE=

Clearly the integrator has taken some time to work out some very complicated condi-
tions for this integral to make sense for all possible complex a and b. Let us now feed
our assumptions about a and b to Integrate:

Timing[Integrate[Sin[t]^2/(a + b*Cos[t]), {t, 0,


2*Pi}, Assumptions -> a>b>0]]
è!!!!!!!!!!!!!!!
2 Ia - a2 - b2 M p
916.8 Second, ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
b2
Note that supplying an inequality for a or b implicitly says that they must be real, as
general complex numbers are not ordered! Finally, a warning: in some versions of
15 Residue calculus 313

Mathematica it is not safe to just use GenerateConditions -> False. You


might like to see what happens in this example if you try this. Again, if your version of
Mathematica supplies a more complicated answer, use Simplify and FullSim-
plify on it.

15.4 Semicircular contours


A large class of real integrals involve integration from negative infinity to positive
infinity. Many of these may be treated by adding a large semicircular completion
contour in either the upper or lower half-plane. One then makes an argument that the
contribution of the semicircle can be ignored, and proceeds to evaluate the residues in
one of the half-planes. There are two levels of the theorem that allow us to discard the
semicircular contribution. The first version makes strong assumptions about the decay of
the integrand at infinity, and is easy to prove using simple inequalities. The second
version, usually known as Jordan's lemma, makes weaker assumptions and is harder to
prove. We shall defer a treatment of this until we consider Fourier and Laplace trans-
forms, which is the main area of application of Jordan's lemma. Note that an integral
from zero to infinity can be written as one from minus infinity to infinity if the integrand
is even – otherwise special methods are required. Also, the nature of the process requires
that integrals from minus infinity to infinity be interpreted in a special way – this leads
us to introduce the notion of the ‘Cauchy Principal Value’.
We motivate the discussion by working with a particular example, which is the
integral, for a  b, and a and b real and positive:

1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.32)
0 Ha + x LHb2 + x2 L
2 2

The integrand is an even function of x, so that the integral under consideration may be
written as
1 ¶ 1
ÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.33)
2 -¶ Ha2 + x2 LHb2 + x2 L

This is not an integral over a closed contour. We need to add a piece, in the form of a
large semicircle in either the upper or lower half plane. To check that this gives zero we
need the following definitions and theorem.

‡ Cauchy principal values and semicircle theorem I


To understand the evaluation of integrals along the entire real axis by the use of contour
methods, we need to appreciate their definition more carefully. Normally, a doubly
infinite integral would be defined by requiring the existence of the double limit (i.e. R
and S tend to infinity independently):
¶ S
‡ f HxL „ x = lim lim ‡ f HxL „ x (15.34)
-¶ Rض Sض -R
314 Complex Analysis with Mathematica

In our discussion of contour integrals, it is convenient to relax this definition to the


Cauchy Principal Value, usually denoted by putting a ‘P’ before the integral:
¶ R
P‡ f HxL „ x = lim ‡ f HxL „ x (15.35)
-¶ Rض -R

This can make a real difference to whether an integral exists! For example, the function
a
f HxL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.36)
pHa + x2 L
2

occurs in elementary probability, for real a > 0. It is called the ‘Cauchy Distribution’,
and is a probability density function (p.d.f.) by virtue of the fact that it is non-negative
and

a
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x = 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.37)
-¶ p Ha 2 + x2 L

The mean value of the associated random variable is given by the double limit of
S
xa
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.38)
-R pHa 2 + x2 L

which evaluates to

a logHa2 + S2 L a logHa2 + R2 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.39)
2p 2p
Clearly, if we let R and S approach infinity independently the answer can be any value
we like! However, if we set R = S the answer is zero for all finite R, and hence the
principal value is zero. This makes sense – the p.d.f. is an even function so the expected
value of the random variable should be zero, since positive and negative values of the
same magnitude carry the same weight in the p.d.f. Or, to put it another way, the inte-
grand for the expected value is an odd function, so we should expect the total area under
the curve to be zero.
When we work with principal value integrals, the contour along the real axis
from -R to R is closed by attaching a large semicircle. The question arises as to whether
we should use the upper or lower half-plane. For ratios of polynomials, it does not
matter, provided certain conditions are satisfied. For integrands containing trigonometric
or exponential functions, it is critical that the right choice is made, and this is also very
important for the development of the theory of Fourier and Laplace transforms.
Our first semicircle theorem is the following. The proof comes with the state-
ment! Theorem 15.1: suppose f HzL satisfies the condition
M
† f HzL§ b ÅÅÅÅÅÅÅÅÅ (15.40)
Rk
on the contour G, parametrized by

z = R‰Âq (15.41)
15 Residue calculus 315

for either 0 b q b p (upper half-plane) or p b q b 2 p (lower half-plane), where k > 1


and M are constants. Then, by the length inequality,
ƒƒ ƒƒ
ƒƒ ƒƒ M pR pM
ƒ ƒ
†ƒ‡ f HzL „ z§ƒ § ÅÅÅÅÅÅÅÅÅÅÅÅk ÅÅÅÅÅ = ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅ (15.42)
ƒƒ ƒƒ R Rk-1
ƒƒ G ƒƒ

because the arc-length of G is pR. This vanishes as R Ø ¶, provided k > 1. For ratios of
polynomials, it is clearly more than sufficient that the degree of the denominator is 2 or
more greater than that of the numerator.

ü Back to our integral


PHzL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; PHzL = 1; QHzL = 2Ha2 + z2 LHb2 + z2 L (15.43)
QHzL

The denominator clearly has zeroes of multiplicity one at the points

poles = 8Âa, -Âa, Âb, -Âb< (15.44)

and these are simple poles. There are two in the upper half plane, at {Âa, Âb}. In this case
we can appeal to the rule for just differentiating the denominator, which uses the function
dQHzL
qHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = 4zHa2 + z2 L + 4zHb2 + z2 L (15.45)
dz
The residues are, first at Âa,
1 Â
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ (15.46)
qHÂaL 4 aHb - a2 L

and then at Âb,


1 Â
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ (15.47)
qHÂbL 4 bHa - b2 L

(15.48)

So the total value of the integral is


1 1 Â Â
2p J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N = 2 J- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N p
qHÂbL qHÂaL 4bHa2 - b2 L 4aHb2 - a2 L
(15.49)
p
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2abHa + bL

Clearly the intermediate steps break down if a = b. In this case there is a double pole,
and the result is obtained by setting
1
gHz_L := ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ (15.50)
2Ha + z2 L
2
316 Complex Analysis with Mathematica

and evaluating the integral as

i dHHz - Â aL2 gHzLL yz p


2p jjj lim ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zz = ÅÅÅÅÅÅÅÅÅ3ÅÅÅÅ (15.51)
kzØÂ a dz { 4a

ü Ÿ Final check against Mathematica


We can of course check the result using Mathematica directly. You can get a very
complicated answer if you do not feed in assumptions about a and b, but let's do it right
first time now:

Integrate[1/((x^2 + a^2)*(x^2 + b^2)),{x, 0,


Infinity}, Assumptions -> {a>0, b>0}]
p
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2 b a2 + 2 b2 a
This, of course, confirms our residue calculation. Note that Mathematica is telling us
that this answer is valid even if a = b. The condition that a and b be distinct was intro-
duced to force the poles to be simple in our residue calculation. The result holds when
a = b, but the detailed residue calculation must be done using the results for double
poles. You should do this calculation.

15.5 Semicircular contour: easy combinations of


trigonometric functions and polynomials
Our first semicircle theorem is sufficient to cope with products of trigonometric func-
tions and rational functions, provided that we pick a semicircle in the correct half-plane,
and the polynomial component in the denominator grows sufficiently rapidly at infinity.
As an example, consider:

sinHxL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.52)
-¶ x + x + 1
2

We cannot complete the contour in either the lower or the upper half-plane as things
stand, because the sine function blows up in each case. The trick is to consider the
integral as the imaginary part of

‰Â x
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.53)
-¶ x + x + 1
2

Now we can complete in the upper half-plane, since the numerator is less than unity in
absolute value there, and the denominator sends the integrand to zero sufficiently fast for
our semicircle theorem to apply. Now, where are the poles? These are at the zeroes of
the denominator. This can be found by use of the formula for a quadratic, leading to the
factorization. Replacing x by the complex variable z, we have
15 Residue calculus 317

è!!! è!!!
i  3 yi  3 y
z2 + z + 1 = jjjjz + ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zzzz jjjjz + ÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zzzz
1 1
(15.54)
k 2 2 {k 2 2 {

The pole in the upper half plane is at


è!!!
1 Â 3
z = - ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.55)
2 2
So the residue can be evaluated as
1 è!!!!
‰Âz ‰ ÅÅ2ÅÅ I-Â- 3 M
lim è!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!! è!!!ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.56)
 3
1 Â
zØ- ÅÅÅÅ2Å + ÅÅÅÅÅÅÅÅ
3
2ÅÅÅÅÅÅ z + ÅÅÅÅ12 + ÅÅÅÅÅÅÅÅ 2
ÅÅÅÅÅ 3

Therefore, taking the real and imaginary parts as


è!!!! è!!!!
2‰- 3 ë2 p cosH ÅÅÅÅ12 L 2‰- 3 ë2 p sinH ÅÅÅÅ12 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅ
Å ÅÅÅÅÅÅÅ
Å ÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.57)
3 3
we obtain the desired result as:
è!!!!
2‰- 3 ë3 p sinH ÅÅÅÅ12 L
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.58)
3
Note that at the same time we have also derived, by taking real parts, the result that
è!!!!

cosHxL 2‰- 3 ë2 p cosH ÅÅÅÅ12 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
‡ x2 + x + 1 ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å Å „ x = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.59)
-¶ 3
It is quite commonplace to obtain the value of a further integral in addition to the value
of the integral originally sought.

ü Ÿ Direct Mathematica evaluation


This time there are no assumptions to be set. The answer for the sine integral comes
back in the form we want right away, but the cosine integral needs a little simplification.

Integrate[{Sin[x], Cos[x]}/(x^2 + x + 1),


{x, -Infinity, Infinity}]
è!!!!
3 è!!!!
!!!
2 ‰- ÅÅÅÅÅ2ÅÅÅÅÅÅ p sinH ÅÅÅÅ12 L H1 + ‰Â L ‰- -1 p
6

è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ


9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
3 3

Simplify@ComplexExpand@%@@2DDDD
è!!!!
3
2 ‰- ÅÅÅÅÅ2ÅÅÅÅÅÅ p cosH ÅÅÅÅ12 L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
3
318 Complex Analysis with Mathematica

The details of the output may depend on the version you are using, but the answers can
be reconciled with such simplification.

15.6 Mousehole contours


ü Theorem 15:2
Suppose that f HzL has a simple pole at a, with residue s. Let fe HtL be the path

fe HtL = a + e ‰Ât , abtb b (15.60)

Then

lim ‡ f HzL „ z = Hb - aLÂs


eØ0 (15.61)
fe

This is typically used to obtain the contributions of small semicircular indentations in


linear contours. Note that it only makes sense for simple poles. The proof is easy – just
write out the Laurent series
s
f HzL = gHzL + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.62)
z-a
where gHzL is holomorphic, and evaluate the integral
s
‡ f HzL „ z = ‡ ÅÅÅÅÅÅÅÅ
z-a
ÅÅÅÅÅÅÅÅ „ z + ‡ gHzL „ z
fe fe fe

b
(15.63)
sÂe‰Ât
= ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ „ t + ‡ gHzL „ z = H b - aLÂs + ‡ gHzL „ z
a e‰Ât
fe fe

Taking limits sends the latter integral to zero, leaving the desired result. The classic type
of application of the Mousehole result is exemplified by the evaluation of

x - sinHxL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.64)
0 x3

We first note that the integrand is even, and so consider half the value of

x - sinHxL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.65)
-¶ x3

First we need to consider how to put the integrand in complex form. Our first guess
might be to regard the real expression as the imaginary part of

Âz - ‰Âz
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅ (15.66)
z3
15 Residue calculus 319

but at the origin this now has a triple pole. One further correction does the trick:

Âz + 1 - ‰Âz
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ (15.67)
z3
Expansion of the exponential in the numerator shows that
1 Â z
f HzL = ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ + … (15.68)
2z 6 24
There is now only one singularity in f , at the origin, where there is a simple pole with
residue 1/2. Now we can apply our semicircle theorem in the upper half-plane, as the
denominator is degree two greater than the polynomial part of the numerator, and the
exponential part of the numerator is well behaved. We therefore use the contour shown
for evaluation:

ci = 8SimplePole @80, 0<, 0.25D, Thickness @0.01D, Circle @80, 0<, 0.5, 80, Pi<D,
Circle@80, 0<, 5, 80, Pi<D,
[email protected], 0<, 85, 0<<D, [email protected], 0<, 8-5, 0<<D,
Text@"C 1 ", 8-2.5, -0.3<D, Text@"C2 ", 82.5, -0.3<D,
Text@"C 3 ", 80.4, 0.7<D, Text@"C4 ", 82.5, 4<D<;
cplot =
Show @Graphics @ci, AspectRatio -> Automatic , Axes -> True, Ticks -> None,
PlotRange -> 88-6, 6<, 8-1, 6<<DD

C4

C3

C1 C2

By Cauchy's theorem

‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z = 0 (15.69)


C1 C2 C3 C4

But in the limit, we can ignore the contribution of C4 . The integral we want is the
combination of C1 and C2 , and this is

J = ‡ f HzL „ z + ‡ f HzL „ z = - ‡ f HzL „ z (15.70)


C1 C2 C3
320 Complex Analysis with Mathematica

But this is now the integral over a small semicircle, traversed clockwise, and so is
Âp
-H-Â pL resH f , 0L = ÅÅÅÅÅÅÅÅÅ (15.71)
2
The imaginary part of this is just p/2, and so our original integral is just p/4.

ü Ÿ Final check against Mathematica

Integrate@Hx - Sin@xDL ê x ^ 3, 8x, 0, Infinity<D


p
ÅÅÅÅÅÅ
4

15.7 Dealing with functions with branch points


There are numerous integrands involving functions such as za and LogHzL for which
special methods are required. All of these involve keeping careful track of the arguments
(in the sense of the phases or ‘args’ of the variables) of the functions involved. There are
several ways of managing integrals involving these type of functions and sometimes one
actually deliberately introduces the log function in order to handle a certain type of
problem. Sometimes a contour such as the following does quite well, where are branch
cut is made down the negative imaginary axis:

ci = 8Thickness @0.01D, Circle@80, 0<, 0.5, 80, Pi<D,


Circle@80, 0<, 5, 80, Pi<D,
[email protected], 0<, 85, 0<<D, [email protected], 0<, 8-5, 0<<D,
Text@"C 1 ", 8-2.5, -0.3<D, Text@"C2 ", 82.5, -0.3<D,
Text@"C3 ", 80.4, 0.7<D, Text @"C4 ", 82.5, 4<D,
8Thickness @0.007D,
Dashing @80.01, 0.01<D, Line@880, 0<, 80, -3<<D< <;
cplot = Show@Graphics @ci, AspectRatio -> Automatic ,
Axes -> False, Ticks -> None, PlotRange -> 88-6, 6<, 8-3, 6<<DD

C4

C3

C1 C2
15 Residue calculus 321

These contours are good when one wishes to avoid unnecessary evaluation of residues in
the lower half-plane. Sometimes however, there may be poles on the negative real axis,
and unless they are simple, this method will fail. A good general purpose contour for
coping with a variety of functions with branch points is the following contour:

ci = 8Thickness @0.01D, Circle@80, 0<, 0.5, 8Pi ê 5, 2 Pi - Pi ê 5<D,


Circle@80, 0<, 5, 8Pi ê 55, 2 Pi - Pi ê 55<D,
Text@"C1 ", 82.5, 0.7<D, Text@"C2 ", 82.5, -0.7<D,
Text@"C3 ", 80.4, 0.7<D, Text@"C4 ", 82.5, 4<D,
[email protected] Cos@Pi ê 5D, 0.5 Sin@Pi ê 5D<, 85 Cos@Pi ê 55D, 5 Sin@Pi ê 55D<<D,
[email protected] Cos@Pi ê 5D, -0.5 Sin@Pi ê 5D<, 85 Cos@Pi ê 55D, -5 Sin@Pi ê 55D<<D,
8Thickness @0.005D, Dashing @80.01, 0.01<D, Line@880, 0<, 88, 0<<D< <;
cplot = Show@Graphics @ci, AspectRatio -> Automatic ,
Axes -> False , Ticks -> None, PlotRange -> 88-6, 6<, 8-6, 6<<DD

C4

C3 C1

C2

In this case the branch cut is taken along the positive real axis. We consider some
applications to illustrate the power of this method. The first gives us a powerful general
theorem. We consider an integral of the form

‡ f HxL „ x (15.72)
0

where f has no branch points, and no poles on the positive real axis or at zero, and goes
to zero sufficiently fast at infinity that we neglect integrals over arcs of large circles. We
do not require that f has any even symmetry. The trick is to consider

‡ f HzL logHzL „ z (15.73)

over the contour consisting of C1 , C2 , C3 , C4 . On the contour just above the real axis,
the contribution from C1 is just

‡ f HxL logHxL „ x (15.74)
0

Just below the real axis, we get a contribution


322 Complex Analysis with Mathematica

0
‡ f HxL HlogHxL + 2pÂL „ x (15.75)

Now the combination of these two is just



-2p‡ f HxL „ x (15.76)
0

Finally, we can check that the integral over the small semicircle goes to zero as its radius
goes to zero. Application of the residue theorem then shows that

‡ f HxL „ x = - ‚ Res@logHzL f HzLD (15.77)
0

where the sum is over the singularities within the contour. This is a strange and beautiful
result!

ü Example using branch method


We will consider the following integral using the method just outlined. Can you think of
another (simpler) approach using a wedge that will work for this particular type of
function? (See also Exercise 15.7.)

1
‡ ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.78)
0 x +1
3

The denominator is zero at the points


Âp 5 Âp
z = 9‰ ÅÅÅÅ3ÅÅÅ , ‰Â p , ‰ ÅÅÅÅÅ3ÅÅÅÅÅÅ = (15.79)

and so can be factorized over these roots, but we do not actually do this, as it will be
easier to use the differentiation theorem to extract the residue. We need to consider
LogHzL times this function. The singularities are on the unit circle,
where LogHzL = Â ArgHzL, so if the function is
logHzL
gHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ (15.80)
Hz3 + 1L

the residue at any pole on the unit circle is the numerator divided by the derivative of the
denominator, i.e. on the unit circle
 ArgHzL
ResHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ (15.81)
3z2
The three pieces, in order of that given in the list in Eq. (15.79), are
p Âp p
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2Âp
ÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ
è!!! (15.82)
ÅÅÅÅ Å3ÅÅÅÅÅÅ 18
3 I3‰ M 6 3
15 Residue calculus 323

p Âp
ÅÅÅÅÅÅÅÅ2ÅÅÅÅÂÅÅÅÅpÅÅ = ÅÅÅÅÅÅÅÅ (15.83)
3‰ 3
5p 5Âp 5p
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
10 Â p
ÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ
è!!! (15.84)
ÅÅÅÅÅÅÅÅ
ÅÅÅÅ
ÅÅ 18
3 I3‰ 3 M 6 3

The negative of the sum of these is just


2p
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ
è!!! (15.85)
3 3

This is the desired result, which we can check directly with Mathematica:

Integrate[1/(x^3 + 1), {x, 0, Infinity}]


2p
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ
è!!!
3 3

If you obtain something different in your current version of Mathematica, use the
simplification tools.

ü More than one branch structure


When the function being integrated has a branch point, and one then adds a logarithm,
matters are more complicated. Let's look at the following integral:
¶ è!!!
x logHxL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅÅÅ „ x (15.86)
0 Hx + 1L

Now this can be treated in a variety of ways – another option is given in the exercises.
Here we proceed directly, so we consider the function
è!!!
z logHzL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅ (15.87)
Hz + 1L

integrated over the same contour. This time the contribution from C1 is the integral we
want, and that from C2 is
¶ è!!!
‰Âp x HlogHxL + 2pÂL
-‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.88)
0 Hx + 1L2

These two add up to


¶ è!!!
x H2 logHxL + 2 p ÂL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.89)
0 Hx + 1L2

Now there is one double pole at z = -1, so to get the residue we need to evaluate the
derivative at z = -1, of
324 Complex Analysis with Mathematica

è!!! (15.90)
z logHzL

and the derivative is


logHzL 1
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅ
è!!! è!!Å!ÅÅÅ (15.91)
2 z z
Putting z = ‰Âp we obtain
Âp 1 p
ÅÅÅÅÅÅÅÅÅÅÅÅÂÅpÅÅÅÅ + ÅÅÅÅÅÅÅÅ
Âp
ÅÅÅÅÅ = -Â + ÅÅÅÅÅÅ (15.92)
2‰ 2 ÅÅÅÅÅ ÅÅ
Å ÅÅÅÅ
Å ÅÅ 2
‰2
Multiplication by 2p and application of the residue theorem gives
¶ è!!!
x H2 logHxL + 2 pÂL p
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x = 2 p J ÅÅÅÅÅÅ - ÂN = 2p + Âp2 (15.93)
0 Hx + 1L 2 2

Now we just take real and imaginary parts, to obtain the following pair of results:
¶ è!!!
x logHxL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅÅÅ „ x = p (15.94)
0 Hx + 1L
¶ è!!!
x p
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅ „ x = ÅÅÅÅÅÅ (15.95)
0 Hx + 1L 2

ü Ÿ Mathematica checks
We can check these directly with Mathematica:

Integrate[(Sqrt[x]*Log[x])/(1 + x)^2, {x, 0, Infinity}]

Integrate[Sqrt[x]/(1 + x)^2, {x, 0, Infinity}]


p
ÅÅÅÅÅÅ
2

15.8 Infinitely many poles and series summation


There are two further classes of integral that are important, both involving integrands
with infinitely many poles. In the first case we wish to pick the contour to just contain a
small number poles, in order to evaluate an integral. In the second case we wish to take a
sequence of contours neatly avoiding a sequence of poles, and carefully add up an
infinite series. We consider three representative problems.
15 Residue calculus 325

‡ An integral involving a periodic function



x
J=‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x (15.96)
-¶ sinhHxL

In this case we consider the function


z
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (15.97)
sinhHzL

The denominator vanishes when z = Ânp, for n an integer, and these will generate simple
poles in the absence of any cancellations. The potential pole at the origin is nullified by
the presence of z in the numerator, so we consider non-zero positive and negative integer
values for n. If we tried some kind of semicircular contour we would have all kinds of
problems since there are infinitely many poles in either half-plane. The point to note
here is that the denominator is periodic in the imaginary direction:

sinhHz + Â pL = -sinhHzL (15.98)

So if we use a rectangular contour going along the real axis and back along the real axis
displaced by a multiple of  n p, we can arrange that the two integrals are closely related.
We use the following contour:

ci = 8SimplePole @80, Pi<, 0.25D,


SimplePole @80, 2 Pi<, 0.25D, SimplePole @80, -Pi<, 0.25D,
Thickness @0.01D, Circle@80, Pi<, 0.5, 8Pi, 2 Pi<D,
Line@88- 9, 0<, 89, 0<<D, Line@88-9, Pi<, 8-0.5, Pi<<D,
[email protected], Pi<, 89, Pi<<D,
Line@889, 0<, 89, Pi<<D, Line@88-9, 0<, 8-9, Pi<<D,
Text@"C1 ", 82.5, -0.3<D, Text@"C2 ", 89.7, Pi ê 2<D, Text@"C4 ", 81, 2.8<D,
Text@"C3 ", 84.5, 3.8<D, Text@"C 5 ", 8-4.5, 3.8<D, Text@"C6 ", 8-9.6, Pi ê 2<D<;
cplot = Show @Graphics @ci, AspectRatio -> Automatic ,
Axes -> True, Ticks -> None, PlotRange -> 88-10, 10<, 8-4, 7<<DD

C5 C3
C4

C6 C2

C1
326 Complex Analysis with Mathematica

By Cauchy's theorem:

‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z


C1 C2 C3
(15.99)
+ ‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z = 0
C4 C5 C6

Now we can ignore the contributions from C2 and C6 in the limit that the ends of the
rectangle go to infinity, as the denominator blows up exponentially. For the three
horizontal sections, we can write

‡ f HzL „ z + ‡ f HzL „ z + ‡ f HzL „ z


C1 C3 C5
(15.100)
¶ ¶ ¶
x x + Âp 2x
= ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x + P ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x = 2J
-¶ sinhHxL -¶ sinhHxL -¶ sinhHxL

where the imaginary principal value integral is zero because the integrand is odd. Finally
we need to deal with the upturned mousehole contour. The residue at  p is the limit
zHz - ÂpL 2z - Âp
lim ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = lim ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = -Âp (15.101)
zØÂ p sinhHzL zØÂ p coshHzL

where the central step is L'Hospital's rule, and we note that

coshHÂpL = cosHpL = -1 (15.102)

So Cauchy's theorem and the mousehole theorem give us

2 J + H-ÂpL H-ÂpL = 0 (15.103)

so J = p2 ê 2.

ü Ÿ Mathematica check

Integrate@x ê Sinh@xD, 8x, -Infinity, Infinity<D

p2
ÅÅÅÅÅÅÅÅÅ
2

‡ Summation type 1
Let gHnL be an even rational function of n, holomorphic except at the origin, satisfying,
for large » z », » gHzL » = OH » z »-k L for k > 1, and we wish to evaluate

‚ gHnL (15.104)
n=1
15 Residue calculus 327

We consider

f HzL = pgHzLcotHpzL (15.105)

First of all note that the poles of f HzL are the poles of gHzL and also at the poles of
cotHpzL. The residues of f HzL at the poles of cotHpzL are just gHnL. Now we pick a square
contour with vertices at
1 1 1 1
JN + ÅÅÅÅÅ N H1 + ÂL; JN + ÅÅÅÅÅ N H-1 + ÂL; JN + ÅÅÅÅÅ N H-1 - ÂL; JN + ÅÅÅÅÅ N H1 - ÂL; (15.106)
2 2 2 2
It is a simple task (that you should do) to show that cotHp zL is bounded on such a square
(note that this square goes between the singularities), so by the behaviour of f for large
z, by letting N Ø ¶ we deduce that the integral over this square tends to zero, and hence
that

2 ‚ gHnL = - ‚ res@pgHzLcotHpzLD (15.107)
n=1 poles of g

ü Example

1 p2
‚ ÅÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅ (15.108)
n=1
n 6

This is proved by taking gHnL = 1 ê n2 and computing the residue of p cotHpzLê z2 at the
origin as -p2 ê3.

Mathematica can do many sums of this type

Sum@1 ê n ^ 2, 8n, 1, Infinity<D

p2
ÅÅÅÅÅÅÅÅÅ
6

‡ Summation type 2
Let gHnL be an even rational function of n, holomorphic except at the origin, satisfying,
for large » z », » gHzL » = OH » z »-k L for k > 1, and we wish to evaluate:

‚ H-1L gHnL
n
(15.109)
n=1

We consider

f HzL = pgHzLcosecHpzL (15.110)

and proceed exactly as before, noting that the residue of f HzL at the poles of cosecHpzL is
now H-1Ln gHnL.
328 Complex Analysis with Mathematica

ü Example
By a similar argument as before, it follows that

H-1Ln p2
‚ ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅ (15.111)
n=1
n 12

This is proved by taking gHnL = 1 ê n2 and computing the residue of pcosecHpzL êz2 at the
origin as p2 ê 6.

Sum@H-1L ^ n ê n ^ 2, 8n, 1, Infinity<D

p2
- ÅÅÅÅÅÅÅÅÅ
12
By considering sums from negative infinity to infinity we can obtain other types of
results – see the last part of Exercise 15.10 for an example. But some series cannot be
summed by these methods – try Exercise 15.19 if you want to get an idea of the depth of
the water you can rapidly find yourself in! We also have the famous Mittag-Leffler
expansion theorem, which can be thought of as a kind of fancy partial fraction expansion
based on the poles of functions, rather than on a simple factorization of a denominator.
The form of this theorem is described below.

Theorem 15.3: Mittag-Leffler Suppose that f HzL only has singularities at simple poles
a1 , a2 , … arranged in increasing absolute value, with residues b1 , b2 , ... at each of
these poles. Suppose further that f HzL is less than M in magnitude on a sequence of
circles of radius Rm , with Rm Ø ¶ as m Ø ¶, with these circles not passing through any
of the poles, and M is independent of m. Then

1 1
f HzL = f H0L + ‚ bn J ÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N (15.112)
n=1
a n z - an

The proof is left as Exercise 15.11 for more enterprising students. Some simple applica-
tions are given in Exercise 15.12. It may surprise you to learn that Mathematica is
perfectly capable of adding up series of this type, to recover the original functions. This
is very helpful, particularly for checking answers, and some examples are given in
Exercise 18.

15.9 The argument principle and Rouché's theorem

‡ The argument principle


Suppose that f HzL is a meromorphic function defined on and inside a simple closed
contour C, with no zeroes or poles on C itself. (You are reminded that meromorphic
means holomorphic in the finite plane apart from poles.) Consider the integral
15 Residue calculus 329

1 f £ HzL
J = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z (15.113)
2p C f HzL

We can consider this integral in two ways.

ü J as a change in argument
If we parametrize C by t, with a b t b b we can write
1 f £ HzHtLL 1  logH f HzHtLLL
J = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ z£ HtL „ t = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ t (15.114)
2p C f HzHtLL 2p C t

and so
t=b
1
J = ÅÅÅÅÅÅÅÅÅÅÅÅ @logH f HzHtLLLD (15.115)
2p t=a

which is the change in the value of the logarithm of f as we move round the path.
Decomposing the complex logarithm we obtain
t=b t=b
1 1
J = ÅÅÅÅÅÅÅÅÅÅÅÅ @logH » f HzHtLLL » + Â ArgH f HzHtLLL D = ÅÅÅÅÅÅÅÅÅ @ArgH f HzHtLLL D (15.116)
2p t=a 2p t=a

so that J is just the change in the argument of f around the path, divided by 2p. This is
normally written without reference to the parameter as
1
J = ÅÅÅÅÅÅÅÅÅ @ArgH f HzLL D (15.117)
2p C

Another interpretation of this view of J is in terms of winding numbers. If we let the


path D denote the image of C under the mapping z Ø w = f HzL, then
1 1
J = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅ „ w (15.118)
2p D w

is the number of times w winds around the origin, since it is 1 ê 2p times the change in
the argument of w = f HzL as z progresses around C and w progresses around D.

ü J as number of zeroes minus number of poles


Suppose that in a neighbourhood of a point zi within C we can write

f HzL = Hz - zi Lni gHzL (15.119)

where g is both holomorphic and non-zero in a neighbourhood of zi , and ni is a non-zero


integer. This is a zero of of order ni if ni is positive, and a pole of order -ni if ni is
negative. Clearly

f £HzL = gHzL ni Hz - zi Lni -1 + g£HzL Hz - zi Lni (15.120)

and so, in a neighbourhood of zi , we can see that


330 Complex Analysis with Mathematica

f £ HzL ni
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + hHzL (15.121)
f HzL z - zi

where hHzL = g£HzL ê gHzL is holomorphic in this same neighbourhood. Applying the
calculus of residues we see immediately that
k
J = ‚ ni (15.122)
i=1

where k is the total number of locations of the zeroes or poles. This result is usually
written as

J = N-P (15.123)

where N is the total number of zeroes, including multiplicies, and P is the total number
poles, each pole weighted by its orders. The argument principle is then summarized by
an equation combining these observations into the form:
1 f £ HzL 1
J = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z = ÅÅÅÅÅÅÅÅÅ @ArgH f HzLLD = N - P (15.124)
2p C f HzL 2p C

‡ Theorem 15.4: Rouché's theorem


Suppose that f HzL and gHzL are holomorphic inside and on a simple closed contour C.
Then Rouché's theorem states that if » gHzL » < » f HzL » on C then f HzL and f HzL + gHzL have
the same number of zeroes inside C, (where multiplicities are included).
To prove this result we set hHzL = gHzLê f HzL, and observe that the assumption of
the theorem is that hHzL < 1 on C. We let N denote the number of zeros of gHzL ê f HzL, and
M the number of zeroes of f HzL. By the argument principle and the fact that f and g are
holomorphic, and hence have no poles inside C, we have

1 f £ HzL + g£HzL 1 f £ HzL


N = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z ; M = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z (15.125)
2p C f HzL + gHzL 2p C f HzL

We now write down the difference, N - M, and show that this is zero under the assump-
tions given:

1 f £ HzL + g£HzL 1 f £ HzL


N - M = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z - ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z (15.126)
2p C f HzL + gHzL 2p C f HzL

Because gHzL = f HzL hHzL we can reorganize this as

N-M
1 f £ HzL + f £ HzL hHzL + f HzL h£ HzL 1 f £ HzL
= ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z - ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p C f HzL H1 + hHzLL 2p C f HzL
15 Residue calculus 331

1 f £ HzL H1 + hHzLL + f HzL h£HzL 1 f £ HzL


= ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z - ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p C f HzL H1 + hHzLL 2p C f HzL
1 f £ HzL H1 + hHzLL f HzL h£HzL 1 f £ HzL
= ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z - ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p C f HzL H1 + hHzLL f HzL H1 + hHzLL 2p C f HzL
1 h£HzL
= ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ z
2p C H1 + hHzLL

Now we note that since hHzL < 1 on C the integrand of this last expression can be
expanded term by term:
1
N - M = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ h£HzL H1 - hHzL + h2 HzL - h3 HzL + …L „ z (15.128)
2p C

The series is uniformly convergent and can be integrated term by term, each term giving
zero. Hence N = M.

‡ An example using Rouché's theorem


Consider the polynomial

PHzL = z8 - 4z3 + 24 (15.129)

We can find out about the zeroes of this function in various ways, with or without
Mathematica. We can use Mathematica to work out directly the integral involved in the
argument principle. We can try to apply Rouché's theorem using ‘pen and paper’.
Finally, we can just ask Mathematica to tell us where the roots are, possibly symboli-
cally, and if necessary, numerically.

ü Ÿ Approach 1: application of the argument principle with Mathematica


PHzL = z8 - 4z3 + 24 (15.130)

P@z_D := z ^ 8 - 4 z ^ 3 + 24;
q@z_D = D@P@zD, zD;
Q@z_D := q@zD

Let's define a function to investigate the argument principle applied over a circle. Note
that we will use numerical integration and then round the result. This is important
because if we used Integrate, this would try to find an analytical expression
(involving the logarithm in many examples) and this would not reliably pick up the
correct branch of the argument.

RootCount@r_D :=
Round@1 ê H2 Pi IL NIntegrate@Q@r Exp@I tDD ê P@r Exp@I tDD
I r Exp@I tD, 8t, 0, 2 Pi<DD
332 Complex Analysis with Mathematica

The following produces some warnings, which arise quite rightly because on the first
(inner) integral the correct result is zero:

Map@RootCount@#D &, 81, 2<D


— NIntegrate::ncvb :
NIntegrate failed to converge to prescribed accuracy after 7 recursive bisections in t near t = 1.98804.

80, 8<

So we know that all eight roots lie between the circles of radius one and two.

ü Approach 2: applying Rouché


Let f HzL = 24 and gHzL = z8 - 4z3 . On the inner circle where » z » = 1 we note
» f HzL » = 24. Furthermore

†gHzL§ = †z8 - 4z3 § § †4z3 § + †z8 § b 5 < 24 = † f HzL§ (15.131)

So by Rouché's theorem the sum f + g = P has the same number of roots as does f
inside the circle » z » = 1, i.e., none. Now consider the outer circle » z » = 2. This time we
choose f HzL = z8 and gHzL = 24 - 4z3 . On the outer circle we have

†gHzL§ = †24 - 4z3 § § 24 + †4z3 § b 24 + 32 = 56 < 128 = 28 = † f HzL§ (15.132)

so that P = f + g has the same number of roots inside as does f , i.e. 8.

ü Ÿ Approach 3: brute-force root-finding


The Solve function does not yield analytical results:

z ê. Solve@z ^ 8 - 4 z ^ 3 + 24 ã 0, zD

8Root@#18 - 4 #13 + 24 &, 1D, Root@#18 - 4 #13 + 24 &, 2D,


Root@#18 - 4 #13 + 24 &, 3D, Root@#18 - 4 #13 + 24 &, 4D,
Root@#18 - 4 #13 + 24 &, 5D, Root@#18 - 4 #13 + 24 &, 6D,
Root@#18 - 4 #13 + 24 &, 7D, Root@#18 - 4 #13 + 24 &, 8D<

But the numerical results are easily found:

rootlist = z ê. NSolve@z ^ 8 - 4 z ^ 3 + 24 ã 0, zD

8-1.37849 - 0.670517 Â, -1.37849 + 0.670517 Â,


-0.569794 - 1.26996 Â, -0.569794 + 1.26996 Â, 0.57115 - 1.47273 Â,
0.57115 + 1.47273 Â, 1.37713 - 0.465032 Â, 1.37713 + 0.465032 Â<

and we can check their absolute values:

Map@Abs, rootlistD
81.53291, 1.53291, 1.39193, 1.39193, 1.5796, 1.5796, 1.45353, 1.45353<
15 Residue calculus 333

ü Ÿ A graphical representation
The results above can be summarized by the following Mathematica plot showing the
two circles and the roots:

circlesnroots = ParametricPlot@
882 Cos@tD, 2 Sin@tD<, 8Cos@tD, Sin@tD<<,
8t, 0, 2 Pi<, AspectRatio Ø 1,
Epilog Ø [email protected],
Map@Point@8Re@#D, Im@#D<D &, rootlistD< D

-2 -1 1 2

-1

-2

‡ Ÿ Other methods for root isolation in Mathematica


Some further help for counting and locating roots of polynomials in Mathematica,
beyond merely using Solve to locate them in the low degree case, is provided by the
RootIsolation package in the algebra area. This can be loaded in the usual way,
and the relevant function is CountRoots:

Needs@"Algebra`RootIsolation` "D;
? CountRoots

CountRoots@f, 8x,a,b<D computes the number of roots H


multiplicities countedL of a univariate polynomial f@xD in
the interval Ha,bL Hfor complex numbers a,b interval Ha,bL is
the open rectangle Hor open line segment or pointL of which
a is the lower-left vertex and b is the upper-right vertexL.

In other words, this function is already set up to do the work for us using rectangular
intervals!

CountRoots@z ^ 8 - 4 z ^ 3 + 24, 8z, 0, 2<D


0

CountRoots@z ^ 8 - 4 z ^ 3 + 24, 8z, -2, 2<D

0
334 Complex Analysis with Mathematica

CountRoots@z ^ 8 - 4 z ^ 3 + 24, 8z, -1.5 - I, 1.5 + I<D

CountRoots@z ^ 8 - 4 z ^ 3 + 24, 8z, -2 - 2 I, 2 + 2 I<D

Show@Graphics@
88RGBColor@0, 1, 0D, Rectangle@8-2, -2<, 82, 2<D<,
8RGBColor@0, 0, 1D, [email protected], -1<,
81.5, 1<D<, [email protected], RGBColor@0, 0, 0D,
Map@Point@8Re@#D, Im@#D<D &, rootlistD<<,
Frame Ø True, AspectRatio Ø 1DD

-1

-2
-2 -1 0 1 2
We can overlay this with the circles plot as well:

Show@%, circlesnrootsD

-1

-2
-2 -1 0 1 2

ü Projects
Write down some polynomials and investigate them using the techniques described
above. Two examples to start you off are given in Exercise 15.20.
15 Residue calculus 335

Exercises
15.1 Evaluate, for a and b real, with a > b > 0, the integral
2p
1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ q
0 a + b cosHqL

Also evaluate using residue methods the integral:


2p
1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ „ q
0 H5 - 2 cosHqLL

How might the second result be deduced from the first?

15.2 Evaluate using residue methods the integral


2p
‡ cos6 HqL „ q
0

and explain how the result can also be obtained using DeMoivre's Theorem.

15.3 Evaluate using residue methods each of the three integrals


¶ ¶ ¶
1 1 1
ÅÅÅÅÅÅÅÅ2ÅÅÅÅ „ x ,
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅ3ÅÅÅÅ „ x ,
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ3ÅÅÅÅ „ x
-¶ Hx2 + 3L -¶ Hx2 + 3L 0 Hx2 + 3L

15.4 Evaluate using residue methods each of the three integrals


¶ ¶ ¶
cosHxL cosHxL cosHxL
ÅÅÅÅÅÅÅÅ2ÅÅÅÅ „ x ,
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅ3ÅÅÅÅ „ x ,
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ3ÅÅÅÅ „ x
-¶ Hx2 + 3L -¶ Hx2 + 3L 0 Hx2 + 3L

15.5 Using the Mousehole result, evaluate the integral



sinHxL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x
0 x

15.6 Consider again the integral


¶ è!!!
x log@xD
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅÅÅ „ x
0 Hx + 1L

Use the substitution x = y2 to show that this is equivalent to



y2 log@yD
4‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ „ y
0 Hy2 + 1L

and hence evaluate the integral.

15.7 Using methods similar to that employed in Section 15.7, evaluate


336 Complex Analysis with Mathematica


1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅ „ x
ÅÅÅÅÅÅÅÅ
0 x5 + 1

Using a similar approach but without logs, also evaluate:



1
‡ ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ „ x
0 x +1
6

Also show how these can be done using a wedge-shaped contour. To figure out where
the wedge should be, consider the angle about the origin over which the integrand is
periodic.

15.8 For 0 < a < 1, evaluate the integral



xa-1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x
0 x+1

15.9 Evaluate the integral



coshHa xL
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ x
0 coshHxL

using a suitable rectangular contour.

15.10 Evaluate the following four infinite sums:


¶ ¶
1 1
‚ ÅÅÅÅÅ4ÅÅÅÅ , ‚ ÅÅÅÅÅ6ÅÅÅÅ
n=1
n n=1
n
¶ ¶
1 H-1Ln
‚ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅ , ‚ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅ
n=1
a + n2
2
n=-¶
a2 + n2

15.11 (Harder) By considering the function


f HzL
gHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z-z

and integrating over the sequence of circles given in the statement of the theorem, prove
the Mittag-Leffler expansion theorem.

15.12 Assuming the Mittag-Leffler theorem, derive generalized partial fraction expan-
sions for cosecHzL, secHzL, tanHzL, cotHzL. How may these be used directly to infer their
equivalents for hyperbolic functions?

Ÿ In the following exercises with Mathematica please note the suggestions in the
introduction for cross-checking the output of Integrate. In all cases where there are
parameters with assumptions about them, try both the deafult setting of GenerateCon-
ditions -> True, and making use of Assumptions settings. Avoid the use of
GenerateConditions -> False.
15 Residue calculus 337

15.13 Ÿ Check the results of Exercises 15.1 through 15.5 using Mathematica. Note that
you may need to use algebra functions such as PowerExpand and Simplify to get
obvious agreement.

15.14 Ÿ Use Mathematica to directly evaluate the following integral without making
any assumptions about a, and then repeat the process with some suitable assumptions.

1
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ „ x
0 Ha + x2 L
2

Simplify the results using Simplify, PowerExpand etc. as necessary, and compare
your answer with that obtained by residue methods.

15.15 Ÿ Use Mathematica to check the results obtained in Exercise 15.7.

15.16 Ÿ Use Mathematica to check the results obtained in exercise 9. You might find
the use of a combination of TrigExpand and Simplify to be helpful.

15.17 Ÿ Mathematica's built-in function Sum can treat a large set of infinite sums
symbolically. Use this function to confirm your answers to Exercise 15.10.

15.18 Ÿ Mathematica can also check results of Mittag-Leffler type. Use the Sum
function to evaluate, for example
¶ ¶
1 1
8 z „ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ and 8 z „ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
H2 n - 1L p - 4 z 2 2 2 H2 n - 1L p + 4 z2 2 2
n=1 n=1

and confirm as many of your answers to Exercise 15.12 as you can.

15.19 Ÿ (More of an investigative project) Find out what happens when you try to sum

1
‚ ÅÅÅÅÅ3ÅÅÅÅ
n=1
n

by the methods introduced in this chapter. Try looking up ‘Apery's constant’, and
‘Zeta(3)’ on the internet and in the literature to see what this question leads to. Mathemat-
ica is aware of these issues, and gives symbolic results, for example:

Sum@1 ê n ^ 3, 8n, 1, Infinity<D

zH3L

15.20 Ÿ Using the principle of the argument, Rouché's theorem and Mathematica's root
isolation and find techniques, investigate the location of the zeroes of

pHzL = z4 - z3 + 4
qHzL = z8 - z3 + 2
16 Conformal mapping I: simple mappings
and Möbius transforms

Introduction
Complex functions have an elegant interpretation in terms of mappings of the complex
plane into itself. We explored this briefly in Chapter 8. Now we wish to study the
geometrical aspects in rather more detail. Our plan is as follows. First, we shall literally
play with Mathematica to get a feel for what some simple mappings do to simple
regions. Next we shall look at the property of ‘conformality’ – that holormorphic
functions, when interpreted as mappings, preserve angles between curves at most points.
Then we shall explore the relationship between the geometry of circles and lines and a
special class of mappings called Möbius transforms.
This chapter is the foundation for several that follow. In particular, in Chapter 19
we shall explore the application of conformal mapping to problems in physics in 2-dimen-
sional regions. Chapter 23 will explore how some of this material may be generalized to
higher dimensions. Chapter 21 will look at how conformal maps, and the Schwarz–Christ-
offel transformation in particular, can be managed numerically. Chapter 23 will also
reveal the real physics underlying the Möbius transform when it is seen in terms of
Einstein's theory of special relativity.

16.1 Ÿ Recall of visualization tools


Our first goal is to use Mathematica to explore some simple mappings. We shall do so
by loading the ComplexMap Package and making a pair of additional functions,
CartesianMap and PolarMap. Let's load the package and ask about the first of
these functions:

Needs@"Graphics`ComplexMap`"D;
? Graphics`ComplexMap`CartesianMap

"CartesianMap@f, 8x0, x1, HdxL<, 8y0, y1, HdyL<D plots the


image of the cartesian coordinate lines under the function
f. The default values of dx and dy are chosen so that the
number of lines is equal to the value of the option Lines.

We extend the functionality of the ComplexMap package by defining a pair of func-


tions that show us the effect of the conformal map both ‘before’ and ‘after’. Clearly we
can define both Cartesian and polar versions. In each case two plots are created. The first
has the identity mapping, while the second has the function incorporated. This makes it
very straightforward to see the effect of a mapping on a region bounded by Cartesian or
polar coordinate lines:
16 Conformal mapping I: simple mappings and Mobius transforms 339

PolarConformal@func_, radial_, polar_, options___D :=


Show@GraphicsArray@8PolarMap@# &, radial, polar,
options, DisplayFunction -> IdentityD,
PolarMap@func, radial, polar,
options, DisplayFunction -> IdentityD
<D, DisplayFunction -> $DisplayFunctionD;

CartesianConformal@func_,
xrange_, yrange_, options___D :=
Show@GraphicsArray@8
CartesianMap@# &, xrange, yrange,
options, DisplayFunction -> IdentityD,
CartesianMap@func, xrange, yrange,
options, DisplayFunction -> IdentityD
<D, DisplayFunction -> $DisplayFunctionD;

‡ Ÿ Functions to plot complex regions defined by inequalities


In recent versions of Mathematica, there is another wonderful package, Inequality-
Graphics, that helps with the visualization of mappings:

Needs@"Graphics`InequalityGraphics` "D;

? ComplexInequalityPlot

ComplexInequalityPlot@ineqs, 8z, zmin, zmax<D plots the the region defined


by ineqs within the box bounded by 8Re@zminD, Im@zminD< and 8Re@zmaxD,
Im@zmaxD<. The functions that occur within the inequality need to
be real valued functions of a complex argument, e.g. Abs, Re and Im.

ComplexInequalityPlot@ 1 ê 2 § Abs@zD § 1, 8z< D

0.5

-1 -0.5 0.5 1

-0.5

-1
340 Complex Analysis with Mathematica

16.2 Ÿ A quick tour of mappings in Mathematica


The purpose of this section is to give you a feel for what happens to regions in the
complex plane when we apply a mapping associated with an elementary function.

‡ A simple example of a Möbius transform


It is easiest to begin with a simple example of a Möbius transform. We shall look at
these in greater generality shortly. Consider the mapping WHzL given by the formula

W[z_] = (z - I)/(z + I);

The corresponding inverse mapping is readily found by solving for z in terms of


w = W@zD:
 Hw + 1L
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (16.1)
w-1
You can of course get Mathematica to do it:

z ê. Solve@W@zD == w, zD
 Hw + 1L
9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
w-1
Let's look first at the images of four points under the mapping:

8W@0D, W@ID, Limit@W@zD, z -> InfinityD, W@-ID<


1
— Power::infy : "Infinite expression ÅÅÅÅÅ encountered.
0
8-1, 0, 1, ComplexInfinity<

Consider also the real axis in z-space. Any real point is equidistant from +Â and -Â so
» w » = 1 if z is real. So the real axis gets mapped to the unit circle. If z is in the upper
half-plane the modulus of W@zD will be less than one, so the upper half-plane is mapped
into the interior of the unit circle. We can look at this in various ways using our func-
tions. First, let's check that the upper half-plane gets mapped to the unit circle:

zUpperHalfPlane = ComplexInequalityPlot@ Im@zD ¥ 0,


8z, -5 - 5 I, 5 + 5 I <, DisplayFunction Ø Identity D;
wOfzUpperHalfPlane = ComplexInequalityPlot@
Im@-I Hw + 1L ê Hw - 1LD ¥ 0, 8w, -5 - 5 I, 5 + 5 I <,
DisplayFunction Ø Identity D;
Show@
GraphicsArray@8zUpperHalfPlane, wOfzUpperHalfPlane<D,
DisplayFunction Ø $DisplayFunction D
16 Conformal mapping I: simple mappings and Mobius transforms 341

5 1
4 0.5
3
2 -1-0.5 0.5 1
1 -0.5
-4 -2 2 4 -1
If we want to look at the Cartesian grid image, we can do that with CartesianCon-
formal. Note that this time we get, in the right-hand image, just that part of the unit
circle mapped to by the plotted rectangle:

CartesianConformal@HH# - IL ê H# + ILL &, 8-5, 5<, 80, 5<,


Lines -> 30, PlotPoints -> 40, PlotRange -> AllD

5 1
4 0.5
3
2 -1-0.5 0.5
1 -0.5
-4 -2 2 4 -1
We can also view this using PolarConformal applied to the unit circle applied to the
inverse mapping:

PolarConformal@HI * H# + 1L ê H1 - #LL &, 80, 1<,


80, 2 Pi<, Lines -> 20, PlotPoints -> 40,
PlotRange Ø 88-2, 2<, 8-2, 2<<D

2 2
1.5 1.5
1 1
0.5 0.5

-2-1.5-1-0.5 0.5 1 1.5 2 -2-1.5-1-0.5 0.5 1 1.5 2


-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
We can look at the inverse mapping in other ways. This is given by Eq. (16.1)
ÂHw + 1L
z = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
w-1
In this case we see that a complex point equidistant from +1 and -1 will get mapped to
the unit circle. That is, the imaginary axis in w-coordinates gets mapped to the unit circle
in z-coordinates. Let's visualize this as before:
342 Complex Analysis with Mathematica

LeftHalfwPlane = ComplexInequalityPlot@ Re@wD § 0,


8w, -5 - 5 I, 5 + 5 I <, DisplayFunction Ø Identity D;
zOfLeftHalfwPlane = ComplexInequalityPlot@
Re@Hz - IL ê Hz + ILD § 0, 8z, -5 - 5 I, 5 + 5 I <,
DisplayFunction Ø Identity D;
Show@
GraphicsArray@8LeftHalfwPlane, zOfLeftHalfwPlane<D,
DisplayFunction Ø $DisplayFunction D

1
2
0.5

-5 -4 -3 -2 -1 -1-0.5 0.5 1
-0.5
-2
-1

-4

‡ Power mappings
Let's take a look at the square and the cube mapping

PolarConformal@# ^ 2 &, 80, 1<, 80, Pi ê 2<,


Lines -> 20, PlotPoints -> 40, PlotRange -> AllD

0.8 1
0.8
0.6 0.6
0.4 0.4
0.2
0.2 -1 -0.5 0.5 1

0.2 0.4 0.6 0.8 1

PolarConformal@# ^ 3 &, 80, 1<, 80, Pi ê 3<,


Lines -> 20, PlotPoints -> 40, PlotRange -> AllD
16 Conformal mapping I: simple mappings and Mobius transforms 343

0.8
1
0.6 0.8
0.6
0.4 0.4
0.2
0.2
-1 -0.5 0.5 1
0.2 0.4 0.6 0.8 1

ü Fractional powers
By taking suitable fractional powers the effect of a power mapping can be undone:

PolarConformal@# ^ H1 ê 2L &, 80, 1<, 80, Pi<,


Lines -> 20, PlotPoints -> 40, PlotRange -> AllD

1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
-1 -0.5 0.5 1 0.2
0.4
0.6
0.81
This gives us the idea of opening up a wedge to a half-plane, or vice-versa:

zFirstQuadrant =
ComplexInequalityPlot@ Re@zD ¥ 0 && Im@zD ¥ 0,
8z, -5 - 5 I, 5 + 5 I <, DisplayFunction Ø Identity D;
wOfzFirstQuadrant = ComplexInequalityPlot@
Re@w ^ 2D ¥ 0 && Im@w ^ 2D ¥ 0, 8w, -5 - 5 I, 5 + 5 I <,
DisplayFunction Ø Identity D;
Show@
GraphicsArray@8zFirstQuadrant, wOfzFirstQuadrant<D,
DisplayFunction Ø $DisplayFunction D

5
4
4
2
3

2 -4 -2 2 4
-2
1
-4
1 2 3 4 5
344 Complex Analysis with Mathematica

Next we look at some other mappings.

ü Rotations

PolarConformal@Exp@I Pi ê 6D * # &,
80, 1<, 8-Pi ê 6, Pi ê 6<, Lines -> 20,
PlotPoints -> 40, PlotRange -> AllD

0.4 0.8

0.2 0.6

0.4
0.20.4 0.60.8 1
-0.2 0.2
-0.4
0.2 0.4 0.6 0.8 1

‡ Exponential mappings
CartesianConformal@Exp, 80, 1<, 80, Pi ê 2<,
Lines -> 20, PlotPoints -> 40, PlotRange -> AllD

1.5
1.25 2.5

1 2
1.5
0.75
1
0.5 0.5
0.25
0.5 1 1.5 2 2.5

0.20.40.60.8 1

‡ Log mappings
PolarConformal@Log, 8E ^ 2, E ^ 4<,
80, Pi ê 2<, Lines -> 20, PlotPoints -> 40D
16 Conformal mapping I: simple mappings and Mobius transforms 345

50
1.5
40 1.25
1
30
0.75
20 0.5
0.25
10
2.5 3 3.5 4
10 20 30 40 50

‡ Joukowski aerofoil mapping


There is a very famous conformal mapping that captures several interesting features of
aerofoils. The Joukowski mapping can be used to investigate various problems related to
fluid flow, by transforming the region exterior to a circle to that exterior to an aerofoil
shape:

Joukowski@x_, y_, R_, vbl_, q_D :=


Exp@I qD * HHvbl + x + I yL +
H-x + Sqrt@R ^ 2 - y ^ 2DL ^ 2 ê Hvbl + x + I yLL

ü Varying the thickness


When both x and y are zero the circle is mapped into a real line segment. As x changes
the mapped region transforms from an aerofoil-shaped region into a plane. The first
frame of an animation demonstrating this is shown in the text in the output below – the
electronic version contains the full movie. If you are using Mathematica technologies
beyond version 5.2 see the enclosed CD and on-line supplement as well.

Do@PolarConformal@Joukowski@x, 0, 2, #, 0D &,
82, 5<, 80, 2 Pi<, Lines -> 10, PlotPoints -> 40,
PlotRange -> 88-6, 6<, 8-6, 6<<D, 8x, 0.5, 0.0, -0.05<D

6 6
4 4

2 2

-6 -4 -2 2 4 6 -6 -4 -2 2 4 6
-2 -2

-4 -4
-6 -6
346 Complex Analysis with Mathematica

ü Varying the camber


Now, by varying y, the camber of the aerofoil can be adjusted:

Do@PolarConformal@[email protected], y, 2, #, 0D &,
82, 5<, 80, 2 Pi<, Lines -> 10, PlotPoints -> 40,
PlotRange -> 88-6, 6<, 8-6, 6<<D, 8y, 1, -1, -0.1<D

6 6
4 4
2 2

-6 -4 -2 2 4 6 -6 -4 -2 2 4 6
-2 -2

-4 -4

-6 -6

ü Varying the angle of attack


A simple rotation can also be applied:

Do@PolarConformal@[email protected], 0.5, 2, #, qD &,


82, 5<, 80, 2 Pi<, Lines -> 10, PlotPoints -> 40,
PlotRange -> 88-6, 6<, 8-6, 6<<D, 8q, 0, Pi ê 4, Pi ê 16<D

6 6
4 4
2 2

-6 -4 -2 2 4 6 -6 -4 -2 2 4 6
-2 -2

-4 -4
-6 -6
16 Conformal mapping I: simple mappings and Mobius transforms 347

16.3 The conformality property


You should now take a careful look at the pictures in the previous section and ask
yourself the question: At what angles do the curves (in the right-hand plots) intersect? It
should not take long to convince yourself that the answer is, usually, a right angle. Apart
from special points, such as the trailing edge of the aerofoil, the mappings have pre-
served the property that the original (left-hand plot) Cartesian or polar coordinate curves
intersect at a right angle. This occurs in spite of the fact that globally the shapes of
regions are transformed dramatically – locally, two curves that intersected at a right
angle usually intersect at a right-angle after the mapping has been applied. What is
happening here – and why do things occasionally go wrong? The answer lies in the
conformality property of holomorphic mappings. Consider two curves f1 HtL and f2 HtL
with the property that

f1 @0D = f2 @0D = z0 (16.2)

That is, they intersect at z0 , and we make the convenient choice that this corresponds to
t = 0 for both curves. Suppose that we apply a holomorphic mapping

w = f HzL (16.3)

to a region of the complex plane containing a neighbourhood of z0 . We get a pair of


curves

y1 HtL = f Hf1 HtLL


(16.4)
y2 HtL = f Hf2 HtLL

such that y1 H0L = y2 H0L = w0 = f Hz0 L. The question that we wish to pose and answer is :
What is the angle between the curves f1 and f2 at t = 0, and how is it related to the
angle between the curves y1 and y2 at t = 0? To define the angle between the curves f1
and f2 , we must assume that the tangents to the curves exist at t = 0. A point, z1 , on
f1 in a neighbourhood of z0 is given by
° °
z1 = f1 HDtL = f1 H0L + Dt f1H0L + OHDt 2 L > z0 + +Dt f1 H0L (16.5)

Similarly, a point z2 on f2 in a similar neighbourhood is given by


° °
z2 = f2 HD tL = f2 H0L + Dt f2 H0L + O HDt2 L > z0 + +Dt f2 H0L (16.6)

The angle between the f curves at t = 0 is given by the limit as D t Ø 0 of


z 1 - z0
ArgJ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N (16.7)
z 2 - z0

and this is then given by


°
i f1 H0L zy
Argjjjj ÅÅÅÅÅÅÅÅ
° ÅÅÅÅÅÅÅÅÅ zzz (16.8)
k f2 H0L {
348 Complex Analysis with Mathematica

Similarly, the angle between the y curves is


°
i y1 H0L yz
Argjjjj ÅÅÅÅÅÅÅÅ
° ÅÅÅÅÅÅÅÅÅ zzz (16.9)
k y2 H0L {
But by the chain rule, for i = 1, 2,
° °
yi H0L = f £ Hz0 L fi H0L (16.10)

so we can assert that provided f ' Hz0 L  0, the angles between the two set of curves are
identical. Matters go wrong when the derivative vanishes.

16.4 The area-scaling property


The effect of the derivative being non-zero or zero may also be interpreted in terms of
areas of infinitesimal regions. The following argument assumes that you have taken a
basic multi-variable calculus course. If we consider our mappings as real mappings

u = uHx, yL
(16.11)
v = vHx, yL

then the area magnification factor is given by the Jacobian


Hu, vL
J = ¢ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ¶ (16.12)
Hx, yL

Exercise 16.3 encourages you to use the Cauchy–Riemann equations to show that this is
equal to

† f £ HzL§2 (16.13)

So areas are locally rescaled by a conformal mapping, and are squashed to zero where
the derivative vanishes, which is also where the angle-preserving property fails.

16.5 The fundamental family of transformations


There is a simple family of transforms that lead up to the Möbius transform. The mem-
bers of this simple family are:

(1) translation by a: w = z + a;
(2) rotation by q: w = z‰Âq ;
(3) stretching by a (real): w = az;
(4) inversion: w = 1 ê z;
(5) the general linear transformation, for a, b complex: w = az + b.

By composing all of these maps, we get the Möbius transform, sometimes also called the
bilinear or fractional transform:
16 Conformal mapping I: simple mappings and Mobius transforms 349

az + b
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (16.14)
cz + d

16.6 Ÿ Group properties of the Möbius transform


We can get Mathematica do to quite a bit of the work involved here. First, we wish to
show that a Möbius transform is invertible. So define the mapping in Mathematica thus:

Clear@z, w, WD;
W@zD = Ha z + bL ê Hc z + dL;

We require that ad  bc, because of the derivative being:

Simplify@D@W@zD, zDD
ad-bc
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ
Hd + c zL

The inversion is trivial:

z ê. Solve@W@zD == w, zD@@1DD
dw-b
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a-cw
Let's define another Möbius transform as follows:

Q@z_D = Ha z + bL ê Hg z + dL;

Now we compose the two transforms:

Simplify@Q@W@zDDD
ba+aza+d b+cz b
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
bg+azg+d d+czd

To make it completely obvious what has happened, we group the terms with and without
a z in both numerator and denominator:

Collect@Numerator@%D, zD ê Collect@Denominator@%D, zD
b a + d b + z Ha a + c bL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
b g + d d + z Ha g + c dL

So the composition of two Möbius transforms is also a Möbius transform, and the
inverse of a Möbius transform is also a Möbius transform. Given that there is an obvious
identity mapping that is also a Möbius transform, it is now clear that Möbius transforms
form a group under composition. (If you know precisely what a group is you should
check the remaining group requirement of associativity yourself.). This is a very interest-
350 Complex Analysis with Mathematica

ing group for all sorts of reasons, of both a mathematical and physical character. For
now we content ourselves with a few mathematical observations, but in Chapter 23 the
true significance is revealed as a complex representation of the Lorentz group of special
relativity.

16.7 Other properties of the Möbius transform


If you have done any algebra the fact that Möbius transforms form a group may have
caused you to wonder whether this group is in any sense a symmetry group – is there
some object or set of objects that are left invariant by Möbius transforms? There are in
fact at least two ‘yes’ answers to this question. We shall give one answer here and
another in Chapter 23. Even if you do not know what a group is, the observations made
here a rather ctitical in understanding the effect of Möbius transforms, and in understand-
ing how to build one with specific properties.

‡ A simple characterization of circles and lines


What we wish to establish is that Möbius transformations map the set of all circles and
lines into itself. To establish this it is necessary to have a characterization of circles and
lines that facilitates this observation. There is more than one way of treating circles and
lines to make this straightforward, and we will take an algbraic route. Consider first a
circle, centre a and radius r. The equation of this circle is

†z - a§2 = r2 > 0 (16.15)

which we may expand as

zzê - azê - êê
a z + H†a§2 - r2 L = 0 (16.16)

More flexibly, with A and C real, we consider an equation of the form


êê
Azzê + Bzê + B z + C = 0 (16.17)

This is equivalent to:


êê
zzê + HB ê AL zê + HB ê ALz + C ê A = 0 (16.18)

which is a circle with centre -Bê A and radius-squared given by

B2 - AC
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ (16.19)
A2
So the quadratic equation Eq. (16.17) with A and C real and B2 > AC represents a
circle. For a line, whose real description is

ax + by = c (16.20)

we just have to note that this may be rewritten in complex form as the condition
16 Conformal mapping I: simple mappings and Mobius transforms 351

êê
Bzê + Bz + C = 0 (16.21)

with C real. So combining the cases of A zero and non-zero we see that the set of circles
and lines is characterized by the single condition
êê
Azzê + Bzê + Bz + C = 0 (16.22)

where A and C are real and B2 > AC. It is a line if A = 0 and is a circle otherwise. This
is sometimes referred to as the equation of a circline.

ü Ÿ Mathematica implementation
Let's define the circline condition symbolically. For what follows we remind the reader
that complex conjugation is denoted in Mathematica InputForm by Conjugate and
in output by a star in recent versions. (We have used a bar in the text).

Circline@z_, A_, B_, C_D :=


A z Conjugate@zD + B Conjugate@zD + Conjugate@BD z + C;

Let's also introduce a general symbolic characterization of a Möbius transform:

Möbius@z_, a_, b_, c_, d_D := Ha z + bL ê Hc z + dL

Let's take the equation of a circline and apply it to the Möbius transform of z:

Circline@Möbius@z, a, b, c, dD, A, B, CD

Hb + a zL B B Hb + a zL A Hb + a zL Hb + a zL
C + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
d+cz Hd + c zL Hd + c zL Hd + c zL

First, we simplify it:

Simplify@%D

HA Hb + a zL + B Hd + c zLL Hb + a zL + HC Hd + c zL + Hb + a zL B L Hd + c zL


ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Hd + c zL Hd + c zL

Let's inspect the denominator and numerator:

Denominator@%D

Hd + c zL Hd + c zL

The denominator is just

†d + c z§2 (16.23)

and the numerator is:


352 Complex Analysis with Mathematica

Numerator@%%D

HA Hb + a zL + B Hd + c zLL Hb + a zL + HC Hd + c zL + Hb + a zL B L Hd + c zL

Now, if Möbius[z,a,b,c,d] satisfies the equation of a circline, this numerator


must vanish. What condition does this give on z? This is just another quadratic expres-
sion involving z and its complex conjugate. Let's shorten and simplify it a little:
ê ê
% ê. 8Conjugate@ b + a zD -> b + a ê z,
êêê ê ê
Conjugate@BD -> B, Conjugate@d + c zD -> d + c ê z<
êê êê êê
HA Hb + a zL + B Hd + c zLL Hb + êê
a zê L + HC Hd + c zL + Hb + a zL BL Hd + êê
c zê L

Collect@%, 8z, z ê<D


êê êê êê êê êê êê ê
A b b + B d b + C d d + b B d + HA b êê a + B d êê
a + C d êê
c + b B êê
cL z +
êê êê êê êê êê êê ê
z Ha A b + B c b + c C d + a B d + Ha A a + B c a + c C c + a B êê
êê êê êê c L zL

Let's make some checks. The coefficients not involving z, and multiplying zzê are real,
and the coefficent of z is the complex conjugate of that of zê . So we set:
ê ê ê êê
A' = a A a + B c a + c C c + a B c;
ê ê ê êê
B' = A b a + B d a + C d c + b B c;
êêêêê ê ê ê êê
B' = a A b + B c b + c C d + a B d;
ê ê ê êê
C' = A b b + B d b + C d d + b B d;

We need to check the sign of the primed version of B2 - AC . This is given by:
êêêêê
SimplifyAB ' B ' - A ' C 'E
êê êê êê
-Hb c - a dL HA C - B BL Hb êê
c - êê
a dL

This is B2 - AC times the square of the absolute value of bc - ad, so is positive if the
original B2 - AC was! So the circline equation is preserved in that z also satisfies a
circline equation. As an alternative, note that since a Möbius transformation is the
composition of various translations, rotations, rescalings and inversions, it is sufficient
to check that the circline equation is preserved by each of these separately.

‡ Working with three given points


Sometimes one wishes to find a Möbius transform mapping three given points into three
known image points. This is easily accomplished with Mathematica:

Clear@MöbiusCreator, za, zb, zc, wa, wb, wcD


16 Conformal mapping I: simple mappings and Mobius transforms 353

MöbiusCreator@ z_,
8 za_, zb_, zc_<, 8wa_, wb_, wc_<D :=
Module@8soln<,
soln = Solve@8wa == Möbius@za, a, b, c, 1D ,
wb == Möbius@zb, a, b, c, 1D ,
wc == Möbius@zc, a, b, c, 1D <, 8a, b, c<D;
Möbius@z, a, b, c, 1D ê. soln@@1DDD

MöbiusCreator@z, 80, -I, -1<, 8I, 1, 0<D


Âz+Â
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
1-z

This works fine in Mathematica for finite points. If you know that particular values of z
must end up at zero or infinity, this makes the construction of the numerator and denomi-
nator straightforward, up to a scaling in each, and then a third point can be used to fix
the overall scale. Let's look at our initial example in this light, but now backwards.
Suppose we want the points

8-1, 0, 1< (16.24)

to map to

80, Â, ¶< (16.25)

The numerator must be proportional to Hz + 1L, in order for -1 to map to zero. Similarly,
the denominator must be proportional to Hz - 1L. So the map must be of the form
aHz + 1L
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (16.26)
z-1
and we deduce that

a = -Â (16.27)

in order for the the image of zero to be correct.

‡ Comments
A large number of transformations may be effected by combining Möbius transforms
with simple power functions and other elementary functions. The action of Möbius
transformations is best handled by understanding the circline property and exploring the
behaviour of particular points. When trying to map one region into one seemingly
unrelated, a good policy is to try to break down the mapping into a sequence of simple
mappings that get there step by step. Above all, practice is required to obtain a feeling
for what works! In the exercises below, this idea of composing several simpler mappings
is exploited several times – these questions should be attempted in order as more
complex questions may use the result of the one previous.
354 Complex Analysis with Mathematica

16.8 Ÿ More about ComplexInequalityPlot


It will help with the exercises if you understand how to represent combinations of
inequalities. For example, if you wish to bound one function by two values of its abso-
lute value, or real or imaginary parts, you can just write down a double inequality:

ComplexInequalityPlot@ 1 § Abs@z - ID § Sqrt@2D ,


8z, -5 - 5 I, 5 + 5 I <D

2
1.5
1
0.5

-1-0.5 0.5 1

If you need to combine bounds on different functions, you can use the logical AND
denoted && in Mathematica:

ComplexInequalityPlot@ 1 § Abs@z - ID § Sqrt@2D


&& Abs@z + ID § Sqrt@2D, 8z, -5 - 5 I, 5 + 5 I <D

0.2
0.1
-1 -0.5 -0.1 0.5 1
-0.2
-0.3
-0.4
The logical OR, given in Mathematica by ||, can also be used:

ComplexInequalityPlot@
Abs@zD § 1 ê 2 »» Abs@z - 1D ¥ 2, 8z, -5 - 5 I, 5 + 5 I <D

-4 -2 2 4
-2

-4
16 Conformal mapping I: simple mappings and Mobius transforms 355

Exercises
In Exercises 16.3-10, you are encouraged to use the CartesianConformal and
ComplexInequalityPlot functions to verify any drawings you have made using
Mathematica, preferably after you have thought about them with pen and paper.

16.1 What happens to the angles between curves through the origin under the mapping
w = z2 ?
16.2 What happens to the angles between curves through the origin under the mapping
w = zn , for n = 3, 4, 5, ... etc.?
16.3 Use the Cauchy–Riemann equations to show that the Jacobian is given by

J = † f £ HzL§2

16.4 What is the image of the quadrant

0bArgHzLb ÅÅÅÅp2

under the mapping w = z2 ?

16.5 What is the image of the region


p
0 § ArgHzL § ÅÅÅÅÅÅ
n
under the mapping w = zn , for n a positive integer?

16.6 What is the image of the real axis under the mapping
z-Â
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z+Â
and what is the image of the upper half-plane under the same mapping?

16.7 Find a mapping that takes the wedge

-pê6 § ArgHzL § pê6


into the upper half-plane with the real axis included. [Uses Exercise 16.2]

16.8 Find a mapping that takes the wedge

-pê6 § ArgHzL § pê6


into the closed disk bounded by the unit circle. [Uses Erercises 16.6, 16.7]

16.9 Find a mapping that takes the wedge

-pê4 § ArgHzL § pê4


356 Complex Analysis with Mathematica

into the closed disk bounded by the unit circle. [Similar to Exercise 16.8]

16.10 Consider the region defined by the inequalities


è!!! è!!!
†z - § < 2 †z + § < 2

Draw the region, and verify that the points +1 and -1 lie on its boundary, and that zero
is in its interior. Find a Möbius transform that takes the points 81, -1, 0< to 80, ¶, 1<.
Hence find a mapping that takes the given region into the interior of the unit circle.
[Uses Exercise 16.9]

16.11 Ÿ Using the CartesianConformal and ComplexInequalityPlot


functions, and trying particular values of a, explore the action of the mapping
pz
w = sinJ ÅÅÅÅÅÅÅÅÅ N
a
on the region
a a
ImHzL r 0; - ÅÅÅÅÅ < ReHzL < ÅÅÅÅÅ
2 2
16.12 Ÿ Using the CartesianConformal function and ComplexInequality-
Plot functions, and trying particular values of a, explore the action of the mapping
pz
w = cosJ ÅÅÅÅÅÅÅÅÅ N
a
on the region

ImHzL r 0; 0 < ReHzL < a

16.13 Ÿ Find a Möbius transform that maps the cube roots of unity, 8w, w2 , 1<, into
81, 0, -1<, where

w = ‰2pÂê3
17 Fourier transforms

Introduction
In this chapter we shall explore the notion of a ‘transform’ of a function, where an
integral mapping is used to construct a ‘transformed’ function out of an original func-
tion. The continuous Fourier transform is one of a family of such mappings, which also
includes the Laplace transform and the discrete Fourier transform. The Laplace trans-
form will be discussed in Chapter 18. Numerical methods for the discrete Fourier
transform and for the inversion of Laplace transforms will be given in Chapter 21.
What is the point of such transforms? Perhaps the most important lies in the
solution of linear differential equations. Here the operation of a transform can convert
differential equations into algebraic equations. In the case of an ordinary differential
equation (ODE), one such transform can produce a single algebraic condition that can be
solved for the transform by elementary means, leaving one with the problem of inver-
sion – the means by which the transformed solution is turned into the function that is
desired. In the case of a partial differential equation (PDE), for example in two variables,
one transform can be used to reduce the PDE into an ODE, which may be solved by
standard methods, or, perhaps, by the application of a further transform to an algebraic
condition. Again one proceeds to a solution of the transformed problem. One or more
inversions is required to obtain the solution.
In probability theory the transform of a distribution is called the characteristic
function of the distribution. All the moments of the distribution are easily obtained from
this characteristic function (which is just a complex form of the moment-generating
function), and the Fourier inversion theorem guarantees that the density function can be
recovered from the characteristic function.
This chapter will not constitute a comprehensive investigation of Fourier trans-
form calculus. What we shall do is focus on the relevance of contour integration to
calculate transforms and their inverses – the material developed in Chapter 15 is critical
and should be reviewed now if you are not already familiar with it. Although this will be
our focus, along the way we shall give a brief tour of distributions and the delta-function
– enough to get a proper feel for the inversion theorem in its proper setting and explore
some of the applications to differential equations.
Another approach to managing Fourier transforms is simply to compile a list of
functions, transforms and their inverses, and some rules. The method of contour integra-
tion is then the method of last resort. Of course, contour integration has to be used to
compile some of these tables!
Finally, note that the focus here will be on the full complex form of the trans-
form, using the complex exponential function. Some elementary texts use sine and
cosine trasforms – the view here is that the use of the complex form is much cleaner, and
can always be re-expressed in sine/cosine terms when absolutely necessary, for those
functions posessing the necessary symmetry.
358 Complex Analysis with Mathematica

17.1 Definition of the Fourier transform


Their are many different definitions of the Fourier transform in the literature, all of
which are related by numerical normalization factors involving 2p and -1. Try not to let
this worry you – you just need to be careful about compiling information from different
sources. You should also be aware, if you are using a very old version of Mathematica,
(versions 3.x or earlier) that the default conventions in Mathematica are different in
version 4.x or later from those in earlier versions. Another difference is that from
version 4.x onwards the transforms are in the kernel rather than in an add-on package, as
used to be the case. The definition used here as the default is the following. Given a
function f HxL defined for -¶ < x < ¶, we set

` 1
ÅÅÅÅÅÅÅÅÅ ‡ f HxL ‰Âwx „ x
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.1)
2p -¶

‡ Ÿ Mathematica implementation
The conventions used here are consistent with a large body of common use, particularly
in modern physics and also with Mathematica's defaults. Mathematica has a number of
Fourier-related functions. You can find out what is present by the following query:

? *Fourier*

If you execute that command you will see several functions to try out – what we want
here is to get at the details of the definition of immediate interest:

? FourierTransform

FourierTransform@expr, t, wD gives the symbolic Fourier


transform of expr. FourierTransform@expr, 8t1, t2, ... <, 8w1,
w2, ... <D gives the multidimensional Fourier transform of expr.

So let's ask about the options, thereby getting the default values:

Options@FourierTransformD
8Assumptions ß $Assumptions,
GenerateConditions Ø False, FourierParameters Ø 80, 1<<

Note the appearance of Assumptions and GenerateConditions. Given that


Fourier is essentially an integration, whenever you supply symbolic parameters, you
should supply explicit assumptions about the nature of the parameters. This is for the
same reasons as discussed in Chapter 15. Here, becasue the default is GenerateCondi-
tions -> False , it is especially important. The list FourierParameters is
given in the form 8a, b<, and supplies the general result:
17 Fourier transforms 359


` »b »
f HwL = $%%%%%%%% %%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
1-a ‡
f HtLeÂbwt „ t (17.2)
H2pL -¶

Some common choices for 8a, b< are {0, 1} (default; modern physics), {1, -1} (pure
mathematics; systems engineering), {-1, 1} (classical physics), {0, -2 Pi} (signal
processing).

17.2 An informal look at the delta-function


This section is not meant to be rigorous. It contains a sketch of harder material that you
may wish to skip for now. Our goal is to give enough information to see how the
inversion and convolution theorems may be proved when put in the most appropriate
setting. The point is that a full description of transform calculus makes use of a set of
objects that is rather bigger than the set of all functions – this is the set of all distribu-
tions. One can think about distributions in various ways. Here first is an algebraic view.
Let's forget about functions for a moment and think about ordinary real vectors in n real
dimensions – this constitutes a real vector space V. You can think about ordinary real
space where n = 3 if it helps. Such a vector space has, naturally associated with it, a dual
space, V ' consisting of all linear mappings from V to . The dual space V £ has the same
dimension, n, as V. A very explicit representation can be given. If v œ V, and has
components with respect to a basis ei that are vi , there is a dual basis f i of V £ with
respect to which a vector w œ V £ has components wi . The linear mapping to  is given
by
n
‚ wi vi (17.3)
i=1

Given a notion of distance in V, an explicit isomorphim between V and its dual can be
set up. The distance is usually expressed in terms of a metric function gi j –in Euclidean
space with a standard Cartesian basis it would be 1 if i = j and zero otherwise. The
mapping to  obtained from a vector v and its metric-induced dual is
n n
‚ ‚ vi v j gi j (17.4)
i=1 j=1

and in the Euclidean case it is just the standard inner product


n
‚ vi vi (17.5)
i=1

What does all this have to do with functions? Now consider the set of all continous real
functions f HxL defined on some interval a b x b b, which is possibly infinite in extent.
Given a particular function f and another function gHxL, we can define an element of the
dual space associated with g by the mapping Lg , by the formula
360 Complex Analysis with Mathematica

b
Lg @ f D = ‡ gHxL f HxL „ x (17.6)
a

(It is not important here to consider the convergence issues when one or both of a, b are
infinite.) So any function can be associated with an element of the dual space by this
device – a function can be converted into a mapping from functions to the reals by the
use of integration. Does this mean that the dual space is equivalent to the set of func-
tions?
The answer is a resounding NO! The dual space is much bigger than the original
function space (which is already infinite in dimension), and it is called the set of
‘distributions’. How can we see that it is bigger? The answer takes us straight to the
notion of a ‘delta-function’, which is not really a function at all! Pick a point a in the
interval on which the functions are defined, and set

Da @ f D = f HaL (17.7)

This is a perfectly valid linear mapping that does not arise through the integration of f
against any other continuous function. What we do now is to invent a representation of
such distributions that looks like an ordinary function, and call it

dHx - aL (17.8)

the delta-function, or d-function, with support at a. It has the following properties:

d Hx - aL = 0 if x  a (17.9)
b
‡ f HxLdHx - aL „ x = f HaL (17.10)
a

provided a < a < b. You can think of dHx - aL as being an ‘infinite spike’ located at a
that integrates to unity.

‡ Ÿ The d-function as the limit of a sequence of functions


Although this object is not really a function at all, it is very convenient to think of it in
terms of the limit of a sequence of functions. This ‘limit’ is not the limit in any of the
senses of classical analysis – it is only to be applied under integration. It does not
actually matter what particular sequence of functions is employed, provided that they are
continuous and integrate to unity over the entire real line. Let's introduce two sequences
that do the job. First, let's define D1 as follows.

D1 @e_, x_, a_D :=


1 ê He Sqrt@2 PiDL Exp@-Hx - aL ^ 2 ê H2 e ^ 2LD

In standard mathematical notation (we have also converted the output) it is

TraditionalForm@D1 @e, x, aDD


17 Fourier transforms 361

Hx-aL2
‰- ÅÅÅÅÅÅÅÅ
2e
ÅÅÅÅÅÅ ÅÅ
2

ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!ÅÅÅÅÅÅ (17.11)
2p e

So this is just a Gaussian function. It integrates to unity provided e is real and positive:

Integrate@D1 @e, x, aD,


8x, -Infinity, Infinity<, Assumptions Ø e > 0D

Students of probability or statistics will recognize this as the density function associated
with a normal distribution with mean a and standard deviation e. The second function we
shall introduce is

D2 @e_, x_, a_D := e ê Pi ê HHx - aL ^ 2 + e ^ 2L

In mathematical notation (the output is converted here also) this is


e
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.12)
p HHx - aL2 + e2 L

Integrate@D2 @e, x, aD, 8x, -Infinity, Infinity<,


Assumptions Ø 8Im@aD ã 0, e > 0<D

Students of probability or statistics will recognize this as the density function associated
with a Cauchy distribution centred on a, parametrized by e. Both of these functions have
the property that they integrate to unity, and are peaked at a. (You might like to plot
these functions using Mathematica.) As the parameter e tends to zero, these functions
become more strongly peaked at a. The idea is that their limiting form is precisely that
of a d-function. You can get a better grip on this by considering integrating either
function against a ‘test-function’ f . We can write (from now on the integration range is
fixed as the entire real line):

‡ f HxL Di He, x, aL „ x

¶ ¶
=‡ H f HxL - f HaLL Di He, x, aL „ x + ‡ f HaL Di He, x, aL „ x
-¶ -¶
¶ ¶ (17.13)
= f HaL‡ Di He, x, aL „ x + ‡ H f HxL - f HaLL Di He, x, aL „ x
-¶ -¶

= f HaL + ‡ H f HxL - f HaLL Di @e, x, aD „ x

Now consider what happens as e Ø 0. The last integral has an integrand that is zero at
x = a, because of the factor f HxL - f HaL, but the D-function concentrates itself at this
point, becoming zero elsewhere. Some careful analysis shows that this latter term tends
to zero, leaving us with just f HaL when e = 0. So these D-functions do have a limit that
362 Complex Analysis with Mathematica

is a d-function, when all ‘limits’ are taken assuming an integration is being carried out.
Having got a grip on the d-function, we need to say what it has to do with
Fourier transforms. The concept we are after is to define the Fourier transform of unity,
i.e,

1 Âwx
è!!!!!! ‡ 1 ‰ „ x
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÅÅÅÅ (17.14)
2p -¶

This does not exist at all in the usual sense, but it has a very simple interpretation once
distributions are introduced. The way to get at this is very simple. We replace ‘1’ in the
integral by a function whose limit is unity. There are several choices, but the one that is
most convenient is to consider, for e > 0,

1
ÅÅÅÅÅÅÅÅ
Å
è!!!!!!!ÅÅÅ
Å ÅÅÅ
Å Å ‡ ‰-e†x§ ‰Âwx „ x (17.15)
2 p -¶

This can be done by pen-and-paper in two pieces, or we can get Mathematica to sort it
out. Note that we have said that the imaginary part of w mustg be less than e in magni-
tude. Think about why this must be true for the integral in Eq. H17.15L to converge.

1/Sqrt[2 Pi]Integrate[Exp[-e*Abs[x]]*Exp[I*w*x],
{x, -Infinity, Infinity}, Assumptions Ø {e>0, -e <
Im[w] < e}]
"##### ÅÅÅÅ
2
e
p
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅ
ÅÅÅÅ
e2 + w2
which is precisely
è!!!!!!
2p D2 He, w, 0L (17.16)

That is, we have established that



1 è!!!!!!
ÅÅÅÅÅÅÅÅÅ ‡ ‰-e†x§ ‰Âwx „ x = 2p D2 He, w, 0L
ÅÅÅÅÅÅÅÅ
è!!!!!! (17.17)
2p -¶

Under any subsquent integration over w, we can let e Ø 0, and hence assert that, as a
distribution,

‡ ‰Âwx „ x = 2pdHwL (17.18)

Eq. (17.18) gives the fundamental link between the Fourier transform and the d-function.

‡ Ÿ Mathematica's d-function
In Mathematica the d-function is associated with the physicist P. Dirac, its key inventor.
Its definition is available within the kernel in version 4 or later. See the Calculus pack-
ages if you are using an older version of Mathematica.
17 Fourier transforms 363

? DiracDelta

DiracDelta@xD represents the Dirac delta


function dHxL. DiracDelta@x1, x2, ... D represents
the multidimensional Dirac delta function dHx1, x2, …L.

DiracDelta@xD

dHxL

Mathematica understands the key link between Fourier transforms and the d- function:

FourierTransform@1, t, wD
è!!!!!!!
2 p dHwL

17.3 Inversion, convolution, shifting and differentiation


We are now in a position to give informal distributional proofs of the key results – the
inversion theorem and the convolution theorem. These are stated with our definitional
convention given in Eq. (17.1).

‡ Theorem 17.1: the inversion theorem


Suppose that Eq. (17.1) holds, i.e.

` 1
ÅÅÅÅÅÅÅÅÅ ‡ f HxL‰Âwx „ x
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!!
2p -¶
Then the inversion theorem states that

1 `
ÅÅÅÅÅÅÅÅÅ ‡ f HwL‰-Âwx „ w
f HxL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.19)
2p -¶

Assuming the distributional result from Eq. (17.18) and that some reordering of integrals
is possible, we can give a simple proof. We have:
¶ ¶ ¶
1 ` 1 i y
ÅÅÅÅÅÅÅÅÅ ‡ f HwL‰-Âwx „ w = ÅÅÅÅÅÅÅÅÅ ‡ jj‡ f HyL‰Âwy „ yzz ‰-Âwx „ w
ÅÅÅÅÅÅÅÅ
è!!!!!!
2p -¶ 2p -¶ k -¶ {
¶ ¶ ¶
(17.20)
i 1 y
= ‡ jj ÅÅÅÅÅÅÅÅÅ ‡ ‰ÂwHy-xL „ wzz f HyL „ y = ‡ dHy - xL fHyL „ y = f HxL
-¶ k 2p -¶ { -¶
364 Complex Analysis with Mathematica

ü Ÿ Mathematica inversion

? InverseFourierTransform

InverseFourierTransform@expr, w, tD gives the symbolic inverse Fourier


transform of expr. InverseFourierTransform@expr, 8w1, w2, ... <, 8t1,
t2, ... <D gives the multidimensional inverse Fourier transform of expr.

InverseFourierTransform@Sqrt@2 PiD DiracDelta@wD, w, tD

‡ Theorem 17.2: the convolution theorem


Suppose we have two transforms:
¶ ¶
` 1 1
ÅÅÅÅÅÅÅÅÅ ‡ f HxL‰Âwx „ x ; g` HwL = ÅÅÅÅÅÅÅÅ
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!! ÅÅÅÅÅÅÅÅÅÅ ‡ gHxL‰Âwx „ x
è!!!!!! (17.21)
2p -¶ 2p -¶

The convolution of f with g, @ f * gDHxL, is defined by,



@ f * gDHxL = ‡ f HyL gHx - yL „ y (17.22)

If hHxL = @ f * gD HxL, then the Fourier transform of the convolution is


` è!!!!!! `
hHwL = 2p f HwL g` HwL (17.23)

Here is the proof.



è!!!!!! `
2p hHwL = ‡ ‰Âwx hHxL „ x

¶ ¶ ¶ ¶
ij 1 ` yzij 1 ` y
= ‡ ‰Âwx‡ jj ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
è!!!!!! ‡ Å ÅÅÅÅ f HpL‰-Â p y
„ p z
z j
j ÅÅÅÅÅÅÅÅ
è!!!!!! ‡ gHqL‰
Å ÅÅÅ
Å ÅÅÅÅ -ÂqHx-yL
„ qzzz„ y„ x (17.24)
-¶ -¶ k 2p -¶ {k 2p -¶ {
¶ ¶ ¶ ¶
1 `
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‡ ‡ ‡ „ p „ q „ y „ x‰Âwx ‰- p y ‰-ÂqHx-yL f HpLg̀HqL
H2pL -¶ -¶ -¶ -¶

Doing the y-integration reduces this to


¶ ¶ ¶
`
‡ ‡ ‡ „ p „ q „ x‰Âwx ‰-Âqx f HpLg̀HqLdHq - pL (17.25)
-¶ -¶ -¶

We now use the d-function to do the q integration, leaving us with


¶ ¶
`
‡ ‡ „ p „ x‰ÂHw -pLx f HpLg̀HpL (17.26)
-¶ -¶

Now we integrate by x, to obtain


17 Fourier transforms 365


` `
2p‡ „ pdHw - pL f HpLg̀HpL = 2p f HwLg̀HwL (17.27)

So we have established that


` è!!!!!! `
hHwL = 2p f HwL g` HwL (17.28)

That is, the Fourier transform of the convolution is essentially (up to a normalization)
the product of the transforms. Similarly, if we have the product of two functions in x
terms, the Fourier transform of such a product can be written as the convolution of the
transforms.

‡ The shift and scaling theorems


Theorem 17.3: the shift theorem. This is simply the observation that if

hHxL = ‰Âxa f HxL (17.29)

then
` `
hHwL = f Ha + wL (17.30)

The proof is left to you as Exercise 17.1. Exercise 17.2 asks you to prove:
Theorem 17.4: the scaling theorem. This is the result that if

hHxL = f Hx ê aL (17.31)

then
` `
hHwL = a f HwaL (17.32)

Note also that the Fourier transform is linear. If

hHxL = a f HxL + b gHxL (17.33)

then the transform of h satisfies


` `
hHwL = a f HwL + b g` HwL (17.34)

‡ Theorem 17.5: the differentiation theorem


For applications in mathematical physics the critial observation is the manner in which
differentiation with respect to x becomes simple multiplication by H-ÂwL on the trans-
form. Let

hHxL = f £ HxL (17.35)

then
` `
hHwL = - Âw f HwL (17.36)
366 Complex Analysis with Mathematica

To prove this, we note that this is a point at which we must be a little less cavalier about
the class of functions we are dealing with. From the definition

` 1
hHwL = ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‡ f £ HxL ‰Âwx „ x (17.37)
2p -¶

and we need to be able to write:



` 1 ij  H f HxL ‰Âwx L y
hHwL = ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‡ j ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - Âw f HxL ‰Â wx zz „ x (17.38)
2p -¶ k x {

and use integration to kill the first term – this requires of course that f Ø 0 as x Ø  ¶.
Then we obtain

` 1 `
hHwL = - Â w ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‡ f HxL‰Âwx „ x = - Âw f HwL (17.39)
2p -¶

Provided higher derivatives tend to zero at ±¶ and the derivatives of the function remain
integrable (continuous will do), repeated application of this result can be used to show
that the Fourier transform of the nth derivative is given by
` `
H f HnL L@wD = H-ÂwLn f HwL (17.40)

Note that if the opposite sign convention is employed for the exponent, the right side of
`
this becomes HÂwLn f HwL. There is a corresponding inverse result that multiplication by x
corresponds to differentiation with respect to w – see Exercise 17.3 for the details.

17.4 Jordan's lemma: semicircle theorem II


It is evident that we need general methods for computing integrals of the form

‡ f HxL‰Âwx „ x

A key result for the evaluation of such integrals is Jordan's lemma, which gives very
useful conditions under which the integration region may be completed by a large
semicircle in the upper (or lower) half-plane (UHP or LHP), and hence evaluated by the
calculus of residues. Let's work with the upper half-plane version, where we assume that
w > 0.
Theorem 17.6: Jordan's lemma. Consider the semicircular path

FR @tD = R‰Ât
(17.41)
0§t§p

and let MR be the maximum (formally, the supremum) of » f HzL » on the image of FR in .
Suppose that w > 0 and that as R Ø ¶,

MR Ø 0 (17.42)
17 Fourier transforms 367

Then Jordan's lemma states that

‡ f HzL ‰Âwz „ z Ø 0 (17.43)


FR

as R Ø ¶.

ü Comments
(1) The condition on f is very weak – we just need that the function tends to zero.
(2) If w > 0 then as the imaginary part of z becomes large the integrand is exponentially
damped – this is why we need to associate positive w with the upper half-plane. If w < 0
there is an obvious corresponding result for the lower half-plane.
(3) Once we have this result the answer for the integral for w > 0 is just

2p ‚ Res@ f HzL‰Âwz D (17.44)


UHP

and for w < 0 it is

-2p ‚ Res@ f HzL‰Âwz D (17.45)


LHP

Note the additional minus sign in Eq. (17.44) – we traverse the LHP contour clockwise.
These can give quite different functional forms for the answer, and this is important.

ü Proof of Jordan's lemma


Let's first write the integration in terms of an integral over the path parameter t. We
apply the integration inequality from Section 11.4:
ƒƒ ƒƒ p
ƒƒ ƒ
ƒƒ ‡ FHzL‰Âwz „ z ƒƒƒ b MR ‡ °‰ÂwR‰ ÂR‰Ât • „ t
Ât

ƒƒ ƒƒ (17.46)
ƒ FR ƒ 0

But
Ât
°‰ÂwR‰ ÂR‰Ât • = R†‰ÂwRHcosHtL+ sinHtLL § = R‰-wR sinHtL (17.47)

so that
ƒƒ ƒƒ p pê2
ƒƒ ƒ
ƒƒ ‡ FHzL‰Âwz „ z ƒƒƒ b RMR ‡ ‰-wR sinHtL „ t = 2RMR ‡ ‰-wRsinHtL „ t (17.48)
ƒƒ ƒƒ
ƒ FR ƒ 0 0

Now we have the inequality, valid for 0 b t b p ê 2,


2t
sinHtL r ÅÅÅÅÅÅÅÅÅ (17.49)
p
(some plots with Mathematica, and the concave nature of the sine function in this range
of t, should quickly convince you of this) and so we can state that
368 Complex Analysis with Mathematica

ƒƒ ƒƒƒ pê2
ƒƒ
ƒƒ ‡ FHzL‰Âwz „ z ƒƒƒ b 2RMR ‡ -2wR têp ij pH1 - ‰-Rw L yz
ƒƒ ƒƒ ‰ „ t = 2RM R j ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ z (17.50)
ƒ FR ƒ 0 k 2Rw {
ƒƒƒ ƒƒ
ƒƒ pMR H1 - ‰-Rw L pMR
ƒƒ
ƒƒ ‡ FHzL‰ „ z ƒƒƒ b ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Âwz
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ b ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.51)
ƒƒ FR ƒƒ w w

which tends to zero as required.

17.5 Examples of transforms


A large number of Fourier transforms can now be generated by combining together:

(1) the basic distributional results;


(2) the shift, scaling and differentiation theorems;
(3) applications of Jordan's lemma and the calculus of residues;
(4) other contours invented for various special cases;
(5) Mathematica calculations.

It must be appreciated that one or a combination of these methods must be employed.

‡ An example using the basic distributional properties


What is the Fourier transform of f HxL = sinHa xL? This, by definition, is

` 1
ÅÅÅÅÅÅÅÅÅ ‡ sinHaxL‰Âwx „ x
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.52)
2p -¶

This is best approached by writing the integrand in terms of pure exponential functions:

` 1 i ‰Âa x - ‰-Âax y
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!!ÅÅÅÅÅÅÅÅÅ ‡ jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zz ‰Âwx „ x
2p -¶ k 2Â {

1 1
ÅÅÅÅÅÅÅÅÅ ‡ H‰Â Hw+aL x - ‰Â Hw-aL x L „ x
= ÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅ
2Â è!!!!!! 2p -¶
(17.53)

1 p
ÅÅÅÅÅÅÅÅÅ Hd Ha + wL - d Hw - aLL = Â $%%%%%%
= -Â p ÅÅÅÅÅÅÅÅ
è!!!!!! ÅÅÅÅÅÅ Hd Hw - aL - d Ha + wLL
2p 2

ü Ÿ Checking with Mathematica

FourierTransform@Sin@a tD, t, wD

p p
 $%%%%%%
ÅÅÅÅÅÅ dHw - aL - Â $%%%%%%
ÅÅÅÅÅÅ dHa + wL
2 2

See Exercise 17.4 for the cosine function analogue.


17 Fourier transforms 369

‡ Example using Jordan's lemma


Let's consider the function we have used before in defining d-functions:
e
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.54)
p Hx2 + e2 L

We can now evaluate its transform very quickly, for this function tends to zero for large
z, and hence we can apply Jordan's lemma immediately. For w > 0 the transform is given
by

1 e Âwz 1 2Âe ‰Âwz


ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ 2p ‚ ResA ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÅÅ ‰ E = ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‚ ResA ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ E (17.55)
2p UHP
p Hz2 + e2 L 2p UHP Hz - Â eL Hz + Â eL

In the UHP there is only one pole, at z = Âe, and it is simple. So we cover up the one
singular factor and evaluate the remaining expression to obtain
1
ÅÅÅÅÅÅÅÅÅ ‰-ew
ÅÅÅÅÅÅÅÅ
è!!!!!! (17.56)
2p

For w < 0 a similar calculation can be done in the LHP (Exercise 17.5) to obtain ‰e w .
è!!!!!!
Thus the answer for all real w (it integrates to 1 ë 2p if w=0) is just
1
ÅÅÅÅÅÅÅÅÅ ‰-e†w§
ÅÅÅÅÅÅÅÅ
è!!!!!! (17.57)
2p

‡ An inverse transform using Jordan's lemma


Consider the transform function
` Â
f HwL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.58)
w + Âa
What is the associated f HxL? It is given by the inversion formula Eq. (17.19)

 1
f HxL = ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‰-Âwx „ w (17.59)
2p -¶ w + Âa

Note that now we are integrating over w and the parameter in Jordan's Lemma is -x.
The non-exponential part of the integral tends to zero at infinity so we can go ahead and
apply the lemma. For x > 0 we must complete in the lower half-plane. There is one
simple pole and we get the answer
 è!!!!!! -ax
ÅÅÅÅÅÅÅÅÅ H-2pÂL ‰-Â H-ÂaLx =
f HxL = ÅÅÅÅÅÅÅÅ
è!!!!!! 2p ‰ (17.60)
2p

But for x < 0 we must complete in the upper half-plane, where there are no poles at all!
Hence the answer is then zero.
370 Complex Analysis with Mathematica

ü Ÿ Computational check
Note that Mathematica gets all this straight, though it helps to be told the sign of a:

InverseFourierTransform@
I ê Hw + I a L, w, x, Assumptions Ø a > 0D
è!!!!!!!
‰-a x 2 p qHxL

InverseFourierTransform@
I ê Hw + I a L, w, x, Assumptions Ø a < 0D
è!!!!!!!
-‰-a x 2 p qH-xL

The function q, denoted in Mathematica by UnitStep, takes care of the two cases –
here is a plot of it:

Plot@UnitStep@xD, 8x, -3, 3<,


PlotStyle -> [email protected]

0.8

0.6

0.4

0.2

-3 -2 -1 1 2 3
Note the following, which is often useful and follows from the definition of the
d-function:

D@UnitStep@xD, xD
dHxL

‡ A special contour for Gaussian functions


The transforms of some functions require special treatment. Consider the Gaussian
function

‰-Hx-mL êH2s L
2 2

ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!! (17.61)
s 2p
17 Fourier transforms 371

We have written it this way in order to make the link with the characteristic function for
the normal distribution with mean m and standard deviation s. The Fourier transform of
this is

` 1 2
f HwL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‰-Hx-mL êH2s L ‰Â w x „ x
2
(17.62)
2 p s -¶

The term in the exponential is

Hx - mL2 x2 m m2
Âwx - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅ ÅÅÅ
Å = - ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å + J ÅÅÅÅ
Å ÅÅÅ
Å + ÂwN x - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅ
2s2 2s2 s2 2s2
-x2 - m2 + 2xH m + Âs2 wL
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ
2s2
2 2
-Hx - Hm + Âs2 wLL - m2 + H m + Âs2 wL
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.63)
2s2
2
-Hx - Hm + Âs2 wLL s2 w2
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + Âmw - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2
2s 2
- p2 s2 w2
= ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ + Âmw - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2s 2
where p is the complex shifted variable

p = x - HÂws2 + mL (17.64)

We can make a real change of variables to eliminate m, but what do we do about the
imaginary shift? We can write the result so far as

‰Âwm-s w2 ê2
2
J (17.65)

where the quantity J is


¶-Âws 2
1
‰-q êH2s L „ x
2 2
J = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ (17.66)
2ps -¶-Âws2

Now consider a rectangular contour obtained by taking the contour in the definition of J,
and adding a piece coming backwards along the real axis, joined at both ends, to form a
rectangle. We observe:

(1) there is no contribution from the vertical contours, as the integrand tends to zero;
(2) there are no poles inside the rectangle.

By Cauchy's theorem, the total integral must be zero. Hence we note that
¶ ¶
1 1 1 1
J = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‰-q êH2s L „ x = ÅÅÅÅÅÅÅÅ ‰-q êH2s L „ x = ÅÅÅÅÅÅÅÅ
2 2 2 2
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!! ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅ
è!!!!!! (17.67)
2ps -¶ 2p 2p s -¶ 2p

and hence that


372 Complex Analysis with Mathematica

` 1
ÅÅÅÅÅÅÅÅÅ ‰Âw m-s w ê2
2 2
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.68)
2p

This is almost the ‘characteristic function’ for the normal distribution, which omits the
è!!!!!!
factor 1 ë 2p .

ü Ÿ Checking with Mathematica

FourierTransform@
1 ê HSqrt@2 PiD sL Exp@ -Hx - mL ^ 2 ê H2 s ^ 2LD,
x, w, Assumptions Ø 8s > 0, Im@mD == 0<D
s 2 w2
‰Â m w- ÅÅÅÅÅÅÅÅ2ÅÅÅÅÅÅ ÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
è!!!!!! ! ÅÅÅÅÅÅÅÅ
2p

17.6 Expanding the setting to a fully complex picture


Complex numbers actually play other roles in the management of Fourier transforms. It
is not just a matter of finding the values of integrals using Jordan's lemma and applying
the calculus of residues. In fact, we really need to see transforms as being defined for
complex values of w. Why should we bother with this? In fact it allows us to cope with
transforms of a rather larger class of functions, and furthermore to regard Laplace
transforms and Fourier transforms as being related in a rather trivial fashion, by a
90-degree rotation in the complex plane. Furthermore, the application of Jordan's lemma
requires that the function being integrated is actually holomorphic – when is this so?
In this subsection the independent variable will be taken to be t rather than x.
This is partly to make the link with Laplace transforms easier, as we shall be concerned
here mainly with Fourier transforms of functions that are identically zero for t < 0.
As a motivating example, consider the function
0; t < 0
f HtL = : (17.69)
‰at ; t > 0

where we make no particular requirement on the sign of the real parameter a. The
Fourier transform is just

1
ÅÅÅÅÅÅÅÅÅ ‡ ‰Ha+ÂwLt „ t
ÅÅÅÅÅÅÅÅ
è!!!!!! (17.70)
2p 0

This integral is given by evaluating the difference in the values at the limits of the
indefinite integral

1 ‰tHa+ÂwL
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÅÅÅÅ
è!!!!!! a + Âw ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ (17.71)
2p
17 Fourier transforms 373

Under what circumstances does the limit of this, for t Ø ¶, exist and equal zero? We
need the real part of

a + Âw (17.72)

to be less than zero, i.e.

a < ImHwL (17.73)

Under these circumstances the transform exists and equals


1 1
- ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!! (17.74)
2p Ha + ÂwL

Mathematica can also calculate this:

FourierTransform@UnitStep@tD Exp@a tD, t, wD


1
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅ
2 p Ha + Â wL

So it is convenient to allow the transform variable w to be complex. The transform exists


provided the imaginary part is large enough to kill the exponential growth in the func-
tion being transformed.
The inversion theorem must be adjusted accordingly – we need to do the inver-
sion integration by integating along any horizontal contour above Im@wD = a. We shall
not give a proof of the following remark, but it turns out that this type of behaviour is
absolutely typical for the transforms of functions that are zero for t < 0. More specifi-
cally, let f HtL be zero for t < 0 and satisfy a condition that

† f HtL§ b K ‰at (17.75)

for t > 0 and some real K > 0 and real a. Then the Fourier transform exists and is a
holomorphic function of w for ImHwL > a – the upper half-plane above a – see Dettman
(1984) for a discussion of this, and other related properties. The inversion takes place
along a horizontal contour in the half-plane above a. More generally still, for functions
that are not zero for t < 0, there will typically be a strip in which the transform is
holomorphic. See Exercise 17.7 for an example.

17.7 Applications to differential equations


The most elegant applications of Fourier transforms are those to simple partial differen-
tial equations involving a space variable that extends over the entire real line.

‡ The diffusion equation


Consider the equation, for -¶ < x < ¶ and t > 0,
374 Complex Analysis with Mathematica

2 uHx, tL uHx, tL
ÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.76)
 x2 t
with the initial condition that uHx, 0L = f HyL. We write the spatial Fourier transform as

u` Hw, tL = ÅÅÅÅÅÅÅÅ
1
ÅÅÅÅÅÅÅÅÅ ‡ ‰Âwx uHx, tL „ x
è!!!!!! (17.77)
2p -¶

with the inversion relation



1
ÅÅÅÅÅÅÅÅÅ ‡ ‰-Âwx u` Hw, tL „ w
uHx, tL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.78)
2p -¶

Now, as u satisfies the diffusion equation, u` satisfies the ordinary differential equation

u` Hw, tL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + w2 u` Hw, tL = 0 (17.79)
t
This has the solution

u` Hw, tL = u` Hw, 0L ‰-w t


2
(17.80)

So, using our formula for u at general times,



1
‰-Âwx u` Hw, 0L ‰-w t „ w
2
uHx, tL = ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‡ (17.81)
2p -¶

Substituting for the value of u` at t = 0


¶ ¶
1
uHx, tL = ÅÅÅÅÅÅÅÅÅ ‡ ‰-Âwx ‡ ‰Âwy uHy, 0L „ y ‰-w t „ w
2
(17.82)
2p -¶ -¶

Reorganizing gives

uHx, tL = ‡ f HyLHHx - y, tL „ y (17.83)

where

1
HHz, tL = ÅÅÅÅÅÅÅÅÅ ‡ ‰-Âwz-w t „ w
2
(17.84)
2p -¶

We have already analysed such Gaussians and can identify

‰-z êH4tL
2

HHz, tL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!! ÅÅÅÅÅÅÅÅ (17.85)
2 tp

This can be checked in Exercise 17.8. So the answer is the convolution of the initial data
with this Gaussian function – the Green's function for the heat equation. See Exercises
17.9 and 17.10 for some further worked applications.
17 Fourier transforms 375

‡ Laplace's equation in a half-plane


This follows a very similar pattern to the heat equation. Consider the equation, for
-¶ < x < ¶ and y > 0,

2 uHx, yL 2 uHx, yL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å + ÅÅÅÅÅÅÅÅÅÅÅÅÅ = 0
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.86)
 x2  y2

with the boundary condition that uHx, 0L = f HyL and the requirement that u Ø 0 for large
è!!!!!!!!!!!!!!!
r = x2 + y2 . We write the spatial Fourier transform as

1
u` Hw, yL = ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ ‡ ‰Âwx uHx, yL „ x
è!!!!!! (17.87)
2p -¶
with the inversion relation

ÅÅÅÅÅÅÅÅ!ÅÅ ‡ ‰-Âwx u` Hw, yL „ w
1
uHx, yL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.88)
2 p -¶

Now, as u satisfies the Laplace equation, u` satisfies the ordinary differential equation

2 u` Hw, yL
ÅÅÅÅÅÅ = w2 u` Hw, tL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.89)
 y2

With the condition that the answer tends to zero for large y, this has the solution

u` Hw, yL = u` Hw, 0L ‰-†w§y (17.90)

So using our formula for u at general y:



1 -Âwx `
è!!!!!! ‡ ‰
uHx, yL = ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å ÅÅÅÅ uHw, 0L ‰-†w§y „ w (17.91)
2p -¶
Substituting for the value of u` at y = 0:
¶ ¶
1
uHx, tL = ÅÅÅÅÅÅÅÅÅ ‡ ‰-Âwx ‡ ‰Âwy uHy, 0L „ y ‰-†w§y „ w (17.92)
2p -¶ -¶

Reorganizing gives

uHx, yL = ‡ f HtLHHx - t, yL „ t (17.93)

where now

1 y
HHq, tL = ÅÅÅÅÅÅÅÅÅÅ ‡ ‰-Âwq-†w§y „ w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (17.94)
2 p -¶ p Hq + y2 L
2

by our previous result for the transform of the Cauchy distribution. Hence
376 Complex Analysis with Mathematica


y f HtL
uHx, yL = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ t (17.95)
p -¶ HHx - tL2 + y2 L

This formula is known as the Poisson integral formula for a half-plane. We shall discuss
it again in Chapter 19, where it arises from another approach. See Exercise 17.11 for a
simple application. The answer to Exercise 17.11 should look like:

1
0.75 2
0.5
0.25 1.5
0
-2
2 1
-1
0 0.5
1
2

17.8 Ÿ Specialist applications and other Mathematica


functions and packages
In this book we have focused on those aspects of Fourier transforms that link most
naturally either to complex analysis and the calculus of residues, or to the default
functionality built in to Mathematica.
We will not pursue here the variant transforms that make use of the sine and
cosine functions, though their applications are very important in particular fields. In
situations where f HxL has a particular symmetry, e.g. being odd or even in x, it makes
sense to encode this symmetry within the transform, and use the sine or cosine versions.
These transforms and their inverses are available within Mathematica.

? *Fourier*

System`
Fourier FourierSinTransform InverseFourierCosTransform
FourierCosTransform FourierTransform InverseFourierSinTransform
FourierParameters InverseFourier InverseFourierTransform

For example, in the case of the sine transform, we have:


17 Fourier transforms 377

? FourierSinTransform

FourierSinTransform@expr, t, wD gives the symbolic Fourier sine


transform of expr. FourierSinTransform@expr, 8t1, t2, ... <, 8w1,
w2, ... <D gives the multidimensional Fourier sine transform of expr.

This gives the result of the integration


2
$%%%%%%
ÅÅÅÅÅÅ ‡ f HtLsinHwtL „ t (17.96)
p 0

Such transforms are very useful in particular fields, but do not have the elegant simplic-
ity, in complex analytical terms, of the basic complex exponential form.
When one wishes to work numerically there is a package for doing so:

Needs@"Calculus`FourierTransform` "D

You can find out what is in it, in version 4 or later, by executing the following command:

? Calculus`FourierTransform`*

The long result is suppressed here, but the most important ones here are NFourier-
Transform and its inverse, which allow numerical estimation of the transform and its
imverse. We will be more interested in the kernel function Fourier, which will be
discussed in Chapter 20.

Appendix 17: Ÿ older versions of Mathematica


Prior to version 4 the Fourier transform itself was located within an add-on package.
This can be loaded as follows:

Needs@"Calculus`FourierTransform` "D

Let's find out what we have loaded (note that the returned list of functions is specific to
version 3):

? Calculus`FourierTransform`*

FourierCosSeriesCoefficient InverseFourierSinTransform
FourierCosTransform InverseFourierTransform
FourierExpSeries NFourierCosSeriesCoefficient
FourierExpSeriesCoefficient NFourierExpSeries
FourierFrequencyConstant NFourierExpSeriesCoefficient
FourierOverallConstant NFourierSinSeriesCoefficient
FourierSample NFourierTransform
FourierSinSeriesCoefficient NFourierTrigSeries
FourierSinTransform NInverseFourierTransform
FourierTransform $FourierFrequencyConstant
FourierTrigSeries $FourierOverallConstant
InverseFourierCosTransform
378 Complex Analysis with Mathematica

So we have a great many functions to try out – what we want here is to get at the details
of the definition:

? FourierTransform

FourierTransform@expr, t, wD gives a function of w, which is the


Fourier transform of expr, a function of t. It is defined by
FourierTransform@expr, t, wD = FourierOverallConstant * Integrate@
Exp@FourierFrequencyConstant I w tD expr, 8t, -Infinity, Infinity<D.

The default settings actually defined, in earlier versions, are the following:

`
f HwL = ‡ f HxL ‰Âwx „ x (17.97)

So let's ask about the options, thereby getting the default values:

Options@FourierTransformD

8FourierFrequencyConstant Ø 1,
FourierOverallConstant Ø 1,
DefiniteIntegral Ø False, Assumptions Ø 8<<

The first two of these gives is the old form of the list now entitled FourierParame-
ters. Agreement with the version 4 defaults can be obtained by putting a factor of
è!!!!!!!
1 ë 2 p in front of the integral. This can be set in Mathematica by setting an option
with:

FourierOverallConstant -> 1 ê Sqrt@2 PiD

or, permanently within a kernel session, by setting the default:

$FourierOverallConstant = 1 ê Sqrt@2 PiD

Mathematically, we are then asserting that the transform is now



` 1
f HwL = ÅÅÅÅÅÅÅÅ
Å
è!!!!!! ÅÅÅ
Å ÅÅÅÅ ‡ f HxL ‰Âwx „ x (17.98)
2p -¶

The other main variation is to insert a minus sign in the exponent, which can be achieved
in Mathematica by setting an option

FourierFrequencyConstant -> -1

or, permanently within a session, by setting

$FourierFrequencyConstant = -1

If both these variations were to be used, we would have, for example, the new definition
17 Fourier transforms 379


` 1
ÅÅÅÅÅÅÅÅÅ ‡ f HxL ‰-Âwx „ x
f HwL = ÅÅÅÅÅÅÅÅ
è!!!!!! (17.99)
2p -¶

Exercises
In the following the use of Mathematica should be regarded as an optional extra useful
for verifying answers found by ‘pen and paper’.

17.1 Prove the shift theorem, that if

hHxL = ‰Âxa f HxL

then
` `
hHwL = f Ha + wL

17.2 Prove the scaling theorem, that if

hHxL = f Hx ê aL

then
` `
hHwL = af Hwê aL

17.3 Show that the Fourier transform of

xn f HxL

is given by

 n `
J-Â ÅÅÅÅÅÅÅÅÅÅÅ N f HwL
w
17.4 Show that the Fourier transform of

cos HaxL

is given by
"#####
p
ÅÅÅÅ HdHw - aL + dHa + wLL
2

and use Mathematica to confirm your answer.

17.5 Calculate the Fourier transform of


e
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
p Hx + e2 L
2

for w < 0. (Hint: Use Jordan's lemma in the LHP.)

17.6 Use Jordan's lemma to calculate the inverse transforms of the following:
380 Complex Analysis with Mathematica

1 1 1
ÅÅÅÅÅ2ÅÅÅÅ ; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ ; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a +w
2
Ha2 + w2 L Ha + w L Hb2 + w2 L
2 2

Calculate the answers for both x > 0 and x < 0. Ÿ In each case verify your answers
using Mathematica's InverseFourierTransform function.

17.7 (Care required!) Consider the function f HtL defined piecewise, for a, b real, but not
necessarly positive, by
l -a t
o‰ ; t>0
f HtL = m
o ‰+b t ; t < 0
n
For what values of a, b and w does the Fourier transform of this function exist? When it
exists, how must the inversion be done? Show that the inversion recovers the given
function when the transform exists.

17.8 Ÿ Use Mathematica to calculate the inverse Fourier transform of

‰-w t
2

17.9 At time zero (t = 0), an infinite rod is at temperate T0 dHxL. The temperature at later
times satisfies the heat equation

2 u u
k ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅ
x t
Find the temperature everywhere in the rod for t > 0. For physicists: If the speed of
light is c, evaluate the temperature at the point 2ct. What does this imply about the
speed of heat transfer compared to the speed of light? Does this make sense? What do
you think might be wrong, if anything, with the heat equation?

17.10 At time zero (t = 0), an infinite rod is at temperate T0 in the region -a < x < a,
and is at zero temperature elsewhere. The temperature at later times satisfies the heat
equation

2 u u
k ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅ
x t
Find the temperature everywhere in the rod for t > 0.

17.11 Ÿ A function u satisfies Laplace's equation in the region -¶ < x < ¶ and y > 0.
On the line y = 0 it is given by u = 1 if -a < x < a, and is zero elsewhere. Find the
solution for y > 0. Use Mathematica to plot the result for a = 1 and confirm that the
function looks like that given in Section 17.8.
18 Laplace transforms

Introduction
There is a transform that is closely related to a special case of the Fourier transform,
known as the Laplace transform. While the Laplace transform is very similar, histori-
cally it has come to have a separate identity, and one can often find separate tables of the
two sets of transforms. Furthermore, it is very appropriate to make a separate assessment
of both its inversion, and its applications to differential equations. In the latter context,
Laplace transforms are particularly useful when dealing with ODEs and PDEs defined
on a half-space – in this setting its differential properties are slightly different from the
Fourier transform due to the influence of the boundary.
The goal of this chapter is to define the Laplace transform and explain the basic
results and links to complex variable theory. It should be appreciated that there is an
extensive knowledge base of known transforms and their inverses. Sadly, many of the
excellent books of tables of transforms are old and hard to find if not actually out of
print. You might like to check if your library has copies of the old works by Erdelyi.
One notable exception is the extraordinarily comprehensive series of books by Prudni-
kov, Brychkov and Marichev, in which volumes 4 and 5 (Prudnikov et al, 1998, 2002)
give tables of transforms and their inverses. Although these are expensive, they are in
print, are a worthwhile addition to any library and a must for serious professional use.
For a further supply of problems and another friendly introduction to the theory, the text
by Spiegel (1965) is hard to beat and readily available. You should also note that you
can make quite extensive tables of your own with Mathematica!

18.1 Definition of the Laplace transform


It is conventional to regard the independent variable as t, (which is often a time coordi-
nate). For the transform variable we shall use the symbol s, though books and papers
will often use p or q. We are only interested in functions f HtL defined for

tr0 (18.1)
è
The Laplace transform of f HtL, denoted f HsL, or @L f DHsL when we want to avoid any
confusion, is defined by the integral

è
f HsL = ‡ f HtL ‰-ts „ t (18.2)
0
`
In terms of the Fourier transform f HwL, it is readily noted that on the class of functions
that are zero for t < 0, the Laplace transform satisfies the relationship

è è!!!!!! `
f HsL = ‡ f HtL ‰ÂtHÂsL „ t = 2p f HÂsL (18.3)
0
382 Complex Analysis with Mathematica

and is therefore easily seen as the Fourier transform in complex coordinates rotated by a
right angle in the complex plane. Fortunately, everybody seems to agree about the
conventions for Laplace transforms so there are no further parameters to worry about.
The package definition of Laplace transforms that has to be used prior to version 4 is
consistent with the definition within the kernel in versions 4.x or later.
The class of functions that can be Laplace-transformed, as in the case of the
Fourier transform, depends on whether one regards s as a real variable (with complex
numbers only being introduced to interpret the inversion integral as a contour integration
problem), or as an essentially complex variable. The latter view is much more useful, so
we require that f is integrable on any finite interval, and that f is bounded by a simple
exponential function for t large; i.e. there are real constants M, s0 , T, such that for
t > T,

† f HtL§ b M ‰so T (18.4)

Then the Laplace transform exists in at least the region

ReHsL > s0 (18.5)

ü Example
To make the domain of definition clear, let us consider the exponential function itself, as
we did with the Fourier transform, where we found an upper half-plane (UHP) of
convergence. Since w = Âs, an upper-half-plane of convergence should translate to a
right half-plane (RHP) of convergence in the Laplace coodinate s. We can work this out
directly again for the Laplace transform. We set, for t r 0, f HtL = ‰at , so that

è
f HsL = ‡ ‰tHa-sL „ s (18.6)
0

This will converge (as a function) if and only if

ReHsL > ReHaL (18.7)

and then the transform evaluates to


1
f HsL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.8)
s-a
Note that this has a simple pole at s = a. As a complex function, it is now defined as a
holomorphic function everywhere except s = a. There is certainly a half-plane of
convergence, but once evaluated the transform can be defined on a larger region – this
type of behaviour facilitates the inversion.
18 Laplace transforms 383

18.2 Properties of the Laplace transform


The Laplace transform clearly inherits many properties from the Fourier transform, such
as linearity. It is useful to have separate characterizations of such results as the shift
theorem and differentiation results – the latter is slightly different due to boundary terms.

‡ Theorem 18.1: the shift and scaling theorems


Let gHtL = ‰-at f HtL, then (the proof is Exercise 18.1),
è
gè HsL = f Ha + sL (18.9)

Also, if gHtL = f Ht ê aL, then (Exercise 18.2)


è
gè HsL = a f Ha sL (18.10)

‡ Theorem 18.2: the differentiation theorem


When we proved the differentiation identity for Fourier transforms, we freely assumed
that integration by parts was possible and that there were no boundary terms. When the
integral is cut off at zero, the integration by parts introduces boundary terms. In the
Laplace case, where the boundary is always present, we need to make this explicit. We
shall look at this explicitly for the first and second derivatives. Exercise 18.3 asks you to
look at the general case by the method of induction. Consider the Laplace transform of
f £ HtL: This is (we use the longer notation to avoid confusing the tilde and £ notations)

@L f £ D HsL = ‡ f £ HtL ‰-st „ t
0
¶ -st
ij H f HtL ‰ L y
= ‡ j ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + s‰-st f HtLzz „ t
0 k t { (18.11)

= s‡ f HtL‰-st „ t - f H0L
0
è
= s f HsL - f H0L

If we apply this result again, with f HsL = @L g££ D HsL, we obtain

@L g££ D HsL = s2 èg HsL - sgH0L - g£ H0L (18.12)

For higher derivatives, see Exercise 18.3. We shall find these results very useful in
building in initial conditions to the solution of ordinary differential equations.
384 Complex Analysis with Mathematica

‡ Other identities and the holomorphic property


What about the Laplace transform of t f HtL, or tn f HtL? This is related to the derivative of
the Laplace transform, and we can show quite easily that the Laplace transform is
actually differentiable and hence holomorphic in a suitable region. Let's proceed naively
at first. We have
è ¶
IŸ0 f HtL ‰-st „ tM
 f HsL (18.13)
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
s s
Now assuming that we can differentiate under the integral, this is just
è ¶
 f HsL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = - ‡ t f HtL ‰-st „ t (18.14)
s 0

so that if this differentiation can be carried out, we see that the required Laplace trans-
form of t f HtL is
è
 f HsL
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.15)
s
If the Laplace transform is holomorphic, this procedure may be repeated as many times
as we like, so that the Laplace transform of tn f HtL is
è
n f HsL
H-1L ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
n
ÅÅÅÅÅ (18.16)
sn
But is the Laplace transform actually differentiable as a complex function? The answer
is yes, and now that we know what the derivative must look like, if it exists, we can
prove it. So consider
ƒƒ è è ¶ ƒƒ
ƒƒ f Hs + hL - f HsL ƒ
ƒƒ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ‡ t f HtL „ t ƒƒƒ (18.17)
ƒƒ ƒƒ
ƒƒ h 0 ƒƒ

If we can show that this tends to zero as h Ø 0 we will have shown that the transform is
differentiable. We can use the shift theorem to simplify this to
ƒƒ ¶ i ‰-ht - 1 y ƒƒ
ƒƒ ƒ
ƒƒ ‡ jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + tzz ‰-st f HtL „ t ƒƒƒ (18.18)
ƒƒ ƒƒ
ƒ 0 k h { ƒ
But the exponential function has a series expansion, so we can write

‰-ht - 1 H-htLn
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + t = ‚ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.19)
h n=2
hn !

This is of order h and so it is just a matter of tidying up on some analysis. Note that
18 Laplace transforms 385

ƒƒ ¶ -ht ƒƒ ƒƒ ¶ ¶ ƒƒ
ƒƒ ij ‰ - 1 yz -st ƒƒ ƒƒ H-htLn -st ƒƒ
ƒƒ ƒ ƒ ƒ
ƒƒ ‡ j ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + tz ‰ f HtL „ t ƒƒƒ b ƒƒƒ ‡ ‚ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‰ f HtL „ t ƒƒƒ
ƒƒ 0 k h { ƒƒ ƒƒ 0 n=2 hn ! ƒƒ
ƒ ƒ ƒ ƒ (18.20)

-st
b †h§‡ t ‰
2 t»h»
†‰ f HtL§ „ t
0

Now assuming that the transform exists for ReHsL > s0 , let m be the real positive constant
defined by

2m = ReHsL - s0 (18.21)

and constrain h so that

†h§ < m (18.22)

Then we have

ReHh + sL > m + s0 (18.23)

and so
¶ ¶
†h§‡ t 2 ‰t»h» †‰-st f HtL§ „ t b †h§ ‡ t2 ‰-Hs0 + mLt † f HtL§ „ t (18.24)
0 0

The integral converges by virtue of Eq. (18.4), and so this term tends to 0 as h Ø 0. So
the Laplace transform is differentiable, and hence holomorphic in the right half-plane of
convergence.

‡ Ÿ Mathematica and the Laplace transform


Many such transforms can easily be evaluated by standard integration, using substitu-
tions and tables of integrals. Mathematica has a pair of built in functions to carry out the
transform and its inverse. Prior to version 4.x you had to load a package to carry out the
computation. It was in the Calculus area and called LaplaceTransform. So with
much older versions you need to type (most readers will not need to do this)

Needs@"Calculus`LaplaceTransform` "D

before proceeding. Let's find out about the key function of interest:

? LaplaceTransform

"LaplaceTransform@expr, t, sD gives the Laplace transform of


expr. LaplaceTransform@expr, 8t1, t2, ... <, 8s1, s2, ... <D
gives the multidimensional Laplace transform of expr.

Here are two examples:


386 Complex Analysis with Mathematica

LaplaceTransform@Exp@a tD, t, sD
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
s-a

LaplaceTransform@Sin@a tD,
t, s, Assumptions Ø Im@aD ã 0D
a
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
a + s2
2

Several other standard calculations are given in Exercise 18.4. In each case you should
check your answers against those of Mathematica.

‡ Making tables of transforms with Mathematica


The results of Exercise 18.3 can be extended somewhat using the capabilities built in to
Mathematica. In fact, you can generate entire tables of transforms in a few moments.
Here is an extended set. The output style has been converted to that of a displayed
equation, and an asumption that a and b are real has been applied. You might like to
make your own tables from Mathematica, and print them out.

funclist = 81, t, t ^ 2, t ^ a, t ^ a Exp@-a tD,


Sin@a tD, Cos@a tD, Exp@-a tD Cos@b tD,
Exp@-a tD Cos@b tD, Sinh@a tD, Cosh@a tD,
Erf@a Sqrt@tDD<;
tranlist = Map@LaplaceTransform@#, t, s,
Assumptions Ø 8Im@aD ã 0, Im@bD ã 0<D &, funclistD;
TraditionalForm@TableForm@Transpose@
8funclist, tranlist<DDD

1 ÅÅÅÅ1s
t ÅÅÅÅ
s2ÅÅ
1

t2 ÅÅÅÅ
2
s3
ÅÅ
ta s-a-1 GHa + 1L
‰-a t t a Ha + sL-a-1 GHa + 1L
sinHa tL ÅÅÅÅÅÅÅÅ
a
ÅÅÅÅÅÅ
a 2 +s2
cosHa tL ÅÅÅÅÅÅÅÅ
s
ÅÅÅÅÅÅ (18.25)
a 2 +s2
‰-a t cosHb tL ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+s
b 2 +Ha+sL2
ÅÅÅÅÅÅÅÅ
‰-a t cosHb tL ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+s
b 2 +Ha+sL2
ÅÅÅÅÅÅÅÅ
sinhHa tL ÅÅÅÅÅÅÅÅ
a
s2 -a2
ÅÅÅÅÅÅ
coshHa tL ÅÅÅÅÅÅÅÅ
s
s2 -a2
ÅÅÅÅÅÅ
è!!
erfIa t M ņa§
ÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅÅ
2 !!!!
s a +s
18 Laplace transforms 387

18.3 The Bromwich integral and inversion


The Fourier inversion result can be rotated by a right angle to get the Laplace transform
inversion integral, sometimes called the Bromwich integral. For f continuous, whose
transform exists, we have
c+¶
1
f HtL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HsL ‰st „ s (18.26)
2p c-¶

where c > s0 . That is, we take a vertical infinite line within the right half-plane of
convergence (to the right of any singularities), and integrate along this contour. The
details of the derivation from the Fourier result are straightfoward and given in Exercise
18.5. You should try to understand now why Eq. (18.26) and the choice of c guarantee
that f HtL = 0 for t < 0. The explanation is given in Section 18.4.

‡ Use of a ‘knowledge base’ for inversion


One can avoid the direct use of this contour integration for a large number of cases. For
example, suppose that we arrive at a transform given by
è a+s
f HsL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ (18.27)
b + Ha + sL
2

How is one going to determine f HtL? Quite clearly the quickest answer is to consult the
table given by Eq. (18.25), from which the result may be deduced. A great many simple
cases may be deduced by such methods, and you should not hesitate to use such meth-
ods. You can of course also ask Mathematica:

InverseLaplaceTransform@Ha + sL ê Hb ^ 2 + Ha + sL ^ 2L, s, tD

‰-a t cosHb tL

Mathematica also knows how to make use of the rules:

InverseLaplaceTransform@19 ! ê Hs + I aL ^ 20, s, tD

t19 HcosHa tL - Â sinHa tLL

18.4 Inversion by contour integration


The Bromwich integral can, when other methods fail, be computed by direct integration.
We employ, as you might have guessed, a rotated version of Jordan's lemma to deal with
the matter. As always, inspection of the exponentials in the integrand is a good guide to
when and where the semicircles of integration can be added. So let's look at the inver-
sion integral:
388 Complex Analysis with Mathematica

1 c+¶
è
f HtL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HsL ‰st „ s (18.28)
2p c-¶

When t < 0 the integrand decays strongly as the real part of s becomes large and positive
– this is a useful reminder that the rotated Jordan's lemma must be applied to a large
semicircle in the right-half-plane. Since the transform is holomorphic in this region, the
answer from integrating over the closed contour (obtained by joining this semicircle to
the Bromwich contour) is identically zero, by Cauchy's theorem. Hence f HtL ª 0 for
t < 0. When t > 0 matters are rather different. If f HsL contains only a finite number of
poles, we can add a large semicircle in the left half-plane and apply Jordan's lemma
again and use the calculus of residues to deduce that:
è
f HtL = ‚ Res@ f HsL ‰st D (18.29)
LHP
è
where the LHP is the region s < s0 < c. When f HsL has a branch cut, one of two situa-
tions apply. If the branch cut is made between two finite points, and Jordan's lemma can
be applied, we get a contribution from Eq. (18.29) plus a contribution from winding
around the branch cut, which may or may not be expressible in terms of simple func-
tions. If the branch cut goes off to infinity, the contour cannot be closed and one must
use special methods to obtain the answer, and numerical methods may be needed.

ü Inversion example 1
Consider again the function
è a+s a+s
f HsL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.30)
b + Ha + sL
2 Hs + a + ÂbL Hs + a - ÂbL

The denominator of this expression is zero at the two points

s = -a  Âb (18.31)

and the transform has a simple pole at each point. Eq. (18.29) gives us

Ha + H-a - ÂbLL ‰H-a-ÂbL t Ha + H-a + ÂbLL ‰H-a +ÂbL t


f HtL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.32)
HH-a - ÂbL + a - ÂbL HH-a + ÂbL + a + ÂbL

which simplifies to
1
ÅÅÅÅÅ ‰-Ha+bÂL t H1 + ‰2Âbt L = ‰-at cosHbtL (18.33)
2
as before. Some more examples of this type are given within Exercise 18.6. Although
they can be done by other methods, those examples are also valuable practice for the
application of the calculus of residues.

ü Inversion example 2
This is a much more subtle example. Suppose the transform is
18 Laplace transforms 389

1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅÅÅÅÅ
ÅÅÅÅ!ÅÅ
!!!!!! (18.34)
a 2 + s2
This has no poles, but has a branch cut extending between  Âa. But Jordan's lemma
applies, so we begin by adding a large semicircle in the left half-plane. Now we deform
this until it wraps completely around the branch cut. We split the integral into two pieces:

(1) piece one takes us from -Âa to +Âa on the right side of the branch cut. We write
s = Âu and write the contribution to the integral as

1 a
‰Âut
ÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ u (18.35)
2p -a a2 -!!!!!!!
è!!!!!!!!
u2
(2) piece two takes us from +Âa to -Âa down the left side of the branch cut. The signs of
the integrand need careful management. As we move around a small circle from the top
right of the right side of the full contour to the top left, to begin this second peice, we
pick up a minus sign from the square root. But we are also integrating downwards. So
we get another copy of Eq. (18.35) with the same overall sign. So we deduce that

1 a ‰Âut 1 a cosHutL
f HtL = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ! ÅÅÅÅÅÅ „ u = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
!!!!!! ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ „ u (18.36)
p -a a2 - u2 p -a è!!!!!!!!a2 - u2
!!!!!!!

where the last step applies as the denominator of the integrand is even. What is this
function? For this you may need to consult a table of integrals related to special func-
tions. Here we can just ask Mathematica to tell us the answer in terms of Bessel
functions:

Integrate@1 ê Pi Cos@u tD ê Sqrt@a ^ 2 - u ^ 2D,


8u, -a, a<, Assumptions Ø 8a > 0, t > 0<D
J0 Ha tL

You can run another check as well:

LaplaceTransform@BesselJ@0, a tD, t, sD
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅÅÅÅÅ
ÅÅÅÅ!ÅÅ
!!!!!!
a 2 + s2

ü Ÿ Inversion example 3
è è!!!
f HsL = ‰-x s (18.37)

This is a very important case, which we shall ask Mathematica for:


390 Complex Analysis with Mathematica

InverseLaplaceTransform@Exp@-x Sqrt@sDD, s, tD
x2
‰- ÅÅÅÅ4ÅtÅÅ x
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!ÅÅÅÅÅÅÅÅÅÅÅÅÅ
2 p t 3ê2

A closely related case that is relatively straightforward to manage by contour integration


is given in Exercise 18.7. A discussion of the case here is given in the next section and
in Exercise 18.10.

18.5 Convolutions and applications to ODEs and PDEs


There are many applications of Laplace transforms to differential equations. Many of
these involve the convolution theorem for Laplace transforms, which we now state.

‡ Theorem 18.3: the convolution theorem for Laplace transforms


Let f HtL and gHtL be functions with Laplace transforms f HsL and gHsL respectively. We
know that as Fourier transforms, with f and g identically zero for negative values of
their arguments, the convolution theorem holds – we have
è `
f HsL = f HÂsL , gè HsL = g` HÂsL (18.38)

hHtL = @ f * gD HtL = ‡ f HtL gHt - tL „ t (18.39)

` è!!!!!! `
hHwL = 2p f HwL g` HwL (18.40)
è!!!!!!
Hence, on sorting out the factors of 2p , we can assert immediately that the convolu-
tion theorem for Laplace transforms holds: if f , g, h are as above, then
è è
hHsL = f HsL gè HsL (18.41)

The important point is to notice that the limits of the convolution in the definition of h
are not in fact infinite. Since f HtL vanishes for t < 0, and gHt - tL vanishes for t > t, the
integral for the convolution h is actually
t
hHtL = @ f * gD HtL = ‡ f HtL gHt - tL „ t (18.42)
0

The relevance of this to differential equations is that we can often think of the differen-
tial equation as having two components – a differential operator, and initial and/or
boundary conditions and sources. The same operator may be associated with many
different boundary conditions and sources, and the transform approach reveals that the
solution to the problem is a convolution of a function associated with the operator, and
functions associated with the particular sources and/or boundary conditions.
18 Laplace transforms 391

‡ Second-order linear ODEs


Let's consider a family of linear systems of the form

2 yHtL  yHtL
ÅÅÅÅ + b ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + cyHtL = f HtL
a ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.43)
t 2 t
We Laplace-transform the entire equation, to obtain
è
aHs2 yè HsL - syH0L - y£ H0LL + bHsyè HsL - yH0LL + cyè HsL = f HsL (18.44)

We reorganize this to
è
Has2 + bs + cL yè HsL = f HsL + asyH0L + ay£ H0L + byH0L (18.45)

So the transform is, immediately,


è
f HsL + asyH0L + ay£ H0L + byH0L
yè HsL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.46)
as2 + bs + c
We can see that the differential operator is characterized by the denominator, while the
source f and the initial conditions are lumped together in the numerator. It is clear that if
we can find the inverse Laplace transform of
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.47)
as2 + bs + c
then the solution for any collection of source terms and initial conditions is a convolu-
tion of the inverse of this function and the inverse of the numerator. This picture is quite
useful for developing general theory, but in practice we wish to consider practical
examples. Here is one. Some more for you to try are given in Exercise 18.8.

2 yHtL  yHtL
ÅÅÅÅ + 2 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + yHtL = 0
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.48)
t2 t
with yH0L = 0, y£ H0L = 1. Clearly,
1 1
yè HsL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ (18.49)
s +2s+1
2
Hs + 1L

There is a double pole at s = -1, and we need to evaluate


1 ‰st ƒƒƒ
yHtL = „ ResA ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ ‰s t E = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ƒƒƒƒs=-1 = t‰-t (18.50)
Hs + 1L s ƒ
s=-1

There are many ways of checking the answer. Here is one direct alternative that uses the
Mathematica function DSolve:
392 Complex Analysis with Mathematica

y@tD ê. DSolve@8y ' '@tD + 2 y '@tD + y@tD == 0,


y@0D == 0, y '@0D == 1<, y@tD, tD@@1DD

‰-t t

‡ Systems of first-order ODEs


Another common and important problem is that of an ordinary differential equation for a
vector yi HtL:
n
 yi @tD
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ‚ Ai j y j @tD + fi @tD (18.51)
t j=1

or, more compactly, as a matrix equation:

y° = Ay + f (18.52)

When the matrix A consists of constants, clearly the same approach may be applied:
è
s yè HsL - yè H0L = Ayè HsL + f HsL (18.53)

This is rearranged to give


è
HsI - ALyè HsL = f HsL + yè H0L (18.54)

and then inverted as a matrix equation to yield


è
yè HsL = HsI - AL-1 H f HsL + yè H0LL (18.55)

This is a particularly elegant description as the poles in this function are given neatly as
the eigenvalues of the matrix A. Again, this observation is useful for developing general
theory, particularly in Control Theory applications. Sometimes, especially for small n,
we can proceed more directly. As an example, consider the system with
 y1 HtL  y2 HtL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = y1 HtL - y2 HtL; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = y2 HtL - y1 HtL; y1 H0L = 1; y2 H0L = 0 (18.56)
t t
Here we have f = 0, the matrix A is
1 -1
J N (18.57)
-1 1

and the vector yH0L is


1
J N (18.58)
0

The solution for the transformed vector is

s - 1 1 -1 1
J N J N (18.59)
1 s-1 0
18 Laplace transforms 393

which evaluates to

ij ÅÅÅÅÅÅÅÅ
s-1
ÅÅÅÅÅÅ yz
jj s2 -2 s zz
j z (18.60)
k - ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
1
s2 -2 s {
This may be inverted piece by piece, using any of the methods, to obtain

ij ÅÅÅÅ12 + ÅÅÅÅ
2t
y
jj 2ÅÅÅÅ zzz
jj 1 ‰2t z
z (18.61)
ÅÅÅÅ
k 2 - ÅÅÅÅ
Å
2 {
ÅÅÅ

As usual, this can be checked with Mathematica:

8x@tD, y@tD< ê. DSolve@8D@x@tD, tD == x@tD - y@tD,


D@y@tD, tD == y@tD - x@tD, x@0D == 1, y@0D == 0<,
8x@tD, y@tD<, tD

H ÅÅÅÅ12 H1 + ‰2 t L ÅÅÅÅ12 H1 - ‰2 t L L

You should not be put off learning the analytical methods just because Mathematica can
do it directly more quickly – here we want to use Mathematica as a checking tool, so the
example given was simple enough to be done many different ways. Some examples of
the transform method applied to systems of ODEs are given in Exercise 18.9.

‡ The heat equation with zero initial data and a boundary condition
Let's consider the heat equation

2 uHx, tL uHx, tL
ÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.62)
 x2 t
in the region

x > a, t > 0 (18.63)

with the following boundary and initial conditions:

uHa, tL = gHtL ; uHx, 0L = 0 for x ¥ a (18.64)

We also demand that at infinity

lim uHx, tL = 0 (18.65)


xض

This type of problem has many interpretations. The simplest is that of a semi-infinite rod
whose temperature is initially zero, but where one end is subsequently as a temperature
gHtL. This is a good place to use a time-based Laplace transform, as the initial data are
zero, making the Laplace transform of the time-derivative simple. We set

uè Hx, sL = ‡ uHx, tL ‰-st „ t (18.66)
0
394 Complex Analysis with Mathematica

Then the Laplace transform of the diffusion equation gives us

2 uè Hx, sL
ÅÅÅÅ = s uè Hx, sL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.67)
 x2
The solution of this vanishing at infinity is
è!!! è!!!
uè Hx, sL = uè Ha, sL ‰- s Hx-aL = gè HsL ‰- s Hx-aL (18.68)

where the Laplace transform of the boundary condition is



gè HpL = ‡ gHtL ‰-pt „ t (18.69)
0

It follows that the solution is the convolution of gHtL with the inverse Laplace transform
è!!!!
of ‰- p Hx-aL , which we have already found. The solution is therefore just
Hx-aL2
t - ÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅ ÅÅÅ
1 ‰ 4 Ht-tL Hx - aL gHtL
uHx, tL = ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
è!!!! ‡Å ÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ t
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.70)
2 p 0 Ht - tL3ê2

By a change of variables, this may be reorganized to


sHx-aL 2
¶ - ÅÅÅÅÅÅÅÅÅÅÅÅ
1 ‰ 4 ÅÅÅÅÅÅÅÅ Hx - aL gHt - 1 ê sL
uHx, tL = ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
è!!!! ‡Å ÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅ „ s
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.71)
2 p 1êt s1ê2

Let's work out a particular example, with g = 1. We let q = Hx - aL > 0.

Integrate@HExp@-H1 ê 4L * s q ^ 2D * qL ê H2 Sqrt@ Pi sDL,


8s, 1 ê t, Infinity<, Assumptions Ø 8q > 0, t > 0<D
i q yz
erfcjjj ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ zz
è!!!
k2 t {
In our problem we have x > a, so that we can now write down the result as:

i x - a yz i x - a yz
erfcjjj ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ zz = 1 - erf jjj ÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅÅ zz
è!!! (18.72)
k2 t { k2 t {
Note that erfH0L = 0 and erfH¶L = 1, so this solution is unity when x = a and vanishes
when t = 0, or x Ø ¶. The integral for a general g, in the form we have given, can be
extremely awkward to manage (see Exercise 18.10). Here is a plot of the result for a = 0.
18 Laplace transforms 395

Plot3D@Erfc@x ê H2 Sqrt@tDLD, 8x, 0, 2<, 8t, 0.0001, 1<D

1
0.75 1
0.5
0.25 0.8
0 0.6
0
0.5 0.4
1 0.2
1.5
2

18.6 Conformal maps and Efros's theorem


In Chapter 16 we discussed conformal maps. The pedagogical applications of conformal
mapping to potential theory exploit the chain rule for holomporhic functions and the
preservation of certain types of boundary condition under conformal maps (e.g wedges,
Joukowski aerofoilds). This will be discussed in Chapter 19. The question we will
discuss here is what happens when we try to marry conformal mapping to Laplace
transform theory? We can consider this in two different ways. First, if we have a Laplace
è è
transform pair f HtL and f HsL, what function of time is associated with f HmHsLL, where mHsL
is a holomorphic function associated with a conformal mapping? Second, if we have a
(presumably real) mapping t Ø tHtL, what is the Laplace transform of f HtHtLL? Consider-
ing the first case, transforms with a structural form of the type
è è
f HmHsLL or GHsL f HmHsLL

where mHsL and GHsL are simple functions are commonplace. For example, in diffusion
theory and related financial applications it is very common to generate transforms where
m is a simple square root function.

‡ Theorem 18.4: Efros's theorem


According to the series of volumes by Prudnikov et al (1998, 2002), the relevant general-
ized multiplication theorem was written down by A. M. Efros in 1935. Suppose that f HtL
è
has Laplace transform f HsL and that we can find a function gHt, zL such that

‡ ‰-st gHt, zL „ x = GHsL ‰-z mHsL (18.73)
0

then let
396 Complex Analysis with Mathematica


HHtL = ‡ f HzL gHt, zL „ z (18.74)
0

Then the Laplace transform of HHtL is given by


¶ ¶ ¶
è ij y
H HtL = ‡ j‡ f HzL gHt, zL „ z zz ‰-st „ x = GHsL ‡ f HzL ‰-z mHsL „ z
0 k 0 { 0 (18.75)
è
= GHsL f HmHsLL

Note that Eq. (18.75) contains the proof as well as the statement of the result.

ü Corollary: the ordinary convolution theorem


If we set mHsL = s in the above, then

‡ ‰-st gHt, zL „ x = GHsL ‰-z s (18.76)
0

So gHt, zL = gHt - zL and is zero for t < z. Then


t
HHtL = ‡ f HzL gHt - zL „ z (18.77)
0

with Laplace transform


è
GHsL f HsL (18.78)

so that Efros's theorem is indeed a generalization of the usual convolution theorem we


stated as Theorem 18.3.

ü An example
Chapter 1 of both volumes 4 and 5 of Prudnikov et al (1998, 2002) contain several
examples. Here is another example relevant to diffusion and finance theory.
è!!!!!!!! !!!!!!!!
mHsL = n2 + 2 s
1 (18.79)
GHsL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
s+g

ij è!!!!!!!!!!!!!!!! ij - z + è!!! 2 t "######## n 2 ###### y


ÅÅ - g zzz
ÅÅÅÅ
jj - n2 -2 g z jj
gHt, zL = ‰ -g t jj‰ Fjjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!
2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zzz +
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
jj j z
t
k k {
(18.80)
ij -z - è!!! 2 t "######## n2 ###### y y
ÅÅ - g zzz zzz
ÅÅÅÅ
è!!!!!!!!!!!!!!!! j
‰ + n2 -2 g z
Fjjjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!
2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zzz zzz
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
j t zz
k {{
here F is the cumulative normal distribution function.
18 Laplace transforms 397

ü An application of our example


è è!!!!
Let's consider a simple case where g = n = 0 and f HsL = ‰-Hx-aL së 2 . The transform is
then
è!!!
‰-Hx-aL s
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (18.81)
s
which is appropriate to the PDE for the heat equation considered in Section 18.5. For
this case

i -z yz ij z yz i z yz
gHt, zL = 2 Fjjj ÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅ zz + 1 = 1 - erf jjj ÅÅÅÅÅÅÅÅ
è!!ÅÅÅÅÅ zz = erf jj- ÅÅÅÅÅÅÅÅ
è!!!!! è!!!!!ÅÅÅÅÅÅÅÅ zz (18.82)
k t { k 2t { k 2t {
è
and this times the inverse transform of f HsL, with the inverse considered as a function of
z, must be integrated with respect to z. But the inverse transform of
è Hx-aLs
- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅ
f HsL = ‰ è!!!!2 (18.83)

is just

i x - a zy
d jjjz - ÅÅÅÅÅÅÅÅ
è!!! ÅÅÅÅÅÅÅÅ zz (18.84)
k 2 {
è!!!
so the integration reduces to setting z = Hx - aL ë 2 and we are led once again to the
solution of the PDE in the form

i x - a yz
1 - erf jjj ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ zz
è!! (18.85)
k2 t {

ü Changes of time coordinate


These are not usually regarded as complex conformal maps (but in a fundamental
symmetric Fourer transform picture they could be). What do we do about changes of
time variables? What does this induce on the transform? Symmetry suggests a reverse
form of Efros's result, with transforms that are generalized convolutions. An interesting
example is a result written down at the very end of Chapter 1 of Prudnikov et al (2002).
è
Let f HtL have Laplace transform f HsL, then

è
‡ f HsL J p Ha sL „ s (18.86)
0

is the Laplace transform, with coordinate p, of

f HasinhHtLL (18.87)

How does this come about? Let's see how by establishing a simple and closely related
result. Let f HtL be given with transform
398 Complex Analysis with Mathematica


è
f HsL = ‡ ‰-st f HtL „ t (18.88)
0

Consider now the generalized convolution, with Laplace argument p, and where we
replace t by v:
¶ ¶ ¶
è
‡ f HsL ‰-s I p HsL „ s = ‡ f HvL „ v ‡ ‰-sv ‰-s I p HsL „ s (18.89)
0 0 0

If we let u = v + 1, this integral is equal to (using a standard result for the transform of a
modified Bessel function)
¶ ¶
‡ f HvL „ v ‡ ‰-su I p HsL „ s
0 0
¶ ¶ -1 (18.90)
f HvL f HvL ‰-s cosh HuL
= ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ! !!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ! ÅÅÅÅ
!!!! Å ÅÅÅÅ
s Å „ v = è!!!!!!!! !!!!!ÅÅÅÅÅÅÅÅÅÅÅÅÅ „ v
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
0 u2 - 1 Iu + u2 - 1 M 0 u2 - 1

and we can now carry out the inversion s Ø t, and obtain, writing u = v + 1 explicitly
now:

f HvL d@t - cosh-1 Hv + 1LD
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! !!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ v
0 u2 - 1

(18.91)
= ‡ f HvL d@coshHtL - Hv + 1LD „ v = f Hcosh@tD - 1L
0

Which means that



‡ FHqL‰-q I p HqL „ q (18.92)
0

is the Laplace transform of

f HcoshHtL - 1L (18.93)

and we have figured out how to invert a Laplace transform whose variable is given by
the index of a modified Bessel function, provided it appears under an integral with a
function that is the Laplace transform of another function. The exponential is in there for
technical reasons, as coshH0L = 1. The example with the Bessel function and the change
of variables involving sinhHtL can be proved in a similar way. This is left to you as
Exercise 18.11. Other examples can be worked out on a case by case basis.

Exercises
Those exercises containing a supplementary Mathematica component in addition to a
pen and paper exercise are denoted [Ÿ].
18 Laplace transforms 399

è
18.1 Prove the shift theorem, that if gHtL = ‰-at f HtL, then gè HsL = f Ha + sL.
è
18.2 Prove the scaling theorem, that if gHtL = f Ht ê aL, then gè HsL = a f Ha sL.

18.3 Show that the Laplace transform of the nth derivative of f satisfies:
è
@L f HnL D HsL = sn f HsL - sn-1 f H0L - ... - f Hn-1L H0L

(Hint: Use one integration by parts in the definition of @L f HnL D HsL, and use induction.)

18.4 [Ÿ] By direct integration, show that the Laplace transforms of the functions in the
left column are those in the right. You may assume that n is an integer for those cases
that involve it. In each case, don't forget to use the shift theorem whenever possible, and
check your answers with Mathematica.

1 ÅÅÅÅ1s
t ÅÅÅÅ
1
s2
ÅÅ
tn s-n-1 HG Hn + 1LL
‰-a t t n Ha + sL-n-1 HG Hn + 1LL
sin Ha tL ÅÅÅÅÅÅÅÅ
a
ÅÅÅÅÅÅ
a 2 +s2
cos Ha tL ÅÅÅÅÅÅÅÅ
s
ÅÅÅÅÅÅ
a 2 +s2
‰-a t Hcos Hb tLL ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+s
b 2 +Ha+sL2
ÅÅÅÅÅÅÅÅ

18.5 Given the Fourier inversion theorem, and the relationship


è è!!!!!! `
f HsL = 2p f HÂ sL

between the Laplace and Fourier transforms, explain the Laplace inversion formula
given by Equation (18.26).

18.6 Using the calculus of residues and Jordan's lemma, evaluate the inverse Laplace
transforms of
1 1 1 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ ; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ ; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ ; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Hs + 1L
2 Hs + 1L
4 s Hs + 2L Hs + 4L Hs + 4L Hs2 + 9L
2

18.7 [Ÿ] (Harder) Evaluate, by contour integration, the inverse Laplace transform of
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅ!Å!ÅÅÅ
s+1
and check your answer with Mathematica. You need to consider carefully how to
modify the semicircular contour to treat the branch point at s = -1.

18.8 Using the Laplace transform method, find the solutions of

2 yHtL  yHtL
ÅÅÅÅ + b ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + cyHtL = f HtL
a ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
t 2 t
400 Complex Analysis with Mathematica

with the following specializations:

(i) a = 1, b = 0, c = 1, f HtL = 0, yH0L = 1, y£ H0L = 0;


(ii) a = 1, b = 0, c = 1, f HtL = cosHtL, yH0L = 1, y£ H0L = 0;
(iii) a = 1, b = 6, c = 13, f HtL = 0, yH0L = 0, y£ H0L = 1;
(iv) a = 1, b = 6, c = 13, f HtL = sinH2tL, yH0L = 0, y£ H0L = 1.

18.9 Using the Laplace transform method as applied to matrix systems, find the solu-
tions of the following systems of ODEs:

(i) x° = y, y° = -w2 x, yH0L = 0, xH0L = 1.


(ii) x° = -2 x, y° = 2 x - 3 y, z° = 3 y , xH0L = 1, yH0L = 0, zH0L = 0.

18.10 [Ÿ] (Harder) Consider the transform inversion integral for the heat equation in the
form
c+Â ¶ è!!!!
1
qHx, tL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‰- p Hx-aL ‰ p t „ p
2p c- ¶

Deform the contour to wrap around the negative real axis and taking care of the branch
points, show that

1 è!!!!
qHx, tL = ÅÅÅÅÅÅ ‡ ‰- pt sinI p Hx - aLM „ p
p 0

Use Mathematica to evaluate this integral and check that it agrees with inversion
example 3 of Section 18.4.
è
18.11 (Harder) Let f HtL have Laplace transform f HsL. Prove that

è
‡ f HsLJ p HasL „ s
0

is the Laplace transform, with coordinate p, of

f Ha sinhHtLL

18.12 Ÿ Check your solutions to Exercise 18.8 using Mathematica's DSolve function.

18.13 Ÿ Check your solutions to Exercise 18.9 using Mathematica's DSolve function.
19 Elementary applications to
two-dimensional physics

Introduction
Many problems in applied mathematics reduce to a problem in potential theory, requir-
ing the solution, f, known as the potential, of Laplace's equation:

“2 f = 0 (19.1)

Holomorphic functions of a complex variable play a critical role in the solution of this
and related equations. In this chapter we shall explore the solution of Laplace's equation
in two dimensions, when the solution is particularly straighthforward, and solutions may
also be turned into other solutions via the use of conformal mapping. The matter will be
revisited in Chapters 23 and 24, whence we shall see how to manage Laplace's equation
and the Helmholtz equation in three dimensions, and the wave equation in four dimen-
sions. Solutions of Eq. (19.1) have applications to several areas, including:

(1) steady-state diffusion;


(2) gravitation;
(3) electrostatics;
(4) magnetostatics;
(5) fluid dynamics.

Our first task will be to briefly review each of these topics, to see how the potential
arises. Students interested in one particular physical application may wish to focus on
the topic of most interest in Section 19.1. Then we shall look at the solution of Eq. (19.1)
by holomorphic methods and illustrate many of them with Mathematica. The last section
of this chapter looks briefly at generalizations of potential theory – in particular, the
biharmonic equation and its application to viscous flow.

19.1 The universality of Laplace's equation


Consider first the time-dependent diffusion equation with constant diffusivity k. This is,
for a dependent variable T, which we may conceptualize as temperature:
T
ÅÅÅÅÅÅÅÅÅÅ = k“2 T (19.2)
t
It is immediately evident that, when the temperature is time-independent, T satisfies
Laplace's equation. The situation with gravity is even more straightforward. In the
absence of matter, the gravitational field strength is the gradient of a field F satisfying
402 Complex Analysis with Mathematica

Laplace's equation. The story with electromagnetism is a little more subtle. In the
time-independent case, Maxwell's equations reduce to (we are using simplified units):

“ êê = r
êê .E (19.3)

“ êê = 0
êê .B (19.4)


êê µ E
êê = ê0ê (19.5)


êê µ B
êê = êJê (19.6)

where r is the charge density and êJê is the current density (usually these source terms are
multiplied by appropriate electromagnetic constants, but these constants vary with
convention and are of no consequence here). For the electric field êEê , Eq. (19.5) holds
everywhere, so that we may always write

êê = “
E êê f (19.7)

for an electrostatic potential f. Then Eq. (19.3) implies that f satisfies Poisson's equation

“2 f = r (19.8)

and, in the absence of charges, Laplace's equation is obtained once more. The magnetic
case is a little more subtle. Eq. (19.6) says that, away from any current sources, the
magnetic field is curl-free and hence again the gradient, at least locally, of a potential,
and Eq. (19.4) then guarantees that this magnetostatic potential satisfies Laplace's
equation. However, the presence of currents at various points in space causes global
problems. Suppose for example we have a current-carrying wire located at the origin,
and consider the integral of êBê around a closed circle C centred on the origin, with
interior A. By Stoke's theorem, we have, from Eq. (19.6),

êê.„ rê = ‡ “
‡ B êê µ B
êê.„ êSê = ‡ êJê.„ êSê = I (19.9)
C A A

where I is the current in the wire. If the magnetic field was strictly the gradient of a
potential, this integral would have to be zero. What happens is that globally the potential
is multi-valued. We shall see how this is elegantly managed by the multi-valued nature
of certain complex functions!
The case of fluid dynamics is very rich in structure, and we shall explore this
topic in detail in a section of its own. To introduce the matter, we note that the conserva-
tion of fluid mass leads to the equation
r
ÅÅÅÅÅÅÅÅÅÅ + “
êê .Hr êvêL = 0 (19.10)
t
where êvê is the velocity field and r the fluid density. If the fluid is incompressible in the
sense that r must be independent of both position and time, we deduce that

“ êê = 0
êê .v (19.11)
19 Elementary applications to two-dimensional physics 403

In general, fluid mechanics involves the solution of the Navier-Stokes equations, as


discussed in Section 19.7. The simplification we need here is the case of zero vorticity,
i.e.

êê µ êvê = ê0ê (19.12)

in which case we can again write the velocity field as the gradient of a potential, which
by the incompressibility condition must then satisfy Laplace's equation. We shall look at
the special properties of fluids with regard to stream functions in Sections 19.3 and 19.7.
A fluid flow satisfying Eq. (19.12) is said to be irrotational.
Our goal in this Chapter is to explore various approaches to solving Laplace's
equation in two dimensions. This is not as silly as it sounds – although the physical
world is three-dimensional there may be cases of exact or approximate translational (or
other) symmetry that reduces the problem to one that is essentially two-dimensional.

19.2 The role of holomorphic functions


Let's remind ourselves of some facts about holomorphic functions. First of all, we know
that a holomorphic function is infinitely differentiable, so that if we write

f HzL = f Hx + ÂyL = fHx, yL + ÂyHx, yL (19.13)

then f and y may be differentiated twice. We also know (from real analysis) that the
mixed second derivatives are symmetric – for example,

2 f 2 f
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (19.14)
xy yx

and similarly for y. The Cauchy–Riemann equations then guarantee (Exercise 19.1
reminds you of this!) that

2 f 2 f
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = 0 (19.15)
x y

and similarly for y. So the real and imaginary parts of a holomorphic function satisfy
Laplace's equation.

‡ Rewriting Laplace's equation


The fact the holomorphic functions satisfy the Laplace equation can be made rather
more transparent by re-introducing the operators
f 1 f f
ÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ - Â ÅÅÅÅÅÅÅÅÅÅ N (19.16)
z 2 x y
f 1 f f
ÅÅÅÅÅÅÅÅêÅÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ +  ÅÅÅÅÅÅÅÅÅÅ N (19.17)
z 2 x y
404 Complex Analysis with Mathematica

and noting that

2 f
“2 f = 4 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅê (19.18)
z z
This makes it clear that if f is a function of a complex variable, then it satisfies Laplace's
equation if:

(1) it is holomorphic, i.e. a function only of z and not zê ;


(2) it is anti-holomorphic, i.e. a function only of zê and not z.

If you feel that this notational slickness might be hiding something, Exercise 19.2
encourages you to check in detail that an anti-holomorphic function satisfies the Laplace
equation.

‡ The significance of the chain rule and boundary conditions


The chain rule has a very special signifiance here, because it allows us to reshape
regions of the complex plane by conformal mapping, and map solutions of Laplace's
equation in one region into a solution in the re-shaped region. To see this suppose that

z = gHwL (19.19)

is a holomorphic mapping. Then we have, if f HzL is given,

2 f 2  f
2
ÅÅÅÅÅê = †g£ HwL§ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅê
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêê (19.20)
w w z  z
which means, using Eq. (19.18), that if f is a solution of Laplace's equation in terms of
x, y, it is also a solution of

2 f 2 f
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅÅ = 0 (19.21)
u v
where w = u + Âv.
A common technique is to use a conformal mapping to transform the region of
interest into a disc or half-plane. (Quite how this is done in general is an issue in itself –
the Riemann mapping theorem, discussed in Chapter 21 guarantees that it can be done
under very general conditions, but does not tell you how!) There are then very explicit
solutions for the Dirichlet problem for the cases of the disc and the half-plane, which we
shall discuss presently. For now we need to introduce some terminology related to
boundary conditions.
The Dirichlet problem is one where the value of f is prescribed on the boundary,
whereas the Neumann problem is one where the normal derivative (i.e. in the direction
of the outward normal to the region) is specified on the boundary. For the Dirichlet
problem for the Laplace equation, the solution is unique, whereas for the Neumann
problem it is unique up to a constant. (See Exercise 19.3). Furthermore, the problems
where either the function, or its normal derivative, is zero on a given boundary are
19 Elementary applications to two-dimensional physics 405

invariant under conformal mapping. For the first case, if the function is zero and the
coordinates are changed, it clearly remains zero. For the latter observation, the conformal-
ity property guarantees that the differentiation direction remains normal to the boundary
under the conformal mapping, and hence it follows that if the normal derivative is zero
in one set of coordinates, it remains zero after a conformal mapping has been applied.
Note that such zero boundary conditions are typically only applied on the
exterior of a given region – otherwise, for interior solutions, the solution must be zero or
constant inside if it is non-singular inside, by the uniqueness result.

‡ Additional observations
There is some additional structure arising from the Cauchy–Riemann equations. The
relationship between f and y is of some signifiance. In the case of fluid theory the
relationship is of particular importance. Suppose that we identify f as the potential for
the velocity field êvê:
f f
êvê = J ÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅ N (19.22)
x y

Then by the Cauchy–Riemann equations


y y
êvê = J ÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅ N (19.23)
y x

and so if we consider the dot product of the velocity field with the gradient of y, we note
that
y y y y
êê y = J ÅÅÅÅÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅ N.J ÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅ N = 0
êvê.“ (19.24)
y x x y

so that y is constant along the velocity field. We call y the ‘stream function’, and the
curves y = constant are literally the streamlines of the flow. This is a powerful visualiza-
tion tool, and we see that both parts of the holomorphic function are useful. For non-
fluid applications the curves f = constant are called equipotentials, and the curves
y = constant may be interpreted as ‘force field’ or ‘flux’ lines, but for fluids there is
additional signficance in that these latter curves are the paths followed by fluid particles.
This is not the case, for example, for a charged test-particle (i.e. one for which we ignore
its own field) in an electrostatic or gravitational field. In the case of heat flow, these two
sets of curves are sometimes called isothermal lines and flux lines.
406 Complex Analysis with Mathematica

19.3 Integral formulae for the half-plane and disk


There are special results for the Dirichlet problem when the boundary is a circle centred
on the origin, or the upper half-plane. Both of these formulae follow from Cauchy's
integral formula. First we give the result for the half-plane under straightforward assump-
tions.
Let u be the real part of the holomorphic function f HzL, and suppose that uHx, 0L
is known along the entire real axis. Suppose further that f tends to zero as †z§ Ø ¶ in the
upper half-plane. Then

1 y uHq, 0L
uHx, yL = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ „ q (19.25)
p -¶ Hx - qL2 + y2

Before proving this, let's take a look at the result.

‡ Ÿ Example of the half-plane result applied


Suppose that we have a function u that satisfies Laplace's equation in the upper half-
plane, and that when y = 0, then u = 0, except between x = -a and x = a, where it is
unity. What is the solution? All we need to do is to evaluate the integral. We supply a
suitable set of Assumptions:

Integrate@y ê HHx - qL ^ 2 + y ^ 2L ê Pi, 8q, -a, a<,


Assumptions Ø 8a > 0, y > 0, Im@xD ã 0<D

tan-1 I ÅÅÅÅ a-x


ÅÅÅÅÅ M + tan-1 I ÅÅÅÅ
y
a+x
ÅÅÅÅÅ M
y
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
p
Let's take a look at the solution with a = 1:

Plot3D@% ê. a -> 1, 8x, -4, 4<,


8y, 0.0001, 4<, PlotRange -> All,
PlotPoints -> 40, ViewPoint -> 81, 2, 1<D

1
2
3
4
1
0.75
0.5
0.25
-40
-2
0
2
4
19 Elementary applications to two-dimensional physics 407

Does the solution satisfy Laplace's equation?

Simplify@D@%%, 8x, 2<D + D@%%, 8y, 2<DD


0

Some other examples are given in Exercises 19.4–19.6.

‡ Proof of the half-plane result


This is a simple re-arrangment of the Cauchy Integral Formula. Let C be the boundary of
a semicircular region D, where z œ D, with C consisting of two pieces: C1 , the real
interval -R < x < R, and a semicircular arc C2 radius R, centred on the origin, and in the
upper half-plane. The integral formula gives
1 f HwL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w (19.26)
2p C w - z

and Cauchy's theorem gives


1 f HwL
0 = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêÅ „ w (19.27)
2p C w - z

since zê , the image of z in the real axis, lies outside D. Now we subtract these two results,
to obtain
1 1 1 1 f HwLHz - zêL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ f HwL J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêÅ N „ w = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêÅÅÅÅÅ „ w (19.28)
2p C w-z w-z 2p C Hw - zLHw - zL

Now suppose that f is bounded in the sense that † f § b M, for large z, where M Ø 0, as
z Ø ¶. Then the contribution from the integral over C2 vanishes in the limit Rض,
leaving us with the contribution from Eq. (19.28) along the real axis. This gives us
1 ¶ f Hq + 0ÂL y
f Hx + Â yL = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ „ q (19.29)
p -¶ Hx - qL2 + y2

Then, if f = uHx, yL + Â vHx, yL


1 ¶ uHq, 0Ly
ÅÅÅÅÅÅ „ q
uHx, yL = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
p -¶ Hx - qL2 + y2
(19.30)
1 ¶ vHq, 0Ly
vHx, yL = ÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ „ q
p -¶ Hx - qL2 + y2

so that we obtain the half-plane result for both the real and the imaginary part of f . One
point to note is that one cannot just put y = 0 in this formula – you must evaluate the
integral before taking the limit of zero y.
408 Complex Analysis with Mathematica

‡ Dispersion relations
Another more subtle point, which we shall not pursue, is that a similar argument applied
to Eq. (19.26) alone allows you to extract the real part from the imaginary part integrated
along the real axis, and vice versa. This observation leads to the notion of Hilbert
transforms and dispersion relations in mathematical physics, the general idea being that
the notion of holomorphicity allows information about one process, characterizing the
real part, to be extracted from another that is related to the imaginary part. For an
illuminating discussion of this, see Jackson (1975), Chapter 7. Exercise 19.7 gives a hint
of what is happening. This concept has many applications.

‡ Green's function version


If you have taken a course in potential theory based on Green's function methods, you
may know a different way of deriving this result based on the divergence theorem
applied to the function under consideration together with the Green's function. You
might like to contrast the two methods – but note below how we use the method of
images to derive the fundamental solution for a half-plane with Dirichlet boundary
conditions.

‡ Poisson's formula for the disk


The result for a disk is very similar, but is written out in polar coordinates Hr, qL. Sup-
pose that uHR, fL is specified on the disk r = R. Then for r < R, we have
2p
1 HR2 - r2 L uHR, fL
uHr, qL = ÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ f
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (19.31)
2p 0 r + R2 - 2RrcosHq - fL
2

The proof of this follows exactly the same route as the half-plane case, but where, if z
lies inside the boundary circle, the analogue of the image point is the point

R2
z` = ÅÅÅÅêÅÅÅÅÅ (19.32)
z
The details are left to you as Exercise 19.8. An example of the application of this result
is given in Exercise 19.9.

19.4 Fundamental solutions


Many solutions of interest can be built from very simple solutions and careful use of the
geometry. We are particularly interested in solutions corresponding to point-like
sources, which become singular at isolated points. We are also interested in simple
solutions corresponding to uniform fields. We shall now explore a few of these, and see
how to build more exotic solutions from them. As we shall see in the next section, this is
all ‘done with mirrors’.
19 Elementary applications to two-dimensional physics 409

‡ Uniform fields
An important simple case is the elementary function

f HzL = U0 ‰-Âa z (19.33)

where U0 is a real constant. Let's find the real and imaginary parts of this function

ComplexExpand@Exp@-I aD Hx + I yLD

x cosHaL + y sinHaL + Â Hy cosHaL - x sinHaLL

The real part is therefore

f = U0 HxcosHaL + ysinHaLL (19.34)

and the imaginary part is

U0 HycosHaL - xsinHaLL (19.35)

With this and the simple functions developed here, we shall take the time to interpret
each one in terms of fluid flow. If your particular interest lies in another application, you
should consider what these functions mean in that context. So if Eq. (19.34) gives the
potential for a fluid velocity field, the vector field giving the velocity is the gradient,
which is just

U0 8cosHaL, sinHaL< (19.36)

which is manifestly a constant vector of magnitude U0 in a direction at an angle +a to


the positive real axis. Note that there is a minus sign in the exponential of Eq. (19.33).

‡ Sources and sinks


A source of strength k > 0 at the point z = a corresponds to the function

f HzL = k logHz - aL (19.37)

Similarly, a sink of strength k > 0 at the point z = a corresponds to the function

f HzL = -k logHz - aL (19.38)

Suppose that a = 0, so that the real part of f is just

f = k logHrL (19.39)

and the velocity field is therefore of magnitude


k
v = ÅÅÅÅÅÅÅÅÅÅ (19.40)
r
in a radial direction away H+L or towards H-L the origin.
410 Complex Analysis with Mathematica

‡ Vortices
We can build elementary swirling solutions corresponding to a point vortex at z = a.
This is just

f HzL = -ÂklogHz - aL (19.41)

This case is important as it includes the multi-valued effect we remarked on in the


discussion of magnetostatic fields. Suppose we write

z = a + r‰Âq (19.42)

so that we are using polar coordinates centred on the vortex. Then

f HzL = -ÂklogHr‰Âq L = kq - ÂklogHrL (19.43)

whose real part is then

f = kq (19.44)

The gradient of this is then the vector whose magnitude is


k
ÅÅÅÅÅ (19.45)
r
and which points in a direction tangent to a circle radius r centred at a. This is mani-
festly a swirling flow centred on a. Note that the potential is multi-valued. In the magne-
tostatic case this is the potential for magnetic field induced by a wire passing through a,
normal to the complex plane, and carrying a current that is essentially (i.e. up to some
electromagnetic constants that do not concern us) k.

‡ Ÿ Mathematica visualizations of elementary flows


Mathematica has a number of interesting visualization tools to help you understand the
structure of the fields. One of the more interesting ones is the family of PlotField
functions, which in particular allow a vector field to be plotted given only its scalar
potential – this is particularly appropriate for the current application. The package for
two dimensions is loaded as follows:

Needs@"Graphics`PlotField`"D

The functions that have been loaded are given by:

The function that has been loaded that we want is PlotGradientField:

? PlotGradientField

PlotGradientField@f, 8x, x0, x1, HxuL<, 8y, y0, y1, HyuL<, HoptionsLD
produces a vector field plot of the gradient vector field of the
scalar function f by calculating its derivatives analytically.
19 Elementary applications to two-dimensional physics 411

Let's look at the uniform flow for this case:

ComplexExpand@Exp@-I Pi ê 6D Hx + I yLD
è!!! i è!!! xy
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅ + Â jjjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅ zzzz
3 x y 3 y
2 2 k 2 2{

PlotGradientField@
HSqrt@3D x + yL ê 2, 8x, -2, 2<, 8y, -2, 2<D

Here is the source field – note that some warning messages about the behaviour at the
origin have been suppressed in the printed text:

PlotGradientField@
Log@x ^ 2 + y ^ 2D ê 2, 8x, -3, 3<, 8y, -3, 3<D

To treat the vortex, we need to make an explicit conversion to polar coordinates – this is
best done using the two-argument form of the arctangent function:

PlotGradientField@ArcTan@x, yD, 8x, -3, 3<, 8y, -3, 3<D


412 Complex Analysis with Mathematica

Some of these functions can also be interpreted as giving translation-independent fields


in three dimensions – for example, the vortex flow is equivalent to the magnetic field
around a straight current-carrying wire. To view the functions in this form is easy – you
just use a related package:

Needs@"Graphics`PlotField3D` "D

The function that we want is PlotGradientField3D,applied as follows:

PlotGradientField3D@ArcTan@x, yD,
8x, -3, 3, 0.5<, 8y, -3, 3, 0.5<,
8z, -3, 3, 0.5<, ViewPoint -> 81, 2, 10<D
19 Elementary applications to two-dimensional physics 413

19.5 The method of images


The extension of the simple solutions just described, to more complicated regions,
depends on how complicated the region's shape is. An important approach is the
‘method of images’. In this approach boundary conditions of two simple types can be
satisfied on several classes of boundary. The boundary conditions of interest are:

(1) Dirichlet zero, i.e.f = 0 on the boundary;


(2) Neumann zero, i.e. f ê n = 0 on the boundary, where n is the normal direction.

The regions where this can be carried out particularly straightforwardly are:

(i) a half-plane;
(ii) a quadrant;
(iii) a wedge of interior angle 2pê k for some integer k.

We have used the terms ‘Dirichlet’ and ‘Neumann’ as these mathematical


characterizations of the two types of boundary condition are general. You may find other
terms in use to describe particular physical situations. In the electrostatic case, the
Dirichlet problem may be described by saying that the boundary is ‘earthed’. In the case
of steady heat flow, the Neumann problem corresponds to an insulated boundary.
You should also appreciate that the method of images is a very powerful tech-
nique that can be applied in many other situations beyond those can can be modelled by
two-dimensional potential theory and complex variables. For example, in applied
electromagnetic analysis, the applications of the technique (to the Helmholtz equation in
three dimensions) span a whole range of applications, from simple tutorial applications
through to the construction of Green's functions for scattering from complex layered
geometries. See, for example, Jackson (1975) and Lindell (1995). The text by Lindell
gives some applications where a distribution of complex images is used to satisfy
boundary conditions on dielectric media boundaries. In financial analysis, the method
can be applied to solve option pricing problems where the value of a financial instru-
ment becomes zero on one or more ‘barrier’ lines (see Shaw, 1998). However, here our
goals are rather more modest, and we begin by exploring case (i), where we wish to
satisfy boundary conditions on a half-plane.

‡ Ÿ Half-plane boundary conditions


We now consider the case of a half-plane characterized by ImHzL > 0, and a Dirichlet
zero boundary condition imposed along the line y = 0. In the absence of the boundary,
the complex function characterizing a source of strength k at a, with ImHaL > 0, is just
f HzL = k logHz - aL. We can satisfy the zero boundary condition on the real part by adding
a corresponding sink at the conjugate point êê a . In total this gives us a new complex
function
414 Complex Analysis with Mathematica

z-a
gHzL = klogHz - aL - klogHz - êê
a L = klogJ ÅÅÅÅÅÅÅÅÅÅÅÅêêÅÅÅÅ N (19.46)
z-a
Let us write a = a + Â b, z = x + Ây. Then the real part of this function is just

x + Ây - a - Â b 1 i Hx - aL2 + Hy - bL2 zy
ÅÅÅÅÅÅÅÅÅÅÅÅÅ N À = ÅÅÅÅÅ k logjjjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
fHx, yL = k log À J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ zzz (19.47)
x + Ây - a + Â b 2 k Hx - aL + Hy + bL {
2

This manifestly vanishes when y = 0. For example, consider a source of strength unity at
H0, 1L. Here is a contour plot of the resulting potential:

ContourPlot[1/2*Log[(x^2+(y-1)^2)/(x^2+(y+1)^2)],
{x,-2,2},{y,0,4}, PlotPoints -> 30]

0
-2 -1 0 1 2
Here is the field of associated gradients:

PlotGradientField[1/2*Log[(x^2+(y-1)^2)/(x^2+(y+
1)^2)],{x,-2,2}, {y,0,4}]

The corresponding Neumann zero problem is solved by adding a source of idential


strength at the image point. This balances the flows so that there is zero flow through the
boundary. In this case
1
fHx, yL = ÅÅÅÅÅ klogHHHx - aL2 + Hy - bL2 LHHx - aL2 + Hy + bL2 LL (19.48)
2
Consider again a source of strength unity at H0, 1L. Here is a contour plot of the resulting
potential:
19 Elementary applications to two-dimensional physics 415

ContourPlot[1/2*Log[(x^2+(y-1)^2)*(x^2+(y + 1)^2)],
{x,-2,2},{y,0,4}, PlotPoints -> 30]

0
-2 -1 0 1 2
Here is the field of associated gradients – note that the flow is horizontal at y = 0:

PlotGradientField[1/2*Log[(x^2 + (y - 1)^2)*(x^2 + (y
+ 1)^2)], {x, -2, 2}, {y, 0, 4}]

‡ Quadrant and wedge boundary conditions


The approach just used for the half-plane can be extended to treat quadrants, and, under
certain circumstances wedges. For example, the Nuemann zero problem in a quadrant
can be managed by adding three image points in each of the other three quadrants with
the same strength as the original source. Details are left for you to analyse in Exercise
19.10. The Dirichlet problem for a quadrant is discussed in Exercise 19.11, and the
wedge in Exercise 19.12.

19.6 Further applications to fluid dynamics


We have mentioned the application to fluid flow already. A motion of a fluid that is both
incompressible and irrotational, and two-dimensional, can be characterized in terms of
the complex potential

f HzL = fHx, yL + ÂyHx, yL (19.49)


416 Complex Analysis with Mathematica

where f is the ordinary real potential, such that the velocity êvê of the fluid is given by
êvê = ê“ê f. The function y is the stream function, and the velocity field is tangent to the
any curve y = constant.
If we introduce solid boundary surfaces into the geometry under consideration,
there can be no flow normal to the boundary. This means that as a matter of course we
are considering a Neumann problem for f. In particular, we have already solved this
problem where the geometry consists of a half-plane and (if you have investigated
Exercises 19.11-19.12 sufficiently) quadrants and wedges. We can now plot the stream-
lines of these flows as well, by just using the imaginary parts of the functions already
considered. For the case of the half-plane Neumann problem the complex potential is

f HzL = k logHz - aL + k logHz - êê


a L = k logHHz - aL Hz - êê
a LL (19.50)

and the imaginary part of this is

y = k ArgHHz - aL Hz - êê
a LL (19.51)

Now consider the case of a unit source at H0, 1L. We need to evaluate the argument of

Expand@Hx + I Hy - 1LL * Hx + I Hy + 1LLD

x2 + 2 Â y x - y2 + 1

and this is best done using the ArcTan function. Here is the resulting plot, with some
options set to produce a reasonably clean picture (the thick line extending vertically is an
artifact):

ContourPlot@ArcTan@1 + x ^ 2 - y ^ 2, 2 x yD,
8x, -2, 2<, 8y, 0, 2<,
ContourShading -> False, PlotPoints -> 400,
ContourStyle Ø [email protected],
Contours -> Table@k ê 4, 8k, -15, 15, 1 ê 2<D,
AspectRatio -> 1 ê 2D

1.5

0.5

0
-2 -1 0 1 2
This makes the role of the boundary very clear. You might like to explore the
streamlines for point sources within quadrants and wedges in the same way. Other flows
within wedges can be obtained by elementary methods (see Exercise 19.13).
19 Elementary applications to two-dimensional physics 417

‡ Boundary conditions on a plane and circle for general flows


Thus far we have considered some simple boundary conditions associated with simple
flows arising from a point source. Suppose we have a general complex potential f HzL
that is associated with a fluid flow in the absence of a boundary, and we add a half-plane
boundary. We can also ask about the introduction of a circular boundary. What is the
appropriate new complex potential?
Consider the planar boundary first, and suppose that f HzL only has singularities in
the upper half-plane. The only sources and sinks are in the upper half-plane. We
introduce a plane boundary at y = 0 and impose a Neumann boundary condition there.
Then the appropriate new complex potential is just
êêêêêê
gHzL = f HzL + f Hzê L (19.52)

Why is this? Consider first the boundary y = 0. There


êêêêêê
gHxL = f HxL + f HxL œ  (19.53)

and so y = 0 along this boundary. That is, this boundary is a streamline! The Neumann
boundary condition on f is then guaranteed by the orthogonality relations between f and
y. Furthermore, the function we have added only has singularities in the lower half-
plane and so does not introduce any new fictitious sources in the upper half-plane. Using
this method it is easy to generate new solutions in a half-plane geometry (see e.g.
Exercise 19.14).
A similar trick can be used to calculate flows with boundary conditions on a
circle. Suppose that we wish to create a solid boundary on the circle » z » = a, with a real.
Suppose further that f HzL is the complex potential for a flow in the entire complex plane,
with any singularities located outside the circle » z » = a. Then the new complex potential
for the corresponding flow with a solid boundary on the circle is just
êêêêêêêêêê
i a2 y
gHzL = f HzL + f jj ÅÅÅÅêÅÅÅÅÅ zz (19.54)
k z {
Why this works is similar to the argument for a half-plane (see Exercise 19.15).

ü Flow past a cylinder


A useful application of these methods is to consider the modification of a uniform flow
by the introduction of a cylinder (i.e. a circular boundary). In the absence of the circle
the flow is that we have already seen, and we write Eq. (19.33) in the form:

f HzL = HU - ÂVL z

In the presence of the circle, this now becomes

a2
gHzL = HU - ÂVL z + HU + ÂVL ÅÅÅÅÅÅÅÅÅ (19.55)
z
418 Complex Analysis with Mathematica

If the flow is in the x-direction at infinity, this becomes just

i a2 y
gHzL = U jjz + ÅÅÅÅÅÅÅÅÅ zz (19.56)
k z {

In polar coordinates the corresponding potential and stream function are then given by

i a2 y
f = U cosHqL jj ÅÅÅÅÅÅÅÅÅ + rzz (19.57)
k r {
i a2 y
y = U sinHqL jjr - ÅÅÅÅÅÅÅÅÅ zz (19.58)
k r {

which makes it obvious that r = a is indeed a streamline (see Exercise 19.16). In


Cartesian coordinates, the stream function is

i a2 yz
y = U y jj1 - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ z (19.59)
k x2 + y2 {

We can now visualize this flow very easily, using the standard ContourPlot routine
to see the streamlines. Note that they are also shown for the interior of the circle, but the
solution we want is just for the exterior region.

ContourPlot@y * H1 - 1 ê Hx ^ 2 + y ^ 2LL,
8x, -4, 4<, 8y, -2, 2<, AspectRatio -> 1 ê 2,
ContourShading -> False, PlotPoints -> 400,
Contours -> 41, ContourStyle Ø [email protected]

-1

-2
-4 -2 0 2 4

ü Flow past a cylinder with circulation


The fact that the boundary is a streamline is not altered by the addition of a vortex term
centred at the origin. Now we get the complex potential

a2 Âk
gHzL = HU - ÂVL z + HU + ÂVL ÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ logHzL (19.60)
z 2p
If the flow is in the x-direction at infinity, this becomes just
19 Elementary applications to two-dimensional physics 419

i a2 y Âk
gHzL = U jjz + ÅÅÅÅÅÅÅÅÅ zz - ÅÅÅÅÅÅÅÅÅ logHzL (19.61)
k z { 2p
In polar coordinates, the corresponding potential and stream function are then,

i a2 y kq
f = UcosHqL jj ÅÅÅÅÅÅÅÅÅ + rzz + ÅÅÅÅÅÅÅÅÅÅ (19.62)
k r { 2p
i a2 y k
y = UsinHqL jjr - ÅÅÅÅÅÅÅÅÅ zz - ÅÅÅÅÅÅÅÅÅ logHrL (19.63)
k r { 2p

and it is clear that r = a remains a streamline. In Cartesian coordinates, the stream


function is now

i a2 yz k
y = U y jj1 - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅ2ÅÅ z - ÅÅÅÅÅÅÅÅÅÅ logHx2 + y2 L (19.64)
k x 2 + y { 4 p

We can also visualize this flow as before. Here we set k = -5:

ContourPlot@
y * H1 - 1 ê Hx ^ 2 + y ^ 2LL + 5 ê H4 PiL Log@x ^ 2 + y ^ 2D,
8x, -4, 4<, 8y, -2, 2<, AspectRatio -> 1 ê 2,
ContourShading -> False, PlotPoints -> 400,
Contours -> Table@k ê 4, 8k, -15, 15, 1<D,
ContourStyle Ø [email protected]

-1

-2
-4 -2 0 2 4
The points where the streamlines hit the cylinder are an example of stagnation points.
You might like to explore what happens to these as the strength of the circulation term is
increased.

‡ Blasius' theorem
We shall not prove this here (it is an application of Bernoulli's theorem in fluid dynam-
ics), but there is an interesting result due to Blasius that gives the force exerted on an
object as a function of the complex potential gHzL. Suppose the fluid has density r and
the force (per unit length in the third dimension) is given by the complex constant
420 Complex Analysis with Mathematica

F = Fx - ÂFy (19.65)

Then the theorem states that

Âr gHzL 2
F = ÅÅÅÅÅÅÅÅÅ ‡ J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N „ z (19.66)
2 C z

where C is the boundary of the body. Note that since the integrand is holomorphic, C
can be deformed in general, and the calculus of residues used to evaluate the integral.
Let's get Mathematica to work out the force on the cylinder in the flow with circulation
that we have considered:

g[z_] = (U - I*V)*z + (U + I*V)*a^2/z -


(I*k)/(2*Pi)*Log[z];

Collect@Expand@HD@g@zD, zDL ^ 2D, zD


Âk U 2
- ÅÅÅÅÅÅÅÅ
p
ÅÅÅÅ - ÅÅÅÅ kV
p
ÅÅÅÅÅ - ÅÅÅÅ k
ÅÅÅÅÅÅ - 2 a2 U 2 - 2 a2 V 2
4 p2
U 2 - 2 Â V U - V 2 + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ +
z z2
Âa kU
2 2
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅ
p
a kV
p
ÅÅÅÅÅÅ U 2 a4 - V 2 a4 + 2 Â U V a4
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z3 z4

HI * r ê 2L * H2 Pi IL * Residue@%, 8z, 0<D

 Hk U -  k VL r

Expand@%D

ÂkU r+kV r

So the force in the x-direction is Fx = r k V; that in the y-direction is Fy = - r k U. When


V = 0, so that the flow at infinity is horizontal, we have Fx = 0. This calculation shows
that when k < 0 we get a net upwards lift on the cylinder.
This calculation illustrates two further points. First, the lift is generated by the
presence of circulation around the cylinder. Without it there is no lift. Second, there is
no horizontal force in the absence of circulation, which is rather unphysical – there is no
‘air resistance’ This is a consquence of the introduction of the idealization of potential
flow, which is not totally realistic.

‡ Ÿ Conformal mappings on the cylinder


In Chapter 16 we briefly investigated the Joukowski mapping. This transforms the
region exterior to a circle of radius a to that exterior to an aerofoil shape. The mapping
is z ö z, with

i l2 y
z = ‰Â q jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + w + z zz (19.67)
k w+z {
19 Elementary applications to two-dimensional physics 421

With l general this can be used to transform circles into ellipses. For example, here we
generate a rotated ellipse from a unit circle:

h@z_, l_, w_, q_D := Exp@I qD * Hl ^ 2 ê Hw + zL + w + z L

ParametricPlot@8Re@h@1 * Exp@I fD, 1.5, 0, Pi ê 4DD,


Im@h@1 * Exp@I fD, 1.5, 0, Pi ê 4DD<, 8f, 0, 2 Pi<D

-2 -1 1 2
-1

-2

If, additionally, the constraint of Chapter 16 is to be applied, we would impose

"################
#########
l= a2 - ImHwL2 - ReHwL; (19.68)

This generates the aerofoil family we considered earlier. We shall need the inverse of
this mapping with the right behaviour at infinity. Solving the associated quadratic
equation gives
1 1 è!!!!!!!!!!!!!!!!!!!!!!!!!!!!
z = -w + ÅÅÅÅÅ ‰-Âq z + ÅÅÅÅÅ z2 ‰-2Âq - 4l2 (19.69)
2 2
The mapping zö z transforms the region exterior to an aerofoil to that exterior to a
circle. The complex potential for a flow with circulation is then just

i a2 y  k
gHzL = U jjz + ÅÅÅÅÅÅÅÅÅ zz - ÅÅÅÅÅÅÅÅÅÅ logHzL (19.70)
k z { 2p

Let's look at the cases of ellipses first. Here is the complex potential. Note that Mathemat-
ica does not always manage the branch points in the right way, so we write the inverse
mapping in this particular way to try to force the issue.

JoukowskiFlow@z_, q_, a_, w_, U_, V_, k_, l_D :=


Module@8z<,
z = - w + Exp@-I * qD * z ê 2 *
H1 + Sqrt@1 - 4 l ^ 2 Exp@2 I qD ê z ^ 2DL ;
HU - I * VL z + HU + I * VL a ^ 2 ê z -
HLog@zD * I * kL ê H2 * PiLD

We now extract the real potential and stream function by taking real and imaginary parts:
422 Complex Analysis with Mathematica

JoukowskiPhi@x_, y_, q_,


a_, a_, b_, U_, V_, k_, l_D :=
Re@JoukowskiFlow@x + I y, q, a, a + I b, U, V, k, lDD

JoukowskiPsi@x_, y_, q_,


a_, a_, b_, U_, V_, k_, l_D :=
Im@JoukowskiFlow@x + I y, q, a, a + I b, U, V, k, lDD

As our first example, we can now visualize the flow around an ellipse given by

x2 y2
ÅÅÅÅÅÅÅÅ2Å + ÅÅÅÅÅÅÅÅÅ
Å =1 (19.71)
A B2
and as an example we take A = 2, B = 1. The Joukowski mapping takes the ellipse to
è!!!!!!!!!!!!!!!
the exterior of a circle of radius HA + BL ê 2, which is 3 ê2 here, with l = a2 - b2 ë 2,
è!!!
which here is 3 ë 2. Here we show the streamlines associated with this ellipse in a
flow with velocity at infinity H1, 0.5L and k = -4. We make a separate copy of the
ellipse in order to superimpose the boundary clearly.

EllipseGraphic@A_, B_D :=
ParametricPlot@8A Cos@sD, B Sin@sD<,
8s, 0, 2 Pi<, PlotStyle -> [email protected]

ell = EllipseGraphic@2, 1D

0.5

-2 -1 1 2

-0.5

-1
In this and the other examples in this chapter, the value of PlotPoints has been set
quite high (400) to obtain a clean graphic – on an older computer you might wish to
lower the value.

myplot = ContourPlot@JoukowskiPsi@
x, y, 0, 3 ê 2, 0, 0, 1, 0.5, -4, Sqrt@3D ê 2D,
8x, -4, 4<, 8y, -2, 2<, ContourShading -> False,
AspectRatio -> 1 ê 2, PlotPoints -> 300,
Contours -> Table@k ê 4, 8k, -20, 20, 1<DD
19 Elementary applications to two-dimensional physics 423

-1

-2
-4 -2 0 2 4
Show@myplot, ellD

-1

-2
-4 -2 0 2 4
If we keep A = 2 but set B = 0 the ellipse collapses to a flat plate, as shown in the
following streamline plot:

ellb = EllipseGraphic@2, 0D

0.5

-2 -1 1 2

-0.5

-1
424 Complex Analysis with Mathematica

myplotb = ContourPlot@
JoukowskiPsi@x, y, 0, 1, 0, 0, 1, 0.5, -4, 1D,
8x, -4, 4<, 8y, -2, 2<, ContourShading -> False,
AspectRatio -> 1 ê 2, PlotPoints -> 400,
Contours -> Table@k ê 4, 8k, -20, 20, 1<DD

-1

-2
-4 -2 0 2 4
Show@myplotb, ellbD

-1

-2
-4 -2 0 2 4
Finally, we recall that aerofoils with pointy ends can be created using the same transfor-
mation but with l constrained according to Eq. (19.68). Here is one example of how to
implement it – you are encouraged to explore this further in Exercise 19.17.

AeroJoukowskiFlow@z_, q_, a_, w_, U_, V_, k_D :=


Module@8l = Sqrt@a ^ 2 - Im@wD ^ 2D - Re@wD, z<,
z = - w + Exp@-I * qD * z ê 2 *
H1 + Sqrt@1 - 4 l ^ 2 Exp@2 I qD ê z ^ 2DL ;
HU - I * VL z + HU + I * VL a ^ 2 ê z -
HLog@zD * I * kL ê H2 * PiLD

AeroJoukowskiPhi@x_, y_,
q_, a_, a_, b_, U_, V_, k_D :=
Re@AeroJoukowskiFlow@x + I y, q, a, a + I b, U, V, kDD
19 Elementary applications to two-dimensional physics 425

AeroJoukowskiPsi@x_, y_,
q_, a_, a_, b_, U_, V_, k_D :=
Im@AeroJoukowskiFlow @x + I y, q, a, a + I b, U, V, kDD

Here is a symmetrical aerofoil:

ContourPlot@
AeroJoukowskiPsi@x, y, 0, 3 ê 2, 0.5, 0.0, -1, 0.0, 0D,
8x, -4, 4<, 8y, -2, 2<, ContourShading -> False,
AspectRatio -> 1 ê 2, PlotPoints -> 200,
Contours -> Table@k ê 4, 8k, -20, 20, 1<DD

-1

-2
-4 -2 0 2 4

19.7 The Navier–Stokes equations and viscous flow


The use of complex functions in fluid dynamics is not at all confined to potential flow.
There are many beautiful applications to other types of fluid flow that are known, and
indeed there appear to be many unresolved issues. The author is grateful to Dr John
Ockendon, F.R.S. for pointing out some of the basic work in this area, and to Professor
K.B. Ranger for supplying several of his papers. The following discussion is intended to
be a brief introduction only. For an introduction to viscous flow and the biharmonic
equation at a student level within the context of fluid theory, see Ockendon and Ocken-
don (1995). The book by Ockendon et al. (2003) provides a discussion of complex
solutions of the biharmonic equation within the general context of PDEs, and also gives
a short introduction to the work of Ranger (see, for example, Ranger (1991, 1994) and
references therein), which develops develops solution techniques for the complex
representation of the 2-D steady Navier–Stokes equations originally given by Legendre
(1949). Some particular applications of complex variables appear in many articles.
Notable examples include Garabedian (1966), who discusses free boundary flows, and
Finn and Cox (2001), who discuss a method of images for Stokes flow. This section will
require some familiarity with basic identities of vector calculus.
426 Complex Analysis with Mathematica

‡ Fluid flow in more generality


A large class of fluids can be characterized by their density r, a scalar field not initially
presumed constant, and their dynamic viscosity m. The velocity vector field is êvê, and the
pressure is the scalar field p. In general the mass conservation equation
r
ÅÅÅÅÅÅÅÅÅÅ + “
êê .Hr êvêL = 0 (19.72)
t
holds. The conservation of momentum is expressed by the Navier–Stokes equations in
the form
 êvê
rJ ÅÅÅÅÅÅÅÅÅÅ + Hvêê.“
êê L êêvêN = - “
êê p + m “ êvê
2
(19.73)
t
As before, if the fluid is incompressible in the sense that r must be independent of both
position and time, we deduce that

“ êê = 0
êê .v (19.74)

In general, fluid mechanics involves the solution of the Navier–Stokes equations. Rather
than assuming, as before, zero vorticity, we now define the vorticity as

w
êê = “
êê µ êvê (19.75)

In what follows we retain incompressibility but allow for non-zero vorticity. We now
need to use some vector identities. We define the scalar field H as
r 1
H = p + ÅÅÅÅÅ êvê.vêê = p + ÅÅÅÅÅ r êvê2 (19.76)
2 2
and note that if “ êê = 0, then “ êvê = -“
êê .v
2
êê µ êwê . We also recall the vector calculus identity
1
“J ÅÅÅÅÅ êvê.vêêN = Hv êê Lêêvê + êvê µ w
êê.“ êê (19.77)
2
Putting this all together allows us to recast the Navier–Stokes equations as
 êvê
rJ ÅÅÅÅÅÅÅÅÅÅ - êvê µ êwê N + “
êê H = - m “
êê µ w
êê (19.78)
t
Taking the curl of this, and noting that the divergence of the viscosity is identially zero,
we get the vorticity equation
w êê
rJ ÅÅÅÅÅÅÅÅÅÅÅ + Hv êê L w
êê.“ êê - Hw êê L êêvêN = n“ w
êê .“
2
êê (19.79)
t
where the kinematic viscosity n = m ê r. We note that setting the vorticity to zero is
consistent with the vorticity equation, leading us back to potential flow.
19 Elementary applications to two-dimensional physics 427

‡ Steady planar flows and the stream function


Previously we have regarded the stream function as the imaginary part of the complex
potential for steady potential flow. The concept of a stream function has wider applicabil-
ity as we shall now see. In what follows I employ the sign conventions of Ranger
(1994). We let yHx, yL be chosen so that
 y y
êvê = ê“ê µ H- êkê yL = J- ÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅ , 0N (19.80)
y x

In the time-independent or steady case, the vorticity equation (18.79) then reduces to the
scalar equation

1 Hy, “2 yL
“4 y = ÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (19.81)
n Hx, yL

where the right hand side is the usual Jacobian. Note that it is consistent to demand that
“2 y = 0 in this equation, taking us back to potential flow, but now there are many other
interesting cases to consider. We also note that in the various forms of the momentum
(Navier–Stokes) or vorticity equation (18.79) or the 2-D stream form (18.81), and for
problems where one can identify a unique length scale L and speed scale U that character-
izes the problem at hand, it makes sense to perform a further non-dimensionalization of
the variables and introduce the Reynolds number
UL rUL
Re = ÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (19.82)
n m

so that, for example, Eq. (19.81) becomes, after suitable rescalings of all the variables,

Hy, “2 yL
“4 y = Re ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (19.83)
Hx, yL

‡ The Stokes flow limit in complex form


The approximation of Stokes flow is the limit where the Reynolds number becomes
zero. In this case we have

“4 y = 0 (19.84)

which is the biharmonic equation, also well known for its applications to elasticity. This
is easily written in terms of complex variables. As usual, we let, z = x + Ây. Using the
notation introduced in Section 10.9
 1  
ÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ - Â ÅÅÅÅÅÅÅÅÅÅ N (19.85)
z 2 x y
 1  
ÅÅÅÅÅÅÅÅêÅ = ÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ +  ÅÅÅÅÅÅÅÅÅÅ N (19.86)
z 2 x y
428 Complex Analysis with Mathematica

we note that

2 4
“2 = 4 ÅÅÅÅÅÅÅÅÅÅÅÅÅêÅÅÅ ; “4 = 16 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêÅÅÅÅ2ÅÅ (19.87)
zz z2 z
So the biharmonic equation is the condition

4 y
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêÅÅÅÅ2ÅÅ = 0 (19.88)
z2  z
It is simple to integrate this equation to obtain, for y real,

y = ReHzê fH zL + gH zL L (19.89)

where f and g are holomorphic. The potential flow case arises when f = 0.

‡ The general case in complex form


In the case where the kinematic viscosity is finite, then the stream function equation
(19.83) becomes, instead (it is a useful exercise to check this):

4 y Re i y 3 y y 3 y yz
 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêÅÅÅÅ2ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ jj ÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Å ÅÅÅ
Å - ÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ z = 0 (19.90)
 z2 z 2 k  z zzê2 zê z2  zê {
This can be reorganized as follows. We first note that Eq. (19.90) can be written as

2
ÅÅÅÅÅÅÅÅ
ÅÅÅÅ jij ÅÅÅÅÅÅÅÅ
2 y Re y 2 y 2 i 2 y Re y 2 y
Å2ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ N zzzz + ÅÅÅÅÅÅÅÅÅ2ÅÅÅ jjjj ÅÅÅÅÅÅÅÅêÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅÅÅÅêÅÅ N zzzz = 0
jj (19.91)
zê2 k z 2 z {  z k  z 2 z {

An auxiliary real function f is introduced so as to satisfy the equation

2 f 2 y Re y 2
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = Â ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅÅÅÅÅÅ N (19.92)
z z 2 z
and its complex conjugate

2 f 2 y Re y 2
Åê2ÅÅÅÅ = - ÅÅÅÅÅÅÅÅêÅ2ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅ J ÅÅÅÅÅÅÅÅêÅÅ N
ÅÅÅÅÅÅÅÅ (19.93)
z z 2 z

Then elimination of f from Eq. (19.92) and Eq. (19.93) by differentiation leads to Eq.
(19.91). This pair of complex equations is the representation of Legendre (1949), and is
the basis for the complex solution techniques developed by Ranger (1991, 1994).
19 Elementary applications to two-dimensional physics 429

‡ Ÿ Projects
A general investigation of the complex equations for general viscous or Stokes flow is
rather outside the scope of this text. There are many examples in the references below
that merit detailed investigation, using Mathematica as a visualization tool, and you are
encouraged to pursue this. As an example to illustrate this approach, the following
example from Finn and Cox (2001) is interesting in that it makes use of the method of
images with respect to a circular boundary. The following stream function is that for a
"stokeslet" placed inside a circle of radius a. The strength of the stokeslet is A + Â B, and
the image is at s = a2 ê s. Finn and Cox calculate the resulting stream function (we let
zb denote zê) and in Mathematica input form it is given by

Y@z_, zb_, a_, A_, B_, s_, s_D =


1 ê 4 HA Hz + zbL - I B Hz - zbLL
Log@s ê s Abs@z - sD ^ 2 ê Abs@z - sD ^ 2D + A ê 4 ê s
HAbs@zD ^ 2 - a ^ 2L HHz + sL ê Hz - sL + Hzb + sL ê Hzb - sLL +
I B Hz - zbL Hs - sL HAbs@zD ^ 2 - a ^ 2L ê H4 s Abs@z - sD ^ 2L;

That is, Y is given by


ê, a, A, B, s, sD
Y@z, z

 B Hs - sL H†z§2 - a2 L Hz - zê L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ +
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
4 s †z - s§2
ê
1 i s †z - s§2 y A H†z§2 - a2 L H ÅÅÅÅ ÅÅÅÅÅÅ + ÅÅÅÅ
s+z
ÅÅÅÅÅÅ L
s+z
zê -s
ÅÅÅÅÅ logjjjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ zzzz HA Hz + zê L - Â B Hz - zê LL + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
z-s
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
4 k s †z - s§ { 4s

Here is the resulting collection of streamlines as we let s = 1 ê 100, 1 ê 7, 3 ê 7, 5 ê 7.


The boundary circle is shown in bold and the streamlines outside of it are ignorable. In
the following code, in order to set the same options for four similar graphics, we first use
SetOptions to ensure the consistent operation of ContourPlot.

SetOptions@ContourPlot, PlotPoints Ø 200, Contours Ø 50,


ContourShading Ø False, PlotRange Ø All,
Epilog Ø [email protected], Circle@80, 0<, 1D<,
DisplayFunction Ø IdentityD;

plota = ContourPlot@Re@Y@x + I y, x - I y, 1, 0.5,


0.0, 100, 1 ê 100DD, 8x, -1, 1<, 8y, -1, 1<D;
plotb = ContourPlot@Re@Y@x + I y, x - I y, 1, 0.5,
0.0, 7, 1 ê 7DD, 8x, -1, 1<, 8y, -1, 1<D;
plotc = ContourPlot@Re@Y@x + I y, x - I y, 1, 0.5,
0.0, 7 ê 3, 3 ê 7DD, 8x, -1, 1<, 8y, -1, 1<D;
plotd = ContourPlot@Re@Y@x + I y, x - I y, 1, 0.5,
0.0, 7 ê 5, 5 ê 7DD, 8x, -1, 1<, 8y, -1, 1< D;
430 Complex Analysis with Mathematica

Show@GraphicsArray@88plota, plotb<, 8plotc, plotd<<DD

1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1

1 1

0.5 0.5

0 0

-0.5 -0.5

-1 -1
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1

You are encouraged to pursue the work of Finn and Cox further, as the basic object
described here is then built up to describe a more complex geometry. Another interesting
source of examples, this time of free boundary problems, is the paper by Garabedian
(1966).

Exercises
19.1 Show that the Cauchy–Riemann equations imply that both the real and imaginary
parts of a holomorphic function satisfy Laplace's equation.

19.2 What are the analogues of the Cauchy–Riemann equations for a differentiable
function of zê? Show that both the real and imaginary parts of such an anti-holomorphic
function satisfy the Laplace equation.

19.3 Suppose that f1 and f2 are each solutions of Laplace's equation in a region D, and
that on the boundary of D,
19 Elementary applications to two-dimensional physics 431

f1 = f2 = g

where g is a specified function defined on the boundary. Consider h = f1 - f2 . What is


the value of h on the boundary? Does h satisfy Laplace's equation? Now consider the
identity

“ êê hL = “ h + †“
êê .Hh “
2
êê h§
2

Integrate this identity over D and apply the divergence theorem. What does this tell you
about

êê h§ „ x
‡ †“
2

Deduce that h must be identically zero and that f1 = f2 . What happens if a Neumann
boundary condition is applied instead?

Note: in Exercises 19.4 and 19.5, you may work out the answer using pen and paper or
Mathematica (preferably both, to check).

19.4 [Ÿ] Find the solution of Laplace's equation in the upper half-plane that, along the
real axis, takes the values +1 if x > 0 and -1 if x < 0.

19.5 [Ÿ] Find the solution of Laplace's equation in the upper half-plane that, along the
real axis, takes the values +1 if x < -1, 0 if -1 < x < 1 and -1 if x > 1.

19.6 Ÿ Use Mathematica to visualize the solutions to Exercises 19.4 and 19.5.

19.7 Apply the integral formula


1 f HwL
f HzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ „ w
2p C w-z

directly to the semicircular region considered in Section 19.4, and, by taking real and
imaginary parts, show how the real and imaginary parts of f can be computed from each
other.

19.8 Using Cauchy's integral formula applied to a circle, and subtracting Cauchy's
theorem as applied to the image point in Eq. (19.32), derive Poisson's formula as given
by Eq. (19.31).

19.9 [Ÿ] Work out the solution u of Laplace's equation on the interior of the unit disk if
uH1, fL = 1 for 0 < f < p and uH1, fL = -1, for p < f < 2 p. Visualize the answer using
Mathematica.

19.10 [Ÿ] A source of strength k is located in the quadrant x > 0, y > 0 at the point
Ha, bL and Neumann boundary conditions apply along the boundaries x = 0, y = 0. Use
the method of images to find the appropriate complex function for this case, and check
432 Complex Analysis with Mathematica

your answer by using the Mathematica functions ContourPlot and PlotGradient-


Field to visualize the results.

19.11 [Ÿ] A source of strength k is located in the quadrant x > 0, y > 0 at the point
Ha, bL and Dirichlet boundary conditions apply along the boundaries x = 0, y = 0. Use
the method of images to find the appropriate complex function for this case, (be careful
with the signs of the image sources, i.e. are they sources or sinks), and check your
answer by using the Mathematica functions ContourPlot and PlotGradient-
Field to visualize the results.

19.12 [Ÿ] A Wedge of interior angle 2 p ê n with vertex at the origin has Neumann
boundary conditions imposed along its edges. A source is located inside the wedge at the
point Ha, bL. What distribution of image sources will guarantee that the Neumann
condition is satisfied? Find the resulting potential, and check your answer by using the
Mathematica functions ContourPlot and PlotGradientField to visualize the
results. For what values of n is the corresponding Dirichlet problem easily solved in this
way?

19.13 Ÿ Use Mathematica to investigate the fluid flows given by the complex potential
f HzL = zn for various choices of n. (You may find the cases n = 1 ê 2, 2 ê 3, 1, 2, 3
interesting).

19.14 By defining a vortex using Eq. (19.41), find the flow field corresponding to a
vortex at H0, 1L, subject to a solid half-plane at y = 0.

19.15 Explain why Eq. (19.54) gives the complex potential for the flow outside a circle.
(Hint: Do this in two stages: first explain why the circle is a streamline; second, locate
the singularities of the new flow.)

19.16 Show that by setting z = r ‰Â q , the complex potential given by Eq. (19.56) implies
the potential and stream function given by Eq. (19.57) and Eq. (19.58).

19.17 Ÿ Explore the streamlines produced by the function AeroJoukowskiPsi.


Consider varying at least:

(1) the flow direction;


(2) the amount of circulation;
(3) the camber.

Write a function to draw in the aerofoil outline (for example, using the methods of
Chapter 16), and superimpose this on your plots (as with the examples we have given,
there may not be a contour that conveniently outlines the shape of interest, and it is
helpful to distinguish the exterior and interior clearly).
20 Numerical transform techniques

Introduction
In real-world applications if is often the case that a purely analytical approach to trans-
form calculus is insufficient. This chapter explores two techniques that extend the utility
of transform methods by allowing a purely numerical treatment. We can explore numeri-
cal methods for both Fourier and Laplace transforms – in principle any method could be
applied to either type of transform, since one is a rotation of the other. However, in
practice, two types of problem appear to be of most importance:

(1) An essentially numerical approach to forward and backward Fourier transforms;


(2) The inversion of a complicated Laplace transform given in analytical form, for which
there is no known analytical inverse.

An entire book could be written about the first topic, which is at the heart of many
problems in applied mathematics, physics and engineering. It is of particular importance
for signal and image processing. We shall briefly explore Mathematica's Fourier and
InverseFourier functions. It should also be clear than any Fourier transform could
be worked out numerically by the use of NIntegrate. In this chapter this approach
will be explored in detail only for Laplace transforms.
The second topic is particularly important for generating solutions to partial
differential equations. As we have seen in Chapters 18 and 19, certain partial differential
equations may be simplified by transforming with respect to one or more of the indepen-
dent variables, leading to a solvable algebraic or ordinary differential equation. It is
necessary to then invert the solution of the transformed problem, and this is where
difficulties may arise. We shall explore this issue, and, as an example, apply Mathemati-
ca's numerical capabilities to some contemporary problems in financial engineering. We
shall see that Mathematica's easy management of complex contour integration rather
simplifies the matter.

20.1 Ÿ The discrete Fourier transform


The discrete Fourier transform acts on a list of complex numbers. This list may or may
not be realized as the discrete values of a function whose continuous Fourier transform
we wish to approximate. If the list has length n the discrete transform is based on the
principal nth root of unity, which we denote by wn . Note that

wn = ‰2pÂên (20.1)

Now suppose that we have a list ar , for 1 b r b n. Its discrete Fourier transform is given
as a new list bs , given by (with default settings)
434 Complex Analysis with Mathematica

n
1 Hs-1L Hr-1L
bs = ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ ‚ wn ar (20.2)
n r=1

The corresponding inverse is given by


n
1 -Hs-1L Hr-1L
ar = ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ ‚ wn bs (20.3)
n s=1

the proof of which relies on the identity (see Exercise 20.4):

1 + wn + w2n + ... + wn-1


n =0 (20.4)

These are perhaps most easily thought of as being distinct operations from their continu-
ous counterparts, though it can be shown that the continuous Fourier transform does
indeed result from the discrete transform when a suitable limiting process is performed.
The implementation in Mathematica is very straightforward.

? Fourier

Fourier@listD finds the discrete


Fourier transform of a list of complex numbers.

? InverseFourier

InverseFourier@listD finds the discrete


inverse Fourier transform of a list of complex numbers.

For example, we have

Fourier@81, 1, 1<D

81.73205 + 0. Â, 0. + 0. Â, 0. + 0. Â<

InverseFourier@%D

81., 1., 1.<

Note that it is not ncessary that the length of the list be a power of 2. It is particularly
efficient when this is the case.

ü Parameter settings
With the setting FourierParameters Ø {a, b} the discrete Fourier transform
computed by Fourier is
n
1
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ ‚ ur e2pÂbHr-1LHs-1Lên (20.5)
nH1-aLê2 r=1
20 Numerical transform techniques 435

20.2 Ÿ Applying the discrete Fourier transform in one


dimension
Perhaps the most basic use of the discrete transform is to implement filters to either pass
or bar the high or low frequency components of some signal. It is easy to carry out this
type of modelling using the functions built in to Mathematica. Let's invent some noisy
test data, and remind ourselves how big the data set is:

noisy = Table@Cos@tD + Sin@3 tD + 0.5 HRandom@D - 0.5L,


8t, 0, 10, 0.01<D;

A plot reveals the structure of signal + noise:

noisyplot =
ListPlot@noisy, PlotStyle Ø [email protected]

200 400 600 800 1000


-1

-2

Now let's transform it, and plot the result – it is convenient to rotate the data around to
reveal the peaks:

noisytfm = Fourier@noisyD;
ListPlot@Abs@RotateRight@noisytfm, 500DD,
PlotRange -> All, PlotJoined -> TrueD

15
12.5
10
7.5
5
2.5
200 400 600 800 1000

Let's get rid of what we think is the garbage, and have another look at it. Bearing in
mind the vertical scale of this last plot, we shall cut out all transformed data less than
unity in scale:
436 Complex Analysis with Mathematica

filtertfm = Chop@noisytfm, 1.0D;

ListPlot@Abs@RotateRight@filtertfm, 500DD,
PlotRange -> All, PlotJoined -> TrueD

15
12.5
10
7.5
5
2.5
200 400 600 800 1000

Now we invert and plot what we hope is the cleaned up transformed data:

cleanplot = ListPlot@
Chop@InverseFourier@filtertfmDD, PlotJoined -> TrueD

200 400 600 800 1000


-1

-2

Show@cleanplot, noisyplotD

200 400 600 800 1000


-1

-2

So this has clearly removed the noise. Note also that we have used Chop twice in
slightly different ways. First we used it as the filter to clean up the transform. Then we
used it to remove any small imaginary parts from the inverted data.
20 Numerical transform techniques 437

20.3 Ÿ Applying the discrete Fourier transform in two


dimensions
This follows the same pattern as in one dimension. Our goal here is simply to make you
aware of the ability to apply the Fourier function to square arrays as well as one-dimen-
sional lists. As in one dimension, it is very convenient to perform some list rotations in
association with the operation of the transform. We define, for a square data set, the
following

CentredFourier@x_ListD :=
Module@8len = Floor@Length@xD ê 2D<,
Transpose@RotateRight@
Transpose@RotateRight@Fourier@xD, lenDD, lenDDD;

CentredInverse@x_ListD :=
Module@8len = Floor@Length@xD ê 2D<,
InverseFourier@ Transpose@
RotateLeft@Transpose@RotateLeft@x, lenDD, lenDDDD;

‡ Inventing Some Data


We shall invent some data that resembles the letter ‘E’ as follows:

chare@x_, y_D := Which@-30 < x < -20 && -40 < y < 40,
0, -20 § x § 30 && -40 < y < -30,
0, -20 § x § 30 && -5 < y < 5, 0,
-20 § x § 30 && 30 < y < 40, 0, True, 1D

edata = Table@N@chare@x, yDD,


8y, -50, 50, 100 ê 127<, 8x, -50, 50, 100 ê 127<D;
ListDensityPlot@edata, Mesh -> False, PlotRange -> AllD

120
100
80
60
40
20
0
0 20 40 60 80 100120
438 Complex Analysis with Mathematica

fourierddata = CentredFourier@edataD;
ListDensityPlot@Abs@fourierddataD,
Mesh -> False, PlotRange -> 80, 0.5<D

120
100
80
60
40
20
0
0 20 40 60 80 100120

‡ The Gaussian blur


We can construct a systematic blurring mechanism by using the convolution theorem.
We build a blurring function first as a table, and then centre it:

blur = Table@Exp@- Hx ^ 2 + y ^ 2L ê 10D,


8x, -63.5, 63.5<, 8y, -63.5, 63.5<D;
blur = Map@RotateRight@#, 64D &, RotateRight@blur, 64DD;

We wish to blur the ‘E’ by convolving it with this function. We use the convolution
theorem – the observed blurred ‘E’ is the inverse of the product of the transform of the
sharp ‘E’ with the transform of the blurring function:

observede = Chop@CentredInverse@
CentredFourier@blurD * CentredFourier@edataDDD;
ListDensityPlot@observede, Mesh -> False,
PlotRange -> AllD

120
100
80
60
40
20
0
0 20 40 60 80 100120
20 Numerical transform techniques 439

If we were to define the blurring function differently, we can increase the blurring effect:

blur = Table@Exp@- Hx ^ 2 + y ^ 2L ê 100D,


8x, -63.5, 63.5<, 8y, -63.5, 63.5<D;
blur = Map@RotateRight@#, 64D &,
RotateRight@blur, 64DD;
observede = Chop@CentredInverse@
CentredFourier@blurD * CentredFourier@edataDDD;
ListDensityPlot@observede, Mesh -> False,
PlotRange -> AllD

120
100
80
60
40
20
0
0 20 40 60 80 100120

What we have shown here is how to implement the so-called ‘Gaussian blur’ with two
different radii. This is one of a host of filters now commonplace in affordable commer-
cial image processing programs, and available for operation on full colour imagery.
Fourier transforms play a role in many of these filters. A delightful exercise on the
relative importance of amplitude and phase in the tansform, in determining the shapes of
letters, was given by Skotton (1994). This article also contains some handy tips for
generating data associated with characters in a more elegant fashion than was considered
here.

20.4 Numerical methods for Laplace transform inversion


The topic of numerical inversion of Laplace transforms has been actively studied for
many years. An excellent survey of techniques in place up to the mid 1970s was given
by Davies and Martin (1979). A family of Mathematica implementations of a subset of
methods surveyed by Davies and Martin was given quite recently in the Mathematica
journal (Cheng et al. 1994). The package produced in association with that article,
NLaplaceInversion.m, is an excellent implementation of five of the older key
numerical inversion techniques. You should check the MathSource electronic library for
this package.

Work published by Talbot in 1979 has lead to renewed interest in numerical


Laplace transform inversion. A good entry point to recent developments is a paper by
440 Complex Analysis with Mathematica

Rizzardi (1995), who extends Talbot's method in a very useful way. Talbot's original
approach was to use the inversion formula over a cleverly chosen contour in the com-
plex plane. Rizzardi has made the point that Talbot's method has the drawback that the
contour chosen depends on the value of t of interest, so that recomputation is required
for new values of t. He has extended the method so that the same contour can be used
for an entire range of values of t. (It would be a very interesting exercise to use Mathe-
matica to compare Rizzardi's methods, the work by Cheng et al, and the direct method
introduced below.)
However, we have to confront the issue that any method that relies on a particu-
lar type of contour deformation may become useless if the transform under consideration
has a structure that renders such a deformation impossible. For example, branch cuts
extending to infinity along the imaginary axis can wreak havoc. At the same time, we
wish to exploit the capabilities built in to Mathematica for numerical integration in the
complex plane. So the approach taken here will be incredibly simple. We shall perform
numerical inversion of the Laplace transform by using NIntegrate along the Bro-
mwich contour! So we let the cunning integration routines built in to NIntegrate take
care of the problems.

20.5 Ÿ Inversion of an elementary transform


Let's introduce an elementary test problem with which to illustrate the method. Users of
Mathematica version 3 or earlier will need to first enter the following:

Needs@"Calculus`LaplaceTransform` "D;

Most users can proceed straight to asking about the key inversion function.

? InverseLaplaceTransform

"InverseLaplaceTransform@expr, s, tD gives the inverse Laplace transform


of expr. InverseLaplaceTransform@expr, 8s1, s2, ... <, 8t1, t2, ... <D
gives the multidimensional inverse Laplace transform of expr.

FullSimplify@
InverseLaplaceTransform @1 ê HHs + 2L ^ 2 + 1L, s, tDD

‰-2 t sinHtL

fninverse@t_D := Exp@-2 tD Sin@tD

Now we define the direct numerical inversion formula. In the following expression the
intersection of the Bromwich contour with the real axis is given by the parameter
contour. The truncation of the integration is given by the parameter range.
20 Numerical transform techniques 441

NBromwich@func_, t_, contour_, range_, options___D :=


HExp@contour * tD ê H2 PiLL *
NIntegrate@func@contour + I pD * Exp@I p tD,
8p, -range, range<, MaxRecursion -> 12, optionsD

NBromwich@H1 ê HH# + 2L ^ 2 + 1LL &, 1, 0, 500D

0.113881 - 2.20974 µ 10-17 Â

The small imaginary part can best be managed by applying:

Chop@%D
0.113881

Here is the exact answer to six d.p.:

N@fninverse@1D, 6D

0.113881

20.6 Ÿ Two applications to ‘rocket science’

‡ A brief introduction to financial derivatives


You do not need to know anything about financial derivatives to appreciate the Laplace
transform inversion issues that we are about to discuss, but the matter may be much
clearer if we take a moment to explain a little about the pricing of options on assets. For
full details in a Mathematica setting, see Shaw (1998). A call option is a financial
instrument that confers on the holder the right (but not the obligation) to buy a certain
amount of an underlying asset (such as a company share, or foreign currency), for a
fixed price. If this right may be exercised at just one point in the future, after which the
option becomes worthless, the option is said to be of European style. If the right can be
exercised at any point in time up to a certain date, the option is said to be American in
style.
Such options may be valued in a variety of ways, but for our purposes it will be
sufficient to note that under certain assumptions, a general European option on a single
asset can be valued by solving a certain partial differential equation, the Black–Scholes
differential equation. This takes the form

V V 1 2 V
ÅÅÅÅÅÅÅÅÅÅ + S Hr - qL ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅ s2 S2 ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ - r V = 0 (20.6)
t S 2 S
where V is the value of the option, S is the value of the underlying asset (the price of one
share), s is the volatility of the asset, q is a measure of the dividend yield from the asset,
and r is the interest rate. We shall assume that s, r and q are constants. The differential
equation is essntially the time-reversed diffusion equation with some extra terms, and it
442 Complex Analysis with Mathematica

is to be solved (in the case of a call option) with a final condition (being a backwards
diffusion this takes the place of an initial condition) that at time t = T

V = Max@S - K, 0D (20.7)

If no other boundaries or variables are introduced, the solution to this equation is


well-known – it is one example of the celebrated Black–Scholes formula:

V = S ‰-qt FHd1 L - K ‰-rt FHd2 L


logHS ê KL + Hr - q + s2 ê2L HT - tL
d1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
s T -t (20.8)
logHS ê KL + Hr - q - s2 ê2L HT - tL
d2 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
s T -t

where FHxL is the cumulative normal distribution function. This is easily implemented in
Mathematica. In this definition t is the time remaining to expiry of the option (T - t
above):

F[x_] := 1/2*(1 + Erf[x/Sqrt[2]]);


done[s_, s_, k_, t_, r_, q_] :=
((r - q)*t + Log[s/k])/(s*Sqrt[t]) + (s*Sqrt[t])/2;
dtwo[s_, s_, k_, t_, r_, q_] :=
done[s, s, k, t, r, q] - s*Sqrt[t];

BlackScholesCall[s_, k_, s_, r_, q_, t_] :=


s*Exp[-q*t]*F[done[s, s, k, t, r, q]] -
k*Exp[-r*t]*F[dtwo[s, s, k, t, r, q]];

A great many generalizations can be given where the final conditions are modified, or
where additional boundaries are introduced. We shall look at two cases that have been
considered recently from the point of view of Laplace transforms:

(i) A call option that becomes worthless if the underlying price reaches either of two
values (a double-barrier option).
(ii) A call option where the final condition has the asset price replaced by its average
value between t = 0 and t = T (the continuously and arithmetically averaged Asian
option).

‡ The double-barrier call option


A double-barrier option is characterized by a strike, K, and two barriers, L, the lower
barrier, and U, the upper barrier, with

L<K <U (20.9)

The option becomes worthless if the stock price hits either barrier between the initiation
and expiry of the option. Otherwise the payoff at t = T is given by Eq. (20.7). This
problem can be solved by series methods, and a paper by Kunitomo and Ikeda (1992)
20 Numerical transform techniques 443

describes such a method that they argue converges very rapidly.


An alternative method was published recently. Geman and Yor (1996) have
shown how to employ the Laplace transform method to double barrier options, and they
demonstrated good agreement with the series method of Kunitomo and Ikeda. We shall
explore and implement this method here.

‡ The Geman–Yor model for double barrier options


Consider a double-barrier call option whose value is C. We write

C = CBS - ‰-r t S f (20.10)

where CBS is the standard Black–Scholes value, given above, and f is a normalized
measure of the decrease in the value due to the double barrier. The interest rate is r and
the stock price at t = 0 is S. The barrier term f can be written as a function of the time to
expiry T and the scaled variables:
K L U
h = ÅÅÅÅÅÅ ; m = ÅÅÅÅÅ ; M = ÅÅÅÅÅÅÅ (20.11)
S S S
The barrier term is Laplace-transformed to define

yHlL = ‡ ‰-l t fHt, h, m, ML „ t (20.12)
0

Further scaling arguments can be used to write


l
YH ÅÅÅÅ s2
ÅÅÅÅ L
yHlL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.13)
s 2

Geman and Yor (1996) have found an exact closed-form solution for YHqL. First, we
define (positive) quantities a and b by

m = ‰-a M = ‰b (20.14)

We also introduce a variable n as follows:


s 2
r - q - ÅÅÅÅ ÅÅÅÅ
n = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Å ÅÅÅ2ÅÅÅÅÅ (20.15)
s2
Finally, we need a variable m given in terms of the argument of the Laplace transform by
è!!!!!!!!
!!!!!!!!
m= n2 + 2 q (20.16)

We also introduce some auxiliary functions f and g:

h-m+n+1 ‰-m a
f Ha, h, m, nL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.17)
m Hm - nL Hm - n - 1L

2 ‰b Hn+1L 2 h ‰b n h m+n+1 ‰-m b


gHb, h, m, nL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅ2ÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.18)
m2 - Hn + 1L m -n
2 m Hm + nL Hm + n + 1L
444 Complex Analysis with Mathematica

The Laplace transform Y is given by


gHb, h, m, nL sinhHm aL f Ha, h, m, nL sinhHm bL
YHqL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.19)
sinhHm Ha + bLL sinhHm Ha + bLL

A closed-form inversion of this is not at present known, but one can use a variety of
numerical methods to invert it. You might also like to consider the methods of Cheng et
al. (1994) applied to the following.

‡ Ÿ Mathematica implementation of the Geman–Yor double-barrier


model
First we just enter the basic changes of variable employed:

h[S_, K_] := K/S;


a[S_, L_] := Log[S/L];
b[S_, U_] := Log[U/S];
n[s_, r_, q_] := (r - q - s^2/2)/s^2;
m[n_, q_] := Sqrt[n^2 + 2*q]

We define the auxiliary functions f and g given by

h-m+n+1 Exp@-m aD
f@a_, h_, m_, n_D := ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
m Hm - nL Hm - n - 1L

g@b_, h_, m_, n_D :=


2 Exp@b Hn + 1LD 2 h Exp@b nD hm+n+1 Exp@-m bD
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
m2 - Hn + 1L2 m2 - n2 m Hm + nL Hm + n + 1L

Then the Laplace transform Y is given by

Y@S_, K_, L_, U_, s_, r_, q_, q_D :=


ModuleA8A = a@S, LD, B = b@S, UD,
H = h@S, KD, n = n@s, r, qD, m<, m = m@n, qD;
g@B, H, m, nD Sinh@m AD + f@A, H, m, nD Sinh@m BD
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ E
Sinh@m HA + BLD

We now need to invert this transform, evaluated at s2 T, and subtract its discounted and
normalized value from the Black–Scholes value. Now we define the Laplace inversion
by integration along a vertical line in the complex plane (the Bromwich integral), with
real part given by the parameter contour. The integration works, but Mathematica
may warn us about the oscillatory nature of the integration. If you get irritating mes-
sages, you might like to turn it off, using

Off@NIntegrate::slwconD

However, if you choose parameters that result in the integration yielding strange
answers, you should not turn off such messages, and possibly explore the options to
20 Numerical transform techniques 445

NIntegrate. Now we define the valuation by the use of the Bromwich integral. In the
following function we compute the Black–Scholes value, the correction for a unit stock
price, and the full value:

DoubleBarrierCall@S_, K_, L_, U_, s_, r_,


q_, t_, contour_, range_, options___D :=
Module@8bs, dim<,
bs = BlackScholesCall@S, K, s, r, q, tD;
dim = Re@ Exp@-r * tD ê H2 PiL * NIntegrate@
Y@S, K, L, U, s, r, q, contour + I pD *
Exp@Hcontour + I pL * s ^ 2 * tD,
8p, -range, range<, MaxRecursion -> 10,
optionsDD; bs - S * dimD

The range {{contour - 1500 * I}, {contour + 1500 * I}} has been found to be useful for
several practical cases. The truncation at 1500 may need to be modified for other
situations.

ü Examples
The following numerical examples were considered by Geman and Yor (1996). If you
consult their paper you can check that our model agrees with their numerical simulations:

DoubleBarrierCall@2, 2, 1.5,
2.5, 0.2, 0.02, 0, 1, 10, 1500D

0.0410889

DoubleBarrierCall@2, 2, 1.5,
3.0, 0.5, 0.05, 0, 1, 10, 1500D

0.0178568

DoubleBarrierCall@2, 1.75,
1.0, 3.0, 0.5, 0.05, 0, 1, 10, 1500D

0.0761723

‡ Comments on ‘hedging’ the double barrier call


One of the advantages of having a reasonably simple closed form for the Laplace
transform is that any of the partial derivatives can be computed by inverting the partial
derivatives of the transform. Of particular interest is the quantity
V
D = ÅÅÅÅÅÅÅÅÅÅ (20.20)
S
which is related to the amount of shares to be held to properly hedge the option. The
computation of this quantity and its derivative, called G, is given in the exercises.
446 Complex Analysis with Mathematica

‡ Arithmetically averaged Asian call options


This is a much more subtle problem involving a modification to the Black–Scholes
equation that depends on a function of the path taken by the underlying price variable -
the average < S > over the time to expiry of the option is used here, and the final value is

Max@0, < S > - KD (20.21)

This section gives a brief summary of the exact solution for the Asian call given by
Geman and Yor (1993), ‘GY’, also discussed by Eydeland and Geman (1995). Suppose
that the current time is t, and that the option matures at a time T > t. The averaging is
arithmetic, continuous, and began at a time t0 b t. Suppose that the known average value
of the underlying over the time interval @t0 , tD is ES. GY define the following changes of
variables:
1
t = ÅÅÅÅÅ s2 HT - tL (20.22)
4
2 Hr - qL
ÅÅÅÅÅÅÅÅÅ - 1
n = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.23)
s2
s2 HK HT - t0 L - Ht - t0 L ESL
a = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.24)
4S
They also define a function of a transform variable p as
è!!!!!!!!
!!!!!!!!!
mHpL = n2 + 2 p (20.25)

The value of the average price option is then given by

‰-r HT-tL 4 S CHt, n, aL


ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.26)
HT - t0 L s2

The remaining function C@n, t, aD is not given explicitly, but GY give its Laplace
transform,

UHp, n, aL = ‡ CHt, n, aL ‰- p t „ t (20.27)
0

as an integral:
1
ÅÅÅÅ
ÅÅÅÅ m-n
ÅÅÅÅ
ÅÅÅÅÅÅ -2
m+n
ÅÅÅÅ
ÅÅÅÅÅÅ +1 -x
Ÿ0 x 2 H1 - 2 a xL 2
2a
‰ „x
UHp, n, aL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (20.28)
m-n ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
p Hp - 2 n - 2L GH ÅÅÅÅ2ÅÅÅÅÅÅ - 1L

where m is a function of p and n, as given above. Geman and Yor develop a series
description of the transform and show how it can be inverted. We shall now explore how
this can be managed and simplified in Mathematica.
20 Numerical transform techniques 447

ü Ÿ Mathematica implementation of exact arithmetical Asian


The first part of the translation to software is obvious – first we enter the definitions of
the various basic functions:

t@T_, t_, s_D := s ^ 2 HT - tL ê 4;


n@r_, q_, s_D := 2 Hr - qL ê s ^ 2 - 1;
a@S_, ES_, K_, s_, T_, t_, to_D :=
s ^ 2 ê H4 * SL HK * HT - toL - Ht - toL * ESL;
m@n_, p_D := Sqrt@n ^ 2 + 2 * pD

Now we enter the definition of the integral that is part of the transform, and request
immediate evaluation:
1
ÅÅÅÅÅÅ
2a
Å
m-n m+n
F@p_, m_, n_, a_D = ‡ x ÅÅÅÅÅÅÅ
2
Å -2
H1 - 2 a xL ÅÅÅÅÅÅÅ
2
Å +1
Exp@-xD „ x
0

IfAReHm - nL > 2 fl ReHm + nL > -4 fl a > 0,


1 1 1 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ J2 ÅÅ2ÅÅ H-m+n+2L a ÅÅ2ÅÅ H-m+n+2L GJ ÅÅÅÅÅ Hm - n - 2LN
GHm + 1L 2
1 1 1
GJ ÅÅÅÅÅ Hm + n + 4LN 1 F1 J ÅÅÅÅÅ Hm - n - 2L; m + 1; - ÅÅÅÅÅÅÅÅÅÅ NN,
2 2 2a
1 1 1
IntegrateA‰-x x ÅÅ2ÅÅ Hm-n-4L H1 - 2 x aL ÅÅ2ÅÅ Hm+n+2L , 9x, 0, ÅÅÅÅÅÅÅÅÅÅ =,
2a
Assumptions Ø a § 0 fi ReHm - nL § 2 fi ReHm + nL § -4EE

Mathematica has evaluated the integral in terms of hypergeometric functions – we


extract exactly the piece we need by supplying the necessary Assumptions as follows:

G[p_, m_, n_, a_] = Integrate[x^((m - n)/2 - 2)*


(1 - 2*a*x)^((m + n)/2 + 1)*Exp[-x], {x, 0,
1/(2*a)}, Assumptions -> {a>0, Re[m+n]>-4,
Re[n]+2<Re[m]}]
1 1 1 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ J2 ÅÅ2ÅÅ H-m+n+2L a ÅÅ2ÅÅ H-m+n+2L GJ ÅÅÅÅÅ Hm - n - 2LN
GHm + 1L 2
1 1 1
GJ ÅÅÅÅÅ Hm + n + 4LN 1 F1 J ÅÅÅÅÅ Hm - n - 2L; m + 1; - ÅÅÅÅÅÅÅÅÅÅ NN
2 2 2a
There are further cancellations when we insert the other terms that make up the
transform:

G@p, m, n, aD
U@p_, m_, n_, a_D = SimplifyA ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅ E;
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
m-n
p Hp - 2 n - 2L Gamma@ ÅÅÅÅÅÅÅ 2
- 1D

In standard mathematical notation, the transform is just (the output style has been
converted here)
448 Complex Analysis with Mathematica

TraditionalForm@U@p, m, n, aDD
1 1
2 ÅÅ2ÅÅ H-m+n+2L a ÅÅ2ÅÅ H-m+n+2L GH ÅÅÅÅ12 Hm + n + 4LL 1 F1 H ÅÅÅÅ12 Hm - n - 2L; m + 1; - ÅÅÅÅ 2 ÅaÅÅÅ L
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ (20.29)
p Hp - 2 Hn + 1LL GHm + 1L

We now have the ingredients to build the Mathematica model of the arithmetical
average price Asian call. In the following the Laplace transform inversion is again done
by direct numerical integration along the truncated Bromwich contour, whose location is
determined in terms of the parameter n. An explicit truncation parameters is supplied,
and we also exploit some symmetry to do the integration over half the contour:

Off@NIntegrate::slwconD

AriAsianPriceCall@S_, ES_, K_,


r_, q_, s_, T_, t_, to_, range_D :=
Module@8ti = t@T, t, sD, n = n@r, q, sD,
a = a@S, ES, K, s, T, t, toD, contour<,
contour = 2 n + 3;
ac = Re@ 1 ê HPiL *
NIntegrate@U@Hcontour + I pL, m@n, Hcontour + I pLD,
n, aD * Exp@Hcontour + I pL * tiD,
8p, 0, range<, MaxRecursion -> 11DD;
Exp@-r * HT - tLD * 4 * S ê HHT - toL * s ^ 2L * acD

Here is an example to show it working. The asset price is currently 1.9 currency units,
the strike is at 2.0 units, and so on:

[email protected], 0, 2, 0.05, 0, 0.5, 1, 0, 0, 1500D

0.193174

This example shows the power of Mathematica very nicely. In lower level program-
ming, in C/C++ in particular, one has to work extremely hard to work out such contour
integrals. In using this result, one should note that the integration has to be taken over a
larger value of the range variable if the volatility s or the time to maturity T - t is
small. When this is done carefully this method can be used as a benchmark calculational
tool for pricing this type of option, and has been used as such. See, for example, Vecer
(2002).

Exercises
20.1 Ÿ The square wave function is given by (evaluate to see the shape)

fsquare@x_D = Which@x < -0.5, 0, x > 0.5, 0, True, 1D;


Plot@fsquare@xD, 8x, -1, 1<, AspectRatio -> 0.5D;
20 Numerical transform techniques 449

Sample this function over 1000 points and investigate the effect of applying Chop with
various parameters to the transformed data.

20.2 Ÿ Explore the operation of Chop on the Fourier transform of the letter ‘E’.

20.3 Ÿ Explore the operation of convolutions based on non-Gaussian filters, making use
of color to plot the results. The following is a useful template, using

J1 Hx2 + y2 L

instead of a Gaussian:

blur = Table@BesselJ@1, Hx ^ 2 + y ^ 2LD,


8x, -63.5, 63.5<, 8y, -63.5, 63.5<D;;
blur = Map@RotateRight@#, 64D &,
RotateRight@blur, 64DD;
observedd = Chop@CentredInverse@
CentredFourier@blurD * CentredFourier@edataDDD;
ListDensityPlot@observedd, Mesh -> False,
PlotRange -> All, ColorFunction -> HueD;

20.4 Prove the discrete Fourier inversion theorem. (Hint: Use Eq. (20.24).)

20.5 Work out the first and second partial derivatives with respect to S of the double-bar-
rier transform function Y, and hence compute
V
D = ÅÅÅÅÅÅÅÅÅÅ
S
2 V
G = ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ
S
for the double barrier call option. (Don't forget to include the derivatives of the ordinary
Black–Scholes piece!)

20.6 Ÿ Obtain the NLaplaceInversion.m package from MathSource and compare


the results obtained on the transform function with the various implementations therein,
against the direct method developed here, for the function
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ
Hs + 2L2 + 1

20.7 Ÿ Look up Rizzardi's (1995) paper and implement the Talbot and modified Talbot
methods in Mathematica – how well do these methods work on the double barrier call
option inversion problem?

20.8 Identify the two poles in the transform of the solution of the Asian call option, and
compute the residues there. Show that the contribution from these two poles alone to the
value of the option is given by
450 Complex Analysis with Mathematica

i ES Ht - t0 L H‰Hr-qL HT-tL - 1L S y
‰-r HT -tL jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - K zz
k T - t0 Hr - qL HT - t 0 L {
Compare the results of this calculation with the two examples given at the very end of
Section 20.4, for larger values of S.

20.9 Ÿ Work out a formula for the D of the Asian call option, and show that when

S = 2; ES = 0; K = 2;
r = 0.05; q = 0; s = 0.5;
t = 0; t0 = 0; T = 1;

the value of the option is about 0.25 and D is approximately 0.56.

20.10 Where are the branch points of the transform function involved in the Asian call
option? Why does this make inversion awkward when some of the standard approximate
methods are used?
21 Conformal mapping II: the
Schwarz–Christoffel mapping

Introduction
In Chapter 16 we explored some of the geometrical properties of holomorphic functions,
and in particular looked at the behaviour of the Möbius transformation. The key geometri-
cal feature was that the mapping is conformal (where the derivative is non-zero) in the
sense that it is locally angle-preserving. In Chapter 19 we highlighted the importance of
conformal mapping to the solution of Laplace's equation in two dimensions. We pro-
duced several types of solution to Laplace's equation, including several examples where
the region of interest was bounded by a circle or a line in the complex plane.
A question that arise naturally is how to manage matters when the region is not a
half-plane or interior/exterior of a circle. Here we must draw a sharp distinction between
issues of general principle and practicalities of implementation. We shall begin by
stating without proof an important, but non-constructive, theorem that addresses the
general principle. Then we shall introduce the Schwarz–Christoffel (SC) mapping that
gives an explicit construction for polygonal regions.
There are very few examples of the SC mapping that can be worked out in
closed-form in terms of ‘simple’ functions. A novel use of Mathematica is to use its
advanced built-in special-function capabilities, and their linkage to the symbolic integra-
tor, to give evaluations of several expressions usually left as complicated integrals in
more traditional treatments. We can use such evaluations to facilitate the visualization of
the mappings, and hence to confirm the correctness of the answer. As such this chapter
contains an informal introduction to hypergeometric functions and elliptic functions,
which arise naturally from SC mappings associated with triangles and rectangles.
Mathematica's symbolic integrator also allows the results for triangles to be extended to
regular n-gons, again in terms of hypergeometric functions. In more recent versions of
Mathematica the implementation of hypergeometric functions of two variables permits a
still larger category of mappings to be explored. It should be emphasized that this is a
purely analytical treatment, best used as a teaching tool.
For full professional use there is an extensive and highly developed numerical
treatment already available. We shall also comment briefly at the numerical implementa-
tion of the SC mapping. Gratitude is expressed to Professor L. N. Trefethen F.R.S. for
supplying background material on this topic. Readers interested in pursing SC mapping
in more detail, whether analytical or numerical, are encouraged to see Section 2.17 and
to consult the definitive and up-to-date text on the matter: Driscoll and Trefethen (2002).
This chapter is best regarded as an educational bridge between the older and very limited
analytical discussions in textbooks and the full numerical approach developed by
Trefethen, Driscoll and co-workers. Our bridge is constructed using the advanced
analytical tools in Mathematica.
452 Complex Analysis with Mathematica

21.1 The Riemann mapping theorem


This theorem is about simply connected domains D in  that are not the whole of .
Given such a domain the theorem states that there is a 1-1 holomorphic function
w = f HzL that maps D onto the interior of the unit disk, i.e. to the set of complex numbers
w such that » w » < 1. If we further specify that a given point z0 satisfies 0 = f Hz0 L, and
that a specified direction at z0 is mapped into a specified direction at 0 (for example the
direction along the positive real axis), the mapping is unique.
The proof of this result is rather beyond the scope of this book. A reasonably
accessible treatment is given by Dettman (1965). Note that the result could just as easily
have been stated about the existence of a mapping into the upper half-plane, by compos-
ing f with an appropriate Möbius transform.
The drawback of this theorem is that it is purely about existence – it tells us
nothing about how to explicitly construct the mapping.

21.2 The Schwarz–Christoffel transformation

w5 w
 5
z
D  U

3
4
w4
 w3
1

w1 2

w2
x1 x2 x3 x4 x5
This is a very explicit constructive method for finding mappings that will cope with
regions with polygonal boundaries. We can work with various base regions, such as the
upper half-plane or interior of a circle, and to state the basic results we shall consider a
mapping from the upper half-plane.
Suppose that we have a polygon in the w-plane with vertices at w1 , w2 , …, wn
and interior angles at those vertices f1 , f2 , …, fn . Suppose that these points map onto
points x1 , x2 , …, xn on the real axis of the z-plane. Let D denote the interior of the
polygon and U the interior of the upper half-plane. Then a transformation that maps U
onto D is given by the Schwarz–Christoffel (SC) formula:

w = A ‡ Hz - x1 LHf1 êpL-1 Hz - x2 LHf2 êpL-1 …Hz - xn LHfn êpL-1 „ z + B (21.1)

In differential form this is just


21 Conformal mapping II: the Schwarz–Christoffel mapping 453

w
ÅÅÅÅÅÅÅÅÅÅ = A Hz - x1 LHf1 êpL-1 Hz - x2 LHf2 êpL-1 …Hz - xn LHfn êpL-1 (21.2)
z

‡ Informal justification of the SC formula


The simplest way of understanding why the formula works is to consider a family of
infinitesimal increments dz along the real axis in the z plane, and their images dw in the
w plane. The key is to explore the arguments (or phases) of these infinitesimal changes.
Now Eq. (21.2) tells us that:

ArgHdwL
f1 fn (21.3)
= ArgHd zL + ArgHAL + J ÅÅÅÅÅÅÅÅÅ - 1N ArgHz - x1 L + … + J ÅÅÅÅÅÅÅÅÅ - 1N ArgHz - xn L
p p
As z moves along the real axis in the positive direction, when z lies strictly between two
of the xi , (here i is an integer subscript labelling a point in the sequence) all the terms in
Eq. (21.3) are constant, so that w moves in a straight line. This is why the image in the w
plane is polygonal. Now we need to see what happens at the corners. When z passes
through xi , all the terms except those involving xi remain constant, but the factor

ArgHz - xi L (21.4)

jumps from a value of p, when z < xi , to a value of 0, when x > xi . The term
fi
J ÅÅÅÅÅÅÅÅ - 1N ArgHz - xi L (21.5)
p
therefore jumps from the value fi - p to the value 0. The direction in which w is travel-
ling therefore rotates in a positive sense (i.e. anti-clockwise), by p - fi . A change in
direction by this amount corresponds to the introduction of a corner in the polygon with
interior angle fi .
What this discussion establishes is that the real axis maps to the boundary of a
polygonal region. This will be sufficient for our purposes. One can go further and
establish that the mapping is one-to-one and indeed takes the upper half-plane to the
interior of a polygon. We can always check this latter point by working out sample
values of particular mappings, such as the image of Â.

‡ The point at infinity: a simplification


We can assume that one of the points on the real axis, say xn is at infinity, with it then
being dropped from the list of points in the transformation. To see this, we write, with xn
finite,

A = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ (21.6)
H-xn LHfn êpL-1
w xn - z Hfn êpL-1
ÅÅÅÅÅÅÅÅÅÅ = A£ Hz - x1 LHf1 êpL-1 Hz - x2 LHf2 êpL-1 …J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N (21.7)
z xn
454 Complex Analysis with Mathematica

Now we take the limit xn Ø ¶, keeping A' finite and the last factor drops out, leaving us
with
w
ÅÅÅÅÅÅÅÅÅÅ = A£ Hz - x1 LHf1 êpL-1 Hz - x2 LHf2 êpL-1 …Hz - xn-1 LHfn-1 êpL-1 (21.8)
z

‡ The exponents and other comments


We can make a simple geometrical argument that puts one constraint on the exponents.
Note that the sum of the exterior angles of any closed polygon is 2p. So we can state that

Hp - f1 L + Hp - f2 L + … + Hp - fn L = 2 p (21.9)

If we divide this by -p we obtain


f1 f2 fn
J ÅÅÅÅÅÅÅÅÅ - 1N + J ÅÅÅÅÅÅÅÅÅ - 1N + … + J ÅÅÅÅÅÅÅÅÅ - 1N = -2 (21.10)
p p p
so that the sum of the exponents in the SC formula is -2. This is a constraint on what we
can write down, and will also turn out to be useful in relating the SC formula for a
half-plane to the corresponding result for a disk. There is also some freedom in the
choice of the xn . Note first that the constants A and B merely adjust the size and position
of the polygon generated by the mapping. So if we set A = 1 and B = 0 we create a
polygon, say P£ , that is similar to the one, say P, that is desired, but it is not the right
size and in the right location. Let's examine the freedom in the xi within this scheme.
We shall assume that the specialization xn = ¶ has not yet been made. Under these
circumstances, given that the exterior angles are fixed, there are still constraints amongst
the xi . For P£ to be similar to P, given that the angles are fixed (so that the remaining
two side lengths are implied) requires that any n - 2 connected sides of P£ must have
lengths that are in a common constant ratio to corresponding sides of P. This implies
n - 3 constraints on the vertices, which are themselves determined by the n variables xi .
This means that before we make the specialization xn = ¶, three of the xi can be
chosen at will. If this specialization is then made, two of the remaining xi can be chosen.
This freedom can also be understood in terms of the requirements within the Riemann
mapping theorem needed to make the mapping unique – we must specify the image of
one complex point (two real conditions) and a direction (one further real condition) to
ensure uniqueness.

21.3 Analytical examples with two vertices


To get a firm grip on the SC formula, we now consider some simple analytical exam-
ples. It will be evident that the matter becomes rather more complicated once there are
more than three vertices, since then we have to solve the problem of determining the xi
for all but three of the values of i. So we consider first some cases with just two vertices,
which can be done analytically.
21 Conformal mapping II: the Schwarz–Christoffel mapping 455

‡ The semi-infinite vertical strip


Perhaps the simplest case is the semi-infinite vertical strip given by

-a b ReHwL b a; ImHwL r 0 (21.11)

In this case we have


p
w1 = -a; f1 = ÅÅÅÅÅÅ
2
p (21.12)
w2 = a; f2 = ÅÅÅÅÅÅ
2
and we can make the simple choice x1 = -1, x2 = +1. The SC formula gives us
w pê2 pê2 A C
ÅÅÅÅÅÅÅÅÅÅ = A Hz - 1L ÅÅÅÅpÅÅ ÅÅ -1 Hz + 1L ÅÅÅÅpÅÅ ÅÅ -1 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅ!Å!!!
ÅÅÅ!ÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅ!Å!!!
ÅÅÅ!ÅÅ (21.13)
z z -1
2 1 - z2
where the shift of constant from A to C makes it rather obvious how to integrate this
result in terms of inverse trigonometric functions – we have, immediately

w = B + C sin-1 HzL (21.14)

Now the constants B and C can be fixed by looking at the locations of the corners.
Considering the first vertex, this gives us
Cp
-a = B + C sin-1 H-1L = B - ÅÅÅÅÅÅÅÅÅÅÅÅ (21.15)
2
The other vertex gives us
Cp
a = B + C sin-1 H1L = B + ÅÅÅÅÅÅÅÅÅÅÅÅ (21.16)
2
from which it follows that B = 0, and K = 2 a ê p, i.e.

2 a sin-1 HzL pw
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; z = sinJ ÅÅÅÅÅÅÅÅÅÅÅÅ N (21.17)
p 2a
This is one of the very few simple analytical outcomes of the SC formula. We can have
a more detailed look at what this mapping does using the visualization tools we have
already introduced.

‡ Ÿ Recall of visualization tools


As in Chapter 16, we shall use the following functions:

Needs@"Graphics`ComplexMap`"D;
456 Complex Analysis with Mathematica

CartesianConformal@func_,
xrange_, yrange_, options___D :=
Show@GraphicsArray@8
CartesianMap@# &, xrange, yrange,
options, DisplayFunction -> IdentityD,
CartesianMap@func, xrange, yrange,
options, DisplayFunction -> IdentityD
<D, DisplayFunction -> $DisplayFunctionD;

Let's look at this first example with a = 1. Recall that CartesianConformal shows
the images of the real and imaginary coordinate lines under the mapping.

CartesianConformal@H2 ê Pi ArcSin@#D &L,


8-16, 16<, 810 ^ H-8L, 16<, Lines -> 20,
PlotPoints -> 200, PlotRange -> AllD

15
12.5 2
10 1.5
7.5
1
5
2.5 0.5

-15 -10 -5 5 10 15 -1-0.5 0.5 1

‡ The step
There are other examples similar in style to this one, where there are just two vertices to
be considered. An important case, left for you to investigate in detail in Exercise 21.1, is
where the polygon has two right-angled turns of opposite sense – this leads to a mapping
from the upper half-plane to one with a step-shaped boundary.

21.4 Triangular and rectangular boundaries


There are a class of problems where we can get ‘formulae’ for the answers, but where
the formulae remain expressible only as an integral or, as we shall now see using
Mathematica, as a ‘special function’. Some interesting cases can be generated by
considering the creation of triangular and rectangular polygons.
For the case of a triangle, consider the following picture (the parameters in the
plot routine, which is shown only to show you how this figure was drawn, are of no
particular signifiance), where we assume that the point A is at the origin and B is at
w = 1. The interior angles at these two vertices are a and b respectively.
21 Conformal mapping II: the Schwarz–Christoffel mapping 457

Show@Graphics @88GrayLevel @0.6D, Polygon @880, 0<, 81, 0<, 80.3, 1<<D<,
8PointSize @0.03D, Point @80, 0<D<,
8PointSize @0.03D, Point@81, 0<D<,
8PointSize @0.03D, Point @80.3, 1<D<,
Line@88-1 ê 2, 0<, 81.5, 0<<D, Line @880, -1 ê 2<, 80, 1.5<<D,
Text@"A", 80.1, -0.1<D,
Text@"B", 81.1, -0.1<D, Text@"C", 80.3, 1.2<D,
Text@"a", 80.1, 0.1<D, Text@"b", 80.85, 0.1<D<DD;

a b
A B

We wish to build a mapping wHzL such that this triangle is the image of the upper
half-plane, with A the image of the origin z = 0, and B is the image of z = 1. Here we
shall make use of the fact that C can be set to be the image of infinity, so that the SC
formula still only involves two terms:
w
ÅÅÅÅÅÅÅÅÅÅ = A£ zHaêpL-1 Hz - 1LH bêpL-1 = C zHaêpL-1 H1 - zLH bêpL-1 (21.18)
z
So the mapping is given by integrating this result:
z
w = C ‡ z HaêpL-1 H1 - zLH bêpL-1 „ z + B (21.19)
0

Now, when z = 0, we also want w = 0, so we set B = 0. Furthermore, since w = 1 when


z = 1, we must choose C to set
1
1 = C ‡ z HaêpL-1 H1 - zLH bêpL-1 „ z (21.20)
0

Now we can get Mathematica to do some work (which can be done by pen and paper if
you know about Gamma and Beta functions):
458 Complex Analysis with Mathematica

Integrate@z ^ Ha ê Pi - 1L H1 - zL ^ Hb ê Pi - 1L,
8z, 0, 1<, Assumptions Ø 8a > 0, b > 0<D

GH ÅÅÅÅapÅ L GH ÅÅÅÅpbÅ L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+ b
GH ÅÅÅÅÅÅÅÅ
p
ÅÅ L

We can assert that C is given by the reciprocal of this integral, i.e.


a+ b
GH ÅÅÅÅÅÅÅÅ
p
ÅÅÅ L
C = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ (21.21)
GH ÅÅÅÅapÅ L GH ÅÅÅÅpbÅ L

The mapping is then given by


a+ b
GH ÅÅÅÅÅÅÅÅ
p
ÅÅ L z
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a
ÅÅÅÅÅÅÅÅ
Å ÅÅÅ
b
Å ÅÅÅ
Å Å ‡ z HaêpL-1 H1 - zLH bêpL-1 „ z (21.22)
GH ÅÅÅÅpÅ L GH ÅÅÅÅpÅ L 0

‡ Ÿ Analysis with Mathematica


In traditional texts, this is usually where the discussion ends. However, armed with
Mathematica, or a very good book of integrals, we can probe further into the structure of
this mapping – let's ask Mathematica to do the integral:

Integrate@z ^ Ha ê Pi - 1L H1 - zL ^ Hb ê Pi - 1L,
8z, 0, z<, Assumptions Ø 8a > 0, b > 0<D
a b
IfAImHzL  0 fi ReHzL § 1, Bz J ÅÅÅÅÅ , ÅÅÅÅÅÅ N,
p p
b a
IntegrateAH1 - zL ÅÅpÅÅ -1 z ÅÅpÅÅÅ -1 , 8z, 0, z<, Assumptions Ø z > 1EE

Clearly for a range values of z, the answer is given by the middle term of this expression
multiplied by C. We augment the Assumptions accordingly:
a+b
GH ÅÅÅÅÅÅÅ
p
L
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ *
a b
GH ÅÅÅp
Å L GH ÅÅÅ p
ÅL
Integrate@z ^ Ha ê Pi - 1L H1 - zL ^ Hb ê Pi - 1L, 8z, 0, z<,
Assumptions Ø 8Im@zD  0 »» Re@zD § 1, a > 0, b > 0<D

Bz H ÅÅÅÅapÅ , ÅÅÅÅpbÅ L GH ÅÅÅÅÅÅÅÅ


a+ b
p ÅÅ L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
b
ÅÅÅÅÅÅ
GH ÅÅÅÅpÅ L GH ÅÅÅÅpÅ L

To explain this output, we present the full form of the input that generates it:

TraditionalForm@Beta@z, a, bDD

Bz Ha, bL
21 Conformal mapping II: the Schwarz–Christoffel mapping 459

Now we ask about this function.

? Beta

Beta@a, bD gives the Euler beta function BHa, bL.


Beta@z, a, bD gives the incomplete beta function BzHa, bL.

Mathematica has now given us a result in terms of the incomplete beta function. The
theory of analytic continuation then can be used to argue that this holds everywhere. A
proper discussion of this is rather beyond the scope of this text, but, basically, if two
holomorphic functions agree on a suitable region, they are equal everywhere, so we can
use the formula in terms of a beta function, which is holomorphic, for other values of z
besides those suggested by the output from the integrator. In any case, we can check this
formula by using our visualization tool. We consider an equilateral triangle, with
p
a = b = ÅÅÅÅÅÅ (21.23)
3
The formula for w is then:

w ê. 8a -> Pi ê 3, b -> Pi ê 3<

Bz H ÅÅÅÅ13 , ÅÅÅÅ13 L GH ÅÅÅÅ23 L


ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
2
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
GH ÅÅÅÅ13 L

We define a Mathematica formula by

g@z_D = Simplify@%D;

Now let us take a look at the result (this needs a fast machine to compute reasonably
quickly):

CartesianConformal@Hg@#D &L, 8-8, 8<,


810 ^ H-12L, 8<, Lines -> 30, PlotPoints -> 1000,
PlotRange -> All, PlotStyle Ø [email protected]

8 0.6
0.5
6
0.4
4 0.3
0.2
2
0.1
-7.5 -5 -2.5 2.5 5 7.5 0.2 0.4 0.6 0.8 1
Slight numerical plotting effects at end-points aside, this confirms the validity of the
closed-form answer.
Another interesting exercise is to consider the region in the upper half plane
above a related triangle and the real axis – this is left for you to explore in Exercise 21.2.
460 Complex Analysis with Mathematica

‡ Ÿ Hypergeometric and beta functions


The incomplete beta function is a special case of the hypergeometric function. You can
just ask the kernel for some basic information about such functions

? Hypergeometric2F1

Hypergeometric2F1@a, b, c, zD
is the hypergeometric function 2F1Ha, b; c; zL.

More useful is the series expansion, which extrapolates the pattern shown here for the
first few terms:

Series@ Hypergeometric2F1@a, b, c, zD, 8z, 0, 3<D

abz a Ha + 1L b Hb + 1L z2 a Ha + 1L Ha + 2L b Hb + 1L Hb + 2L z3
1 + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + OHz4 L
c 2 c Hc + 1L 6 c Hc + 1L Hc + 2L

The beta function arises from the following special case where c = a + 1:

FullSimplify@
Hz ^ a ê aL Hypergeometric2F1@a, 1 - b, a + 1, zDD

Bz Ha, bL

The reader may well ask how the author knew how to dream up this particular form of
the hypergeometric function! Traditionally this sort of identity would have been found in
one of the classic books of results about special functions. A more modern approach is
to consult an on-line database, such as http://functions.wolfram.com . This is a
Mathematica based collection of results, approaching 100,000 formulae at the time this
book was edited. It is quote common for SC integrals to evaluate to a hypergeometric
function – we shall see some more in later sections. With any of these results it may be
useful to check the integral by differentiating it. Here, for example, we obtain

D@Beta@z, a, bD, zD

H1 - zLb-1 za-1

‡ Ÿ Rectangles and elliptic functions


Now consider the polygon as a rectangle. As in the case of the vertical strip, each
fi = p ê 2. There are now four vertices, so strictly we might consider that this requires a
search procedure to determine the fourth value of xi . However, in this case we can
appeal to symmetry to specify the four pre-image points as 1 and  a for some a, and
investigate the family of shapes that result. We shall assume a > 1 in the following
example. In this case the differential SC mapping takes the form
21 Conformal mapping II: the Schwarz–Christoffel mapping 461

w
ÅÅÅÅÅÅÅÅÅÅ = A Hz + aL-1ê2 Hz + 1L-1ê2 Hz - 1L-1ê2 Hz - aL-1ê2
z
(21.24)
A
= - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!!!!!!2! è!!!!!!!! ÅÅÅÅÅÅÅÅ
!!!!!!!
1 - z a2 - z2
It is a little more convient to write this in terms of a = 1 ê a and a new overall constant
A£ as
w A£
ÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
! è!!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅ
!!!!!!!!!! (21.25)
z 1 - z2 1 - a2 z2
The integral of this is only moderately exotic, in that it defines one of the well known
family of elliptic functions. We now set A£ = 1 and evaluate the integral with some
suitable Assumptions:

Integrate@1 ê HSqrt@1 - z ^ 2D * Sqrt@1 - a ^ 2 z ^ 2DL,


8z, 0, z<, Assumptions Ø 80 < a < 1, Im@zD > 0<D

FHsin-1 HzL » a2 L

To figure out what that output really means, we ask for it in InputForm:

InputForm@%D
EllipticF[ArcSin[z], a^2]

So we define:

SCRect@z_, a_D := EllipticF@ArcSin@zD, a ^ 2D;

and check the derivative is indeed what we want:

D@SCRect@z, aD, zD
1
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
! è!!!!!!!! ÅÅÅÅÅÅÅÅÅÅÅÅÅ
!!!!!!!!!!
1-z 2 1 - a 2 z2

What can the kernel tell us about this function?

? EllipticF

EllipticF@phi, mD gives the elliptic integral of the first kind FHphi»mL.

Further information is provided in Section 3.2.11 of The Mathematica Book (Wolfram


2003), on elliptic integrals and elliptic functions. Let's set a = 2, so that a = 1 ê 2, and
plot the mapping, to get a feel for what is happening:
462 Complex Analysis with Mathematica

CartesianConformal@HSCRect@#, 1 ê 2D &L,
8-16, 16<, 810 ^ H-8L, 16<, Lines -> 40,
PlotPoints -> 200, PlotRange -> AllD

15 2
12.5
10 1.5
7.5 1
5
2.5 0.5

-15 -10 -5 5 10 15 -1.5-1-0.5 0.5 1 1.5


We can see very clearly that the EllipticF function is effecting the mapping we
want. The four vertices are a the points  b,  b + Â c, where, as functions of the parame-
ter a = 1 ê a, b is given by integrating the mapping from 0 to 1:

b @a_D = SCRect@1, aD

KHa2 L

where the Mathematica function just output is given by

InputForm@%D
EllipticK[a^2]

For the case we have plotted, the value of this is:

b@1 ê 2D êê N

1.68575

To extract the right value of c we need to be slightly careful with the branching proper-
ties (also see Wolfram (1993)) of the EllipticF function – to this end we define:

c@a_, e_D = SCRect@1 ê a + e I, aD - b@aD


1
FJsin-1 JÂ e + ÅÅÅÅÅ N À a2 N - KHa2 L
a
For the example at hand, the most obvious approach does not quite work:

c@1 ê 2, 0D êê N

-4.00238 µ 10-9 - 2.15652 Â

If we nudge the point slightly into the upper half-plane, which is, after all, where we are
working, we get:
21 Conformal mapping II: the Schwarz–Christoffel mapping 463

c@1 ê 2, 10 ^ H-12LD êê N

-8.16425 µ 10-7 + 2.15651 Â

Im@%D
2.15651

which is the right value, and consistent with our plot.

21.5 Ÿ Higher-order hypergeometric mappings


These analytical considerations may be taken further, to deal with more general quadrilat-
erals. The calculation of the relevant two-variable hypergeometric functions that is
needed is also quite computationally demanding and a GHz-class machine is recom-
mened. You will also need version 4 or later of Mathematica. Let's add a further pre-ver-
tex at g > 1 and consider the following
w
ÅÅÅÅÅÅÅÅÅÅ = C zHaêpL-1 H1 - zLH bêpL-1 Hg - zLHgêpL-1 (21.26)
z
Let's look at the image of unity first, to get the normalization:

normfactor = Integrate@
z ^ Ha ê Pi - 1L H1 - zL ^ Hb ê Pi - 1L Hg - zL ^ Hg ê Pi - 1L,
8z, 0, 1<, Assumptions Ø 8g > 1, a > 0, b > 0<D
g
g ÅÅpÅÅ -1 GH ÅÅÅÅapÅ L GH ÅÅÅÅpbÅ L 2 F1 I ÅÅÅÅapÅ , 1 - ÅÅÅÅ g a+ b
p ; ÅÅÅÅÅÅÅÅp ÅÅ ; ÅÅÅÅ gM
1

ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+ b
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ
GH ÅÅÅÅÅÅÅÅ
p
ÅÅ L

We will restrict attention to the situation where unity maps to unity, as in the case of the
triangle, so we assert that C is given by the reciprocal of the central term, i.e.

norm = 1 ê normfactor
g
a+ b
g1- ÅÅÅÅpÅ GH ÅÅÅÅÅÅÅÅ p ÅÅ L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅ
GH ÅÅÅÅpÅ L GH ÅÅÅÅpÅ L 2 F1 I ÅÅÅÅpÅ , 1 - ÅÅÅÅgp ; ÅÅÅÅÅÅÅÅ
a b a a+ b
p
ÅÅ ; ÅÅÅÅ1g M

So this mapping is given by


-1
HGH ÅÅÅÅapÅ LGH ÅÅÅÅpbÅ LL g1-HgêpL z
H bêpL-1
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è a ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
g
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+ b
ÅÅÅÅÅ ÅÅÅ
Å ‡ z HaêpL-1 H1 - zL Hg - zLHgêpL-1 „ z (21.27)
2 F 1 I ÅÅÅÅ Å - ÅÅÅÅ ÅÅÅÅÅÅÅÅ
Å Å ÅÅÅÅ M
1
p
, 1 p
; p
; g 0

What about the remaining integral? This is best described by introducing another
hypergeometric function. Consider the following Mathematica function:
464 Complex Analysis with Mathematica

? AppellF1

"AppellF1@a, b1, b2, c, x, yD is the Appell


hypergeometric function of two variables F1Ha; b1, b2; c; x, yL.

We will set:

new =
Hg ^ c * z ^ H1 + aL * AppellF1@1 + a, -b, -c, 2 + a, z, z ê gDL ê
H1 + aL

gc za+1 F1 Ia + 1; -b, -c; a + 2; z, ÅÅÅÅgz M


ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+1
Here is the observation we need:

FullSimplify@D@new, zDD
z c
gc H1 - zLb za J1 - ÅÅÅÅÅ N
g

We now define the mapping in full:

h@z_, a_, b_, g_, g_D = norm *


Hnew ê. 8a Ø a ê Pi - 1, b Ø b ê Pi - 1, c Ø g ê Pi - 1<L;
AppellMap@z_, a_, b_, g_, g_D := h@z, a, b, g, gD;
TraditionalForm@AppellMap@z, a, b, g, gDD
a
p z ÅÅpÅÅÅ F1 I ÅÅÅÅapÅ ; 1 - ÅÅÅÅpbÅ , 1 - ÅÅÅÅ g
p ; ÅÅÅÅ
a
pÅ + 1; z, ÅÅÅÅ
a+ b
g M GH ÅÅÅÅÅÅÅÅ
z
p ÅÅÅ L
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
b
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
g
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
a+ b
ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
a GH ÅÅÅÅapÅ L GH ÅÅÅÅpÅ L 2 F1 I ÅÅÅÅapÅ , 1 - ÅÅÅÅp ; ÅÅÅÅÅÅÅÅ p
Å Å ; ÅÅÅÅ
1
g
M

We can now work with more general quadrilaterals. The following takes some consider-
able time to compute, but nicely illustrates the construction of a trapezoidal region:

CartesianConformal@
HAppellMap@#, Pi ê 2, Pi ê 2, 5 * Pi ê 8, 2D &L,
8-6, 6<, 80.05, 8<, Lines -> 10,
PlotPoints -> 30, PlotRange -> AllD
21 Conformal mapping II: the Schwarz–Christoffel mapping 465

8 1

6 0.8
0.6
4
0.4
2
0.2

-6 -4 -2 2 4 6 0.20.40.60.8
In principle, the Appell function could be made the basis of a semi-analytical treatment
of general quadrilaterals. Note that the value of g has been specified in the example
given. In general, one would need to find g given a specification of the target shape. This
is an example of the ‘pre-vertex’ problem.

‡ Ÿ Hypergeometric mappings with symmetry


In the same spirit as we treated the rectangular regions, we can also treat some six-vertex
regions where the domain is treated symmetrically about the origin. Consider the
SC-mapping defined by
w H bêpL-1 HgêpL-1
ÅÅÅÅÅÅÅÅÅÅ = C zHaêpL-1 H1 - z2 L Hg - z2 L (21.28)
z
Mathematica can integrate this directly reasonably quickly.

Integrate@
z ^ Ha ê Pi - 1L H1 - z ^ 2L ^ Hb ê Pi - 1L Hg - z ^ 2L ^ Hg ê Pi - 1L,
8z, 0, 1<, Assumptions Ø 8g > 1, a > 0, b > 0<D
1 g a b è a g a+2 b 1
ÅÅÅÅÅ g ÅÅpÅÅ -1 GJ ÅÅÅÅÅÅÅÅÅÅ N GJ ÅÅÅÅÅ N 2 F 1 J ÅÅÅÅÅÅÅÅÅÅ , 1 - ÅÅÅÅÅ ; ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; ÅÅÅÅÅ N
2 2p p 2p p 2p g

ü Project
Explore the use of the Appell and 2 F1 hypergeometric function for these mappings.
Show how to produce a mapping of the upper half-plane into a (symmetric) L-shaped
region, by taking a = b = g = p ê 2 and g = 2.

21.6 Circle mappings and regular polygons


The SC formula may also be written in terms of a mapping from the unit circle to a
polygon – the resulting mapping turns out to be no more complicated than the half-plane
SC formula. When the polygon is a regular polygon, the integral simplifies considerably
and can be evaluated by Mathematica in terms of hypergeometric functions.
466 Complex Analysis with Mathematica

‡ The SC formula for the unit circle


Recall from Chapter 16 that the mapping
z-Â
pHzL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (21.29)
z+Â
takes the upper half-plane to the unit circle. The inverse of this mapping is just
 H1 + pL
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (21.30)
1- p

We can actually construct a very simple mapping from the interior of the unit circle to a
polygon by composing this Möbius mapping with the SC formula. Suppose that the
points xi map into points pi on the unit circle. Then, for each i, we have
 Hp + 1L  Hpi + 1L 2  Hp - pi L
z - xi = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅ (21.31)
1- p 1 - pi H1 - pL H1 - pi L

and the Jacobian of the transformation is


z 2Â
ÅÅÅÅÅÅÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ (21.32)
p H1 - pL

We now subsitute all of this into the SC formula (21.1) and make use of the exponent
formula (21.10), which simplifies the result to
è
w = A ‡ Hp - p1 LHf1 êpL-1 Hp - p2 LHf12 êpL-1 …Hp - pn LHfn êpL-1 „ p + B (21.33)

where A is a new arbitrary constant. This result is of course structurally identical to the
half-plane result, but now the pn are points on the unit circle.

‡ Regular polygons
It is evident from Eq. (21.29) that matters simplify if all the exponents are identical.
Furthermore, if we exploit symmetry to consider points pi that are evenly spaced around
the unit circle, we can go further still. We take the points wk to be the n nth roots of
unity, in the form

pk = wkn (21.34)

wn = ‰2pÂên (21.35)

The product

Hp - p1 LHp - p2 L …Hp - pn L (21.36)

then simplifies to just


21 Conformal mapping II: the Schwarz–Christoffel mapping 467

pn - 1 (21.37)

With our target a regular n-gon, the interior angles are all equal and given by:
2
fk = p J1 - ÅÅÅÅÅ N (21.38)
n
and it follows that the exponents are all equal to -2 ê n. Therefore the desired mapping
takes the form

è 1
ÅÅÅÅÅÅÅÅ „ p + B
w = A ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅnê2 (21.39)
Hp - 1L
n

In fact, slightly cleaner results will be obtained from the integration, which will run from
p = 0 to p = z, by redefining A so that this is written as a linear transformation of
z
1
ÅÅÅÅÅÅÅÅ „ p
w = ‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅnê2 (21.40)
0 H1 - p L
n

ü Ÿ Example: the hexagon


A hexagon is obtained by setting n = 6. We now get the integrator to finish the calcula-
tion for us:

Integrate@1 ê H1 - z ^ 6L ^ H1 ê 3L, 8z, 0, z<D


1 1 7 1
z IfA-1 § ReHzL § 1 fi ImHzL  0, 2 F1 J ÅÅÅÅÅ , ÅÅÅÅÅ ; ÅÅÅÅÅ ; z6 N, IntegrateA ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
è!!!!!!!! ÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅ ,
!!!!!!!!!!
6 3 6 3
1 - z 6 z6
8z, 0, 1<, Assumptions Ø Ÿ H-1 § ReHzL § 1 fi ImHzL  0LEE

To check what this function is doing we plot the result. To visualize this mapping from
the circle we now recall, from Chapter 16, the polar version of our mapping viewer:

PolarConformal@func_, radial_, polar_, options___D :=


Show@GraphicsArray@8
PolarMap@# &, radial, polar,
options, DisplayFunction -> IdentityD,
PolarMap@func, radial, polar,
options, DisplayFunction -> IdentityD
<D, DisplayFunction -> $DisplayFunctionD;

PolarConformal@
H# * Hypergeometric2F1@1 ê 6, 1 ê 3, 7 ê 6, # ^ 6D &L,
80, 1<, 80, 2 Pi<, Lines -> 20,
PlotPoints -> 40, PlotRange -> AllD
468 Complex Analysis with Mathematica

1 1

0.5 0.5

-1 -0.5 0.5 1 -1 -0.5 0.5 1

-0.5 -0.5

-1 -1

‡ Ÿ The general regular polygon


Mathematica is also quite happy dealing with a polygon with n vertices:

PolyMap@z_, n_D = Integrate@


1 ê H1 - z ^ nL ^ H2 ê nL, 8z, 0, z<, Assumptions Ø n > 0D
1 2 1
z 2 F1 J ÅÅÅÅÅ , ÅÅÅÅÅ ; 1 + ÅÅÅÅÅ ; zn N
n n n
Let's take a look at this for n = 3, 5:

PolarConformal@HPolyMap@#, 3D &L, 80, 1<, 80, 2 Pi<,


Lines -> 20, PlotPoints -> 320, PlotRange -> AllD

1 1.5

1
0.5
0.5

-1 -0.5 0.5 1 -0.5 0.5 1 1.5


-0.5
-0.5
-1

-1 -1.5

PolarConformal@HPolyMap@#, 5D &L, 80, 1<, 80, 2 Pi<,


Lines -> 20, PlotPoints -> 80, PlotRange -> AllD
21 Conformal mapping II: the Schwarz–Christoffel mapping 469

1 1

0.5 0.5

-1 -0.5 0.5 1 -1 -0.5 0.5 1

-0.5 -0.5

-1 -1

Of course, any of these mappings can be composed with the half-plane to circle Mobius
mapping to show the effect of the mapping when applied to the coordinate lines within
the upper half-plane. This gives less coverage of the target region for any given finite
rectangular subset of the upper half-plane. For example, for the pentagon and square, we
have:

CartesianConformal@HPolyMap@H# - IL ê H# + IL, 5D &L,


8-5, 5<, 80.0001, 5<, Lines -> 20,
PlotPoints -> 40, PlotRange -> AllD

5 1
4
0.5
3
2 -0.75
-0.5
-0.25
0.25
0.5
0.75
1 -0.5

-4 -2 2 4 -1

CartesianConformal@HPolyMap@H# - IL ê H# + IL, 4D &L,


8-5, 5<, 80.0001, 5<, Lines -> 20,
PlotPoints -> 40, PlotRange -> AllD

5
1
4
0.5
3
2 -1-0.5 0.5
1 -0.5
-1
-4 -2 2 4
Note that these rather exotic mappings are the composition of a Mobius transform with a
carefully chosen hypergeometric mapping! See Driscoll and Trefethen (2002, Section
4.4) for an approach to regions exterior to a polgon, also with hypergeometric functions.
470 Complex Analysis with Mathematica

21.7 Detailed numerical treatments


It is evident that the management of polygonal regions with many vertices and no
regular symmetry takes us outside the domain of tractable analytical closed-form
solutions, even when armed with advanced special-function libraries such as those built
in to Mathematica. In addition to computational efficiency issues, there are two points of
difficulty:

(1) determination of the xi to generate a mapping corresponding to a prescribed polygon;


(2) efficient integration to compute the mapping (also needed within (1)).

The first part of this is called the pre-vertex problem. I have resisted the temptation to
implement some of this in Mathematica, as there are very efficient and mature implemen-
tations already available in FORTRAN and MATLAB. Indeed, Mathematica's strength
in this area is probably in the routine management of the simpler examples we have cited
using advanced analytics.
Much of the recent work in this area has been done by L.N. Trefethen and
co-workers. A FORTRAN implementation, SCPACK, suitable for a class of problems
was given by Trefethen (1980), and its successor, the Schwarz–Christoffel Toolbox
(Driscoll, 1996), is now available for use within the MATLAB system, and contains
many enhancements. This is available for download over the World-Wide Web at:
http://www.math.udel.edu/~driscoll/SC/ . Some key references are as follows.
An extensive survey of developments up to about 1985 is given by Trefethen (1986).
Some particular approaches for treating elongated structures are given by Howell and
Trefethen (1990). A more recent but compact survey is given by Trefethen and Driscoll
(1998). The text ‘Schwarz-Christoffel Mapping’ (Driscoll and Trefethen, 2002) is
probably the best entry point.
The numerical approach involves many interesting features. The solution of the
pre-vertex problem involves some cunning transformations to eliminate the constraints
associated with ordering of the xi . The integration also requires an approach that takes
care of the singularities of the integrand at the pre-images of the vertices. This requires
an enhancement of the Gauss–Jacobi method. Often the xi crowd together in an awk-
ward fashion, and this must also be managed. Those interested should see the references
for information on the management of these matters. A supply of other analytical
problems set in the interesting context of fluid dynamics is given by Milne-Thomson
(1938).

Exercises
21.1 Ÿ Consider the polygon in the w plane consisting of the negative real axis, the line
from 0 to  a, and the horizontal line from  a to  a + ¶. Use the SC formula to show
that this can be obtained from the upper half-plane in the z plane by the mapping
21 Conformal mapping II: the Schwarz–Christoffel mapping 471

2a è!!! è!!!!!!!!!!!!!!!!


w = ÅÅÅÅÅÅÅÅÅÅÅÅÅ Isin-1 I z M + z H1 - zL M
p
Confirm the validity of this formula by using the CartesianConformal graphics
function to visualize the mapping with a = 1 and a = 2. (Hint: You will need to use the
pure function

HH2 * IL ê Pi * HArcSin@Sqrt@#DD + Sqrt@# * H1 - #LDL &L

over a suitable domain.)

21.2 Ÿ Consider the polygon given by the shaded region below:

Show@Graphics@
[email protected], Polygon@88-2, 0<, 8-1, 0<, 80, 1<, 81, 0<, 82, 0<, 82, 2<, 8-2, 2<<D<,
8PointSize @0.03D, Point@8-1, 0<D<, [email protected], Point@81, 0<D<,
8PointSize @0.03D, [email protected], 1.0<D<,
Line@88-2, 0<, 82, 0<<D, Line@880, -1 ê 20<, 80, 2<<D,
Text@"A:w=-b", 8-1, -0.2<D,
Text@"B:w=+b", 81.1, -0.2<D, Text@"C:w=Âa", 80.4, 1<D,
Text@"a", 8-0.8, 0.1<D, Text@"a", 80.8, 0.1<D<DD;

C:w=Â a

a a
A:w=-b B:w=+b
Construct an SC mapping with the properties that:

(i) A (-b) is the image of -1;


(ii) B (+b) is the image of +1;
(iii) C (+Â a) is the image of 0.

and express your answer in terms of an integral. What constraint relates a, b and a?
Using the Mathematica integrator, determine the arbitrary constants A and B. By consid-
ering the Mathematica evaluation of the expression

Integrate@z ^ H2 a ê PiL ê H1 - z ^ 2L ^ Ha ê PiL, 8z, 0, z<D

find a closed form for the mapping. Now consider the form of your answer with
p p
a = ÅÅÅÅÅÅ ; b = ÅÅÅÅÅÅ ; a = b = 1
4 4
472 Complex Analysis with Mathematica

By making a construction similar to that given for the interior of the triangle, build the
analogue of the function g[z] in the text, and visualize the results. You should be able
to obtain a plot identical to the following, with the given parameters:

CartesianConformal@Hg@#D &L,
8-1.5, 1.5<, 80.00001, 1.5<, Lines -> 30,
PlotPoints -> 40, PlotRange -> AllD

1.4 2.5
1.2
1 2
0.8 1.5
0.6 1
0.4
0.2 0.5
-1.5 -1 -0.5 0.5 1 1.5 -2 -1 1 2
21.3 Using the SC formula for a square, establish a relationship between a special case
of the hypergeometric function and a special case of an elliptic function.

21.4 Ÿ What is the length of the size of the regular hexagon generated by the mapping

PolyMap@z_, n_D =
Integrate@1 ê H1 - z ^ nL ^ H2 ê nL, 8z, 0, z<D

with n = 6? (Hint: Calculate the image of z = 1 and of z = ‰2pÂê6 . )

21.5 Ÿ The images of very small circles in the unit disk look at lot like circles in the
image n-gon, in the examples given in Section 21.6. Explain this by considering the
power series for PolyMap. You might like to consider the form of

Series@PolyMap@z, 10D, 8z, 0, m<D

to get you going, for various values of integers m.

21.6 Ÿ (Reverse engineering) For each of the following mappings, use the Cartesian-
Conformal function to establish the image region, and then explain how to derive the
mapping from the SC formula:
1
ÅÅÅÅÅÅ cosh-1 HzL ; logHzL ; z1ê3
p
22 Tiling the Euclidean and hyperbolic
planes

Introduction
In our studies so far we have been concerned with the complex plane interpreted as a
two-dimensional Euclidean plane – when the concept of distance has been needed, it has
always been the standard Euclidean notion expressed by Pythagoras' theorem. There are
concepts of distance other than the standard Euclidean one. Indeed, this notion is at the
heart of modern geometrical physics, and finds expression in both the non-positive-defi-
nite notions of distance of special relativity, and the non-flat metrics of general relativity.
In this chapter we shall meet the hyperbolic plane, which is perhaps the simplest
non-Euclidean geometry. We shall not be able, in one chapter, to do full justice to this
concept – indeed, excellent entire books have already been written about it (Coxeter,
1965; Stahl, 1993). What we shall do is explore a little of the geometry through the
process of tiling the hyperbolic plane (see the Bibliography for papers by Coxeter and
Levy on this particular matter also).
This chapter is based substantially (the sections on triangles and the ‘ghosts and
birdies’ tiling) on a project carried out by a former colleague, V. Thomas, for the BBC
Open University Production Centre. Gratitude is expressed to A.M. Gallen and, latterly,
the Open University for permission to use this material, to Professor R. Penrose F.R.S.
(‘R. Penrose’ for short) for several helpful suggestions, and to V. Thomas for permission
to use her work in this text. Later sections (22.6–7) on the projective representations and
tilings by squares were inspired by some suggestions by R. Penrose in connection with
illustrations for his beautiful book (Penrose, 2004). Gratitude is again expressed to R.
Penrose for his guidance on the development of some of the algorithms described here.
This chapter develops techniques for a process that, when given any suitable
triangle, will tile the Euclidean plane using that shape. This then leads to a procedure for
adapting such triangular shapes to produce Escher-like tilings of the Euclidean plane.
These methods are then extended to hyperbolic tilings, represented on the Euclidean
plane by the Poincaré disc, more properly known as Beltrami's conformal representation.
This is illustrated with specific triangles and an Escher-like pattern. Then a look is taken
at Beltrami's projective representation, and tilings by hyperbolic squares in both the
conformal and projective representations. An extension of the technique provides a
hyperbolic tiling using heptagons. This chapter also illustrates yet another role for the
Möbius transformation!

22.1 Background
The familiar geometry of the plane, Euclidean geometry, is only one of many different
geometries that describe the various intrinsic structures of different surfaces. Most of
474 Complex Analysis with Mathematica

these geometries do not have as much symmetry as Euclidean geometry, but there are
two geometries that do: the geometry of the surface of a sphere, and another geometry
called hyperbolic geometry. Hyperbolic geometry shares many of the properties of
Euclidean geometry but differs in certain significant respects. Most importantly, the
ordinary Euclidean notion of parallel lines does not hold. (In Euclidean geometry there
is a unique line through a given point parallel to a given line.) Also the angles in a
hyperbolic triangle do not add up to 180 degrees but always to something less than 180,
the difference being a measure of the area of the triangle. This is a geometry that cannot
be directly represented by any diagram we could draw on paper. However, we can
perform a transformation and obtain a picture of how the geometry would look if we
were to embed it into a Euclidean world in which the whole of the infinite hyperbolic
plane is mapped onto an open unit disc in the Euclidean plane. This particular transforma-
tion can be achieved so that the angular measurements made on this ‘Euclidean’ picture
of the hyperbolic plane (called the Poincaré disc) will be the same as the angles mea-
sured in the actual hyperbolic plane. The Dutch artist M. C. Escher made several wood-
cuts illustrating this representation of hyperbolic geometry.
For a Euclidean space we intuitively know what it would be like to move around
in a space defined by that geometry, and can define transformations that describe these
movements. If we think of the Euclidean plane as the complex plane then these transfor-
mations can be described in terms of functions applied to the complex number z as

z Ø az+b
(22.1)
†a§ = 1

if orientation is preserved (i.e. translation and rotation), or, if orientated is reversed, we


use the non-holomorphic mapping:

z Ø a zê + b
(22.2)
†a§ = 1

In each case a and b are complex numbers.


For the hyperbolic plane the relevant transformations are a subset of the Möbius
transformations and their non-holomorphic equivalents. As a procedure for enabling us
to manipulate the structures of this hyperbolic world, it is useful to think of the transfor-
mations taking the hyperbolic geometry into itself, as represented on the Poincaré disc.
Taking the Euclidean plane as the complex plane, we look at the transformations that
will take the open unit disc (representing the hyperbolic plane) into itself. The unit disc
is described by the set of complex z with †z§ < 1. The transformations that take this disc
into itself are of the form
az+ b
z Ø ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (22.3)
gz+d

where
êê êê
a êê êê
a=dd > b b=gg
êê êê (22.4)
ag = b d
22 Tiling the Euclidean and hyperbolic planes 475

These are the self-transformations of the disc that preserve orientation. There are also
orientation-reversing transformations. These are the same as above but composed with
z Ø zê , so we can write them as
a zê + b
z Ø ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ
g zê + d
(22.5)

with the same relations amongst a, b, g and d.

22.2 Ÿ Tiling the Euclidean plane with triangles


The procedure for creating a tiling that will cover the whole of a surface with a single (or
many) shapes is achieved by defining the transformations of polygonal shapes that
define their positions on a particular plane. One way of defining such a tiling is to reflect
a single shape in its edges repeatedly to produce a pattern built up of many copies of the
same shape. To be able to do this we need to define a reflection in a Euclidean plane.
The reflection of a point c in the line joining the points a and b, given as points in the
complex plane, is the point c£ described by

Haêê b - êê b aL + Ha - bL êê c
c£ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êê ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êê ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (22.6)
a-b
We can use this to produce a general function that will reflect the point r, in the line
joining points p1 and p2. In the following function r, p1, p2 are all lists of length two
representing coordinates in the plane:

reflection@8r_, p1_, p2_<D :=


Module@8cr, cp1, cp2, newcr, nr<,
8cr, cp1, cp2< =
Map@HFirst@#D + I Last@#DL &, 8r, p1, p2<D;
newcr = HHHcp1 - cp2L Conjugate@crD +
HConjugate@cp1D cp2 - cp1 Conjugate@cp2DLL ê
HConjugate@cp1D - Conjugate@cp2DLL;
nr = N@8Re@newcrD, Im@newcrD<DD

To show this reflection in action, we introduce the function showReflection, which


will take any three points and reflect the first in the line joining the other two and
illustrate this procedure. The function pointLabels is employed only to ensure that
the labels associated with each point illustrated occur in an appropriate position:

pointLabels@8a_, la_<, 8b_, lb_<D :=


Module@8theta, disp<,
theta = Arg@HFirst@#D + I Last@#DL & @a - bDD;
disp = 0.25 * 8Cos@theta - Pi ê 2D, Sin@theta - Pi ê 2D<;
8Text@FontForm@la, 8"Times", 14<D, a + dispD,
Text@FontForm@lb, 8"Times", 14<D, b + dispD<D
476 Complex Analysis with Mathematica

showReflection@r_, p1_, p2_D :=


Module@8X<,
Show@Graphics@
Join@
[email protected],
Map@Point,
8r, p1, p2, X = reflection@8r, p1, p2<D<D,
Line@8p1, p2<D<,
pointLabels@8p1, a<, 8p2, b<D,
pointLabels@8X, x '<, 8r, x<DD
D,
AspectRatio -> AutomaticDD

showReflection@84, 1<, 85, 4<, 81, 1<D


a

x
b
Now we can extend this to produce the reflection of a triangle in one of its sides, as
illustrated. For this it will be useful to have a standard function defined that will join the
three points of a triangle and also show the vertices as points. Now we introduce the
general reference triangle, which carries the information about the vertices and the
colour of the triangle:

triangleANDpoints@
triangle@color_: GrayLevel@0D, 8r_, p1_, p2_<DD :=
88Line@8p2, r, p1, p2<D<,
[email protected], Point@rD,
Point@p1D,
Point@p2D<<

To illustrate the reflection of a triangle abc in one of its sides bc we can write the
function reflectedtriangle and apply that to some set of three vertices, the labels
only being added for clarity:
22 Tiling the Euclidean and hyperbolic planes 477

reflectedTriangle@8a_, b_, c_<D :=


Module@8A<,
Show@Graphics@
Join@
8triangleANDpoints@triangle@8a, b, c<DD,
triangleANDpoints@
triangle@8A = reflection@8a, b, c<D, b, c<DD<,
pointLabels@8A, "a'"<, 8a, "a"<D,
pointLabels@8b, "b"<, 8c, "c"<DDD,
AspectRatio -> AutomaticDD

reflectedTriangle@886, 1<, 80, 0<, 85, 6<<D

a' c

b
However, instead of only reflecting one of the points of the triangle in one of the sides,
to tile the plane quickly with these triangular tiles it will be useful to be able to reflect all
three points of the triangle in their opposite sides. Here we will want to apply the
function reflection to the cyclic permutation of the points of the triangle:

cyclicPermutations@x_ListD :=
NestList@RotateLeft, x, Length@xD - 1D

The function reflectTriangles will return the set of three triangles that are the
reflections of the original triangle in each of its sides and the colour of these triangles
will have been changed:
478 Complex Analysis with Mathematica

reflectTriangles@
triangle@color_: GrayLevel@0D, 8a_, b_, c_<DD :=
Map@triangle@
If@Head@colorD == Hue,
ReplacePart@#,
Switch@
#@@1DD, 0.15, 0.72, 0.72, 0.15D,
1D, #, #D &@colorD, #D &,
MapThread@H8a, b, c< ê. #2 -> reflection@#1DL &,
8cyclicPermutations@8a, b, c<D,
8a, b, c<<D
D

Now we can obtain the first step towards tiling the Euclidean plane by applying this
reflecting function to our base triangle once:

Show@Graphics@
Map@triangleANDpoints,
reflectTriangles@
triangle@886, 1<, 80, 0<, 85, 6<<DDD,
AspectRatio -> AutomaticDD

The next stage in this process will be to reflect each of the three new triangles in each of
their three sides. As we come to deal with larger and larger lists of triangles we will
want reflectTriangles to perform this same procedure on each triangle that
makes up that list. We therefore need it to have the attribute of being Listable:

SetAttributes@reflectTriangles, ListableD

In order for this process to produce a larger and larger grouping of triangles it will be
useful to be able to apply the reflectTriangles function over and over again to
the results obtained at each stage. For this we can use the NestList function, which
will give the set containing the triangles produced after applying the reflecting function a
certain number of times.
22 Tiling the Euclidean and hyperbolic planes 479

In our function triangleTilingTry, which will perform this process a


certain number of times, we therefore combine these procedures to repeatedly apply the
reflectTriangles function and then produce the graphic using triangleAND-
points:

triangleTilingTry@triangle_, n_D :=
Show@Graphics@
Map@triangleANDpoints,
Flatten@NestList@
reflectTriangles,
triangle,
nDDDD, AspectRatio -> AutomaticD

Let's see this process carried out for an example where we reflect from a base triangle
twice:

triangleTilingTry@triangle@886, 1<, 80, 0<, 85, 6<<D, 2D

At this stage of the process one of the main problems of the whole procedure begins to
come to light. It will get more complicated the more iterations are performed. Each set
of reflections of a single triangle will produce the triangles surrounding the original
triangle. This means, first, at any given level there is likely to be some overlapping of
triangles and, second, that triangles already produced at an earlier level in the process
are all going to be re-obtained (this is obvious as in our original reflection of the point c
in ab, reflecting c£ in ab will get us back to c). There is a great deal of duplication of
triangles taking place.
Rather than being a problem, the fact that triangles produced at an earlier stage
are re-obtained when the next reflection is performed means that it is not necessary to
carry around information relating to all the triangles of the pattern but only the last two
set of triangles obtained by the iterative process. It is therefore only necessary to use the
Nest function and add in a holder that will keep the last set of triangles acted upon
stored. This can then be joined onto the current set produced for production of the
graphic. This is done using the following code (this is not for actual evaluation – it is to
illustrate the structure):
480 Complex Analysis with Mathematica

Join@Nest@
Htemp = #; refelction procedure @#DL &,
starting triangle ,
number of iterations D,
tempD

The removal of duplicates within any single level of reflections can, at least at this stage,
be done by just asking for duplicates to be removed using the Union function. Later we
will need to take more care over this process. So, the reflections can be performed and
duplicates removed using the following procedure:

Flatten@Union@reflectTriangles@#DDD &

The function Flatten is added so that triangleANDpoints can be used for


displaying the result.
Before we go on to apply all of this and tile a larger area we should take note of
something about the properties of triangles that will successfully tile the Euclidean
plane. The triangle with vertices {{6, 1},{0, 0},{5, 6}}, that has been used so far has
given us a problem after the second iteration, by not closing the pattern. The two tiles on
the bottom right of the diagram are not coinciding but overlapping. It is always the case
that only tiles whose internal angles are sub-multiples of p will tile the Euclidean plane
successfully. So we can now improve our function to become triangleTiling and
for a simple example of a triangular shape that will tile the Euclidean plane we use an
equilateral triangle:

triangleTiling@triangle_, n_D :=
Module@8temp<,
Show@Graphics@
Map@triangleANDpoints,
Join@Nest@Htemp = #;
Flatten@Union@reflectTriangles@#DDDL &,
triangle, nD, tempDD,
AspectRatio -> AutomaticDDD;
22 Tiling the Euclidean and hyperbolic planes 481

triangleTiling@
triangle@88-1, 0<, 81, 0<, 80, N@Sqrt@3DD<<D, 6D

And this can continue as far as you want!

22.3 Ÿ Tiling the Euclidean plane with other shapes


Now what we can do is to try to associate some different shape with the three points of
the triangle, instead of the simple straight lines. This can then be used to produce an
Escher-like pattern where we are using a simple tile shape to tile the Euclidean plane.
Before proceeding with this, it is necessary to point out that the triangles of our
patterns divide naturally into two classes, which we shall call B (black) and W (white),
depending on whether the triangle is obtained from the original one by an even or odd
number of reflections. Thus the B class consists of triangles whose orientations are the
same as the original one, and the W class, those whose orientations are opposite from it.
In modifying the triangles to provide an Escher-like tiling it is conceptually easiest if we
allow the B shapes to be different from the W shapes. Then we can specialize afterwards
to the particular cases where these two shapes are congruent to each other. We can
deform the boundary lines of the B triangles in any way we choose (within certain
limitations, so that unwanted overlaps are avoided). Since the orientations of the W
triangles are oppposite to those of the B triangles, the W shapes defined by the boundary
lines will be ‘inside out’ with respect to the B shapes.
To make the two shapes fit, as in the Escher-like design that we shall be describ-
ing, we can make the deformation on one of the edges the same as (actually the reverse
of) that on one of the others, whilst requiring that that on the third edge be rotationally
symmetric about its central point. In this way we can ensure that the ‘inside out’ W
shape is actually congruent to the B shape. These requirements can be met by deforming
the straight lines of the triangle into the curves shown below.
The curves are defined by giving a set of points that will join the points -1 and 1
(in the Argand plane) by following the prescribed curve. The ones we want (after some
experimentation with graph paper – highly recommended!) are:
482 Complex Analysis with Mathematica

Clear@wD;
Show@Graphics@Line@
pointsBC = 81, 0.7 - 0.1 * I, 0.34 - 0.24 * I, -0.4 * I,
0, 0.4 * I, -0.34 + 0.24 * I, -0.7 + 0.1 * I, -1< ê.
w_ ? NumberQ -> 8Re@wD, Im@wD<DD,
AspectRatio -> AutomaticD

and

Show@Graphics@Line@pointsAB =
8-1, -0.8 - 0.08 * I, -0.6 - 0.15 * I,
-0.4 - 0.19 * I, -0.3 - 0.21 * I,
-0.3 - 0.03 * I, -0.29 + 0.14 * I,
-0.26 + 0.28 * I, -0.18 + 0.4 * I,
-0.09 + 0.3 * I, 0.04 + 0.14 * I, 0.14,
0.24 - 0.19 * I, 0.5 - 0.13 * I,
0.66 - 0.1 * I, 0.82 - 0.07 * I,
1< ê. w_ ? NumberQ -> 8Re@wD, Im@wD<DD,
AspectRatio -> AutomaticD

When these two line shapes are used for particular sides of a triangle, they form
a shape that at least somewhat resembles a bird. However, to get these lines to join any
three points that form a triangle, we need to be able to transform the lines that join the
points -1 and 1 to lines that will join any two points, say a and b. The transformation
a+b 1
z Ø ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅ Ha - bL z (22.7)
2 2
indeed takes the line @-1, 1D into @a, bD, where a and b are the complex numbers repre-
senting the points a and b. So now we can define a function that will join any pair of
general points by a line taking the form of one of our curves, employing the transforma-
tion defined in Eq. (22.7):
22 Tiling the Euclidean and hyperbolic planes 483

birdLine1@8x_, y_<D := Module@8a, b, w, pointsBC<,


8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
pointsBC = 8-1, -0.7 + 0.08 * I, -0.34 + 0.16 * I, 0.2 * I,
0, -0.2 * I, 0.34 - 0.16 * I, 0.7 - 0.08 * I, 1<;
Map@H# Hb - aL ê 2 + Ha + bL ê 2L &,
pointsBCD ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D

We can define a similar function for the other set of points but this time we must take
care over the two forms it will appear in. Though we reflect to change black triangles to
white triangles and vice-versa, we don’t actually reflect the curves. Theses are simply
transported by (non-reflective) Euclidean motions (or, later, by hyperbolic motions) to
the places that they need to be in order to join the required points.
So the second line we are going to use is equivalent to drawing the curve from b
to a, which is why we reverse the order of pointsAB, but we must then remember to
adjust the transformation function to be one that takes the interval @1, -1D into @a, bD.
This is all done by using the marker type to take the value 1 or -1:

birdLine2@type_, 8x_, y_<D :=


Module@8a, b, z, w, pointsAB<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
pointsAB = 8-1, -0.8 - 0.08 * I, -0.6 - 0.15 * I,
-0.4 - 0.19 * I, -0.3 - 0.21 * I, -0.3 - 0.03 * I,
-0.29 + 0.14 * I, -0.26 + 0.28 * I, -0.18 + 0.4 * I,
-0.09 + 0.3 * I, 0.04 + 0.14 * I, 0.14, 0.24 - 0.19 * I,
0.5 - 0.13 * I, 0.66 - 0.1 * I, 0.82 - 0.07 * I, 1<;
If@type == -1, pointsAB = Reverse@pointsABDD;
Map@H# * type * Hb - aL ê 2 + Ha + bL ê 2L &,
pointsABD ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D

A function that will take any three points and join them to form a bird will therefore take
the form:

birdyTriangleLine@triangle@color_, 8a_, b_, c_<DD :=


8color,
Line@Join@birdLine2@1, 8a, b<D, birdLine1@8b, c<D,
birdLine2@-1, 8c, a<DDD<

This can be shown using an equilateral triangle as the underlying base:

Show@Graphics@birdyTriangleLine@
triangle@RGBColor@1, 0, 0D,
88-1, 0<, 81, 0<, 80, N@Sqrt@3DD<<D
DD, AspectRatio -> AutomaticD
484 Complex Analysis with Mathematica

These line birds can be changed to coloured birds by swapping Polygon for Line in
the definition of birdyTriangle:

birdyTriangle@triangle@color_, 8a_, b_, c_<DD :=


8color,
Polygon@Join@birdLine2@1, 8a, b<D, birdLine1@8b, c<D,
birdLine2@-1, 8c, a<DDD<

So now we are ready to combine these two processes. First, create the series of points
that give the vertices of the shapes that tile the plane and then join them using the bird
pattern:

birdTiling@shape_, n_D :=
Module@8temp<, Show@Graphics@
Map@birdyTriangle, Join@
Nest@Htemp = #;
Flatten@Union@reflectTriangles@#DDDL &,
8shape<, nD, tempDD
D, AspectRatio -> AutomaticDD

birdTiling@triangle@[email protected],
88-1, 0<, 81, 0<, 80, N@Sqrt@3DD<<D, 6D
22 Tiling the Euclidean and hyperbolic planes 485

We are almost in a position to be able to do a similar kind of tiling that, instead


of working in a Euclidean plane, applies to a hyperbolic plane and produces a tiling that
will fit on the Poincaré disc. This will mean a change in the formulae used to perform
the reflections and also in the way in which lines will be drawn that join the vertices of
the hyperbolic triangles.

22.4 Ÿ Triangle tilings of the Poincaré disc


Having developed the procedure for tiling a Euclidean plane, we can take the same
procedure and adapt that for use on the Poincaré disc, where we need to redefine func-
tions that are going to reflect a point in a line, and need to explain how to join points by
a hyperbolic line. For a point r that is to be reflected in the hyperbolic line joining the
points a and b, the reflection is defined by the transformation rule:
êê êê
b êê
a - a b + Ha - b + b b a - a b êê a L rê
r Ø ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êê êê êêÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êê ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êê ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅ (22.8)
a - b + b b êê a - a êê a b + Ha b - êê a bL rê

This is implemented in the function hyperbolicReflection where we are reflect-


ing the point r in the hyperbolic line joining p1 and p2. :

hyperbolicReflection@8r_, p1_, p2_<D :=


Module@8cr, cp1, cp2, newcr, nr<,
8cr, cp1, cp2< =
Map@HFirst@#D + I Last@#DL &, 8r, p1, p2<D;
newcr = HHConjugate@cp1D cp2 - Conjugate@cp2D cp1L +
Conjugate@crD Hcp1 - cp2 + cp1 cp2 Conjugate@cp2D -
cp2 cp1 Conjugate@cp1DLL ê
HHConjugate@cp1D - Conjugate@cp2D +
Conjugate@cp1D cp2 Conjugate@cp2D -
Conjugate@cp2D cp1 Conjugate@cp1DL +
Conjugate@crD
HConjugate@cp2D cp1 - Conjugate@cp1D cp2LL;
nr = N@8Re@newcrD, Im@newcrD<DD

Similarly, we need to define the form of the hyperbolic line that joins any two points to
be able to construct the geometric shapes that will make up the tiling of the hyperbolic
plane. The hyperbolic lines in the Poincaré disc are represented by Euclidean circles that
meet the bounding unit circle at right angles, and where, as a limiting case, the diameters
of that unit circle also represent hyperbolic straight lines. A way of obtaining the curves
representing the hyperbolic straight line joining two points, let us say a and b, is to think
of the Euclidean straight line running from -1 to 1 (in the complex plane) and define a
transformation that will take that line to the hyperbolic line joining a and b. Such a
transformation takes the form
486 Complex Analysis with Mathematica

z Ha - la b bL - Ha + la b bL
z Ø ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅ (22.9)
z H1 - la b L - H1 + la b L

where
êê
H1 - a b L 1 - a êê a
la b ÅÅÅÅÅÅ $%%%%%%%%
= ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêê %%%%%%%%%
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅ
êêÅÅ (22.10)
†1 - a b § 1-bb

This technique can be used to define the function hyperbolicLine, which will join
any two points, a and b, by transforming the set of points on the straight line running
from -1 to 1, under the transformation as defined above:

hyperbolicLine@8a_List, b_List<D :=
Module@8aC, bC, points, lamdaAB, pointsAB<,
8aC, bC< = Map@HFirst@#D + I Last@#DL &, 8a, b<D;
points = Range@-1, 1, 0.1D;
lamdaAB =
HH1 - aC Conjugate@bCDL ê Abs@1 - aC Conjugate@bCDDL *
Sqrt@H1 - aC Conjugate@aCDL ê H1 - bC Conjugate@bCDLD;
pointsAB = Map@
HH# HaC - lamdaAB bCL - HaC + lamdaAB bCLL ê
H# H1 - lamdaABL - H1 + lamdaABLLL &,
pointsD ê. x_ ? NumberQ -> 8Re@xD, Im@xD<D

To allow us to follow the same technique as used for the Euclidean tiling we need to
define a function to produce a graphic form of, let us say, a hyperbolic triangle, using the
function that will join any two points with a hyperbolic line. As the function hyperbol-
icLine returns a list of points making up the line, we can join the different lists that
define the three lines of the triangle to obtain a sequence of points that define the
perimeter and create a Polygon of that shape:

hyperbolicTriangle@
triangle@color_: GrayLevel@0D, 8a_, b_, c_<DD :=
Join@8color<,
8Polygon@
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, a<, 2, 1D
DDD<D

The function reflectHyptTri defines the function that will produce the next level of
triangles obtained by reflecting a single triangle in each of its sides:
22 Tiling the Euclidean and hyperbolic planes 487

reflectHypTri@triangle@color_, 8a_, b_, c_<DD :=


Map@triangle@
If@Head@colorD == Hue,
ReplacePart@#,
Switch@#@@1DD, 0.15, 0.72, 0.72, 0.15D, 1D &@
colorD
D, #D &,
MapThread@
H8a, b, c< ê. #2 -> hyperbolicReflection@#1DL &,
8cyclicPermutations@8a, b, c<D,
8a, b, c<<DD

This function similarly alters the colouring of the triangles after each reflection. This
function also needs to have the attribute Listable:

SetAttributes@reflectHypTri, ListableD

Finally, to produce the hyperbolic tiling, just as with the Euclidean case, we can define a
function hypTriangleTiling1 (this is provisional – hence the ‘1’ affix) and apply
that to a set triangle:

hypTriangleTiling1@triangle_, n_D :=
Module@8temp<,
Show@Graphics@
Map@hyperbolicTriangle,
Join@
Nest@Htemp = #; Flatten@Union@reflectHypTri@#DDDL &,
triangle, nD, tempDD
D, AspectRatio -> AutomaticDD

hypTriangleTiling1@triangle@[email protected],
880, 0<, 80.266077, 0<, 80, 0.140626<<D, 8D

An example of one method by which one calculates the details of the starting shape is
given in Section 22.6.
488 Complex Analysis with Mathematica

‡ Accuracy and duplication management


One property of a tiling of the hyperbolic plane is that as we approach the boundary
circle we move out to hyperbolic infinity. This means that as the tiling approaches the
boundary circle the triangles are going to get smaller and smaller as more and more of
them are squeezed into a limited space. The vertices of these small triangles need to be
calculated to a high enough accuracy to ensure that the triangles match neatly. For this
reason we start by taking the vertices of the original triangles to an accuracy of ten
decimal places, which should be sufficient for our needs. As an aside, we note that this
idea is a very general and powerful one. There are many cases where some form of
iteration may be used to define a sequence, possibly of functions, but the iteration may
even be unstable and produce growing errors. One of the useful features of Mathematica
is the ability to do arbitrary-precision arithmetic. Hence, by writing down very high
precision starting values, unstable iteration becomes practical!
In calculating the vertices of the reflected triangles some rounding error is going
to occur. This is not a problem in the first few iterations of the reflecting procedure, but
does become apparent as the process is continued. The problem that this then produces is
that two triangles which for our purposes are identical will not be recognized as being
so, since their vertices will differ in some decimal place. The most straightforward way
to remove these repeated triangles is to check whether their vertices differ by less than a
particular amount (we are choosing 10-15 ), and if they do, remove one of the triangles.
(This is also needed for the Euclidean tiling when a large number of iterations are
performed.) This is implemented in removeDuplicates:

removeDuplicates@list_ListD :=
Module@8removelist, listnew, i, n, diff<,
listnew = Sort@Flatten@listDD;
For@n = 1, n <= Length@listnewD, n ++,
removelist = 8<;
For@m = n + 1, m <= Length@listnewD, m ++,
If@Min@Flatten@diff = Map@
Flatten@Map@Abs, Hlistnew@@n, 2DD - #LDD &,
Join@#, Map@Reverse, #DD &@
cyclicPermutations@listnew@@m, 2DDD
DDDD > 0.001H*0.1, for heptagons*L,
Break@D,
For@l = 1, l <= Length@diffD, l ++,
If@Apply@Plus, diff@@lDDD < 10 ^ -8,
If@
! MemberQ@Map@H# < 10 ^ -9L &, diff@@lDDD,
FalseD, AppendTo@removelist, listnew@@mDDD;
Break@D
DDDDD;
listnew = Complement@listnew, removelistD
D; listnewD
22 Tiling the Euclidean and hyperbolic planes 489

You will notice that the list of structures to be checked for duplicates is first sorted and
then, within the loops, which pick their way through pairs of triangles (or whatever
shape is being compared), the value of diff is calculated, which holds the differences
between each of the coordinates defining the shape. If the minimum value here is greater
than 0.001, then we can safely say that these shapes are far enough apart that we would
have moved away from the region containing shapes near to the shape we are checking,
and can move on to check the next shape. Otherwise the process for actually checking
whether two shapes are the same continues and any repeated shapes are removed as
necessary.
Having this function now allows us to repeat the reflection process for many
iterations and approach the point where we can fill the unit disc. To do this we can
define a general function that, given any hyperbolic triangle, will perform the specified
number of reflections to produce the tiling.

hypTriangleTiling@
shape_ ? HHMatchQ@Head@#D, triangleDL &L, n_D :=
Module@8temp<,
Show@Graphics@
8Circle@80, 0<, 1D,
Map@hyperbolicTriangle,
Join@
Nest@Htemp = #; Print@Length@tempDD;
Flatten@
removeDuplicates@reflectHypTri@#DDDL &,
8shape<, nD,
tempDD
<
D,
AspectRatio -> Automatic,
PlotRange -> 88-1, 1<, 8-1, 1<<DD

Here we have carried out this process for a many reflections (n = 40). You should check
that this works on your system and get a feel for timings by trying, for example, n = 20
first. The n = 20 test calculation takes under a minute to caclulate and render on a Power
Macintosh G4 at 1.4 GHz. Note that running the following calculation will take rather
longer! It will also produce progress output that is suppressed here.

hypTriangleTiling@triangle@[email protected],
880, 0<, 80.2660772453, 0<, 80, 0.14062593<<D, 40D
490 Complex Analysis with Mathematica

22.5 Ÿ Ghosts and birdies tiling of the Poincaré disc


Now we have all the tools necessary to be able to produce a tiling of the hyperbolic
plane similar to those of M. C. Escher. The shapes we shall use are the same as those for
the Euclidean tiling and we shall just add some more details to characterize two different
types of element.
To define the shape of the bird, the functions birdLine1 and birdLine2
used to produce the Euclidean drawing are employed again, with the alteration that
instead of using a linear transformation to define the lines it is replaced with the corre-
sponding hyperbolic transformation. For example,

H# Hb - aL ê 2 + Ha + bL ê 2L &

goes to
22 Tiling the Euclidean and hyperbolic planes 491

HH# Ha - lamdaAB bL - Ha + lamdaAB bLL


ê H# H1 - lamdaABL - H1 + lamdaABLLL &

In addition, we can add some lines that will allow us to create more characterful shapes.
Here we add lines to characterize the basic shape into either a ghost or a raven (time to
get the graph paper out again!):

ghost@8x_, y_<D :=
Module@8a, b, lamdaAB, face1<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
face1 = 880.23, 0.21 + 0.03 * I, 0.17 + 0.04 * I, 0.14,
0.15 - 0.04 * I, 0.205 - 0.045 * I, 0.24<,
80.09, 0.07 + 0.03 * I, 0.03 + 0.04 * I, 0.,
0.01 - 0.04 * I, 0.065 - 0.045 * I, 0.09<,
8-0.1 + 0.08 * I,
-0.08 + 0.12 * I, -0.04 + 0.16 * I, 0.19 * I,
0.06 + 0.2 * I, 0.1 + 0.2 * I, 0.16 + 0.19 * I,
0.2 + 0.15 * I<<;
8GrayLevel@0D, [email protected] * Abs@a - bDD,
lamdaAB =
HH1 - a Conjugate@bDL ê Abs@1 - a Conjugate@bDDL *
Sqrt@H1 - a Conjugate@aDL ê H1 - b Conjugate@bDLD;
Map@Line, Map@HH# Ha - lamdaAB bL - Ha + lamdaAB bLL ê
H# H1 - lamdaABL - H1 + lamdaABLLL &,
face1D ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D<D

The raven not only has a face, but tails and wing feathers. These are defined separately
as each set of characteristics is connected with one of the three lines of the triangle that
forms the basis of our raven shape:

birdLineHyp1@8x_, y_<D :=
Module@8a, b, lamdaAB, pointsBC<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
pointsBC =
8-1, -0.7 + 0.08 * I, -0.34 + 0.16 * I, 0.2 * I, 0,
-0.2 * I, 0.34 - 0.16 * I, 0.7 - 0.08 * I, 1<;
lamdaAB =
HH1 - a Conjugate@bDL ê Abs@1 - a Conjugate@bDDL *
Sqrt@H1 - a Conjugate@aDL ê H1 - b Conjugate@bDLD;
Map@HH# Ha - lamdaAB bL - Ha + lamdaAB bLL ê
H# H1 - lamdaABL - H1 + lamdaABLLL &,
pointsBCD ê. w_ ? NumberQ -> 8Re@wD, Im@wD<
D
492 Complex Analysis with Mathematica

birdLineHyp2@type_, 8x_, y_<D :=


Module@8a, b, z, w, pointsAB<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
pointsAB = 8-1, -0.8 - 0.08 * I, -0.6 - 0.15 * I,
-0.4 - 0.19 * I, -0.3 - 0.21 * I,
-0.3 - 0.03 * I, -0.29 + 0.14 * I,
-0.26 + 0.28 * I, -0.18 + 0.4 * I,
-0.09 + 0.3 * I, 0.04 + 0.14 * I,
0.14, 0.24 - 0.19 * I, 0.5 - 0.13 * I,
0.66 - 0.1 * I, 0.82 - 0.07 * I, 1<;
If@type == -1, pointsAB = Reverse@pointsABDD;
lamdaAB =
HH1 - a Conjugate@bDL ê Abs@1 - a Conjugate@bDDL *
Sqrt@H1 - a Conjugate@aDL ê H1 - b Conjugate@bDLD;
Map@HHtype * # * Ha - lamdaAB bL - Ha + lamdaAB bLL ê
Htype * # * H1 - lamdaABL - H1 + lamdaABLLL &,
pointsABD ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D

raven@8x_, y_<D :=
Module@8a, b, lamdaAB, face2<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
face2 = 88-0.12 + 0.3 * I, -0.11 + 0.28 * I, -0.1 + 0.2 * I,
-0.1 + 0.04 * I,
-0.16 + 0.09 * I, -0.2 + 0.12 * I, -0.28 + 0.14 * I<,
8-0.04 + 0.21 * I, -0.04 + 0.2 * I, -0.06 + 0.14 * I,
-0.07 + 0.1 * I, -0.1 + 0.04 * I<,
8-0.2 - 0.09 * I, -0.18 - 0.06 * I, -0.14 - 0.06 * I,
-0.12 - 0.09 * I, -0.13 - 0.13 * I, -0.16 - 0.14 * I,
-0.19 - 0.13 * I, -0.2 - 0.09 * I<,
8-0.28 - 0.34 * I, -0.285 - 0.3 * I, -0.3 - 0.22 * I<,
80.22 - 0.2 * I, 0.2 - 0.21 * I, 0.16 - 0.22 * I,
0.1 - 0.24 * I<<;
8GrayLevel@0D, [email protected] * Abs@a - bDD,
lamdaAB =
HH1 - a Conjugate@bDL ê Abs@1 - a Conjugate@bDDL *
Sqrt@H1 - a Conjugate@aDL ê H1 - b Conjugate@bDLD;
Map@Line, Map@HH# Ha - lamdaAB bL - Ha + lamdaAB bLL ê
H# H1 - lamdaABL - H1 + lamdaABLLL &,
face2D ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D<D;

rightFeather@8x_, y_<D :=
Module@8a, b, lamdaAB, feathers1<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
feathers1 = 88-0.13 - 0.24 * I, -0.1 - 0.23 * I,
-0.02 - 0.2 * I<,
22 Tiling the Euclidean and hyperbolic planes 493

80.01 - 0.3 * I, -0.21 * I<,


8-0.18 - 0.16 * I, -0.1 - 0.14 * I, -0.02 - 0.11 * I<,
8-0.26 - 0.06 * I, -0.2 - 0.04 * I, -0.1 - 0.01 * I,
-0.02 + 0.02 * I<, 8-0.36 + 0.03 * I, -0.26 + 0.06 * I,
-0.1 + 0.1 * I, -0.02 + 0.12 * I<<;
8GrayLevel@0D, [email protected] * Abs@a - bDD,
lamdaAB =
HH1 - a Conjugate@bDL ê Abs@1 - a Conjugate@bDDL *
Sqrt@H1 - a Conjugate@aDL ê H1 - b Conjugate@bDLD;
Map@Line, Map@HH# Ha - lamdaAB bL - Ha + lamdaAB bLL ê
H# H1 - lamdaABL - H1 + lamdaABLLL &,
feathers1D ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D<D;

leftFeather@8x_, y_<D :=
Module@8a, b, lamdaAB, feathers2<,
8a, b< = Map@HFirst@#D + I Last@#DL &, 8x, y<D;
feathers2 = 880.68, 0.56 + 0.05 * I, 0.42 + 0.08 * I,
0.31 + 0.1 * I<,
80.56 - 0.12 * I, 0.48 - 0.09 * I, 0.4 - 0.07 * I,
0.31 - 0.06 * I<, 80.47 - 0.24 * I, 0.38 - 0.21 * I,
0.3 - 0.2 * I<, 80.36 - 0.34 * I, 0.26 - 0.3 * I<,
80.29 - 0.44 * I, 0.2 - 0.4 * I<,
8-0.37 + 0.135 * I,
-0.325 + 0.06 * I, -0.22 - 0.1 * I,
-0.14 - 0.2 * I<, 8-0.575 + 0.1 * I, -0.56 + 0.06 * I,
-0.48 - 0.04 * I, -0.38 - 0.16 * I, -0.28 - 0.275 * I<,
8-0.78 + 0.06 * I, -0.72,
-0.66 - 0.06 * I, -0.6 - 0.12 * I<<;
8GrayLevel@0D, [email protected] * Abs@a - bDD,
lamdaAB =
HH1 - a Conjugate@bDL ê Abs@1 - a Conjugate@bDDL *
Sqrt@H1 - a Conjugate@aDL ê H1 - b Conjugate@bDLD;
Map@Line, Map@HH# Ha - lamdaAB bL - Ha + lamdaAB bLL ê
H# H1 - lamdaABL - H1 + lamdaABLLL &,
feathers2D ê. w_ ? NumberQ -> 8Re@wD, Im@wD<D<D
Null

The function ghostsANDravens will produce the two basic tiles with which we will
fill the Poincaré disc. To show the difference between the two shapes we are employing,
we will change the function reflectHypTri so that under reflection not only the
colour of a shape is reversed but also the type from ghost to raven. So we define the
function ghostsANDravens to act differently depending on whether the argument is
a ghost or a raven:
494 Complex Analysis with Mathematica

ghostsANDravens@ghost@color_, 8a_, b_, c_<DD :=


88color,
Polygon@Join@birdLineHyp2@1, 8a, b<D,
birdLineHyp1@8b, c<D,
birdLineHyp2@-1, 8c, a<DDD<,
ghost@8b, a<D<

ghostsANDravens@raven@color_, 8a_, b_, c_<DD :=


88color,
Polygon@Join@birdLineHyp2@1, 8a, b<D,
birdLineHyp1@8b, c<D,
birdLineHyp2@-1, 8c, a<DDD<,
raven@8a, c<D,
rightFeather@8c, b<D,
leftFeather@8b, a<D<

To see how these look:

Show@Graphics@ghostsANDravens@
ghost@[email protected], 880, 0<, 80.448288, 0.258819<,
80.448288, -0.258819<<D
DD,
AspectRatio -> AutomaticD

Before checking the graphic for the raven, let us define a new reflection function that
will swap between the raven and the ghost at each reflection:
22 Tiling the Euclidean and hyperbolic planes 495

reflectHypShape@
shape_ ? HHMatchQ@#, ravenD »»
MatchQ@#, ghostDL &L@
color_, 8a_, b_, c_<DD :=
Map@Switch@shape, ghost, raven, raven, ghostD@
If@Head@colorD == Hue,
ReplacePart@#,
Switch@#@@1DD, 0.15, 0.72, 0.72, 0.15D, 1D &@
colorD
D, #D &,
MapThread@
H8a, b, c< ê. #2 -> hyperbolicReflection@#1DL &,
8cyclicPermutations@8a, b, c<D,
8a, b, c<<D
D

SetAttributes@reflectHypShape, ListableD

Now with the raven we must take care. The outline of this shape is the same as the
original ghost shape, but the triangle is given with the opposite orientation. This, as you
will recall, was the reason for using the specific lines for birdline1 and
birdline2. However now we have introduced to the shapes elements that do not have
these properties we must take care how they are used. If we are to start the tiling with the
ghost then the shape as displayed is quite acceptable. The raven outlines will appear as
the gaps between the ghosts, but unreflected, whereas the triangles themselves have been
obtained by reflection. This is taken care of by the symmetry of one curve and the
repetition of the other. We must take care that the orientation of the edges is consistent
so that the two shapes emerge as they are supposed to.

Show@Graphics@ghostsANDravens@reflectHypShape@
ghost@[email protected], 880, 0<, 80.448288, 0.258819<,
80.448288, -0.258819<<DD@@1DDDD,
AspectRatio -> AutomaticD
496 Complex Analysis with Mathematica

If we had looked at the raven shape in its unreflected form, it would have looked a little
odd, since the ordering of the vertices defining the shape determine whether the shading
of the polygon will occur on one side or the other of any one line defining our shape.
Now we have all the tools to define the function that will produce a hyperbolic
tiling of some specified shape up to a certain number of reflections:

hyperbolShapes@shape_, n_D :=
Module@8temp<,
Show@Graphics@8Circle@80, 0<, 1D,
Map@ghostsANDravens,
Join@Nest@Htemp = #; Print@Length@#DD;
Flatten@
removeDuplicates@reflectHypShape@#DDDL &,
8shape<, nD, tempDD<
D, AspectRatio -> AutomaticDD

Try the following, which should take just a few seconds on a GHz-class machine:

hyperbolShapes@
ghost@[email protected], 880, 0<, 80.4482877361, 0.2588190451<,
80.4482877361, -0.2588190451<<D, 8D

The following takes a few minutes to compute and render on a GHz-class machine:

hyperbolShapes@
ghost@[email protected], 880, 0<, 80.4482877361, 0.2588190451<,
80.4482877361, -0.2588190451<<D, 14D
22 Tiling the Euclidean and hyperbolic planes 497

22.6 Ÿ The projective representation


The geometric representation we have considered so far is not the only one of interest. A
detailed discussion of the history and geometry relevant to these variations is given by
Penrose (2004). The various possibilities appear to have first been realized by the Italian
geometer E. Beltrami. The representation we have discussed so far, often known as the
Poincaré disc, is better known as Beltrami's conformal representation. There is also a
Beltrami projective representation. When working with respect to a unit radius disc, the
mapping from conformal to projective is obtained by the mapping taking the point Hx, yL
to that given by the following function:

Projective@8x_, y_<D :=
Module@8rsq = x ^ 2 + y ^ 2<, 8x, y< * 2 ê H1 + rsqLD

That is,
498 Complex Analysis with Mathematica

Projective@8x, y<D
2x 2y
9 ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅ , ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
x + y + 1 x + y2 + 1
2 2 2

We could re-engineer all of our tilings based on the conformal representation, but it is
easier just to insert the function Projective at various places in our existing Mathe-
matica functions. For the triangles, all we need to do is the following:

PhyperbolicTriangle@
triangle@color_: GrayLevel@0D, 8a_, b_, c_<DD :=
Join@8color<,
8Polygon@Map@Projective@#D &,
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, a<, 2, 1D
DDDD<D

PhypTriangleTiling@
shape_ ? HHMatchQ@Head@#D, triangleDL &L, n_D :=
Module@8temp<,
Show@Graphics@
Map@PhyperbolicTriangle ,
Join@
Nest@Htemp = #;
Flatten@
removeDuplicates@reflectHypTri@#DDDL &,
8shape<, nD,
tempDD
D,
AspectRatio -> Automatic,
PlotRange -> 88-1, 1<, 8-1, 1<<DD

We do not need quite so many iterations to appear to fill out the geometry to the edge of
the circle:

PhypTriangleTiling@triangle@[email protected],
880, 0<, 80.2660772453, 0<, 80, 0.14062593<<D, 20D
22 Tiling the Euclidean and hyperbolic planes 499

This figure illustrates the key difference between the conformal and projective representa-
tions. The latter conveys the impression of being drawn on a sphere. The circles implicit
in the tiling in the conformal representation are now straight lines in the projective
representation. Another beautiful example of this, based on the work of M.C. Escher in
his woodcut Circle Limit I, is given in Sections 2.4 and 2.5 of Penrose (2004).

22.7 Ÿ Tiling the Poincaré disc with hyperbolic squares


The methods developed above for triangles can be readily extended to squares. The
basic functions are the same as for triangles, as follows, except that we simplify the
colouring scheme to black and white.
500 Complex Analysis with Mathematica

hyperbolicSquare@
square@color_: GrayLevel@0D, 8a_, b_, c_, d_<DD :=
Join@8color<,
8Polygon@
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, d, a<, 2, 1D
DDD<D

PhyperbolicSquare@
square@color_: GrayLevel@0D,
8a_, b_, c_, d_<DD :=
Join@8color<,
8Polygon@Map@Projective@#D &,
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, d, a<, 2, 1D
DDDD<D

reflectHypSqu@
square@color_: GrayLevel@0D,
8a_, b_, c_, d_<DD :=
MapThread@square,
8Table@color, 84<D,
lines = Partition@8a, b, c, d, a<, 2, 1D;
refl@8x__<D := H# :> hyperbolicReflection@8#, x<DL &;
MapThread@8a, b, c, d< ê. HMap@refl@#1D, #2DL &,
8#, Map@Complement@8a, b, c, d<, #D &, #D<
D &@linesD<D

SetAttributes@reflectHypSqu, ListableD;
SetAttributes@hyperbolicSquare, ListableD;
SetAttributes@PhyperbolicSquare, ListableD

Now we ask ourselves two questions:

(1) how many hyperbolic squares will meet at a vertex?


(2) how do we figure out in detail the coordinates of the initial hyperbolic square?

Note how odd it is that we can even ask the first question! This would not make any
sense in the usual Euclidean plane. These two questions are related. We need to write
down equations governing the intersection Ha, aL of two circles centred at points H0, bL
and H b, 0L, each of which interesects the unit circle at a right angle, and which intersect
each other at an angle of 2p ê n, where n is prescribed. If you do this (I leave this as a
worthwhile exercise!) you find that a is governed by the quartic (effectively quadratic)
equation
22 Tiling the Euclidean and hyperbolic planes 501

1 2p
a2 + ÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅ = secJ ÅÅÅÅÅÅÅÅÅÅ N (22.11)
4a n

n = 6;
Solve@a ^ 2 + 1 ê 4 ê a ^ 2 ã 1 ê Cos@2 Pi ê nD, aD
1 è!!! 1 è!!!
99a Ø ÅÅÅÅÅ I-1 - 3 M=, 9a Ø ÅÅÅÅÅ I1 - 3 M=,
2 2
1 è!!! 1 è!!!
9a Ø ÅÅÅÅÅ I-1 + 3 M=, 9a Ø ÅÅÅÅÅ I1 + 3 M==
2 2

N@%, 20D
88a Ø -1.3660254037844386468<, 8a Ø -0.36602540378443864676<,
8a Ø 0.36602540378443864676<, 8a Ø 1.3660254037844386468<<

The value we want is the one that is real and positive and less than one, i.e.

size = N@HSqrt@3D - 1L ê 2, 20D

0.36602540378443864676

Having worked out our starting value, we can have a look at the results. This will take
some time.

Show@Graphics@8Circle@80, 0<, 1D,


Map@hyperbolicSquare,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 8DD<
D, AspectRatio -> AutomaticD
502 Complex Analysis with Mathematica

Note that we can move to the projective representation just as before. This time the
impact is not quite so dramatic!

Show@Graphics@8Circle@80, 0<, 1D,


Map@PhyperbolicSquare,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 4D
D<
D, AspectRatio -> AutomaticD

Here we have employed a two-colour (or rather black and white) representation. This
does require that n is of course even. With a bit of tidying up we can semi-automate the
production of graphics for other even n. Let's look at n = 8:

n = 8;
size =
N@Select@a ê. Solve@a ^ 2 + 1 ê 4 ê a ^ 2 ã 1 ê Cos@2 Pi ê nD,
aD, 0 < # < 1 &D, 20D@@1DD;
Show@Graphics@8Circle@80, 0<, 1D,
Map@hyperbolicSquare,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 8D
D<
D, AspectRatio -> AutomaticD
22 Tiling the Euclidean and hyperbolic planes 503

Show@Graphics@8Circle@80, 0<, 1D,


Map@PhyperbolicSquare,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 4D
D<
D, AspectRatio -> AutomaticD

With a larger value of n we need to do even more reflections just to get the right basic
picture at the vertices of the original square. This one, with n = 14, takes a while but is
worth the wait!
504 Complex Analysis with Mathematica

n = 14;
size =
N@Select@a ê. Solve@a ^ 2 + 1 ê 4 ê a ^ 2 ã 1 ê Cos@2 Pi ê nD,
aD, 0 < # < 1 &D, 20D@@1DD;
Show@Graphics@8Circle@80, 0<, 1D,
Map@hyperbolicSquare,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 8D
D<D, AspectRatio -> AutomaticD

For larger values of n the corresponding projective picture approaches that of a square
inscribed in the circle with very little edge detail. The following does not try to fill in all
the edge detail as it is not visible on this scale, but you can just see the meeting of 14
squares at the vertices of the central square:
22 Tiling the Euclidean and hyperbolic planes 505

n = 14;
size =
N@Select@a ê. Solve@a ^ 2 + 1 ê 4 ê a ^ 2 ã 1 ê Cos@2 Pi ê nD,
aD, 0 < # < 1 &D, 20D@@1DD;
Show@Graphics@8Circle@80, 0<, 1D,
Map@PhyperbolicSquare,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 6D
D<D, AspectRatio -> AutomaticD

ü Working with unfilled polygons


If n is odd, we cannot use a simple two-colour scheme. A simple approach is to just
display lines. In many ways the case n = 5 is the most interesting, especially in the
projective representation.

hyperbolicSquareL@
square@color_: GrayLevel@0D, 8a_, b_, c_, d_<DD :=
Join@8color<,
8Line@
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, d, a<, 2, 1D
DDD<D
506 Complex Analysis with Mathematica

PhyperbolicSquareL@
square@color_: GrayLevel@0D,
8a_, b_, c_, d_<DD :=
Join@8color<,
8Line@Map@Projective@#D &,
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, d, a<, 2, 1D
DDDD<D

SetAttributes@hyperbolicSquareL, ListableD;
SetAttributes@PhyperbolicSquareL, ListableD

n = 5;
size =
N@Select@a ê. Solve@a ^ 2 + 1 ê 4 ê a ^ 2 ã 1 ê Cos@2 Pi ê nD,
aD, 0 < # < 1 &D, 20D@@1DD;
Show@Graphics@8Circle@80, 0<, 1D,
Map@hyperbolicSquareL,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 7D
D<
D, AspectRatio -> AutomaticD
22 Tiling the Euclidean and hyperbolic planes 507

n = 5;
size =
N@Select@a ê. Solve@a ^ 2 + 1 ê 4 ê a ^ 2 ã 1 ê Cos@2 Pi ê nD,
aD, 0 < # < 1 &D, 20D@@1DD;
Show@Graphics@8Circle@80, 0<, 1D,
Map@PhyperbolicSquareL,
Nest@
Flatten@removeDuplicates@reflectHypSqu@#DDD &,
8square@88size, size<, 8-size, size<,
8-size, -size<, 8size, -size<<D<, 6D
D<
D, AspectRatio -> AutomaticD

22.8 Ÿ Heptagon tilings


As well as the simple tilings we have already created exactly the same techniques, can
be employed to tile either the Euclidean or Hyperbolic planes using suitable shapes. As a
further example, we can also tile the hyperbolic plane using regular heptagons, some-
thing that is possible on the hyperbolic plane, but not on the Euclidean plane. In the
same way as we have in the previous examples we define a function that will produce a
Graphics object from the heptagon object. Here we are only using an outline of a
heptagon, rather than shading, and consider a case where three heptagons meet at a
vertex:
508 Complex Analysis with Mathematica

hyperbolicHeptagon@
heptagon@color_: GrayLevel@0D,
8a_, b_, c_, d_, e_, f_, g_<DD :=
Join@8color<,
8Line@
Apply@Join,
Map@hyperbolicLine,
Partition@
8a, b, c, d, e, f, g, a<, 2, 1D
DDD<D

PhyperbolicHeptagon@
heptagon@color_: GrayLevel@0D,
8a_, b_, c_, d_, e_, f_, g_<DD :=
Join@8color<,
8Line@Map@Projective@#D &,
Apply@Join,
Map@hyperbolicLine,
Partition@
8a, b, c, d, e, f, g, a<, 2, 1D
DDDD<D

We also define a function that will reflect a given heptagon in each of its sides and
return the resulting set of seven heptagons:

reflectHypHept@
heptagon@color_: GrayLevel@0D,
8a_, b_, c_, d_, e_, f_, g_<DD :=
MapThread@heptagon,
8Table@color, 87<D,
lines = Partition@8a, b, c, d, e, f, g, a<, 2, 1D;
refl@8x__<D := H# :> hyperbolicReflection@8#, x<DL &;
MapThread@8a, b, c, d, e, f, g< ê. HMap@refl@#1D, #2DL &,
8#,
Map@Complement@8a, b, c, d, e, f, g<, #D &, #D<
D &@linesD<
D

Now each of these functions needs to be Listable in order for the procedure of
continually reflecting and then the drawing process to work:

SetAttributes@reflectHypHept, ListableD;
SetAttributes@hyperbolicHeptagon, ListableD;
SetAttributes@PhyperbolicHeptagon, ListableD
22 Tiling the Euclidean and hyperbolic planes 509

The same technique for removing duplicated shapes is used as for removing duplicated
triangles. The only change is that checking for the duplicates only stops when individual
elements are more than 0.1 units apart rather than the previous 0.001 units. This arises
since the ordering of vertices of these heptagons is not regular and so ordering sets of
them does not mean that all shapes within a certain region will be as close to each other
in the ordered set as was the case with triangles. Now we can produce a graphic that will
start with a central hyperbolic heptagon (the coordinates being calculated using the same
technique as for the hyperbolic triangles) and by reflection fill the whole of the unit
circle:

Show@Graphics@8Circle@80, 0<, 1D,


Map@hyperbolicHeptagon,
Nest@
Flatten@removeDuplicates@reflectHypHept@#DDD &,
8heptagon@
880.2709597367419336349, 0.1304873319336850037<,
80.06692152840391196858, 0.2932023733985011144<,
8-0.1875099557726562724, 0.2351300474557987219<,
8-0.3007426187463786622, 0.<,
8-0.1875099557726562724,
-0.2351300474557987219<,
80.06692152840391196858, -0.2932023733985011144<,
80.2709597367419336348, -0.1304873319336850037<
<D<, 5DD<D, AspectRatio -> AutomaticD
510 Complex Analysis with Mathematica

Show@Graphics@8Circle@80, 0<, 1D,


Map@PhyperbolicHeptagon,
Nest@
Flatten@removeDuplicates@reflectHypHept@#DDD &,
8heptagon@
880.2709597367419336349, 0.1304873319336850037<,
80.06692152840391196858, 0.2932023733985011144<,
8-0.1875099557726562724, 0.2351300474557987219<,
8-0.3007426187463786622, 0.<,
8-0.1875099557726562724,
-0.2351300474557987219<,
80.06692152840391196858, -0.2932023733985011144<,
80.2709597367419336348, -0.1304873319336850037<
<D<, 4DD<D, AspectRatio -> AutomaticD

It is possible to colour this figure so that the colouring scheme is consistent across the
whole figure using nine different colours. This has not been implemented algorithmi-
cally at the time of publication and any ideas on elegant methods for this would be most
welcome!

22.9 Ÿ The upper half-plane representation


We already know how to map the upper half-plane into the interior of the unit circle.
This is just the mapping
z-Â
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (22.12)
z+Â
22 Tiling the Euclidean and hyperbolic planes 511

Writing w = x + Â y, we can invert this as


 Hx +  y + 1L
z = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (22.13)
1-x-Ây

We can define an analogue of the map Projective, which we call ToUHP, as follows:

re = ComplexExpand@Re@I H1 + x + I yL ê H1 - x - I yLDD;
im = Simplify@
ComplexExpand@Im@I H1 + x + I yL ê H1 - x - I yLDDD;

g@x_, y_D = 8re, im<;


ToUHP@8x_, y_<D := g@x, yD

ToUHP@8x, y<D

2y x2 + y2 - 1
9- ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅ , - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ =
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
H1 - xL2 + y2 x2 - 2 x + y2 + 1

We now insert this function in place of Projective, as follows:

UHPhyperbolicTriangle@
triangle@color_: GrayLevel@0D, 8a_, b_, c_<DD :=
Join@8color<,
8Polygon@Map@ToUHP@#D &,
Apply@Join,
Map@hyperbolicLine,
Partition@8a, b, c, a<, 2, 1D
DDDD<D

UHPhypTriangleTiling@
shape_ ? HHMatchQ@Head@#D, triangleDL &L, n_D :=
Module@8temp<,
Show@Graphics@8Line@88-5, 0<, 85, 0<<D,
Line@880, 0<, 80, 10<<D,
Map@UHPhyperbolicTriangle ,
Join@
Nest@Htemp = #;
Flatten@
removeDuplicates@reflectHypTri@#DDDL &,
8shape<, nD, tempDD< D, AspectRatio -> Automatic,
PlotRange Ø 88-5, 5<, 80, 12<<DD

We can now obtain another famous representation, best shown by example, with the
lower boundary also shown.

UHPhypTriangleTiling@triangle@[email protected],
880, 0<, 80.2660772453, 0<, 80, 0.14062593<<D, 40D
512 Complex Analysis with Mathematica

Exercises
22.1 Ÿ Re-visualize all these tilings by mapping the tilings of the unit disc into the
upper half-plane, using a suitable Möbius transformation.

22.2 Ÿ Investigate the transformation of other tilings into the projective representation.

22.3 Ÿ Investigate the tiling of the unit disc by n-gons for values of n > 5.

Comment: the author recognizes that his own contributions here are somewhat ad hoc!
Anyone interested in developing a systematic and optimized package to do these kinds
of graphics, for general n-gons, unfilled or filled, general colouring schemes and confor-
mal, projective or half-plane representations, is encouraged to do so and contact the
author!
23 Physics in three and four dimensions I

Introduction
When we come to explore real dimensions greater than two, matters become consider-
ably more interesting. Indeed, in my own undergraduate studies, the question as to how
to solve Laplace's equation in three or more dimensions using methods analogous to
those presented here went unanswered, and remains unanswered in most undergraduate
curricula the world over. I did not see the answer until my postgraduate studies, studying
twistor methods in Oxford, and did not fully understand many of the geometrical aspects
until my own post-doctoral work on twistor descriptions of minimal surfaces and strings.
However, this author at least is convinced that many of the concepts are easily under-
stood using only the elementary complex analysis already presented here, and this
chapter is in part an attempt to get the message across in such a fashion. Another goal of
this chapter and the subsequent one is to persuade some of you that, as well as being a
basis for research in fundamental theoretical physics, there are also some interesting
problems in basic and very applied mathematics that might well be solved with such
methods, if only more people worked on it!
In some ways the presentation is easier if we make the jump straight to four
dimensions, and treat the relativistic case. Results for three dimensions can then be
obtained by constraining matters to a hyperplane t = 0. This is also more elegant as our
starting point is then a detailed investigation of the ‘celestial spehere’, and the interpreta-
tion of Möbius transforms as relativistic Lorentz transformations, which was promised
earlier, then emerges naturally. So we shall dwell at length on a relativistic interpretation
of stereographic projection to begin with. This is all very necessary, as clearly it is no
longer possible to associate real and complex spaces through simple associations such as

w = x + Ây (23.1)

as there as now a third space coordinate, which we shall term z, and a time coordinate, t.
The relativistic interpretation of stereographic projection is in fact the key to understand-
ing how to make the jump to four dimensions. In this chapter we shall avoid the use of z
as denoting a complex number, for obvious reasons! One might wonder if further
extensions of the number system are needed to deal with three and four dimensions, but
it will turn out (just as for dealing with polynomials) that complex numbers are enough!
The discussion here is intended to be relatively informal and accessible to
anyone who has progressed thorugh the basic material on complex analysis discussed
previously in this text. In particular, familiarity with the material of Chapter 16 is
assumed. However, there is a large body of advanced work in mathematical physics and
pure mathematics related to these topics. A good place to go for a thorough discussion
and a detailed exposition of spinor theory is that of Penrose and Rindler (1984a, b), the
material of which is the basis of a large portion of this chapter.
514 Complex Analysis with Mathematica

23.1 Minkowski space and the celestial sphere


We shall consider Minkowski space, , as the vector space represented by four-dimen-
sional position vectors

X m = 8ct, x, y, z< (23.2)

where m = 0, 1, 2, 3, and c is the speed of light, equipped with an inner product, or


‘metric’ h mn = diagH+1, -1, -1, -1L, so that the length-squared of a vector, be it a
position vector or a displacement vector, is,

X 2 = h mn X m X n = c2 t 2 - x2 - y2 - z2 (23.3)

We use the summation convention introduced by Einstein, which states that the appear-
ance of a repeated index implies summation over its possible values. A vector X is said
to be timelike if has positive length, null if it has zero length, and spacelike if it has
negative length. This convention, that ordinary Euclidean three-vectors have negative
length, may seem rather bizarre to a beginner in relativity, but it is just a convention, and
does avoid many irritating factors of -1 later. The null vectors are especially important,
as they represent the directions of light rays. If we fix an origin O in , the set of null
position vectors with origin at O is given by the family of points satisfying

rê 2 = x2 + y2 + z2 = c2 t2 (23.4)

which represent the locus of points moving at speed c towards or away from the origin.
If we fix the time-scale (so that we consider only the directions of vectors based at the
origin) so that

†ct§ = 1 (23.5)

we get two copies of the unit sphere characterized by

x2 + y2 + z2 = 1 (23.6)

The sphere with ct = +1 is denoted S+ and that with ct = -1 is denoted S- . These two
spheres represent the directions of light rays emanating from the origin, in the case of
S+ , and arriving at the origin, in the case of S- . For this reason S- is often called the
celestial sphere. It represents the field of vision for an observer located at O – every-
thing that he or she sees is represented in its direction by a point on S- . This is very
important for our understanding of how our observer's view of the world shifts when
they acquire a velocity.
23 Physics in three and four dimensions I 515

23.2 Stereographic projection revisited


The key to using complex variables in a relativistic setting is to associate the spheres
S+ and S- with the Riemann sphere and the Argand plane, by stereographic projection.
We shall not go into detail on the geometrical aspects of this, as an algebraic treatment
will be more immediately useful. Consider first S+ . We let, for points on S+ only,
x + Ây
w = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (23.7)
1-z
The modulus-squared of w is given by

x2 + y2
êêê = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ 1 - z2 1+z
ww ÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (23.8)
H1 - zL H1 - zL 1-z

We can now invert the relationship to obtain


w + êê wê w - êê wê ww êêê - 1
x = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêêêÅÅ ; y = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêêÅêÅÅÅÅÅ ; z = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêêêÅÅ (23.9)
1 + ww ÂH1 + wwL 1 + ww

Note that the point at infinity is given by the North pole (z = 1) of the sphere S+ . We can
also use polar coordinates in the form
q
w = ‰Â f cotJ ÅÅÅÅÅ N (23.10)
2
What do we do about S- ? There is a natural mapping between S+ and S- known as the
antipodal mapping. A light ray passing through O and arriving at the point Hx, y, zL on
S+ must have passed through the point H-x, -y, -zL, on S- so that the natural mapping
is to associate antipodal points on the two spheres. On the complex coordinates, the
antipodal map is given by
1
wö - ÅÅÅÅ
êêÅÅ (23.11)

so that the polar coordinate representation is
q
w = -‰Â f tanJ ÅÅÅÅÅ N (23.12)
2

23.3 Projective coordinates


There is a certain awkwardness about the coordinate w introduced in the previous
section, as we need to allow for the point at infinity. This can be managed more ele-
gantly by introducing coordinates Hz, hL related to w by
z
w = ÅÅÅÅÅ (23.13)
h
516 Complex Analysis with Mathematica

This pair are projective or homogeneous coordinates for the sphere(s) – the pairs Hz, hL
and Hl z, l hL represent the same point, provided l œ  and l  0. The point at infinity is
then given by setting h = 0. These projective coordinates also play another role. To see
this most straightforwardly, we first make some adjustments to the scaling of the
êê
relations characterizing stereographic projection. If we let b = z z + h êê h , then Eq.
(23.9) can be recast as
êê êê êê
z êê
h + hz z êê
h - hz zz - hh êê
x = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; y = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; z = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; (23.14)
b Âb b
The persistent appearance of b is an inconvenience, and so, rather than working with a
è!!!
sphere of radius unity, we shall work with a sphere of radius b ë 2 . This gives us the
four relations
1 êê êê 1 êê êê
ct = ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ Hzz + hh L; x = ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ Hz h + hz L;
2 2
(23.15)
1 êê 1 êê
è!!! ÅÅÅÅÅÅ Hz êê
y = ÅÅÅÅÅÅÅÅ êê
è!!!ÅÅÅÅÅ Hzz - hh L;
h - hz L; z = ÅÅÅÅÅÅÅÅ
 2 2

This leads directly to an elegant matrix characterization of this relationship, in the form
êê
1 ct + z x + Ây ij zz z êê
h yz z êê êê A êêA
£
ÅÅÅÅÅÅÅÅ
Å ÅÅÅÅ J
è!!! x - Ây ct - z N = j êê êê z = J h NHz , h L = S S (23.16)
2 k hz hh {

where S A is the two-component complex ‘vector’


z
SA = J N (23.17)
h

and the index A, labelling the rows, runs from zero to one. (This is just a convention
linked to the fact that the time coordinate is often the zero component of the four-dimen-
sional vector X m .) The index A£ is attached to the complex conjugate vector and labels
the columns of the matrices.
These two-component vectors play a very special role in relativistic physics and
are given a special name – they are called spinors. (Physicists often refer to four-compo-
nent, or Dirac, spinors that are made up of a pair of the more fundamental ones dis-
cussed here.) What we have done is to show that spinors, up to a scale factor, character-
ize the (real) null directions emanating from a point. When we attach the scale factor, a
two-component spinor characterizes a null (real) four-vector.
We have assumed that the coordinates Hct, x, y, zL are themselves real. If we
allow them to be complex we can still use these algebraic characterizations of null
four-vectors. Inspection of the matrix
£ 1 ct + z x + Ây
X AA = ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ J x - Ây ct - z N (23.18)
2
23 Physics in three and four dimensions I 517

£
shows that it corresponds to a zero-length vector if and only if the determinant of X A A
is zero. This occurs if and only if the rows are linearly dependent, and, as there are only
two rows, this means that this matrix can be factorized in the form
£ £
X AA = S A pA (23.19)

for some pair of spinors S and p. In the special case when X corresponds to a real vector
p is the complex conjugate of S, but in the complex setting this is relaxed.
You may well ask, what about the case when X m is not zero-length? Not all
points arise as points separated from the origin by a null direction. We shall return to this
presently. But already we have enough mathematics at our disposal to investigate some
very interesting effects to do with the appearance of objects to an observer that is
moving rapidly, and the link between Möbius transforms and relativistic physics. We
begin with the latter.

23.4 Möbius and Lorentz transformations


The importance of spinors and projective coordinates for the sphere emerges when we
consider how to interpret the set of linear transformations that act on spinors. Consider
the linear transformation (remember that summation over B = 0, 1 is implicit)
èA
SA Ø S = LAB SB (23.20)

where the matrix L is given by four complex numbers:


a b
L=J N (23.21)
c d

If we write this our in coordinates, we have


è
z Ø z = az + bh
h Ø hè = cz + dh
(23.22)

and on the single non-projective coordinate w this induces the mapping


aw + b
è = ÅÅÅÅÅÅÅÅ
wØw ÅÅÅÅÅÅÅÅÅÅÅÅÅ (23.23)
cw + d
which is our old friend, the Möbius transformation. Let's explore this new matrix
interpretation of such mappings. Note first that if we rescale all four coordinates
Ha, b, c, dL, the same Möbius transformation is obtained. So we shall rescale L so that
det L = 1, i.e. the unimodular condition applies:

ad - bc = 1 (23.24)

The set of complex matrices of this form is given a name, it is SLH2, L, and algebra-
ically gives a multiplicative group. So far we have thought about it only in terms of its
action on the two-component spinors. But it also acts on matrices of the form given by
Eq. (23.18), and indeed this action will have the same form whether or not X AA' is a null
518 Complex Analysis with Mathematica

vector representable as a product of spinors. In terms of matrices, the mapping induced


on X is
è
X Ø X = LXL* (23.25)

where L* is the transposed complex conjugate. From this relation we can deduce the
action on the determinants of X:
è
det X Ø det X = detHLXL* L = det L det X det L* = det X (23.26)

So the determinant is invariant. For a general X this determinant is, from Eq. (23.18),
one half of

c2 t2 - x2 - y2 - z2 (23.27)

which is precisely the relativistic distance function. This, by definition, is a Lorentz


transformation. (It is in fact a special form of Lorentz transformation that preserves the
sense of time – these are called restricted Lorentz transformations.)
We have established that unimodular Möbius transformations correspond to
elements of SLH2, L, each of which generate a restricted Lorentz transformations. The
relationship is not quite 1:1, because both L and -L give the same Lorentz transforma-
tion. This correspondence is at the heart of a complex-analytic treatment of relativistic
physics. One immediate question is to ask: What does our knowledge of Möbius transfor-
mations tells us about relativity?

23.5 The invisibility of the Lorentz contraction


One of the most immediate results from this analysis concerns how rapidly moving
obsevers perceive the world compared to observers who are stationary. Many elemen-
tary discussions of relativity contain a confusing description of the ‘Lorentz Contraction’
, with objects appearing to be squashed in the direction of motion of the observer. A
favourite construction is to show what Einstein saw on his tram ride to work, with a tram
moving close to the speed of light, and the houses on the side of the street looking rather
narrower than usual! Such discussions completely confuse the business of going out and
measuring obects, usually with ‘rods’ and ‘clocks’, with the calculation of what happens
to light rays arriving in the eye of an observer. The latter is a rather more subtle affair.
That there is something rather incomplete with the simple contraction picture can
be seen by recalling what happens when you drive (preferably rather slowly) into an area
of falling snow. If you are stationary, the snow appears to fall from directly above.
When you drive at some speed, the snow appears to arrive on your windscreen at a
non-zero angle to the vertical. It is possible, as this author recalls, to drive fast enough
that the snow appears to be travelling horizontally, though I must emphatically discour-
age others from trying to reproduce this effect. What this crude physical analogy is
telling us is that objects appear to be moved to in front of us, but it does not tell us how
their apparent shape changes. To get a grip on this we need to exploit the concept of the
celestial sphere, and the effect of Lorentz transformations on the points on this sphere.
23 Physics in three and four dimensions I 519

This issue was not properly appreciated until quite recently – see Terrell (1959)
and Penrose (1959). In particular, we shall look at what happens to our perceptions of
spheres. To a stationary observer, a stationary sphere will present a circular outline on
that observer's celestial sphere. Let's explore this and see what happens when that
observer accelerates.
The first observation we need is that if an object presents a circular outline on
S , then its outline corresponds also to a circle in the Argand plane. To see this, note that
a circle outlined on S corresponds to the intersection of a plane with S . So let the
equation of the plane be characterized by the direction cosines Hl, m, nL of its unit
normal. Then the intersection of S with this plane is given by those points on S
satisfying

lx + my + nz = d (23.28)

with d 2 < 1. If we scale, for example, the sphere S+ so that ct = 1, then we can parame-
trize points on it by Eq. (23.9), to obtain

lHw + êê
wêL - ÂmHw - êê
wêL + nHww
êêê - 1L = dHww
êêê + 1L (23.29)

and on reorganization this gives


êêê + Hl - ÂmLw + Hl + ÂmLw
Hn - dLww êêê = m + d (23.30)

We have already studied this equation – provided n =/ d it is the equation of a circle,


otherwise it is the equation of a straight line. Similar equations are obtained on S- by the
use of the antipodal map. We already know also that under a Möbius transformation, the
family of equations given by Eq. (23.30) are transformed into the same family. Since S-
has the interpretation as the field of view of an observer at the origin, objects with a
circular outline, such as a sphere, will still appear spherical to an observer travelling
rapidly but instantaneously coincident with the origin, i.e. spheres do not appear to be
squashed in the direction of motion.
This analysis can be taken one step further. We already know that Möbius
transformations are conformal maps of the Argand plane. It is, in fact, also the case that
stereographic projection between the Riemann sphere and the Argand plane is confor-
mal. So if we compose these observations, if follows that the shape of a small object
(characterized by the local angles between elements of its outline on S- ) is also left
invariant by a Lorentz transformation.
To appreciate that stereographic projection is conformal requires a basic apprecia-
tion of the relationship between metrics and angles – we have not spelled this out before
now. First of all, the notion of distance in Euclidean three-space is given by the simple
Pythagorean metric

ds2 = d x2 + d y2 + d z2 (23.31)

We need to know what form this takes when restricted to the Riemann sphere, for
example S+. It is straightforward to show (see Exercise 23.1) that if we use the parametri-
zation given by Eq. (23.9), then
520 Complex Analysis with Mathematica

ds2 = fHw, êê
wêL dwdw
êêê (23.32)

where
4
f = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êêêÅLÅÅÅ2ÅÅ (23.33)
H1 + ww

So the distance function on S+ is a multiple of the distance function on the Argand


plane, the latter being just dwdwêêê. That is, stereographic projection effects a locally
isotropic expansion of the neighbourhood of points, and hence is angle-preserving.
Thus far we have established two important observations. For all observers
instantaneously co-located

(1) the apparent shape of small objects is invariant under changes of observer velocity;
(2) the circular outline of an object of arbitrary size is also invariant under changes of
observer velocity.

These two results, due, respectively, to Terrell (1959) and Penrose (1959), constitute
what is known as the ‘invisibility of the Lorentz contraction’. As we have seen, these
results follow directly from the conformality and circle-preserving properties of the
Möbius (Lorentz) transformation. So now we know that objects do not get anisotropi-
cally squashed. Next we need to get a better grip on the detail of what does happen.

23.6 Outline classification of Lorentz transformations


We now know that a Lorentz transformation is one of the family of mappings
aw + b
è = MHwL = ÅÅÅÅÅÅÅÅ
wØw ÅÅÅÅÅÅÅÅÅÅÅÅÅ
cw + d
with the property that ad - bc = 1. We have already discussed some of the properties of
these mappings in Chapter 16. We shall look again now with the fresh eye of relativity.
The most straightforward way of analysing the mappings is to classify them on the basis
of their fixed points. If we set wè = w in this last equation, we obtain a quadratic equa-
tion for w, which in general has two, possibly coincident, roots. So we can consider
these two cases separately.

‡ Distinct Roots
It is immensely helpful to analyse this case by picking appropriate coordinates. We are
assuming that there are two distinct complex numbers w1 and w2 that are left invariant
by the Möbius transformation under consideration. These correspond to two distinct
points on each of the spheres S+ or S- . As discussed in Section 16.8, we can construct a
second Möbius transformation, say G, to send each of these two points to any given new
pair of points. We shall choose the new pair of points to be zero and infinity. So let
23 Physics in three and four dimensions I 521

è
x = GHwL; x = GHwè L (23.34)

and it follows that


è
x = GHwè L = GHMHwLL = GHMHG-1 HxLLL (23.35)

It also follows that the mapping


è
x Ø x = NHxL = G Î M Î G-1 HxL (23.36)

is a Möbius transformation, as the transformations form a compositional group, and it


has fixed points at zero and infinity. What is the nature of such a transformation,
expressed by N? Let us now suppose that we have written this new mapping in the form
Ax + B
NHxL = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
Cx + D

Inspection of the formula for the fixed points reveals that there is a fixed point at infinity
if and only if C = 0. So the possession of a fixed point at infinity is equivalent to being
able to write N in the form

NHxL = A£ x + B£

for complex contants A£ , B£ . Clearly the origin is then also a fixed point if and only if
B£ = 0. Thus we obtain the following result. A Möbius/Lorentz transformation with a
pair of distinct fixed points is equivalent (under a change of coordinates expressed by
Eq. (23.35)) to the simple complex rescaling:
è
x Ø x = A£ x (23.37)

‡ Equal Roots
We have also done most of the work to analyse the case of a unique fixed point. We
apply a transformation of the form of Eq. (23.35) to place the single fixed point at
infinity. So the transformation must be equivalent to
è
x Ø x = A£ x + B£ (23.38)

Now how do we ensure that there are no other fixed points? If we write down the
equation

x = A£ x + B£ (23.39)

we see that there is a second finite solution unless A£ = 1. So the case of equal roots is
equivalent to
è
x Ø x = x + B£ (23.40)

which is a simple complex translation. This classification will be sufficient for our needs
here. A much more detailed exposition is given by Needham (1997).
522 Complex Analysis with Mathematica

‡ Physical interpretations
What we have shown is that any Möbius/Lorentz transformation is equivalent to either a
multiplication of the form of Eq. (23.37) or a translation of the form of Eq. (23.40).
What do these observation mean physically? We need to do two things: (a) interpret the
imposition of infinity, and optionally, zero, as the fixed points, and (b) interpret the
transformations then given by Eqs. (23.37) and (23.40).
Suppose first that we impose zero and infinity as fixed points. This means that
both B and C are zero. The matrix of the transformation with respect to these coordinates
is then just

il 0 yz
L = jj z (23.41)
k 0 l-1 {

where A£ = l2 , l œ , and we observe that acting on the corresponding spatial coordi-


nates, this induces a mapping via Eq. (23.25), which is particularly simple. The direc-
tions given by ct + z and ct - z are left invariant, and there is no mixing of these coordi-
nates with the x, y coordinates. In detail, we have, if

l = r‰Ây (23.42)

then (see Exercise 23.2 for the details)


è
ct + zè = r2 Hct + zL
è 1
ct - zè = ÅÅÅÅÅ2ÅÅÅÅ Hc t - zL (23.43)
r
èx + Âyè = ‰2Ây Hx + ÂyL

So the use of zero and infinity as fixed points corresponds to making the choice of ct  z
as an invariant pair of directions (they are not absolutely invariant, being rescaled by
reciprocal factors). The form of the set of equations (23.43) suggests that we split this
case into two further special cases. The first is where r = 1. The t, z pair are then left
invariant, and we observe that the effect of the transformation is a rotation of the x, y
plane by an angle 2y. The second case is perhaps a little more interesting. We set y to
zero. The x, y pair are then left invariant, and we have new formulae expressing the
mapping from the pair z, t to the new pair z£ , t£ . This is most easily expressed by
introducing new and rather suggestive parameters as follows. First we set

r = ‰m (23.44)

and define g r 1 by

g = coshH2 mL (23.45)

We now introduce a speed parameter v defined up to a ± sign by the equation


23 Physics in three and four dimensions I 523

1
g = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (23.46)
"########
1 - #ÅÅÅÅ v#####
2
ÅÅ
c2

and we fix its sign by requiring that


gv
sinhH2mL = ÅÅÅÅÅÅÅÅÅ (23.47)
c
It then follows from Eq. (23.43) (see Exercise 23.3 for details) that
è zv
t = gJt + ÅÅÅÅÅ2ÅÅÅ N
c (23.48)
zè = gHz + vtL

This is perhaps the most famous form of the Lorentz transformation. The plane given by
setting zè = 0 is equivalent to the constraint z = -vt. The effects of time dilation and the
Lorentz contraction can now be derived with care from these relations. However, our
interest is in the appearance of objects. This is most easily expressed by use of the
Möbius transformation
è
x Ø x = r2 x (23.49)

What is r2 expressed in terms of v? This is now easy. We have

v 1 + v ê c 1ê2
A£ = r2 = ‰2 m = coshH2 mL + sinhH2 mL = gJ ÅÅÅÅÅ + 1N = J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N (23.50)
c 1 - vêc

Now all of this analysis has been worked out on coordinates adapted to S+ . The corre-
sponding action on S- can be deduced by applying the antipodal map to Eq. (23.49),
which gives the effect as the real rescaling factor
è = ÅÅÅÅwÅÅÅÅÅ
wØw (23.51)
r2

Now we use the polar coordinate representation for S- , i.e.


q
w = -‰Â f tanJ ÅÅÅÅÅ N (23.52)
2
to deduce that the effect of the transformation is just

q£ 1 - vê c 1ê2 q
tanJ ÅÅÅÅÅÅÅÅ N = J ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ N tanJ ÅÅÅÅÅ N (23.53)
2 1 + vê c 2

This is a very important formula. It tells us how the apparent direction of a light ray
changes as we adjust the velocity of the observer at the origin. It is sometimes called the
angular abberation formula. This relation also helps us to fix the sense of v in our minds
– if a stationary obsever perceives a star or other object at an angle q to the North pole,
then an obsever heading to the North pole with speed v > 0 perceives that same object to
be located at an angle q' to the North pole, at that instant when he/she is instantaneously
co-located with the stationary observer.
524 Complex Analysis with Mathematica

The second case – that of one fixed point at infinity – is left as an exercise for
you to explore the details. For now we wish to explore the effects of Eq. (23.53) in a
little more detail.

23.7 Ÿ Warping with Mathematica


In order to implement this, we shall simplify the graphics somewhat, and represent all
objects by collections of points. This makes the drawing a little inefficient, but makes
the implementation of the conformal map very trivial. We shall consider an imaginary
race of aliens called The Grob, who travel around in cubical spaceships. We want to find
out what their spaceship looks like if we view it from an observer that is initially station-
ary with respect to the Grob ship, and then from an observer travelling at ‘Warp Factor’
9. With due deference to certain other cultural interpretations of this term, for the
purposes of this discussion Warp Factor 9 means 0.9 times the speed of light. (The
management of observers equipped with trans-warp drive is beyond the scope of this
discussion.) We can also consider more boring speeds such as Warp Factor 5.
First of all we shall build our cubes:

xside@n_D := Table@8k ê n, 0, 0<, 8k, 0, n<D;


yside@n_D := Table@80, k ê n, 0<, 8k, 0, n<D;
zside@n_D := Table@80, 0, k ê n<, 8k, 0, n<D;

move@origin_, points_D := Map@Horigin + #L &, pointsD

PointCube@origin_List, n_D :=
Module@8xpts = xside@nD,
ypts = yside@nD,
zpts = zside@nD<,
Flatten@8move@origin, xptsD,
move@origin + 80, 1, 0<, xptsD,
move@origin + 80, 0, 1<, xptsD,
move@origin + 80, 1, 1<, xptsD,
move@ origin, yptsD,
move@ origin + 81, 0, 0<, yptsD,
move@ origin + 81, 0, 1<, yptsD,
move@ origin + 80, 0, 1<, yptsD,
move@origin, zptsD,
move@origin + 81, 0, 0<, zptsD,
move@origin + 80, 1, 0<, zptsD,
move@origin + 81, 1, 0<, zptsD
<, 1DD

Let's have two cubes, in different locations:

testa = [email protected] * 81, 1, 1.5<, 40D;


testb = [email protected] * 8-1, -1, 0<, 40D;
23 Physics in three and four dimensions I 525

Now we define a function that projects the points onto the unit sphere. The idea is that
our observer will sit in the centre of the nose cone of a spaceship, and the cone has an
observation window that is the cap of a sphere. The observer therefore sees the outside
world entirely in terms of a ‘painting’ on his window – this window forms a section of
his or her celestial sphere. We will draw the window also as part of a sphere – we
actually do the painting slightly inside. The following function takes points in space and
paints them onto the inside surface of the observation window:

ProjectToUnitSphere@8x_, y_, z_<D :=


Module@8r = Sqrt@x ^ 2 + y ^ 2 + z ^ 2D, q, f<,
q = ArcCos@z ê rD;
f = ArcCos@x ê Hr * Sin@qDLD;
0.999 * 8Sin@qD Cos@fD, Sin@qD Sin@fD, Cos@qD<D

Here is the painting carried out with the angular abberation factor derived above:

AbberateProjectToUnitSphere@8x_, y_, z_, warp_<D :=


Module@8r = Sqrt@x ^ 2 + y ^ 2 + z ^ 2D, q, f, newtheta,
abber = Sqrt@HH1 - warp ê 10L ê H1 + warp ê 10LLD<,
q = ArcCos@z ê rD;
f = ArcCos@x ê Hr * Sin@qDLD;
newtheta = 2 * ArcTan@abber * Tan@q ê 2DD;
0.999 * 8Sin@newthetaD Cos@fD,
Sin@newthetaD Sin@fD, Cos@newthetaD<D

newcubea = Map@ProjectToUnitSphere@#D &, testaD;

newcubeb = Map@ProjectToUnitSphere@#D &, testbD;

abbernewcubea@warp_D :=
Map@AbberateProjectToUnitSphere @Append@#, warpDD &,
testaD;

abbernewcubeb@warp_D :=
Map@AbberateProjectToUnitSphere @Append@#, warpDD &,
testbD;

In order to calculate the graphics effectively, we shall load a package that makes the
computation of scaled coordinates slightly easier. This is from Wickham-Jones (1994).
We shall exhibit the relevant settings, however – you do not need to get this package,
but it is very useful to have, and is available from http://library.wolfram.com (if
you get a warning about a CrossProduct object on loading this package ignore it).

Needs["ExtendGraphics`View3D`"]
526 Complex Analysis with Mathematica

?ViewPointFromUser

ViewPointFromUser@ pt, plotrange, boxratiosD


returns the ViewPoint that corresponds to the point in
user coordinates pt, with PlotRange prng and BoxRatios box.

We shall deal with a cap that is part of the hemisphere:

MyPlotRange = {{-1.1, 1.1},{-1.1, 1.1},{0.4, 1.1}};


zwidth = MyPlotRange[[3,2]] - MyPlotRange[[3,1]];
MyBoxRatios = {2.2, 2.2, zwidth};
MyViewPoint = ViewPointFromUser[{0,0,0.0},
MyPlotRange, MyBoxRatios];

Here is the actual data:

{MyBoxRatios, MyViewPoint}
2.2 2.2 0.7
J N
0. 0. -0.340909

Let's draw the observation window with these settings:

HemiSphere = ParametricPlot3D@
1.1 * 8Sin@qD Cos@fD, Sin@qD Sin@fD, Cos@qD<,
8q, 0, Pi ê 2<, 8f, 0, 2 Pi<,
Boxed -> False, BoxRatios -> MyBoxRatios,
Axes -> False, Shading -> False,
PlotRange -> MyPlotRange,
ViewPoint -> MyViewPoint,
PlotPoints -> 810, 30<D

Now we shall view this window painted with the external scene:
23 Physics in three and four dimensions I 527

baseplota = Show@Graphics3D@Map@Point, newcubeaD,


Boxed -> False, BoxRatios -> MyBoxRatios,
Axes -> False, Shading -> False,
PlotRange -> MyPlotRange, ViewPoint -> MyViewPoint,
DisplayFunction -> IdentityDD

baseplotb = Show@Graphics3D@Map@Point, newcubebD,


Boxed -> False, BoxRatios -> MyBoxRatios,
Axes -> False, Shading -> False,
PlotRange -> MyPlotRange, ViewPoint -> MyViewPoint,
DisplayFunction -> IdentityDD

Here is the zero velocity scene. There are limitations in the way Mathematica projects
this, but you certainly perceive the cubes as having straight sides. This will change when
we boost the observer's speed.

Show@HemiSphere, baseplota, baseplotbD

abberplota@warp_D :=
Show@Graphics3D@Map@Point, abbernewcubea@warpDD,
Boxed -> False, BoxRatios -> MyBoxRatios,
Axes -> False, Shading -> False,
PlotRange -> MyPlotRange, ViewPoint -> MyViewPoint,
DisplayFunction -> IdentityDD

abberplotb@warp_D :=
Show@Graphics3D@Map@Point, abbernewcubeb@warpDD,
Boxed -> False, BoxRatios -> MyBoxRatios,
Axes -> False, Shading -> False,
PlotRange -> MyPlotRange, ViewPoint -> MyViewPoint,
DisplayFunction -> IdentityDD
528 Complex Analysis with Mathematica

Now let's look at the same scene from an observer moving at half the speed of light:

Show@HemiSphere, abberplota@5D, abberplotb@5DD

At Warp Factor 9, i.e. 90 per cent of c the effect is even more dramatic:

Show@HemiSphere, abberplota@9D, abberplotb@9DD

You might like to make a movie of the process of ‘going to warp’ – here is one to try
(see also the exercises – the output is not shown here):

Do@Show@HemiSphere, abberplota@mD, abberplotb@mDD,


8m, 0, 9, 1<D

Finally, if you have, or can obtain, the add-on application Dynamic Visualizer, try using
this to obtain still more realistic results.
23 Physics in three and four dimensions I 529

23.8 From null directions to points: twistors


We now have a very firm grip on what happens to the field of observations of observers
under Lorentz transformations. But to start doing physics in three and four dimensions,
we shall need rather more. In particular, we shall need a way of representing points in
space and space-time. All we have so far is an understanding of the properties of points
that are obtained by passing a light ray through an origin.
In order to describe general points via a suitable complex geometry, we will
need to introduce the concept of a twistor, due to Penrose (see for example, Penrose and
Rindler, 1984b). The following is intended to be an informal discussion, but will contain
the key ingredients. We need first to extend the structures asociated with spinor algebra.
We have already encountered the concept of a spinor as a two-component object:
z
SA = J N
h
êêA£
We also have their complex conjugates S . Furthermore, we can define corresponding
elements of the dual space, say lA , and elements of the dual conjugate space p A£ . As
usual, the operation of contraction (summing over repeated indices), gives us a complex
number – for example:

SA lA = S0 l0 + S1 l1 œ  (23.54)

and similarly for their complex conjugates. The most obvious question from a linear
algebra point of view is to ask whether there is a natural mapping from a spinor to a dual
spinor. This as usual relies on the existence of a natural inner product on spinors. There
is indeed one, but it takes a rather unusual form that is induced by the relativistic concept
of distance embodied in Eq. (23.3). We have already observed that this norm on vectors
corresponds to the operation of taking determinants of matrices of the form given by Eq.
(23.18), which were
£ 1 ct + z x + Ây
X AA = ÅÅÅÅÅÅÅÅ
è!!!ÅÅÅÅÅ J x - Ây ct - z N
2

Such determinants can also be calculated by the introduction of suitable alternating


symbols. We define the spinor metric eAB to be +1 if A = 0, B = 1; -1 if A = 1, B = 0
and zero otherwise. The complex conjugate is identical. Now consider the expression
(summation convention applies as usual):
£ £
eAB eA£ B£ X AA X B B
£ £
£
00 £
= e01 e0£ 1£ X 0 0 X£ 11 +£ e10 e1£ 0£ X 11 X£ £
+ e01 e1£ 0£ X £ X £ +e10 e0£ 1£ X X£ 01 £
01 10 10
(23.55)
= 2e01 e0£ 1£ X 00 X 11 + 2 e01 e1£ 0£ X 01 X 10
= c2 t 2 - x2 - y2 - z2
So then this strange alternating metric on spinors is naturally compatible with the
relativistic concept of distance. Thus we do have a natural inner product on spinors:
530 Complex Analysis with Mathematica

<l, m> = eAB lA mB (23.56)

and the inner product of any spinor with itself is identically zero. (This takes some
getting used to.) Furthermore, we can use this eAB quantity to define dual spinors from
spinors:

lB = lA eA B (23.57)

and the corresponding inverse mapping eAB exists and we can extract spinors from dual
spinors thus:

lA = eAB lB (23.58)

We shall need these structural observatiosn in the following discussion.


A twistor, in its simplest guise, is a pair consisting of a spinor and an element of
the complex conjugate dual space:

Z a = 8wA , pA£ < (23.59)

The new index a runs from 0 to 3. It is not to be confused with the space-time index
which also runs from 0 to 3. The introduction of such objects gives us enough structure
to properly define a relationship between general points in Minkowski space and the
associated complex space known as twistor space. This relationship is that of incidence
between a space-time point and a twistor, and in Minkowski space it is given by the
relationship
£
wA = Â X A A pA£ (23.60)

The nature of this relationship is extraordinarily subtle. First, we note that it only
involves the coordinates Z a in a projective sense – there is no scaling implicit in this
£
relationship. Second, given a space-time point x expressed by the matrix X A A , we can
obtain a two-dimensional family of twistors (or, projectively, a one-dimensional family)
that are incident with x. Finally, given a twistor Z a there are an entire family of space-
time points that are incident with it. Indeed, if x0 is any one solution, so will that given
by
£ £ £
X AA = X0A A + lA pA (23.61)

for all values of the spinor l. This, geometrically, represents a null 2-plane in (complex)
Minkowski space.
So how do we define a point in Minkowski space in twistor terms? Since a point
corresponds to a one-dimensional family in projective terms – a line in projective twistor
space, it is now straightforward to specify a point as corresponding to a pair of twistors
(two points on the line). Algebraically this should come as no surprise. The incidence
relation (23.60) corresponds to two equations. To specify the four coordinates embedded
£
in X A A we need four equations – so incidence with two distinct twistors will suffice. So
a point can be characterized by a pair of incidence relations:
23 Physics in three and four dimensions I 531

£
w1A = ÂX A A p1A£ ;
£ (23.62)
w2A = ÂX A A p2A£

and this has the solution


£ £ £ £
ÂX AA = Hw1A p2A - w2A pA1 L ê Hp1C £ pC2 L (23.63)

23.9 Minimal surfaces and null curves I: holomorphic


parametrizations
We shall now consider our first application of basic twistor algebra. This is not, in fact,
an immediate application to equations like Laplace's equation, but is an application to a
construction that does not have an analogue in two dimensions – the construction of
minimal surfaces (soap bubbles!). There is some beautiful geometry that we can explore
that is based on the properties of complex holomorphic curves whose tangent is every-
where null. The visualization of the real expressions of these curves is naturally
achieved within Mathematica. We shall also learn some useful facts about points and
how they are represented in complex terms – this will also be useful in Chapter 24.
This is not a text about differential geometry, so we shall not indulge in an
exhaustive discussion on minimal surfaces, but we do need to make the link between
minimal surfaces and certain holomorphic null curves. This correspondence applies in
general dimension d. We are interested in finding maps from 2 to d , represented as
xa Hu, vL, such that the area of an immersed two-surface is a minimum. Such surfaces
arise very naturally in nature – in particular the surface formed when a wire frame is
dunked in soapy water is a surface of least area such that its boundary is given by the
wire frame.
This is a problem in the calculus of variations and in general leads to non-linear
differential equations. These equations can be simplified considerably if one exploits the
freedom to reparametrize the surface. We shall assume that this can be done in such a
way that the surface is conformal to a plane in the Hu, vL coordinates. In other words, the
infinitesimal distance ds between two points is given in terms of their coordinate shifts,
Hdu, dvL, by

ds2 = fHu, vL Hdu2 + dv2 L (23.64)

Such coordinates are often called isothermal coordinates. The differential equations
governing the minimal surface then become the set

ij 2 2 y
j ÅÅÅÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅÅÅÅÅ zz xa = 0 (23.65)
k u2 v2 {

but there are additional constraints associated with Eq. (23.3), which take the form that
the tangent vectors to the surface along the u and v directions are of the same length and
orthogonal, i.e. if the metric function is hab (not necessarily of the signature of Eq.
(23.3), nor necessarily in four dimensions, but composed of a dimension-d diagonal
matrix of 1 down the diagonal), then
532 Complex Analysis with Mathematica

 xa  xb  xa  xb
hab ÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ = hab ÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ (23.66)
u u v v
 xa  xb
hab ÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅ = 0 (23.67)
u v
For a detailed discussion of the differential geometry associated with these surfaces, and
on isothermal coordinates, see Chapter 23 of Gray (1993), which contains many applica-
tions of Mathematica to differential geometry, and the references therein.

‡ Holomorphic representation via null curves


The point of discussing these equations in a complex analysis setting is that Eq. (23.65)
can be solved by requiring that xa is the real part of a complex vector field, i.e. a holomor-
phic function of w = u + Âv:

xa = ReHX a @wDL (23.68)

The constraints (23.66), (23.67) are then equivalent to demanding that X a HzL has a
tangent that is null:

 Xa  Xb
hab ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = 0 (23.69)
w w
So we see that the differential equation has been essentially eliminated, leaving us with a
holomorphic system satisfying a simple geometrical condition given by Eq. (23.69).
This is a good point for a pause for thought on what has been accomplished. The
equations characterizing a minimal surface constitute a set of non-linear differential
equations. We have simplified these by introducing isothermal coordinates. The differen-
tial equation states that each component of the position vector characterizing a point on
the surface must be a harmonic function of the isothermal coordinates, and so can be
managed in terms of holomorphic functions. We are left with a nullity constraint.

‡ The construction of null holomorphic curves in Minkowski space


We shall now go one step further and solve the nullity constraint completely. The work
we have done setting up the theory of spinors and twistors makes dealing with this very
easy indeed for the case of four dimensions and nullity condition being based on the
Minkowski metric given by Eq. (23.3). The twistor geometry of this was first set out by
the author (Shaw, 1985), though the formulae that result are much older, as we shall see
presently. The analysis for some other signatures and dimensions is summarized by
Shaw and Hughston (1990).
First of all, the nullity of the tangent vector implies the existence of a spinor field
pA HwL with the property that
£
23 Physics in three and four dimensions I 533

£
 XA A
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ pA£ = 0 (23.70)
w
This spinor field is only defined projectively by this equation. We define an associated
twistor field by requiring incidence everywhere:
£
wA HwL = ÂX A A HwLpA£ HwL (23.71)

Now we differentiate both sides with respect to w, using a dot to denote differentiation.
Since Eq. (23.70) holds we deduce that

w°A HwL = Â X A A HwLp°A£ HwL


£
(23.72)

so that the point is also incident with the derivative twistor. But now we can extract X
from the twistor, as two incidence relations serve to define the point in general. That is,

 X AA = IwA p°A - w°A p A M ë IpC £ p°C M


£ £ £ £
(23.73)

This gives us a formula for a null curve in terms of an arbitrary differentiable twistor
curve. There is a great deal of freedom in this formula. First, we note that it is invariant
under w-dependent rescalings of the twistor curve. (You might like to check this.) So
only the proective components matter. We exploit this and choose the complex parame-
ter such that
£
w = p0£ êp1£ ; pA£ = p1£ Hw, 1L ; pA = p1£ H1, -wL (23.74)

We also introduce explicit coordinates for wA as:


è!!! £
wA = 2 Âp1 8 f HwL, gHwL< (23.75)

It is now a matter of unravelling Eq. (23.73) using the variables in Eqs. (23.74) and
(23.75). For example
£ è!!! £
ÂX 00 = 2 Â f HwL (23.76)

becomes the condition

ctHwL + zHwL = f £ HwL (23.77)

Unpacking the other conditions and reorganizing gives

ct = f £ + g - wg£
x = g£ + f - w f £
(23.78)
Ây = f - w f £ - g£
z = f £ - g + wg£

These formulae are actually rather old! The representation of null curves and minimal
surfaces by these formulae were first given in a series of papers by Montcheuil (1905)
and Eisenhart (1911, 1912). However, their understanding in terms of complex relativistic
geometry emerged relatively recently (Shaw, 1985). The corresponding results for dimen-
sion three are older still – we shall look at this right away.
534 Complex Analysis with Mathematica

‡ Reduction to three-dimensional Euclidean space


If we constrain Eqs. (23.78) so that the resulting curve lies in the hyperplane t = 0, we
must impose the condition

f £ = -g + wg£ (23.79)

This can be integrated. If we demand that g = G£ for some G, then

f = wG£ - 2G (23.80)

The remaining equations in (23.78) then boil down to

x = -2G + 2wG£ + H1 - w2 LG


Ây = -2 G + 2wG£ - H1 + w2 LG (23.81)
z = 2wG - 2 G£

This is a very important formula. It gives the general solution for a holomorphic null
curve in complex Euclidean three-space. Its real part is a minimal surface in real Euclid-
ean three-space. Note that neither this formula nor its four-dimensional counterpart
contain any integration – we have solved the problem completely in terms of free
holomorphic functions.
Note that the result for three dimensions can also be derived by an intrinsically
three-dimensional argument. This has been given by Hitchin (1982), and gives the
Weierstrass (1866a) parametrization for minimal surfaces, in its integral-free form. The
paper by Weierstrass is available on the internet (Weierstrass 1866b).

‡ Degeneration to points
Before we look at the surfaces generated by these formulae, let's take a quick look at
degenerate situations. It will be evident that if we take f and g to be both linear func-
tions of w, Eq. (23.78) will give constant values for Hct, x, y, zL. Similarly, if G is
quadratic, Eq. (23.81) will also give constant values for Hx, y, zL. Let's explore this a
little, and suppose that

G = a + bw + cw2 (23.82)

It follows that

G£ = b + 2cw;
(23.83)
G = 2c

Application of Eq. (23.81) then gives us

x = 2Hc - aL; Ây = -2Ha + cL; z = -2 b (23.84)

or inverting this
23 Physics in three and four dimensions I 535

1
G = - ÅÅÅÅÅ HHx + ÂyL + 2zw - Hx - ÂyLw2 L (23.85)
4
This is a simple way of observing that points in Euclidean three-space correspond to
quadratic functions of w. We shall need this in Chapter 24. Similarly, we can give an
explicit coordinate representation of the fact that points in Minkowski space correspond
to a pair of linear functions of w. What we need to observe for now is that adding a
linear term to f and/or g, or adding a quadratic term to G, will not materially alter the
form of the null curve or associated minimal surface – it will just translate it.

23.10 Ÿ Minimal surfaces and null curves II: minimal


surfaces and visualization in three dimensions
We now consider the business of generating minimal surfaces using Mathematica. Let
us suppose that we always work in terms of a variable w and supply a function G whose
complex argument is w. First we wish to extract the null curve. We do this by using a
method similar to that introduced by Gray (1993), but avoiding any integration:

NullCurve[G_][w_] :=
Module[{ww, temp, one, two},
one = D[G[ww], ww];
two = D[G[ww], {ww, 2}];
temp = {-2*G[ww]+2*ww*one + (1-ww^2)*two,
I*(2*G[ww]-2*ww*one+(1+ww^2)*two),
2*ww*two - 2*one};
Simplify[temp /. ww->w]
]
Let's check it is working by giving it a trivial quadratic – we should get a point back:

NullCurve[-1/4((x+I y) + 2 z #-(x - I y)#^2)&][w]

8x, y, z<

Next we wish to write out the real part of these null curves, based on a convenient
parametrization:

MinimalSurface[G_, w_, params_] :=


Module[{null},
null = NullCurve[G][w];
ComplexExpand[Re[null /. w-> params]]]

Next we wish to generate some automatic plotting routines. We also want the flexibility
to use either Cartesian or Polar coodinates, or possibly a hybrid. Let's do a Cartesian
version first:
536 Complex Analysis with Mathematica

CartesianMinimalSurface[G_, w_, {umin_, umax_},


{vmin_, vmax_}, options___] :=
Module[{ms, u, v},
ms = MinimalSurface[G, w, u + I v];
ParametricPlot3D[Evaluate[ms], {u, umin, umax}, {v,
vmin, vmax}, options]]

Here are some versions for other coordinates:

PolarMinimalSurface[G_, w_, {umin_, umax_}, {vmin_,


vmax_}, options___] :=
Module[{ms, u, v},
ms = MinimalSurface[G, w, u*Exp[I v]];
ParametricPlot3D[Evaluate[ms], {u, umin, umax}, {v,
vmin, vmax}, options]]

ExponentialMinimalSurface[G_, w_, {umin_, umax_},


{vmin_, vmax_}, options___] :=
Module[{ms, u, v},
ms = MinimalSurface[G, w, Exp[u+I v]];
ParametricPlot3D[Evaluate[ms], {u, umin, umax}, {v,
vmin, vmax}, options]]

Here, for example, we find Enneper's surface corresponds to the simple choice w3 :

CartesianMinimalSurface[#^3&, w, {-4, 4}, {-4, 4},


PlotPoints -> 30]

100
50
0 200
-50
-100
0
-200

0
-200
200
23 Physics in three and four dimensions I 537

The catenoid is obtained by chooing G = w logHwL, but we need to consider carefully


what coordinates to use:

CartesianMinimalSurface[#*Log[#]&, w, {-4, 4}, {-4,


4}, PlotPoints -> 30]

1
0
-1
4
-2
-3 2

-4 0
-2
0 -2
2
-4
4
ExponentialMinimalSurface[#*Log[#]&, w, {-2, 2}, {0, 2
Pi}, PlotPoints -> 30]

2
0
-2 5

-4
0
-5
0
-5
5

The exploration of these surfaces is left to you – some suggestions are given in Exercise
23.6. Here is one more to get you started:
538 Complex Analysis with Mathematica

CartesianMinimalSurface@1 ê H10 - # ^ 3L ^ H1 ê 3L &,


w, 8-1, 1<, 8-1, 1<, PlotPoints Ø 30D

0.2

-0.2

0.1

-0.1

-1.2
-1.1
-1
-0.9

Exercises
23.1 [Ÿ] Suppose that we have a curve on the sphere S+ paramterized by wHsL as s
varies, with Eq. (23.9). Show that
°
4 w° êê wê
x° 2 + y° 2 + z° 2 = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
êêêÅÅÅÅL2ÅÅÅÅ
H1 + w w

where the dot denotes differentiation with respect to s. Confirm your results by repeating
the calculation using Mathematica.

23.2 Show that if the mapping defined by Eq. (23.25) in the special form of Eq. (23.41)
is applied to a matrix of the form of Eq. (23.18), then the result is as expressed by Eq.
(23.43).

23.3 Derive Eq. (23.48) from Eq. (23.43) by using the parametrizations expressed by
Eqs. (23.45-23.47).

23.4 Elucidate the effect of a transformation such as that given by Eq. (23.40), with one
fixed point at infinity, by deriving the equations analogous to Eq. (23.43).
23 Physics in three and four dimensions I 539

23.5 Ÿ There are many ways of extending the warping observer example given in
Section 23.8. Try extending this to include:

(i) management of shaded polygonal objects.


(ii) recomputation of the scene as the observer actually
moves through the field of alien ships.
(iii) more ‘realistic’ alien ships.
(iv) addition of colour and Doppler shift effects.

23.6 Ÿ There are many issues in the theory of minimal surfaces that you can explore.
Some suggestions are:

(i) Given a choice of G, what is the effect of replacing this by ÂG?


(ii) Explore what happens within ParametricPlot3D when the functions
(such as log) contain branch points. Investigate how to fix this.
(See also Maeder, 1994).
(iii) Try taking G to be any of Mathematica's special functions, as well
as interesting polynomial, rational and algebraic expressions.

23.7 Given the explicit formulae in Eq. (23.78) and Eq. (23.81), in each case work out
the complex tangent vector to the curve, and verify that it has zero length with respect to
the appropriate measure of distance.
24 Physics in three and four dimensions II

Introduction
The goal of this Chapter is to provide you with a very basic understanding of how
Laplace's equation (in three space variables) and the scalar wave equation (in three space
and one time dimension) can be solved using holomorphic methods. This chapter will
build on the methods developed in Chapter 23 in a very direct way, and you are recom-
mended to read that chapter now before proceeding further here.
The material on dimension three is, in part, a much simplified version of part of
a series of lectures given by Nigel Hitchin (now Professor, F.R.S.) in Oxford in the early
1980s. The picture presented here will not give you anything like the full geometrical
picture underlying the results, which we shall develop by elementary methods. Part of
the theory of the intrinsic three-dimensional approach is developed in a paper published
by Hitchin (1982). The four-dimensional picture is covered most comprehensively by its
principle architect, Professor Sir Roger Penrose, F.R.S., in Penrose and Rindler (1984a,
b).

24.1 Laplace's equation in dimension three


Perhaps the most natural place to start is with the solution of Laplace's equation in three
variables. In Chapter 23 we found, in Eq. (23.85), a natural holomorphic representation
of a point in (possibly complex) three-dimensional space, arising as a degenerate case of
a holomorphic null curve. This representation is in terms of a special type of quadratic
holomorphic function. Absorbing the irrelevant factor of 1 ê 4 into the definition of the
function G, we have the formula

G = Hx + Â yL + 2 z w - Hx - Â yL w2 (24.1)

This quadratic function of the complex variable w plays a very special role, and we shall
give it a name: hêêx HwL, where êxê = Hx, y, zL. For a proper discussion of the geometrical
significance of hêxê HwL you should see Hitchin (1982). Now suppose that f Hh, wL is
holomorphic in both of its arguments h and w. What can we say about f Hhêxê HwL, wL? As
it is holomorphic, we can certainly work out its second derivatives:

2 2
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ f Hhx H wL, wL = H1 - w2 L fhh (24.2)
x
2 2
ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ f Hhx H wL, wL = -H1 + w2 L fhh (24.3)
y

2
ÅÅÅÅÅÅÅÅÅ2ÅÅÅ f Hhx H wL, wL = 4w2 fhh (24.4)
z
24 Physics in three and four dimensions II 541

It follows immediately that

“2 f Hhx H wL, wL = 0 (24.5)

by elementary addition of Eqs. (24.2–24.4). So for any choice of w and f , we have a


solution of Laplace's equation. By the linearity of Laplace's equation, we can linearly
superimpose such solutions for different choices of w, and we can express this through
integration. Thus, given f Hh, wL, we define a scalar field f as follows:

FHx, y, zL = ‡ f Hx + Ây + 2zw - Hx - ÂyLw2 , wL „ w (24.6)


C

where, provided only f is holomorphic, f satisfies Laplace's equation (apart from


possible singular points) for a given choice of the contour C.
We should emphasize that such integral representations are not new and were
derived without twistor methods many years ago. Whittaker (1903) wrote down a
formula of a similar type to Eq. (24.6). It should also be appreciated that there is much
geometric subtlety associated with Eq. (24.6) that we shall not be able to explore
properly. The point is that there may be many choices of f yielding a given f, each
differing from the other by a function that integrates to zero under the contour. Cauchy's
theorem guarantees that there will be many such functions. A proper study of this and
how it is managed mathematically is outside the scope of this book. We can, neverthe-
less, do a great many interesting things with Eq. (24.6) and a naive approach.

24.2 Solutions with an axial symmetry


In order to get a grip on Eq. (24.6) we shall explore some simple special cases where the
field f possesses some symmetry. Perhaps the most interesting case is that of scalar
fields f that are axis-symmetric. That is, choosing the axis of symmetry to be the
z-direction, we seek invariance under rotations within the x–y plane. In our classification
of Lorentz transformations given in Chapter 23, in particular by the last of the Eqs.
(23.43), we saw that the mapping (we divide y by two here, and use w as a spinor
coordinate)

w Ø ‰Ây w (24.7)

induces the rotation

x + Ây Ø ‰Â y Hx + ÂyL (24.8)

It follows that

hêxê HwL = Hx + ÂyL + 2zw - Hx - ÂyLw2 Ø ‰Ây hêxê HwL (24.9)

So the induced action on the h variable is also multiplication by ‰Ây . We also note that

„ w Ø ‰Ây „ w (24.10)
542 Complex Analysis with Mathematica

So to obtain axis-symmetric solutions, the function f Hh, wL must be of the form


1 h
f Hh, wL = ÅÅÅÅÅÅ gJ ÅÅÅÅÅÅ N (24.11)
w w
for some holomorphic g, and we obtain the formula for axis-symmetric solutions in the
form (inserting a normalization factor that will clean the results up):

1 i hêxê HwL y 1
F = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ gjj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zz ÅÅÅÅÅÅ „ w (24.12)
2p k w { w
This formula is equivalent to that given by Whittaker and Watson (1984, note 18.3). Its
geometrical characteristics in twistor terms have been uncovered in a series of articles
by, amongst others, by Ward (1981, 1990) and Mason (1990). It was originally written
down, in trigonometric form, by Whittaker (1903).
To elucidate the structure of this formula, we assume that g has a Laurent series
about the origin, and the contour is deformable to a circle containing the origin. We can
now consider components of g that are just powers of its argument. That is, we are
interested in evaluating

1 i hêxê HwL y 1
n
1 hn êxê HwL
Fn = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ zz ÅÅÅÅÅÅ „ w = ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ÅÅÅÅÅÅÅÅÅn+1
ÅÅÅÅÅÅÅÅÅÅÅÅ „ w (24.13)
2p k w { w 2p w

where the integration is over a circle. To evaluate Eq. (24.13), let us set y = 0,
z = r cosHqL, x = r sinHqL. Then Eq. (24.13) simplifies to
n
rn 1 1
ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ J2 cosHqL + J ÅÅÅÅÅÅ - wN sinHqLN ÅÅÅÅÅÅ „ w (24.14)
2p w w

Now set w = ‰Â t to parametrize the integral. We obtain


2p
2 n rn
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ HcosHqL - Â sinHtL sinHqLLn „ t (24.15)
2p 0

The evaluation of this integral is well known in terms of elementary functions. It is


given, for example, by Gradshteyn and Ryzhik (1980, Eq. 3.611.3) in the form:
p
‡ HcosHqL + Â cosHxL sinHqLL „ x
n

0
p
(24.16)
= ‡ HcosHqL + Â cosHxL sinHqLL-n-1 „ x
0
= p Pn @cosHtLD

where Pn is the nth Legendre polynomial. Making some simple changes of variable, we
obtain, for Eq. (24.15), if n r 0,

2n rn Pn @cosHqLD (24.17)

and if n = -k - 1, for k = 1, 2, 3,…


24 Physics in three and four dimensions II 543

Pk @cosHqLD
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ (24.18)
2k+1 rk+1
Thus we obtain the well-known family of solutions in terms of Legendre polynomials.
This contour integral approach can also lead to other interesting representations of the
Legendre polynomials (see exercise 24.1.) Exercise 24.2 invites you to explore similar
solutions with the property that

F Ø ‰Âmy F (24.19)

under a rotation about the z axis.

24.3 Translational quasi-symmetry


We can generate some other simple solutions by exploring solutions with a translational
‘symmetry’:

FHx, y, a + zL = ‰l a FHx, y, zL (24.20)

We can express this equivalently as the condition that


F
ÅÅÅÅÅÅÅÅÅÅ = l F (24.21)
z
and this will of course generate (some) solutions of the 2-D Helmholtz equation

2 F 2 F
ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å + ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å + l2 F = 0 (24.22)
x y

if we pull out the exponential function of z. Suppose we impose a condition analogous to


Eq. (24.21) on the underlying complex function itself. This gives us
f
2 w ÅÅÅÅÅÅÅÅÅÅ = l f (24.23)
h

which has the solution

f = ‰lhêH2wL hHwL (24.24)

where h is general (holomorphic apart from some poles). What types of field does this
give us? We now need to evaluate expressions that boil down to contour integrals of the
form

‰l z 1
ÅÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‰ ÅÅÅÅ2Å lHHx+ÂyLêw-Hx-ÂyLwL hHwL „ w (24.25)
2pÂ

where h (we assume) has a Laurent series. Under this assumption, we may as well
consider expressions of the form
544 Complex Analysis with Mathematica

1 1
ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‰ ÅÅ2ÅÅ lHHx+ÂyLêw-Hx-ÂyLwL w-Hn+1L „ w (24.26)
2pÂ

for n an integer. To evaluate this we make use of the generating function for Bessel
functions in the form

1
‰ ÅÅ2ÅÅ p Ht-1êtL = ‚ tk Jk HpL (24.27)
k=-¶

We set, with f now the plane polar angle:


è!!!!!!!!!!!!!!!
p = l r = l x2 + y2 (24.28)

Hx - ÂyLw
t = - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ = -‰-Âf w (24.29)
r

The integral becomes



1
ÅÅÅÅÅÅÅÅÅÅÅÅ ‡ ‚ wk H-1Lk ‰-Âkf Jk Hl rLw-Hn+1L „ w (24.30)
2p k=-¶

and this can be evaluated directly based on residues, to give

H-1Ln ‰-Ânf Jn HlrL (24.31)

which is an important family of basic solutions to the 2-D Helmholtz equations.

24.4 From three to four dimensions and back again


As with the discussion of null curves given in Chapter 23, matters are slightly more
straightforward in the full relativistic and four-dimensional picture. We can make direct
use of the twistor-space-time incidence relation
£
wA = ÂxAA pA£ (24.32)

to construct solutions of the scalar wave equation in a natural holomorphic way. We are
now interested in the interpretation of holomoprhic functions of twistors f HZ a L in
space-time terms. Now by splitting the argument up into its spinor pairs:

f HZ a L = f HwA , pA£ L (24.33)

it then becomes natural to consider space-time fields obtained by imposing the incidence
relation thus:
£
f HÂxAA pA£ , p A£ L (24.34)

and carrying out a suitable integration over possible values of pA£ . Now because the
incidence relation is really a relationship between space-time points and twistors consid-
24 Physics in three and four dimensions II 545

ered projectively – the scale being irrelevant, we need to work this out in projective
terms. In our standard coordinates, we have
è!!! 0
2 w = ÂHct + zL p0£ + ÂHx + ÂyL p1£ (24.35)
è!!! 1
2 w = ÂHx - ÂyL p0£ + ÂHct - zL p1£ (24.36)

Now we set
è!!! è!!!
p 0£ -Â 2 w0 -Â 2 w1
w = ÅÅÅÅÅÅÅÅÅÅ ; p = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; q = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ ; (24.37)
p 1£ p1£ p1£

and this gives us

p = Hct + zLw + Hx + ÂyL (24.38)

q = Hx - ÂyLw + Hct - zL (24.39)

Now working projectively with the scale factor p1£ removed, we wish to consider
contour integrals of the form

‡ gH p, q, wL „ w (24.40)

or, in explicit coordinates:

YHx, y, z, tL = ‡ g@wHct + zL + Hx + ÂyL, wHx - ÂyL + Hct - zL, wD „ w (24.41)

where g is holomorphic in each of its arguments but otherwise arbitrary. We now


investigate this formula. But we note first that the geometric appreciation of this formula
is due to Penrose – a full discussion is given by Penrose and Rindler (1984a, b), includ-
ing the result for other types of massless fields including electromagnetic fields. How-
ever, results equivalent to this were first obtained by Bateman (1904, 1944) based on
Whittaker's earlier analysis for the Laplace equation.

‡ Solving the wave equation


We write the wave equation in the form

1 2 Y 2 Y 2 Y 2 Y
ÅÅÅÅÅ2ÅÅÅ ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å - ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å - ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = 0 (24.42)
c t x y z

The fact that Eq. (24.41) satisfies Eq.(24.42) can be hammered out by direct differentia-
tion, but it is rather more transparent if more suitable coordinates are chosen. We
introduce
êê
u = ct - z; v = ct + z; z = x + Ây; z = x - Ây (24.43)

and note that (see Exercise 24.3) Eq. (24.42) is equivalent to the condition
546 Complex Analysis with Mathematica

i 2 Y 2 Y y
4 jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêêÅÅÅÅ zz = 0 (24.44)
k u v z  z {

Now note that in these coordinates, Eq. (24.41) gives us


êê
Y = ‡ gHwv + z, wz + u, wL „ w (24.45)

and satisfaction of Eq. (24.44) is immediate, since each term in Eq. (24.44) is the
contour integral of w times the mixed second derivative of g with respect to its first and
second arguments, and they cancel!

‡ Solving the Helmholtz equation in three dimensions


Suppose that we now constrain Eq. (24.45) and demand that
Y
ÅÅÅÅÅÅÅÅÅÅ = -ÂwY (24.46)
t
We can solve this by demaning that g itself satisfy the same condition when constrained
to space-time points, i.e.

ÅÅÅÅÅÅÅÅ g@Hx + ÂyL + wHct + zL, w Hx - ÂyL + Hct - zL, wD = -Â w g (24.47)
t
Now let, as before

p = x + Ây + wHct + zL
(24.48)
q = ct - z + wHx - ÂyL

Then Eq. (24.47) becomes the condition


g g
c Jw ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ N = -Âwg (24.49)
p q

As usual, we let w = ck for some k, so that this is the condition


g g
w ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ = -Âkg (24.50)
p q

This first-order partial differential equation can be solved in a variety of ways. Perhaps
the simplest is to remove the right-hand side by use of an integrating factor based on the
second argument, q, of g. So we write

gHp, q, wL = ‰-Âkq hHp, q, wL (24.51)

where
h h
w ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ = 0 (24.52)
p q
24 Physics in three and four dimensions II 547

we solve this PDE by inspection in the form

hHp, q, wL = HHp - wq, wL (24.53)

for H some holomorphic function of two variables. Note further that

p - wq
= x + Ây - wHwHx - ÂyL + Hct - zLL + wHct + zL
(24.54)
= Hx + ÂyL + 2zw - w2 Hx - Â yL
= hx H wL

Re-assembling all this, we have constructed a solution of the form

Y = ‰-Âwt FHx, y, zL (24.55)

where

F = ‡ ‰-ÂkHwHx-ÂyL-zL HHhx HwL, wL„ w (24.56)

and this satisfies the Helmholtz equation:

2 F 2 F 2 F
ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å + ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å + ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ + k2 F = 0 (24.57)
x y z

Note also that when k = 0 this formula also reduces naturally to that we have already
given for the Laplace equation in 3-D. This is one of the ways in which the formulae for
three dimensions emerge as special cases of the relativistic result. Another approach
makes use of the freedom in the detailed choice of the integrating factor. If we balance it
symmetrically between the two arguments of g we obtain an equivalent representation:
-Â k
gHp, q, wL = ‰ ÅÅÅÅ2ÅÅÅÅÅÅÅ Hpêw+qL HHp - wq, wL (24.58)

This leads to the formula for solutions of the Helmholtz equation in the form
1
F = ‡ ‰- ÅÅ2ÅÅ ÂkHwHx-ÂyL+Hx+ÂyLêwL HHhx HwL, wL„ w (24.59)

Exercise 24.44 guarantees that any solution of Eq. (24.50) can be written in this form.

‡ Change of global coordinates


One observation that is sometimes useful is to appreciate what happens when we switch
from the w-coordinate to its inverse, in order to analyse functions that are well-behaved
at infinity in w-space. We make the replacement
1
wö wè = ÅÅÅÅÅÅ (24.60)
w
Inspection of Eq. (24.37) shows that if we correspondingly re-scale the wA spinor by p0£
instead of p1£ we induce the rescalings
548 Complex Analysis with Mathematica

p
p ö pè = ÅÅÅÅÅÅ = w
è p
(24.61)
w
q
qö qè = ÅÅÅÅÅÅ = wè q (24.62)
w
If we now follow through the argument above for time-independent fields, we find that
the analogous formula for h is given (up to a sign) by
è - Hx + ÂyLwè 2 = - ÅÅÅÅhÅÅÅÅÅ
hè = qè - pè wè = Hx - ÂyL - 2zw (24.63)
w2

ü The differential geometry view


That Eq. (24.63) this is exactly the right formula to use (i.e. with the right sign) follows
from a rather deeper geometrical argument, where h is interpreted as representing
complex tangent vector fields (where the tangents are those to the Riemann sphere), in
the sense of differential geometry. That is, a tangent vector is given by

h ÅÅÅÅÅÅÅÅÅÅ (24.64)
w
If we wish to equate this to its corresponding form in reciprocal coordinates:
 
h ÅÅÅÅÅÅÅÅÅÅ = hè ÅÅÅÅÅÅÅÅèÅÅ (24.65)
w w
But, by Eq. (24.60), we have
 
ÅÅÅÅÅÅÅÅèÅÅ = -w2 ÅÅÅÅÅÅÅÅÅÅ (24.66)
w w
So we must have
h
hè = - ÅÅÅÅÅÅÅÅ2Å (24.67)
w
You might wish to explore some other related issues. For example, you might like to
show that (case (2) is for the more adventurous)

(1) The form of the axis-symmetry constraint is preserved under such an inversion;
(2) The only vector fields that are holomorphic everywhere has h a quadratic in w.

24.5 Translation symmetry: reduction to 2-D


This section represents an informal presentation of an argument due to N. Hitchin.

So far so good. But are these contour integral expressions really the appropriate generali-
zation of the simple formula for two dimensions? In two dimensions we usually just
write down
24 Physics in three and four dimensions II 549

fHx, yL = ReH f HwLL;


(24.68)
w= x+Ây

One way to explore this is to see what happens when we reduce dimensions from three
to two, and seek solutions of Laplace's equation in three dimensions, but which satisfy

FHx, y, z + uL = FHx, y, zL (24.69)

Now inspection of Eqs. (24.20–23) reveals that the procedure outlined there fails if l = 0
We only get functions that are independent of h. So this is a matter of some subtlety.
This is the point where we must get a better grip on the fact that our holomorphic
functions represent spatial fields only once the contour integration has been carried out.
We cannot just impose the condition

f Hh + t w, wL = f Hh, wL (24.70)

and we must take better account of the contour integration. Let us simplify matters and
assume that the contour of integration C is deformable to the unit circle. Suppose that
instead of Eq. (24.62) we demand that

f Hh + tw, wL = f Hh, wL + g0 Ht, h, wL - g1 Ht, h, wL (24.71)

where g0 is holomorphic on a region containing all of the interior of the unit circle, and
g1 is holomorphic on all of the exterior region, including infinity. Remember that this
means that we set z = 1 ê w and demand that g1 is holomorphic at z = 0. Now when we
integrate Eq. (24.63) over C, we obtain, by Cauchy's Theorem, the result that

‡ f Hh + wt, wL „ w = ‡ f Hh, wL „ w (24.72)


C C

which is what is actually required. We must take account of (63) when imposing transla-
tional symmetry. Now, differentiating Eq. (24.71) with respect to t, and then setting
t = 0, we obtain
f
w ÅÅÅÅÅÅÅÅÅÅ = g° 0 - g° 1 = G0 @h, wD - G1 @h, wD (24.73)
h

where the dot denotes t-differentiation, and G0 is holomorphic on the interior region, G1
on the exterior region. Now we integrate this relation with respect to h to obtain

w f = H0 @h, wD - H1 @h, wD (24.74)

where H0 is holomorphic on the interior region, H1 on the exterior region. Let us look at
the contribution of H0 to the remaining contour integration. The contribution is of the
form
H0 @hx HwL, wD
‡ ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
w
ÅÅÅÅÅÅÅÅ „ w (24.75)
C
550 Complex Analysis with Mathematica

but since H0 is holomorphic on the interior of C we can evaluate this using the calculus
of residues at the manifest simple pole at w = 0. The answer is just

2pÂH0 @hx H0L, 0D = 2pÂH0 @x + Ây, 0D (24.76)

which is just a holomorphic function of x + Ây. A detailed analysis of the exterior peice
requires some more analysis, based on the change of global coordinate given in the
previous section. Inspection of Eq. (24.63) shows that the corresponding calculation
leads to a contribution that is a holomorphic function of hè x H0L, i.e. x - Ây. In other
words, the contour integrals that are translation invariant reduce to expressions of the
form

h0 Hx + ÂyL + h1 Hx - ÂyL (24.77)

where each hi is a holomorphic function of its argument. So the contour integration


evaporates, leaving us with just the evaluation of functions. In this picture, dimension
two is rather special – the use of contour integration is rather more general. Note that
taking the real part of a holomorphic function of x + Â y is just a special case of Eq.
(24.77). It is noteworthy that an essentially holomorphic 3-D picture reduces to a
situation where both w = x + Ây and êêwê = x - Ây play a role. So superficially non-holomor-
phic structures in 2-D are really the projection of a larger and essentially holomorphic
structure in higher dimensions. This is a very important observation. It has interesting
consequences for applied mathematics. For example, in the solution of the biharmonic
problem for fluid flow discussed in Section 19.7, in Eq. (19.89) in particular (where z
represented x + Ây), the solution looks non-holomorphic in a very essential way. Again,
this turns out to be an illusion of the 2-D projection from a 3-D holomorphic structure,
but a proper discussion of this is well outside the scope of this book.

24.6 Comments
Chapters 23 and 24 were intended to be only the briefest of introductions to what is
possible in higher dimensions. You should be aware that this is just a rather blinkered
glimpse at the full power of twistor methods. In this chapter we have just been discuss-
ing the Laplace equation, scalar Helmholtz equation, and scalar (massless) wave equa-
tion, and using very simple ideas about contour integration.
The pure mathematicians among you should appreciate that we have glossed
over a proper treatment of the holomorphic functions and the contour integration. The
right setting for all of this is within sheaf cohomology. A good place to start in under-
standing how to set this up is Chapter 6 of Penrose and Rindler (1984b).
The theoretical/mathematical physicists among you should be aware that the
treatment of the scalar massless wave equation is a very special case. There are analo-
gous contour integral solutions on Minkowski space-time of the source-free:

(1) Maxwell's equations;


(2) massless neutrino equations;
(3) linearized Einstein equations.
24 Physics in three and four dimensions II 551

Indeed, massless fields of arbitrary helicity are easily handled by twistor methods, as is
also discussed in Chapter 6 of Penrose and Rindler (1984b). The methods extend, rather
remarkably, to Yang–Mills fields and at least part (so far) of the way to the full Einstein
equations in General Relativity. These are essentially non-linear systems – in some ways
the solution of the minimal surface problem discussed in Chapter 23 is a model for the
management of such non-linear systems – Plateau's problem for minimal surfaces starts
off as a hard non-linear problem. It only becomes easy when viewed in the right
(holomorphic) way. Recent work includes clearer management of sources and currents.
A collection of useful recent entry points to work in twistor theory including these issues
is given, for example, by Bailey and Baston (1990), Mason and Hughston (1990),
Mason et al. (1990).
Those of you interested in applied mathematics in more of an engineering
context may wonder what these methods have to offer you. At the time of writing, this is
less clear, but there are some fascinating unexplored aspects. The contour integral
methods introduced here were first made widely known (albeit without a clear geometri-
cal picture, the non-cohomological aspects of which have been presented here) by
Whittaker and Watson (1984 in its current available form), in a text first published much
earlier. They have not (yet) become part of the standard undergraduate presentation,
probably because approaches based on repeated separation of variables (SOV) are easier
to teach, and, more importantly, because the imposition of boundary conditions is easy
within the SOV approach, provided the boundaries lie on coordinate surfaces. This is an
important provision. For example, exact solutions for scattering of time-harmonic plane
waves by objects are only available for simple structures such as spheres, cylinders and
so on. (A good catalogue is given by Bowman et al. 1987.) The computation of scatter-
ing by general objects is now a huge industry, remains difficult, and is still well beyond
the scope of numerical methods for a general two-dimensional boundary surface for
frequency domains of common interest. Yet there are tantalising sporadic appearances of
contour integral methods, from the ‘Watson transformation’ to the ‘Sommerfeld inte-
grals’ (see Bowman et al., 1987, for some examples). So far as this author is aware,
there is no systematic appreciation of whether and how such occasional appearances are
related to the general twistor formulae. Ph.D. project recommendation no. 1 is to sort
this out (hard) – a lesser and more practical Ph.D. proposition would be to try to under-
stand how specific boundary conditions influence the choice of twistor function and
contour. The author would be delighted to hear of progress in this area, and in applica-
tions of twistor methods to fields such as fluid dynamics, as well as scalar and electro-
magnetic scattering.

Exercises
24.1 The fact that each Legendre polynomial corresponds to a certain power of h ê w
makes it easy to add up series of such polynomials using the formula for a geometric
series. Using the calculus of residues and the integral representation for
552 Complex Analysis with Mathematica

2n rn Pn @cosHqLD

to show that

1
‚ 2n rn Pn @cos qD = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
ÅÅÅÅÅÅÅÅÅÅÅÅÅÅ
"################################ ##############
n=0 1 - 2H2rL cosHqL + H2rL2

24.2 (Project) Explore the fields corresponding to the holomorphic functions


h n
Gn,m Hh, wL = J ÅÅÅÅÅÅ N wm-1
w
for n > 0, m r 0, as follows:

(i) What is the value of the field f if m > n?


(ii) How does the resulting field f change under a rotation by y about the z-axis?
(iii) Evaluate the field along the axis y = 0 as far as you can.

Look up the definition of the associated Legendre functions and try to relate them to
your expressions. See also Note 18.31 of Whittaker and Watson (1984).
êê
24.3 Suppose that u = ct - z; v = ct + z; z = x + Ây; z = x - Ây. Show, by using the chain
rule for partial derivatives, that

1 2 Y 2 Y 2 Y 2 Y
ÅÅÅÅÅ2ÅÅÅ ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å - ÅÅÅÅÅÅÅÅÅÅÅÅ2 Å - ÅÅÅÅÅÅÅÅÅ2ÅÅÅÅ = 0
c t x y z

is equivalent to:

i 2 Y 2 Y y
4 jj ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ - ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅêêÅÅÅÅ zz = 0
k u v z  z {

24.4 Consider the partial differential equation


g g
w ÅÅÅÅÅÅÅÅÅÅ + ÅÅÅÅÅÅÅÅÅ + Âkg = 0 (24.78)
p q

Let new coordinates be defined by

a = p - wq
b = p + qw

Show, using the chain rule, that the PDE of Eq. (24.78) becomes
g Âkg
ÅÅÅÅÅÅÅÅÅÅ = - ÅÅÅÅÅÅÅÅÅÅÅÅ
b 2w

and deduce that the general solution is of the form

g = ‰-Âk bêH2wL hHa, wL


Bibliography
V. Adamchik and M. Trott (1994). Solving the Quintic, poster and numerous web
resources available at http://library.wolfram.com/examples/quintic/
L.V. Ahlfors (1953, 1979). Complex Analysis: An Introduction to the Theory of Analytic
Functions of One Complex Variable. (First and Third ed.) McGraw-Hill.
J. D'Angelo (2002). Inequalities in Complex Analysis. Mathematical Monograph #28,
Mathematical Assoication of America.
T.B. Bahder (1995). Mathematica for Scientists and Engineers. Addison-Wesley.
T.N. Bailey and R.J. Baston (ed.) (1990). Twistors in Mathematics and Physics. London
Mathematical Society Lecture Note Series 16. Cambridge University Press.
H. Bateman (1904). The solution of partial differential equations by means of definite
integrals. Proceedings of the London Mathematical Society, 1 (2), p. 451-8.
H. Bateman (1944). Partial Differential Equations of Mathematical Physics. Dover.
A.F. Beardon (1991). Iteration of Rational Functions. Springer Graduate Texts in
Mathematics, no. 132. Springer.
R.P. Boas (1987). Invitation to Complex Analysis. Random House.
J.J. Bowman, T.B.A. Senior and P.L.E. Uslenghi (1987). Electromagnetic and Acoustic
Scattering by Simple Shapes, revised edition. Hemisphere Publishing.
D.M. Burton (1995). Burton's History of Mathematics, An Introduction, 3rd edn. Wm. C.
Brown Publishers.
G. Cardano (1993). The Great Art, or the Rules of Algebra, translated by Richard
Witmer. Dover Reprint.
A. Cayley (1879). The Newton–Fourier imaginary problem. American Journal of
Mathematics, 2, p. 97.
H. Cartan (1961). The elementary theory of analytic functions of one or several complex
variables. The original French version is 1961. The english translation dating from 1963
is available as a 1995 Dover reprint, where the relevant discussion can be found on p.
126.
A.H.-D. Cheng, P. Sidauruk and Y. Abousleiman (1994). Approximate inversion of the
Laplace transform. The Mathematica Journal, 4 (2), p. 76-82.
H.S.M. Coxeter (1964). Regular compound tessellations of the hyperbolic plane. Proceed-
ings of the Royal Society, A278, p. 147-167.
H.S.M. Coxeter (1965). Non-Euclidean Geometry, 5th ed.. University of Toronto Press.
B. Davies and B. Martin (1979). Numerical inversion of the Laplace transform: a survey
and comparison of methods. Journal of Computational Physiscs, 33 (1), p. 1-32.
J.W. Dettman (1965). Applied Complex Variables, Dover reprint.
R.M. Dickau (1997). Compilation of iterative and list operations. The Mathematica
Journal, 1 (1), p. 14-15.
T.A. Driscoll (1996). Algorithm 765: a MATLAB toolbox for Schwarz–Christoffel
mapping. ACM Transactions on Mathematical Software, 22, p. 168-186.
T.A. Driscoll and L.N. Trefethen (2002). Schwarz–Chistoffel Mapping. Cambridge
University Press.
554 Complex Analysis with Mathematica

L.P. Eisenhart (1911). A fundamental parametric representation of space curves, Annals


of Mathematics (Ser II), XIII, p. 17-35.
L.P. Eisenhart (1912). Minimal surfaces in Euclidean four-spaces, American Journal of
Mathematics, 34, p. 215-236.
A. Eydeland and H. Geman (1995). Asian options revisited: inverting the Laplace
transform. RISK Magazine, March.
M. Field and M. Golubitsky (1992). Symmetry in Chaos: A Search for Pattern in Mathe-
matics, Art and Nature. Oxford University Press. (Chapter 4). See also the web site at
http://nothung.math.uh.edu/~mike/
M.D. Finn and S.M. Cox (2001). Stokes flow in a mixer with changing geometry.
Journal of Engineering Mathematics, 41, p. 75-99.
P.R. Garabedian (1966). Free boundary flows of a viscous liquid. Communications on
pure and applied mathematics, XIX (4), p. 421-434.
H. Geman and M. Yor (1993). Bessel processes, Asian options, and perpetuities. Mathe-
matical Finance, 3 (4), p. 349-375.
H. Geman and M. Yor (1996). Pricing and hedging double-barrier options: a probabilis-
tic approach. Mathematical Finance, 6 (4), p. 365-378.
I.S. Gradshteyn and I.M. Ryzhik (1980). Tables of integrals, series and products,
corrected and enlarged edition. Academic Press.
A. Gray (1993). Modern differential geometry of curves and surfaces. CRC Press.
T.W. Gray and J. Glynn (1991). Exploring Mathematics with Mathematica, Addison–
Wesley.
Getting Started with Mathematica on (Windows, Macintosh, Linux etc.) Systems. Wol-
fram Research Mathematica Documentation Kit.
N.J. Hitchin (1982). Monopoles and geodesics. Communications in Mathematical
Physics, 83, p. 579-602.
L.H. Howell and L.N. Trefethen (1990). A modified Schwarz–Christoffel transformation
for elongated regions. SIAM Journal of Scientific and Statistical Computing, 11, p.
928-949.
R. R. Huilgol (1981). Relation of the conjugate harmonic functions to f HzL in cylindrical
polar coordinates. Australian Mathematical Society Gazette, 8 (1), p. 23-25.
J.D. Jackson (1975). Classical Electrodynamics, Second edition. Wiley.
N. Kunitomo and M. Ikeda (1992). Pricing options with curved boundaries. Mathemati-
cal Finance, 2 (4), p. 275-297.
E.V. Laitone (1977). Relation of the conjugate harmonic functions to f HzL. The American
Mathematical Monthly, 84 (4), p. 281-283. (Available on-line at JSTOR).
R. Legendre (1949). Solutions plus complète du problème Blasius. Comptes Rendus,
228, p. 2008-2010.
I.V. Lindell (1995). Methods for Electromagnetic Field Analysis. IEEE Press/Oxford
University Press Series on Electromagnetic Wave Theory.
S. Levy (1993). Automatic generation of hyperbolic tilings. In The Visual Mind, M.
Emmer (ed.), MIT Press.
S. Levy and T. Orloff (1990). Automatic Escher. The Mathematica Journal, 1 (1),
p.34-35.
R. Maeder (1994). The Mathematica Programmer. AP Professional.
Bibliography 555

R. Maeder (1995). Function iteration and chaos. The Mathematica Journal, 5 (2), p.
28-40.
R. Maeder (1997). Programming in Mathematica. Third Edition. Addison Wesley.
L.J. Mason (1990). Sources and currents; relative cohomology and non-Hausdorff
twistor space. In Further Advances in twistor theory Vol. I: The Penrose transform and
its Applications. Pitman Research Notes in Mathematics 231. Longman.
L.J. Mason and L.P. Hughston (ed.) (1990). Further advances in twistor theory, Vol. 1:
The Penrose transform and its Applications. Pitman Research Notes in Mathematics 231.
Longman.
L.J. Mason, L.P. Hughston P.Z. and Kobak (ed.) (1990). Further advances in twistor
theory, Vol. 2: Integrable systems, conformal geometry and gravitation. Pitman Research
Notes in Mathematics 232. Longman.
Mathematica Applications Package – Dynamic Visualizer (1999). See the web site at:
http://www.wolfram.com/products/applications/visualizer/
R. May (1976). Simple mathematical models with very complicated dynamics. Nature,
261, p. 459-469.
L.M. Milne-Thomson (1937). On the relation of an analytic function of z to its real and
imaginary parts. Mathematical Gazette, 244 (21), p. 228-229.
L.M. Milne-Thomson (1938). Theoretical Hydrodynamics, first edition. See also second
edition (1949), third Edition (1955), fourth Edition (1962). The fifth edition remains
available as a Dover reprint.
M. Montcheuil (1905). Résolution de l'équation ds2 = d x2 + d y2 + d z2 , Bulletin de la
Société Mathématique de France, 33, p. 170-171.
T. Needham (1997). Visual Complex Analysis. Clarendon Press.
H. Ockendon and J.R. Ockendon (1995). Viscous Flow. Cambridge texts in applied
mathematics, Cambridge University Press.
J.R. Ockendon, S.D. Howison, A. Lacey and A. Movchan (2003). Applied Partial
Differential Equations, revised edition, Oxford University Press.
H-0. Peitgen and P.H. Richter (1986). The Beauty of Fractals: images of complex
dynamical systems, Springer.
R. Penrose (1959). The apparent shape of a relativistically moving sphere. Proceedings
of the Cambridge Philosophical Society, 55, p. 137-9.
R. Penrose (1999). The Emperor's New Mind. Oxford University Press.
R. Penrose (2004). The Road to Reality. Jonathan Cape.
R. Penrose and W. Rindler (1984a). Spinors and space-time, Vol. 1: Two-spinor calcu-
lus and relativistic fields. Cambridge University Press.
R. Penrose and W. Rindler (1984b). Spinors and space-time, Vol. 2: Spinor and twistor
methods in space-time geometry. Cambridge University Press.
W.H. Press, S.A. Teukolsky, W. T. Vetterling and B.P. Flannery (1992). Numerical
Recipes in C, The Art of Scientific Computing, Second Edition. Cambridge University
Press.
A.P. Prudnikov, Yu.A. Brychkov and O.I. Marichev (1998). Integrals and Series, Vol 4:
Direct Laplace Transforms, (second printing). Gordon and Breach.
A.P. Prudnikov, Yu.A. Brychkov and O.I. Marichev (2002). Integrals and Series, Vol 5:
Inverse Laplace Transforms, (digital edition). Gordon and Breach.
556 Complex Analysis with Mathematica

K.B. Ranger (1991). A complex variable integration technique for the two-dimensional
Navier–Stokes equations. Quarterly of Applied Mathematics, XLIX (2), p. 555-562.
K.B. Ranger (1994). Parametrization of general solutions for the Navier–Stokes equa-
tion., Quarterly of Applied Mathematics, LII, p. 335-41.
M. Rizzardi (1995). A modification of Talbot's method for the simultaneous approxima-
tion of several values of the inverse Laplace transform. ACM Transactions on Mathemati-
cal Software, 21 (4), p. 347-371.
W. Rudin (1976). Principles of Mathematical Analysis. McGraw-Hill.
W.T. Shaw (1985). Twistors, minimal surfaces and strings, Classical and Quantum
Gravity, 2, L113-119.
W.T. Shaw and J. Tigg (1993). Applied Mathematica. Addison-Wesley.
W.T. Shaw (1995). Symmetric chaos in the complex plane. The Mathematica Journal, 5
(3), p. 85-89.
W.T. Shaw (1995b). MathLive and the virtual dynamics lab. The Mathematica Journal,
5 (2), p. 14-20.
W.T. Shaw (1998). Modelling Financial Derivatives with Mathematica, Cambridge
University Press.
W.T. Shaw (2004). Recovering holomorphic unctions from their real or imaginary parts
without the Cauchy-Riemann equations. SIAM Review, 46 (4), p. 717-728.
W.T. Shaw and L.P. Hughston (1990). Twistors and strings. In Twistors in mathematics
and physics, eds. T.N. Bailey and R. Baston. London Mathematical Society Lecture
Notes, no. 156. Cambridge University Press.
B.C. Skotton (1994). On amplitude and phase in printed characters. The Mathematica
Journal, 4 (2), p. 83-86.
M.R. Spiegel (1965). Laplace Transforms. Schaum's Outlines series, McGraw-Hill.
M.R. Spiegel (1981). Theory and Problems of Complex Variables. Schaum's outline
series, McGraw-Hill.
S. Stahl (1993). The Poincaré half-plane: a gateway to modern geometry. Jones and
Bartlett.
R.A. Struble (1979). Obtaining analytic functions and conjugate harmonic functions.
Quarterly of Applied Mathematics, 37 p.79-81.
A. Talbot (1979). The accurate numerical inversion of Laplace transforms. Journal of the
Institute of Mathematics and its Applications, 23, p. 97-120.
J. Terrell (1959). Invisibility of the Lorentz contraction, Physical Review D, 116 (4), p.
1041-5.
L.N. Trefethen (1980). Numerical computation of the Schwarz–Christoffel transforma-
tion. SIAM Journal of Scientific and Statistical Computing, 1, p. 82-102.
L.N. Trefethen (ed.) (1986). Numerical Conformal Mapping. North-Holland.
L.N. Trefethen and T.A. Driscoll (1998). Schwarz–Christoffel mapping in the computer
era, Oxford University Computing Laboratory report 98/08.
J. Vecer (2002). Unified Asian pricing. RISK Magazine, June.
L.I. Volkovyskii, G.L. Lunts, I.G. Aramanovich (1960). (Russian original edition) A
Collection of Problems on Complex Analysis. English translation (1965) Pergamon Press.
Currently available as Dover reprint (1991).
S. Wagon (1991). Mathematica in Action. W.H. Freeman.
Bibliography 557

R.S. Ward, R.S (1981). Axissymmetric stationary fields. In Twistor Newsletter 11.
Reprinted (1990) In Further Advances in twistor theory Vol. I: The Penrose transform
and its Applications. Pitman Research Notes in Mathematics 231. Longman.
K. Weierstrass (1866a). Über die Flächen derren mittlere Krümmung überall gleich null
ist. Monatsberichte der Königlich Preußischen Akademie der Wissenschaften zu Berlin,
p. 612-625.
K. Weierstrass (1866b). (1866a via the world-wide web):
http://bibliothek.bbaw.de/bibliothek-digital/digitalequellen/schri
ften/anzeige/index_html?band=09-mon/1866&seite:int=628
E.T. Whittaker (1903). On the partial differential equations of mathematical physics.
Mathematische Annalen, 57, p. 333-355.
E.T. Whittaker and G.N. Watson (1984). A course of modern analysis. Cambridge
University Press.
T. Wickham Jones (1994). Mathematica Graphics, Techniques and Applications.
Springer.
S. Wolfram (2003). The Mathematica Book, 5th Edition. Wolfram Media.
Index

/., Mathematica concept of “given”, implementation with Mathemat-


3 ica, 226
i, notation for imaginary number, 12 inverting ComplexExpand, 227
j, notation for imaginary number, 12 alternating series test for convergence,
[[ ]], to refer to position in list, 3 198
[ ], to contain arguments of functions, analytic functions, 214
3 angle-preserving map, 347
δ-function animations
as Fourier transform of unity, 362 making with Do, 52, 87
as limit of sequence of functions, Appel hypergeometric function, 464
360 Appel1F1, 464
definition, 359, 360 ArcCosh, 170
in Mathematica, 362 ArcCot, 170
{ }, to denote lists, 3 ArcCoth, 170
//N, to denote numerical evaluation, ArcCsc, 170
4 ArcCsCh, 170
==, to denote equality within equa- ArcSec, 170
tion, 3 ArcSech, 170
=, to denote assignment of one quan- ArcSin, 170
tity to another, 3
branching of, 173
visualization of, 181, 183
3-D
arcsine
complex numbers for, 513, 540
visualization of, 181
4-D ArcSinh, 170
complex numbers for, 513, 540 ArcCos, 170
ArcTan, 170
Abs, modulus function, 18 ArcTanh, 170
absolute convergence, 195 area-scaling induced by holomorphic
in Taylor’s theorem, 270 function, 348
aerofoil, 424 Arg, argument function, 17
by a conformal map, 345 Argand plane, 14
Ahlfors, L.V., 229 Argand, J.R., 14
Ahlfors–Struble theorem, 208 argument
finding harmonic conjugates with, Mathematica function Arg, 17
231 ambiguity in, 16
history of, 228 of complex number, 16
Index 559

principal value, 17 catenoid, 537


principle of the, 328 Cauchy inequalities, 271
Asian call option, 446 Cauchy integral formula, 263
assignment, use of =, 3 Cauchy principal value, 313
Assumptions Cauchy sequence, 196
use with FourierTransform, 358 Cauchy’s theorem
use with Integrate, 312 converse to, 274
attraction, basin of, 59 strong (Cauchy–Goursat) form,
axis-symmetric solutions of Laplace’s 250
equation, 541 weak form based on Green’s the-
orem, 250
basin of attraction, 59 Cauchy–Goursat theorem
Beardon, A.F., 56 for a triangle, 250
Beta, 458, 460 for star-shaped set, 255
beta function, 458, 460 Cauchy–Riemann equations, 208, 212,
bifurcation 213, 403
and symmetry generation, 100 and orthogonal curves, 214
diagrams of, 98 harmonic functions, 215
explained in terms of stable/unstable Laplace’s equation, 215
roots, 86, 88, 91
using to recover function from
symmetry-increasing, 143 real part, 221
biharmonic equation, 427
Cayley planet
complex variable solution, 428
for cubic, 74
bilinear transformation, 348
for septic, 75
Black–Scholes equation, 441, 442
Cayley’s problem
Blasius’ theorem, 419
solution for a cubic, 62
Boas, H., 208
solution for a simple septic, 73
Boas, R.P., 229
solution for quadratic, 60
boundary condition
Cayley, A., 59
Dirichlet, 404
Neumann, 404 celestial sphere, 514
branch cut, 171 Chop
Mathematica conventions, 172 example of use, 174, 436
detailed investigation of arcsin, circle
173 complex equation of, 350
branch point, 171 circline
defined, 351
C code explored with Mathematica, 351
use with Mathematica, 120, 148 closed set, 163
calculus cobwebbing, 78
fundamental theorem of, 241 convergence of, 79
call option, 441 error behaviour, 79
with Asian feature, 446 plots of, 93, 94, 96
with double barrier, 442 Coeffcient
Cardano, G., 1, 41 applied to quartic equation, 48
CartesianMap, 177 Collect
560 Index

applied to expression, 49 conformal map, 338


colour function examples, 146 and Laplace transforms, 395
colouring schemes for fractals, 64 and Laplace’s equation, 404
comparison test for convergence, 197 on a cylinder, 420
complex conjugate visualization of, 341–345
Mathematica function Conjugate, conformal representation of hyperbolic
18 plane, 498
of complex number, 14 conformality of holomorphic functions,
complex number 347
n’th root of, 26 Conjugate, complex conjugate func-
x + iy notation, 12 tion, 18
x + jy notation, 12 connected set, 248, 286
x+Iy notation, 13 continuity
algebraic properties, 13 of a function at a point, 164
Argand plane representation, 14 of sequence of uniformly conver-
argument, 16 gent functions, 199
as a point in the plane, 14 under addition etc., 164
complex conjugate of, 14 contour
cube root of, 27 circular, 305
exponential form, 29 defined as a piecewise smooth path,
functions of, 159 238
imaginary part, 14 deforming, 255
modulus of, 14 for treating branching integrands,
ordered pair notation, 12 320, 321, 323
polar representation, 15 integral defined, 240
real part, 14 length of, 242
square root of, 25 mousehole, 318
working in 3-D, 513, 540 rectangular, 324
working in 4-D, 513, 540 semicircular, 313, 316, 366
complex plane UHP or LHP?, 316, 367
extended, 175 zero theorem, 314
complex roots of equations, 5 semicircular with indentation, 318
ComplexExpand, 161 contour integration, 240
applied to trigonmetric and hy- issues with older versions of Math-
perbolic functions, 168 ematica, 245
as function to take real and imag- with Mathematica, 244
inary parts of expressions, ContourPlot, 414, 416, 418, 419, 422,
19 423, 425, 429
inverting with Mathematica im- convergence
plemenation of Ahlfors–Struble absolute, 195
theorem, 227 in Taylor’s theorem, 270
complexification Cauchy’s condition for, 196
issues with, 224 of monotone bounded real sequence,
ComplexInequalityPlot, 339, 354 196
ComplexMap package, 177, 338 of subsequence of bounded se-
Index 561

quence, 196 deforming contours, 255


radius of, 202 to a circle, 256
terms tending to zero, 196 del Ferro, S., 41
tests for, 196 delta-function
uniform, 195 as Fourier transform of unity, 362
in Taylor’s theorem, 270 as limit of sequence of functions,
uniform and integration, 243 360
uniform behaviour of power se- definition, 359, 360
ries, 204 in Mathematica, 362
convergence test derivative
alternating series, 198 complex, 212
comparison, 197 financial, 441
Dirichlet, 198 differentiability
integral, 198 complex, 212
nth root, 197 complex conjugates, 220
ratio, 197 implies partial derivatives exist,
convergence-time algorithm for New- 209
ton–Raphson, 63 insufficiency of existence of par-
convergent subsequence in iterated map, tial derivatives, 209
81 of complex function considered
convolution theorem as two real functions, 211
for Fourier transforms, 364 of function of two real variables,
for Laplace transforms, 390 209
generalized (Efros), 395 of polynomial, 217
Cos, 170 of power series, 218
power series, 29 other notations, 220
Cot, 170 relation to Cauchy–Riemann equa-
Cosh, 170 tions, 213
Coth, 170 differential equation
CountRoots, 334 solved by Fourier transform, 373
Csc, 170 solved by Laplace transform, 391,
CsCh, 170 392
cube root of unity, 27 solved with DSolve, 392, 393
role in solving cubic equation, 43 differentiation
cubic equation addition rule, 215
as iterated logistic map, 81 and Fourier transforms, 365
history, 41 and Laplace transforms, 383
resolvent for quartic, 48 and sequences of uniformly con-
solution, 44 vergent functions, 200
solution with Mathematica, 42 chain rule, 216
solved via Newton–Raphson, 62, product rule, 216
67 quotient rule, 217
cyclic group, 138 reciprocal rule, 216
in images generated from poly- diffusion equation, 401
nomial maps, 142 solved by Fourier transform, 374
562 Index

solved by Laplace transform, 393 power series, 29


dihedral group, 138 Expand, 160
in images generated from non- applied to quartic equation, 48
polynomial maps, 142 with Trig -> True option, 25
in images generated from poly- exponential function
nomial maps, 140 Mathematica function Exp, 13
Dirichlet boundary condition, 404 complex properties, 31
and disk, 408 definition for complex variable,
and half-plane, 406, 414 165
and quadrant, 415 related to trigonometric functions,
and wedge, 415 29
Dirichlet’s test for convergence, 198 expression
disc imaginary part with ComplexExpand,
closed, 163 19
open, 163 real part with ComplexExpand,
punctured, 163 19
discrete Fourier transform, 433 showing detailed stucture with
applied to 1-D filtering, 435 FullForm, 21
applied to 2-D filtering, 437 extracting a holomorphic function from
distribution, 359 its real part
Do Ahlfors–Struble method, 221
for animated graphics, 52 Cauchy–Riemann method, 221
domain, 159, 248
simply connected, 248 Factor, 6
DSolve, 392, 393 applied to quartic equation, 47,
48
Efros’s theorem, 395 FactorList, 6
Einstein’s equations, 550 Ferrari, L., 41
Eisenhart, L.P. solution of quartic equation, 47
minimal surfaces in four dimen- Field, M., 138
sions, 533 filtering noise, 435
ellipse, fluid flow past, 422 financial derivatives, 441
EllipticF, 461 FindRoot
elliptic function, 461 applied to solving equations, 59
Enneper’s surface, 536 FixedPoint, 63
equality, use of == to denote equal- exercises with, 76
ity in an equation, 3 for Newton–Raphson problems,
Erfc, 178 63
visualization of, 179, 181, 184 FixedPointList, 63
error function applied to Mandelbrot map, 119
visualization of, 179, 181, 184 exercises with, 76
essential singularity, 288 fluid
other characterization of, 289 conservation of mass, 402
visualized, 292 detailed flows, 415
Exp flow past a flat plate, 423
exponential function, 13 flow past an ellipse, 422
Index 563

force on body, 420 planet, 73


incompressible, 402 fractional transformation, 348
irrotational flow, 403 FullForm, function to show detailed
potential flow past a cylinder, 417 structure of expression, 21
with circulation, 418 function
source above a half-plane, 416 analytic, 214
source outside a circle, 417 and conformality, 347
uniform flow, 409 Appel hypergeometric two vari-
viscous flow, 425 able, 464
in 2-D, 427 area-scaling induced by, 348
with circulation, 418 beta, 458, 460
zero vorticity condition, 403 checking for being harmonic with
Fontana, N., 41 Mathematica, 230
force on a body in a fluid, 420 defined by power series, 205
four dimensions defined formally, 159
physics in, 513, 544 definition by series, 165
Fourier, 433–435, 437 definition by use of real analogues,
Fourier transform, 357 165
and differential equations, 373 domain of, 159
elliptic, 461
and heat/diffusion equation, 374
exponential, 165
and Laplace’s equation, 375
harmonic, 215
conventions, 358
holomorphic, 214
convolution theorem, 364
hyperbolic, 167
defined, 358
hypergeometric, 460, 463
differentiation theorem, 365
integral over a contour, 240
discrete, 433
multi-valued, 171
in a complex setting, 372
range of, 159
in older Mathematica versions,
real and imaginary parts of, 160,
377
161
inversion theorem, 363 regular, 214
of Cauchy p.d.f., 369 trigonometric, 166
of Gaussian function, 370 visualization with Mathematica,
of sine function, 368 176, 183
of unity, 362 fundamental theorem of algebra, 272
scaling theorem, 365 fundamental theorem of calculus, 241
shift theorem, 365
FourierParameters, 434 Gamma
FourierTransform, 358 visualization of, 185
conventions, 358 gamma function
options, 358 visualization of, 185
fractal Geman-Yor model
from iterated sine function, 189, for double barrier options, 443
191 geometry
Newton–Raphson for cubics, 65, Euclidean, 474
67 hyperbolic, 474
564 Index

ghosts and birdies tiling Hypergeometric2F1, 460, 463


of the Euclidean plane, 484
of the Poincaré disc, 490, 497 Im, imaginary part function, 18, 161
given, /. notation, 3 image processing, 438
Golubitksy, M., 138 images
graphics using checkers and holes, 187 method of, 413
Green’s theorem in the plane, 249 imaginary numbers, introduction of,
for complex function, 249 1
group imaginary part
cyclic, 138 Mathematica function Im, 18
dihedral, 138 of complex number, 14
Möbius transforms, 349 of expression, Mathematica func-
tion ComplexExpand, 19
harmonic conjugates ineqaulities
finding with Ahlfors–Struble the- visualizing, 339
orem, 231 inequality
harmonic function length, 242
and Cauchy–Riemann equations, value, 242
215 InequalityGraphics
checking with Mathematica, 230 Mathematica package, 339
Head, function to show type of nnum- InequalityGraphicsPlot, 354
ber or expression, 20 infinity
heat equation, 401 adding to complex plane, 175
solved by Fourier transform, 374 InputForm, 5
solved by Laplace transform, 393 integral test for convergence, 198
hedging Integrate
applied to double barrier call op- care with use, 302
tion, 445 use to check residue calculation,
Helmholtz equation 308, 312, 316, 317, 323, 324,
twistor solution, 546 326
Hitchin, N., 534, 540 use with Assumptions, 302, 312
holomorphic 3-D structures, 550 integration
holomorphic functions, 214 contour, 240
hyperbolic functions of branching functions, 321, 323
Mathematica expressions for, 170 of function with periodic singu-
definition for complex variable, larities, 324
167 of powers of z about the origin,
hyperbolic plane, 473 240
conformal representation, 498 of sequence of uniformly conver-
projective representation, 498 gent functions, 199
UHP representation, 511 over arbitrary angle about sim-
hypergeometric function, 460, 463 ple pole, 318
Appel two variable, 464 over infinite range, 313, 316
confluent, 447 trigonometric, 305
in Asian option theory, 447 with Mathematica, 302
Hypergeometric1F1, 447 inverse function
Index 565

for sinh, 169 and holomorphic functions, 403


for trigonometric and hyperbolic axis-symmetric, 541
functions, 170 from Cauchy–Riemann equations,
inverse hyperbolic functions 215
Mathematica expressions for, 170 in three dimensions, 540
inverse trigonometric functions invariance under conformal maps,
Mathematica expressions for, 170 404
InverseFourier, 433, 434, 436, 437 solved by Fourier transform, 375
InverseLaplaceTransform, 387, 440 LaplaceTransform, 385
inversion, 348 Laurent series, 278
isolated singularity, 287 uniquness of coefficients, 281
isolated zeroes, 287 use of known power series, 283
iterated map Legendre polynomial, 542
implementation with Nest, 82 length inequality, 242
limit
Jordan’s lemma, 366 of a function at a point, 164
Joukowski flow, 421, 424 Limit
Joukowski map, 345 use to calculate residue, 296, 299
attack angle variation, 346 use with residue theorem, 308
camber variation, 346 line
visualized, 345 complex equation of, 350
linear transformation, 348
Kummer’s function, 447
Liouville’s theorem, 271
Laitone, E.V., 229 list
Laplace transform, 381 generating with Table, 7
and change of time variable, 397 picking an element of a given po-
and differential equations, 391, sition within, 3
392 Listable, 478
and heat/diffusion equation, 393 Log
convolution theorem, 390 branching of, 172
definition, 381 logarithm
differentiation theorem, 383 ambiguity in, 32
holomorphic property, 384 as inverse to exponential, 32
inversion, 387 branching of, 172
of algebraic function, 389 modulus-argument form, 32
of rational function, 388 why there is no global form, 241
with branch cut, 389 logistic map, 78
making tables with Mathemat- cubic, 80, 81
ica, 386 quadratic, 80, 103
numerical inversion, 439, 441, 445 Lorentz contraction
scaling theorem, 383 invisibility of, 518
shift theorem, 383 Lorentz transformation
Laplace’s equation, 401 angular abberation, 523
and fluid flow, 402 as Möbius map, 517
and heat flow, 401 classification, 520
566 Index

details of velocity change, 522 for wedge, 415


remapping light rays with Math- metric
ematica, 524 relativistic, 514
Milne-Thomson, L.M., 229
Mandelbrot map minimal surface, 531
definition of, 106 and holomorphic null curves, 532
fixed points of, 107 in four-space, 533
Misiurewicz points, 113 in three-space, 534
periodic orbits of, 110 Montcheuil–Eisenhart formula, 533
Mandelbrot set visualized with Mathematica, 535
escape-time algorithm, 114 Weierstrass formula, 534
pictures of, 119, 123, 127–129 Minkowski space, 514
problems in drawing it properly, Mittag-Leffler theorem, 328
129 Module
purist black and white pictures use of in graphics program, 27
of, 131–133 modulus
purist vs pretty pictures, 134 Mathematica function Abs, 18
what precisely is it?, 115 of complex number, 14
map Montcheuil, M.
conformal, 338 minimal surfaces in four dimen-
logistic, 78 sions, 533
Mandelbrot, 106 Morera’s theorem, 274
Möbius, 338 movies
Newton–Raphson, 56 making with Do, 52, 87
non-linear with symmetry, 138 multi-valued function, 171
Schwarz–Christoffel, 451 Möbius map, 338
Map and Poincaré disc, 474
applied to solving an equation, as a group, 349
59 as Lorentz trasnformation, 517
Margolis, B., 229 inverted with Mathematica, 61
Mathematica older versions link to Newton–Raphson and Cay-
Fourier transforms in, 377 ley’s problem, 60
MathLink simple components of, 348
use in drawing fractals, 120 simple example, 340
use in drawing images of sym- to map three points as specified,
metric chaos, 148 352
maximum modulus theorem, 275
Maxwell’s equations, 550 N, to denote numerical evaluation, 4
May, R., 80, 104 Navier–Stokes equations, 425
Mean value theorem for the modulus, complex 2-D form, 428
237 neighbourhood, 163
mean-value theorem, 275 deleted, 163
method of images, 413 Nest
for circle, 417 applied to iterated map, 138
for half-plane, 414, 416 applied to logistic map, 82
for quadrant, 415 NestList
Index 567

applied to iterated map, 91, 138 use of, 406


Neumann boundary condition, 404 PlotGradientField, 410
and half-plane, 414, 416, 417 PlotGradientField3D, 412
and quadrant, 415 PlotRange, 9
and wedge, 415 polar representation of complex num-
noise filtering with Fourier transform, ber, 15
435 PolarMap, 178
NResidue pole, 288
use of package, 297, 308 order of, 288
NSolve, 332 other characterization of, 289
applied to quartic equation, 52 residue at, 292
nth root test for convergence, 197 residue for simple case, 293
null visualization of, 291
holomorphic curve, 532 polynomial
twistor construction, 533 complex differentiability, 217
vector, 514 polynomial equations
have all roots complex, 272
Ockendon, J.R., 229 iteration solution, 56
open set, 163 numerical solution, 56
option pricing, 441 Possion’s formula for the disk, 408
Options, 7 potential theory, 401
order of pole, 288 power series
behaviour on circle of convergence,
ParametricPlot, 421 203
path convergence of, 202
closed, 237 defining functions by, 205
defined, 237 uniform convergence of, 204
drawing in Mathematica, 238 PowerExpand
length of, 242 applied to quartic equation, 50
piecewise smooth, 238 Prime, 7
simple, 237 principal value, of the argument, 17
smooth, 238 principle of the argument, 328
Penrose, R., 473, 529, 540 projective representation of hyperbolic
physics plane, 498
in four dimensions, 513, 544
in three dimensions, 513, 540 quadratic equation
in two dimensions, 401 as motivation for i, 2
relativistic, 545 solution of, 2
plane solved by Newton–Raphson, 60
Euclidean, 473 treated as iterated logistic map,
hyperbolic, 473 103
plate quartic equation
fluid flow past, 423 history, 41
Plot, 9 solution by Ferrari’s method, 47
Plot3D solution with Mathematica, 46
applied to complex functions, 171 solved by Newton–Raphson, 71
568 Index

quintic equation mapping theorem, 452


issues with, 51 sphere, 175
numerical solution with NSolve, zeta function
52 visualization of, 182
solved by Newton–Raphson, 71 rocket science, 441
RootIsolation
range, 159 Mathematica package, 334
ratio test for convergence, 197 roots
rational numbers, motivation from solv- branching of, 171
ing equations, 11 of complex numbers, 26
Re, real part function, 18, 160, 161 of unity, 27
real numbers, motivation from solv- rotation, 348
ing equations, 10 Rouché’s theorem, 330
real part
Mathematica function Re, 18
scaling theorem
of complex number, 14
for Fourier transforms, 365
of expression, Mathematica func-
for Laplace transforms, 383
tion ComplexExpand, 19
Schwarz–Christoffel map, 451
Reduce, 25
advanced numerical methods, 470
regular functions, 214
defined, 452
relativity
and complex numbers, 515 for hexagon, 467, 468
metric of, 514 for pentagon, 469
removable singularity, 288 for rectangle, 461
Riemann’s theorem, 288 for regular polygon, 466
residue for trapezoid, 465
defined from Laurent series, 282 for triangle, 456, 468
example calculations of, 293 for vertical strip, 455
formula for pole, 292 from circle, 465, 466
formula for simple pole, 293 point at infinity, 453
theorem for integrals, 302 power of Mathematica, 451
Residue Sec, 170
at essential singularities, 296 Sech, 170
examples of use, 294–296, 298 semicircle integration, 314
residue theorem with complex exponentials, 366
and branching integrands, 320 septic equation
and indented semicircular con- solved by Newton–Raphson, 71
tour, 318 sequence
and rectangular contour, 324 of complex functions, 194
and semicircular contour, 313, 316 of complex numbers, 194
and series summation, 326 series
applications, 304 Laurent, 278
trigonometric integrals, 305 of complex functions, 195
resolvent cubic, 48 power series, 202
Reynolds number, 427 summation, 326
Riemann Series
Index 569

function for generating power se- Stokes flow, 427


ries, 29 and cylinder, 429
in computing Laurent expansion, stream function
283 for viscous flow, 427
set stretching, 348
closed, 163 Struble, R.A., 229
connected, 248, 286 summation of infinite series
open, 163 by residue method, 326
star-shaped, 254 with Mathematica, 327, 328
SetAttributes, 478 symmetric chaos, 138
SetOptions, 429 high-resolution imagery, 150
shift theorem symmetry in complex non-linear map,
for Fourier transforms, 365 138
for Laplace transforms, 383
silly face picture, 70 Table, 7
simple pole, 293 Tan, 170
Sin, 170, 177 Tanh, 170
iterated, 189, 191 Tartaglia, 41
power series, 29 Taylor’s theorem, 265
visualization of, 181, 184 absolute convergence, 265, 270
sine differences from real case, 266
iterated to make a fractal, 189, uniform convergence, 265, 270
191 tests for convergence – see conver-
visualization of, 181, 184 gence test, 196
singularity Thomas, V., 473
classification of (isolated), 288 three dimensions
essential, 288 physics in, 513, 540
isolated, 287 reduction to two, 548
pole, 288 holomorphic properties, 550
removable, 288 tiling, 473
Sinh, 170 of Euclidean plane with ghosts
sink, 409 and birdies, 484
soap bubble, 531 of Euclidean plane with other shapes,
Solve, 332 481
applied to cubic equation, 42 of Euclidean plane with trian-
applied to quadratic equation, 3 gles, 475
applied to quartic equation, 46 of Poincaré disc with ghosts and
source, 409 birdies, 490, 497
spinor, 516 of Poincaré disc with heptagons
two-component, 516 conformal representation, 509
Sqrt, 7 projective representation, 510
branching of, 171 of Poincaré disc with hyperbolic
square roots of complex numbers, 25 squares
StandardForm, 5 conformal representation, 501,
stereographic projection, 175, 515 503, 504, 506
570 Index

projective representation, 502, continuity and integration counter-


503, 505, 507 examples, 201
of the Poincaré disc with trian- in Taylor’s theorem, 270
gles, 485, 490 M-test, 200
projective representation, 499 upper half-plane representation of hy-
UHP representation, 512 perbolic plane, 511
TraditionalForm, 5
transform value inequality, 242
Fourier, 357, 358 vector
Laplace, 381 null, 514
translation, 348 spacelike, 514
Trefethen, L.N., 451 timelike, 514
triangle subdivision, 251 viscous fluids, 425
with Mathematica, 259 equation for stream function, 427
TrigExpand, 24, 168 visualization
TrigFactor, 25 alternative 3D schemes, 185, 187
trigonometric functions of aerofoil, 345
Mathematica expressions for, 170 of angular abberation, 524
Mathematica function Cos, 24 of arcsine function, 181, 183
Mathematica function Sin, 25 of catenoid, 537
converting multiple angles to pow- of complex functions, 176
ers, 23 of complex functions in three di-
with TrigExpand, 24 mensons, 183
converting powers to multiple an- of conformal map, 341–345
gles, 23 of discontinuous function with par-
with TrigReduce, 25 tial derivatives, 210
definition for complex variable, of double pole, 291
166 of Enneper’s surface, 536
factorizing with TrigFactor, 25 of essential singularity, 292
power series, 29 of flow around a flat plate, 424
related to exponential function, of flow around ellipse, 423
29 of fluid flow past a cylinder, 418
TrigReduce, 169 with circulation, 419
twistor of fundamental theorem of alge-
and minimal surfaces in four di- bra, 273
mensions, 533 of gamma function, 185
and minimal surfaces in three di- of ghosts and birdies tiling of Poincaré
mensions, 534 disc, 497
as pair of spinors, 530 of heptagon tiling of Poincaré disc
theory, 529, 540, 544, 550 conformal representation, 509
two-component spinor, 516 projective representation, 510
of inequalities, 339, 354
uniform convergence, 195 of Joukowski map, 345
and continuity, 199 of Lorentz transformation, 524
and differentiation, 200 of minimal surfaces, 535
and integration, 199, 243 of potential flows, 410
Index 571

of power series, 205 using surfaces with holes, 187


of SC map with CartesianMap, 177
for hexagon, 468 with PolarMap, 178
for pentagon, 469 vortex, 410
for rectangle, 462 vorticity equation, 426
for trapezoid, 465
for triangle, 459, 468 wave equation
for vertical strip, 456 twistor solution, 545
of simple pole, 291 Weierstrass, K.
of sin function, 177 M-test, 200
of sine function, 181, 184 minimal surface formula, 534
of singularities, 290 Wessel, C., 14
of source above half-plane, 416 Wessel–Argand plane, 14
of square tiling of Poincaré disc winding number, 264
conformal representation, 501,
503, 504, 506 zeroes
projective representation, 502, isolation of, 287
503, 505, 507 locating with Rouché’s theorem,
of Stokes flow in cylinder, 429 332
of triangle tiling of Poincaré disc, locating with Mathematica,
490 332
projective representation, 499 location of, 330
UHP representation, 512 Zeta
of vector field, 410, 412 visualization of, 182
using contour plots, 176 zeta function
using surface plots, 183 visualization of, 182

You might also like