Why do these answer differ when integrating the square root of $\tan x$ using complex numbers?

82 Views Asked by At

The screenshot below shows a step of simplification that, intuitively, I thought made sense. Simply rewriting the one square root as a product of the sqrt(-1) times the remaining square root. Then writing the sqrt(-1) as i, and making it a coefficient.

$I = \displaystyle\frac{1}{\sqrt{i}}\arctan{\left(\sqrt{-i\tan{x}}\right)} - \frac{1}{\sqrt{i}}\operatorname{arctanh}{\left(\sqrt{-i\tan{x}}\right)} $

$I = \displaystyle\frac{1}{\sqrt{i}}\arctan{\left(i\sqrt{i\tan{x}}\right)} - \frac{1}{\sqrt{i}}\operatorname{arctanh}{\left(i\sqrt{i\tan{x}}\right)} $

However, upon investigating the graphs, these two answers are different. Can anyone explain the discrepancy? Did I make an error in assumption?