Hmm thanks again topsquark, but to be honest I don't understand :/

**How do we evaluate $\displaystyle \int^{\pi}_{0}f(\cos x, \sin x)dx$ using the ***residue theorem* in complex analysis?
If we were integrating from 0 to 2*pi we could use the unit circle centred on the origin as the contour, because z follows that contour, and then apply the residue theorem to calculate 2*pi*i*[sum of enclosed poles] = answer.

I'm sure it can be done easily for 0 to pi because I read from

http://www.math.gatech.edu/~cain/winter99/supplement.pdf that "

*Our method is easily adaptable for integrals over a different range, for example* *between 0 and pi or between ąpi.*" Unfortunately he doesn't give an example.

So how de we adapt the simple z = e^(i x) substitution method integrating from 0 to 2*pi, i.e over the unit circle, to integrate from 0 to pi?

**I'm just looking for a simple example of $\displaystyle \int^{\pi}_{0}f(\cos x, \sin x)dx$ using the ***residue theorem* in complex analysis, please.