Given $\int \frac{2}{(1-x)(1+x^2)}dx$
The most obvious approach is to use Partial fractions
Let $\frac{2}{(1-x)(1+x^2)}=\frac{A}{1-x}+\frac{Bx+C}{1+x^2}$
$\Rightarrow \frac{2}{(1-x)(1+x^2)}=\frac{A+Ax^2+Bx-Bx^2+C-Cx}{(1-x)(1+x^2)}$
We get $A=1, B=1, C=1$
The integral now becomes
$\int[\frac{1}{1-x}+\frac{x+1}{1+x^2}]dx$
$\Rightarrow \int[\frac{1}{1-x}+\frac{x}{1+x^2}+\frac{1}{1+x^2}]dx$
Now, we can simply integrate term by term
$\Rightarrow -\log|1-x|+\frac{\log(1+x^2)}{2}+\tan^{-1}x+c $
$\Rightarrow \log |\frac{\sqrt{1+x^2}}{1-x}|+\tan^{-1}x+c $
Please review my solution and if you have any other way of integrating then please share your solution.
Here is another way to integrate \begin{align} &\int \frac{2}{(1-x)(1+x^2)}dx\\ =& \int \frac{2(1+x)}{1-x^4}dx= \int \frac{2x}{1-x^4}+ \frac{2}{1-x^4} \ dx\\ =& \int \frac{1}{1-x^4} \ d(x^2)+\int \frac{1}{1-x^2}+\frac{1}{1+x^2}\ dx\\ = &\ \frac12\ln|\frac{1+x^2}{1-x^2}|+ \frac12\ln|\frac{1+x}{1-x}|+\tan^{-1}x+C \end{align}