verty said:
That is a very good question, I don't know the answer to it. I'm going to investigate this.
Sorry, the original question has no trouble because the range of tan is just R. Here is a more applicable problem:
##y = \int {dx \over (1 - x^2)^2}##
##x =? \; sin\theta##
##dx = cos\theta \; d\theta##
##y = \int sec^3\theta \; d\theta##
## = {1 \over 2} [sec\theta \; tan\theta + \int sec\theta \; d\theta] + C##
## = {1 \over 2} [sec\theta \; tan\theta + ln| sec\theta + tan\theta | ] + C##
## = {1\over 2}{x \over 1 - x^2} + {1\over 4} ln | {1+x\over 1-x}| + C##On the other hand, one can make a translation:
##x = u-1##
##dx = du##
##y = \int {dx \over (1 - x^2)^2} = \int{ dx \over (1+x)^2 (1-x)^2} = \int {du \over u^2(2-u)^2}##
After some partial fraction magic:
##y = \int {1 \over 4(2-u)^2} + {1 \over 4u^2} + {1 \over 4u} + {1 \over 4(2-u)} du##
## = {1 \over 4} [ {1 \over 2-u} - {1\over u} + ln|u| - ln|2-u| ] + C##
## = {1 \over 4} [ {2(u-1) \over u(2-u)} + ln| {u \over 2-u} | ] + C##
## = {1 \over 2} {x \over 1 - x^2} + {1 \over 4} ln| {1+x \over 1-x} | + C##
I can't explain it but it's the same answer. Probably it has to do with the behaviour of sin(z) and cos(z) for complex z.