# Definite Integral over a path

What does

Integrate[f[z], {z, a, b, c, d}]


exactly calculate? Is it

$$\int_a^b f(z)\, \mathrm{d}z +\int_b^c f(z)\, \mathrm{d}z +\int_{c}^d f(z)\, \mathrm{d}z ?$$

That was my first idea but

Integrate[f[z], {z, a, b, a}]


isn't simplified to 0 (even with a FullSimplify).

For example

   Integrate[1/z, {z, 1, I, -1, -I, 1}]


gives as result $2\cdot \pi \cdot i$, which is the value of any closed path around zero.

Which path does it take in the complex plane? Because there has been an Integral, where I thought it would converge, but I got an error with this one.

-
Well it was an example for Nintegrate somewhere ( i think for the Residues but i am not sure). In fact Integrate[1/z, {z,1,I,-1,-I,1}] gives $2\cdot \pi \cdot i$ –  Dominic Michaelis Feb 26 '13 at 22:02
@Szabolcs it shows up under the Details section for NIntegrate. Specifically, it takes the straight line path from $x_i$ to $x_{i+1}$, testing for singularities at the $x_i$. –  rcollyer Feb 26 '13 at 22:49

This syntax is correct and it does what you were guessing. However, the simplification is done only if you enter a specific function:

Integrate[x^2, {x, a, b, c, a}]


0

In other words, I replaced your symbolic f by x^2. I think it is reasonable to not simplify such integrals unless you know that the path of the integration doesn't enclose (or in 1D, touch) any singularities. But this can't be guaranteed if the function is unspecified.

Edit

The segments between the points in the specification a,b,c... are straight lines if the integral is more than one-dimensional. In case you're interested in more general line integrals (either in the complex plane or otherwise), here ia a related post:

Complex line integral

-
Do you know which way is taken in the complex plane? –  Dominic Michaelis Feb 26 '13 at 22:37
@DominicMichaelis The straight line between them. ListPlot[{Re[#], Im[#]} & /@ Reap[NIntegrate[z, {z, 0, 1 + 2 I, -3 - 2 I}, EvaluationMonitor :> Sow[z]]][[-1, -1]]] –  ssch Feb 26 '13 at 22:43