For example, how can I calculate

$$\int_{\left | z \right |=1}\frac{dz}{z}$$

I know that the answer is $2\pi i$ but how do I do it using Mathematica?

  • 2
    $\begingroup$ Parametrize the range of integration. Then make sure you properly rewrite dz using the chain rule. (@Nasser gave a response with explicit detail in case this is not clear.) $\endgroup$ – Daniel Lichtblau Aug 23 '13 at 23:08

If you want to calculate this integral with Mathematica use beautiful (and very powerful!)$\;$ Cauchy Integral Formula implying an adequate theorem of Complex Residue. Thus we have $$\int_{\left | z \right |=1}\frac{dz}{z}= 2\pi i\; Res_{z_{0}=0} f$$ where $f(z)=\frac{1}{z}$.

We can find the residue at $z_0=0$ of $f(z)$ in Mathematica with Residue:

Residue[1/z, {z, 0}]



z = Exp[I t];
dz = D[z, t];
Integrate[(1/z) dz, {t, 0, 2 Pi}]

Mathematica graphics

The idea is to convert it to complex contour integration.

  • $\begingroup$ This is incorrect, dt is "infinitesimal" while D[z[t],t] is not (in dt = D[z[t], t]), etc... $\endgroup$ – Artes Aug 23 '13 at 23:08
  • $\begingroup$ @Artes, so I assume you do not want the first way of expression it? i.e. use explicit function? Will remove the function, and keep the expression. no problem. $\endgroup$ – Nasser Aug 23 '13 at 23:14
  • $\begingroup$ You could write dz = D[z, t] dt but you musn't write dz = D[z, t]. Next Integrate[(1/z) dz, {t, 0, 2 Pi}] doesn't make sense. $\endgroup$ – Artes Aug 23 '13 at 23:17
  • 1
    $\begingroup$ Now, your approach is more appropriate, unfortunately using this symbol dz it seems to be a differential while it seems you are using it in a different context. You haven't demonstrated seamlessly why you change $\frac{dz}{z}$ to another function using the same symbols. $\endgroup$ – Artes Aug 24 '13 at 10:11

Your Answer

