# Integrate on a contour in the complex plane

I want to integrate the function

f[z]= z + Conjugate[z]

over a circle of radius 2 centered at the origin.

For the sake of stating something that I have tried:

Integrate[z + Conjugate[z], {z, 1, I, -1, -I, 1}]

seems to give me the integral around the square with vertices 1, I, -1, -I. Also I can get the integral on a line segment with:

Integrate[z + Conjugate[z], {z, 0, 1 + I}].

How do I integrate on a curve?

• Let $z=2\exp(it)$... Commented Jun 5, 2016 at 21:58

First we shall define 'the integration on a curve'. Traditionally, this is defined as integration of f.dl where dl is the length of a small part of the curve.

So, using t as a medium, we can explicitly write out the curve's function on a complex plane, here let's assume it's z=2 Exp[I t].

Then we can use t, a real number, as the integration variable, which make this problem significantly easier.

The final code is shown below:

z=2 Exp[I t];
f[z_]:=z+Conjugate[z];
Integrate[f[z] D[z,t],{t,0,2 Pi}]

result is:

8 I Pi

• If on a contour, this problem can be quite difficult as not all the time the contour can be explicitly explained by functions. But I suppose your need is just what I've posted~:)
– Wjx
Commented Jun 6, 2016 at 11:58
• OK Thanks. The result I am after is 8*Pi*I. I can use your code but the definition of complex integration is different from what you have. Also in order to integrate around the entire circle t must go from 0 to 2*Pi. z=2 Exp[I t]; f[z_]:=z+Conjugate[z]; Integrate[f[z] D[z,t],{t,0,2*Pi}] Commented Jun 6, 2016 at 18:21
• yeah，this code can be used in different situations, but you will need to change the function of the integration curve and the integration range.
– Wjx
Commented Jun 7, 2016 at 0:09
• Why do you have a Abs there? Which definition are you following? Commented Apr 17 at 8:29
• @xzczd If it's complex path integral then it shouldn't have the Abs, I thought the question was about integral of a real value over a curve, which requires a Abs.
– Wjx
Commented Apr 24 at 9:09

EDIT

It can get more complicated. Look at a contour given by

r[t_] := 1 + 2 Cos[t];

Original post

The result of the integral for a (reasonable) closed contour is just 2 I times the area enclosed by the contour.

Proof: the integral is

$$\int \left(z^*+z\right) \, dz$$

Letting

$$z=x+i y$$,
$$dz=dx+i dy$$

the integral becomes

$$\int 2 x (dx + i dy)=2 i \int dy* x - 2 \int dx *x$$

It can be easily shown that the second summand vanishes over a closed curve which completes the proof. QED.

As of version 13.3, ContourIntegrate is introduced:

Clear[z];
f[z_] := z + Conjugate[z];
ContourIntegrate[f[z], z ∈ Circle[{0, 0}, 2]]
(* 8 I π *)
• I wonder why MMA doesn't add this functionality to the original Integrate function for the same purpose.
– yode
Commented Apr 24 at 9:34
• @yode That'll cause certain ambiguity, I guess. For example, as mentioned in the document, the following is valid for ContourIntegrate: ContourIntegrate[E^(I z)/(z^3 + 1/8), z \[Element] RegularPolygon[6]]. Commented Apr 24 at 9:46