Author 
Comment/Response 
Peter Pein

08/26/12 5:17pm
Hi Amir,
after losing patience I used a simpler approach. y is just a phase shift and has no influence to the value of the integral. 2 Pi is a multiple of the period w.r.t. x and due to the even powers there is a bit more symmetry.
So defining
f[x_, y_, a_] = (1 + a^4 Tan[2 x  2 y]^2)/(1 + a^2 Tan[2 x  2 y]^2);
the value at x==k*Pi/4, k integer, y==0 has to be determined by the use of limits. So I added an intermediate point of integration at Pi/4.
the value of the integral is
value = Simplify[
4*Integrate[f[x, 0, a], {x, 0, Pi/4, Pi/2},
Assumptions > Element[a, Reals]]
]
this evaluates to
Pi*(2  a + 2*a^2  Abs[a])
in a few seconds.
For a in {1, 0, 1} this value is 2*Pi.
maybe the wrong result you got is due to the removable singularities at x = k*Pi/4 + Mod[y, Pi/4]?
Peter
URL: , 
