Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Incorrect result for integral of (cos z) / z

I am confused by the following result: I'd like to integrate cos(z) / z on a circle around the origin. I tried:

var('z,t')

f = (cos(z))/z

show(f)

gamma = e^(i * t) 

dg = gamma.diff(t)

h = f(z=gamma) * dg
print(h)
show(h.integrate(t, 0, 2 * pi))

and I get:

I*cos(e^(I*t))
0

If I put the same integral into WolframAlpha, I get the result I was expecting (2 pi i).

Is this a bug, or have I specified the problem incorrectly?