I wanted to evaluate the following integral:
Integrate[(2 - 2 Cos[a - b])/(1 + x^2 - 2 x Cos[a - b]), {a, 0, 2 Pi}, {b, 0, 2 Pi}]
which yields (4 Pi^2)/x
as the result. However, the same integral upon with substitution of variables and expressed as
Integrate[(2 - 2 Cos[y])/(1 + x^2 - 2 x Cos[y]), {a, 0, 2 Pi}, {y, 0, 2 Pi}]
yields (8 Pi^2)/(1 + x)
as the answer. I can't trace the root for this error. Can somebody clarify why Mathematica gives a wrong answer for the first input?