18
$\begingroup$

I can't find how to calculate path integrals of complex functions in the complex plane.

For example: $$\oint_{\mid z \mid =2}\frac{1-e^z+z}{z^3 (z-1)^2}dz$$

$\endgroup$
4
  • 2
    $\begingroup$ It'll be helpful if you provide the Mathematica code you've used $\endgroup$ Commented Nov 13, 2013 at 15:49
  • 2
    $\begingroup$ Parametrize z = Exp[I*t] and have t vary from 0 to 2*Pi $\endgroup$ Commented Nov 13, 2013 at 16:10
  • $\begingroup$ Are you sure this question is related to Mathematica ? $\endgroup$ Commented Nov 13, 2013 at 16:30
  • $\begingroup$ Related (possibly duplicate): Complex line integral and Definite Integral over a path $\endgroup$ Commented Aug 11, 2015 at 5:02

2 Answers 2

26
$\begingroup$

For this function:

f[z_] := (1 - E^z + z)/(z^3 (z - 1)^2) 

there are no branch cuts in the complex plane therefore we simply use Cauchy integral theorem and the related formula of the complex residue, i.e. we sum up residues of the function $f$ in the circle $\mid z \mid =2$. Let's denote $$int = \oint_{\mid z \mid =2}\frac{1-e^z+z}{z^3 (z-1)^2}dz$$ Now we have:

int = 2 Pi I Total[ Residue[f[z], {z, #}] & /@ {0, 1}] // Simplify 
 I (-11 + 4 E) Pi 

Alternatively we can parametrize z over the given circle z -> 2 E^(I t):

(1 - E^z + z)/(z^3 (z - 1)^2) /. z -> 2 E^(I t) 
(E^(-3 I t) (1 - E^(2 E^(I t)) + 2 E^(I t)))/(8 (-1 + 2 E^(I t))^2) 

and d z -> 2 I E^(I t) d t, now we have:

Integrate[(E^(-3 I t)(1 - E^(2 E^(I t)) + 2 E^(I t)))/( 8(-1 + 2 E^(I t))^2) 2 I E^(I t), {t, 0, 2 Pi}] 
I (-11 + 4 E) Pi 
% // TraditionalForm 

enter image description here

$\endgroup$
20
$\begingroup$

If a numerical answer is good enough you can just enter the path. As @Artes said it doesn't have to be the circle exactly.

NIntegrate[f[z], {z, 2 - 2 I, 2 + 2 I, -2 + 2 I, -2 - 2 I, 2 - 2 I}] (* 0. - 0.398582 I *) 

Check :

I (-11 + 4 E) Pi // N (* 0. - 0.398582 I *) 

Another suggestion from @Artes (thanks !) : one can use symbolic integration as well and

Integrate[f[z], {z, 2 - 2 I, 2 + 2 I, -2 + 2 I, -2 - 2 I, 2 - 2 I}] // FullSimplify 

will reproduce his result.

$\endgroup$
3
  • $\begingroup$ I upvoted your answer, I think it shouldn't be deleted since as far as I know this way of computing integrals couldn't be found in documentation. $\endgroup$ Commented Nov 14, 2013 at 15:16
  • 2
    $\begingroup$ @Artes, FYI this usage is the third bullet point under Details and Options for NIntegrate. $\endgroup$ Commented Nov 14, 2013 at 15:29
  • 2
    $\begingroup$ @chuy Thanks, in fact there is it, but what about Integrate? Perhaps there is it somewhere, but couldn't find it. $\endgroup$ Commented Nov 14, 2013 at 15:34

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.