<s>[INST] Why doesn't the substitution $x=it$ work in the integral $\int\frac{x^2}{{(x^2+1)}^2}dx$? For İntegral $$\int\frac{x^2}{{(x^2+1)}^2}dx$$  I used this substitution $x=it$
We have,

$$\begin{align}
\int\frac{x^2}{{(x^2+1)}^2}dx &=-i\int\frac{t^2}{{(t^2-1)}^2}dt \\
&=-\frac i4\left( \int\frac{1}{t-1}dt+\int\frac{1}{(t-1)^2}dt-\int\frac{1}{t+1}dt+\int\frac{1}{(t+1)^2}dt\right) \\
&=-\frac i4\left(\ln\left|\frac{t-1}{t+1}\right|-\frac{2t}{t^2-1}+C \right)
\end{align}$$ 

In the answer the function $\ln$ doesn't included.
My answer is wrong. Where is the mistake? I can not see.
 [/INST] your result can be written in a simpler form as:
$$-\frac{i}{4}\left( \frac{2t}{{{t}^{2}}-1}+\ln \left( 1+t \right)-\ln \left( 1-t \right) \right)$$
now substitute $t=-ix$
$$\begin{align}
  & =-\frac{i}{4}\left( \frac{2\left( -ix \right)}{{{\left( -ix \right)}^{2}}-1}+\ln \left( 1-ix \right)-\ln \left( 1+ix \right) \right) \\ 
 & =-\frac{i}{4}\left( \frac{2ix}{{{x}^{2}}+1}+\ln \left( 1-ix \right)-\ln \left( 1+ix \right) \right) \\ 
 & =-\frac{i}{4}\left( \frac{2ix}{{{x}^{2}}+1}+\left( \left( ix \right)-\frac{{{\left( ix \right)}^{2}}}{2}+\frac{{{\left( ix \right)}^{3}}}{3}-\cdots  \right)+\left( \left( ix \right)+\frac{{{\left( ix \right)}^{2}}}{2}+\frac{{{\left( ix \right)}^{3}}}{3}-\cdots  \right) \right) \\ 
 & =-\frac{i}{4}\left( \frac{2ix}{{{x}^{2}}+1}+2\left( ix \right)+\frac{2{{\left( ix \right)}^{3}}}{3}+\frac{2{{\left( ix \right)}^{5}}}{5}+\cdots  \right) \\ 
 & =-\frac{i}{4}\left( \frac{2ix}{{{x}^{2}}+1}+2ix-\frac{2i{{x}^{3}}}{3}+\frac{2i{{x}^{5}}}{5}-\cdots  \right) \\ 
 & =\frac{1}{2}\left( \frac{x}{{{x}^{2}}+1}+x-\frac{{{x}^{3}}}{3}+\frac{{{x}^{5}}}{5}-\cdots  \right) \\ 
 & =\frac{1}{2}\left( \frac{x}{{{x}^{2}}+1}+{{\tan }^{-1}}\left( x \right) \right) \\ 
\end{align}$$ 
</s>