# Trouble with an integral

Hi,

Let f be the following function:

f(t, z0, z1) = (z0*z1 - 1)*(z0 - z1)/((t*z0 - 1)*(t*z1 - 1)*(t - z0)*(t - z1)*z0)

f is a nice holomorphic function and I would like to compute the contour integral

\int_{|z1|=1} \int_{|z0|=1} f(t, z0, z1) dz0/z0 dz1/z1

Assuming 0 < t < 1, the result should be -4 pi^2/(t^2-1).

In Sage:

**var("z0, z1, theta0, theta1")**

**assume(0 < t < 1)**

**f = (z0 z1 - 1)(z0 - z1)/((tz0 - 1)(tz1 - 1)(t - z0)(t - z1)z0)**

**g = f.subs({z0: exp(I theta0), z1: exp(Itheta1)})**

Now if I integrate with respect to theta0 first: **g.integrate(theta0, 0, 2 pi)**

*Sage answers that the integral is zero. If I integrate with respect to theta1 first:*

**factor(g.integrate(theta1, 0, 2****pi).integrate(theta0, 0, 2**

*pi))**Sage answers that the integral is -4*pi^2/t^2 which is also clearly wrong...

Maple finds the right answer.

What can I do to make Sage compute it right? (This is a test I need to compute much more complicated integrals after this so I have to make sure Sage gives me the right answer).