<s>[INST] Integrate $\int\frac{2t^2}{t^4+1}dt$ 
Integrate $\int\frac{2t^2}{t^4+1}dt$

While evaluating the integral $\int\sqrt{\tan x}dx$ in Evaluating the indefinite integral $\int\sqrt{\tan x}dx$. using the substitution $t^2=\tan x\implies2tdt=\sec^2x.dx$, thus 
$$
\int\sqrt{\tan x}dx=\int\frac{2t^2}{t^4+1}dt
$$
This is solved using partial fractions, Check answers of @Bhaskara-III, @Harish Chandra Rajpoot. But, what if I try the following
My Attempt
$$
\int\frac{2t^2}{t^4+1}dt=\int\frac{2t^2}{(t^2+i)(t^2-i)}dt\\
\frac{2t^2}{(t^2+i)(t^2-i)}=\frac{A}{t^2+i}+\frac{B}{t^2-i}\\
2t^2=A(t^2-i)+B(t^2+i)\implies A=1, B=1\\
\color{red}{\frac{2t^2}{(t^2+i)(t^2-i)}=\frac{1}{t^2+i}+\frac{1}{t^2-i}}\\
$$
$$
\int\frac{2t^2}{t^4+1}dt=\int\frac{1}{t^2+i}dt+\int\frac{1}{t^2-i}dt=\int\frac{1}{t^2+(\sqrt{i})^2}dt+\int\frac{1}{t^2-(\sqrt{i})^2}dt
$$
Is it possible to somehow finish the integration with my substitution ?
Pls check: integrating square root of $\tan x$, answer by @Mhenni Benghorbal, seems to be a similar substitution as in my attempt.
 [/INST] Hint
You have $$\int \frac {2t^2dt}{t^4+1}$$
Which can be written as $$\int \frac {(t^2+1+t^2-1)dt}{t^4+1}$$
$$\int \frac {(t^2+1)dt}{t^4+1}+\int \frac {(t^2-1)dt}{t^4+1}$$
$$\int \frac {(1+t^{-2})dt}{t^{-2}+t^2}+\int \frac {(1+t^{-2})dt}{t^2+t^{-2}}$$
For the first one substitute $$u=x-\frac 1x$$ and for second one substitute $$p=x+\frac 1x$$
</s>