And

As such, has a pole of order 1 at z = 1 and two poles of order two at z = i and z = -i.

Let be some Jordan curve around all these three poles : for example, the curve parametrized by with .

Then by the residue theorem.

But the residue of a function f(z) at a simple pole c is given by .

Thus .

Then

.

This time, the pole is of second order, thus its residue is given by the formula :

, where n is the order of the pole.

Thus, .


.

Following the same procedure :

.

So <math>\oint_{\gamma} f(z) dz = 2 \pi i \Bigg( \frac{e}{4} + \frac{3ie^i}{8} - \frac{3ie^i}{8} \Bigg) = \frac{e \pi i}{2}.