3. Contour Integrals
A complex function can be integrated along a path in the complex plane much in
the same way a real
function of two real variables can be integrated along a path in R^2. In contrast
to the real case, however, these
complex integrals (called contour integrals) are intimately linked with the
poles of the integrand. Before stating
the precise relationship , let’s compute some contour integrals and make a few
initial discoveries. We use the
fol lowing definition .
Definition. Suppose C is a path in the complex plane, and f(z) is a complex
function. Given a parametric
representation z(t) of C, with t0 ≤ t ≤ t1, we define

Example. Let’s calculate
where C is the contour given below:

The curve C is given by the equation x = y2 + 1. We must first find a
parameterization of C. Suppose we
introduce the parameter t, and let y = t for −2 ≤ t ≤ 2. Since x = y2 + 1, we
then have x = t2 + 1. We
therefore have a parameterization of the curve C, given by
z(t) = (t2 + 1) + itfor −2 ≤ t ≤ 2.
To store this contour in MatLab we enter:
>> syms t real;
>> y = t;
>> x = t2+1;
>> z = simple(x + i*y)
z =
t2+1+i*t
Now that we have a parameterized path, MatLab can calculate the contour integral
of any complex function
along this path (so long as that function doesn’t have a pole on the path).
First we store the function and
integrand:
>> f = z2-2*z+1;
>> Integrand = f*diff(z,t);
We calculate the contour integral using the int command, and convert the result
to a numerical answer
using the double command:
>> F = int(Integrand, 't, -2, 2);
>> F = double(F)
F =
0 +58.6667i
Example.
Thus,
Of course, we could also calculate this
integral explicitly:

As we will soon see, it is a theorem of complex analysis that the contour
integral of an entire function depends
only on the endpoints of the path, and not on the path taken between them.
Example. To see this in action, let’s calculate
using the
contour below, given by the
equation x = 5, shown below:

We repeat the same process used in the previous example:
>> syms t real;
>> y=t;
>> x=5;
>> z=simple(x+i*y);
>> f=z2-2*z+1;
>> Integrand=f*diff(z,t);
>> F=int(Integrand, 't, -2, 2);
>> F=double(F)
F =
0 +58.6667i
Example .
Thus,
, and so it indeed
appears that 
Indeed, we can again manually compute

It turns out that a contour integral of a meromorphic function f around a closed
loop C only depends on
the poles of f contained inside C. More precisely, we have the following
theorem:
Theorem. Suppose f is a meromorphic function and C is a simple closed loop (e.g.
a circle ). If p1, . . . , pk are
the poles of f lying in the interior of C, then

This remarkable theorem has several corollaries.
Corollary 1. If f is an entire function, then
for any closed loop
C.
Proof. For a simple closed curve C, the statement follows immediately from the
theorem. For an arbitrary
closed loop C, it is a consequence of a slightly more general version of the
theorem.
Corollary 2. If f is an entire function, then
depends only on the
endpoints of C.
Proof. Suppose C1 and C2 are two different paths with the same endpoints. Let C
be the loop given by C1−C2.
Then

On the other hand, by Corollary 1 we have

since f doesn’t have any poles. The result follows.
Exercise 7. Let C be the contour given by x2 + y2 = 1, shown below. Observe that
C can be parameterized
by x = cos(t), y = sin(t), for 0 ≤ t ≤ 2 .
For each of the functions f(z) given below, use MatLab to:
a) Compute
using MatLab;
b) Find the poles of f contained inside C;
c) Compute the residue of f at each of these poles; and
d) Compute
and compare the result with your answer from part
(a).

i) f(z) = z3 + 2z2 + 1
ii) f(z) = z5 − z
iii) 
iv) 
v) 