# A simple question on contour integral in Mathematica

**URL:** <https://community.wolfram.com/t/a-simple-question-on-contour-integral-in-mathematica/7154>\
**Category:** Questions\
**Tags:** physics\
**Created:** [November 9, 2015, 10:30am UTC](https://community.wolfram.com/t/a-simple-question-on-contour-integral-in-mathematica/7154 "2015-11-09T10:30:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmemami](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@jmemami](https://community.wolfram.com/u/jmemami)\
**Post date:** [November 9, 2015, 10:30am UTC](https://community.wolfram.com/t/a-simple-question-on-contour-integral-in-mathematica/7154/1 "2015-11-09T10:30:53Z")

</div>

HI,  
Is there a simple way to do contour integral in Mathematica 7(home-edition)? A simple Ex:  
integral of 1/z on the unit circle abs(z)=1.  
Thanks  
Javad

---

<div class="post-metadata">

**Author:** ![seanc](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/seanc/32/34005_2.png) [@seanc](https://community.wolfram.com/u/seanc)\
**Post date:** [November 9, 2015, 2:41pm UTC](https://community.wolfram.com/t/a-simple-question-on-contour-integral-in-mathematica/7154/2 "2015-11-09T14:41:57Z")

</div>

Not the way you’re thinking. In the real world you would just calculate the residue at 0. So you can do one of two things:

- Calculate the residue using the Residue function [Series, Limits, and Residues—Wolfram Documentation](http://reference.wolfram.com/language/tutorial/Residues.html)
- Calculate the path and convert the path integral into an ordinary one that Integrate can use.

---

<div class="post-metadata">

**Author:** ![murray](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/murray/32/39879_2.png) [@murray](https://community.wolfram.com/u/murray)\
**Post date:** [November 9, 2015, 3:47pm UTC](https://community.wolfram.com/t/a-simple-question-on-contour-integral-in-mathematica/7154/3 "2015-11-09T15:47:23Z")

</div>

Your example is tricky to handle because an answer depends upon where you’re starting, i.e., what you may assume as known.Thus there are (at least) three approaches.

1. As noted in Sean Clarke’s answer, you could directly calculate the contour integral from its definition. Parameterize the unit circle _C_:

2. If you already know Cauchy’s Integral Formula, apply it directly.

3. Calculate the residue at the origin and use the Residue Theorem. The catch is — how do you find the residue?  
_Mathematica_ will tell it to you:

But then how does _Mathematica_ know that? You could further ask _Mathematica_ for (part of) the Laurent expansion around the origin:

```
     Series[f[z],{z,0,3}]

```

But that rather begs the question as to how that expansion is determined.

The simplest way to know the residue at the origin is to note that, by definition, the function has a singularity inside C only the simple pole at the origin, so that Res(f,0) = limz→ 0 z (1/z) = 1.
