If make the substitution $ u= \tan x$ then the limits of the integral both go to 0, giving us the wrong result of 0. My book suggests that this error is due to the discontinuity of the tangent function in between the limits of the integral. However, I do not see why the discontinuity leads to a wrong answer.
Also, how can i rectify this error, still using the same substitution. Any help in this direction would be appreciated.