Integrate[1/(1 - x^2), x] // FullSimplify
ArcTanh[x]
But as we see in follow graphcs:
Plot[{1/(1 - x^2), ArcTanh[x]}, {x, -5, 5}, PlotRange -> {-3, 3}]
We can see the Integrate
just calculate the part of -1<x<1. Is it a bug of Integrate? How do I compute the complete integration of this function with Mathematica? And as I know the right answer is $$\int\frac{1}{1-x^2}dx=\frac{1}{2}\ln{\left|\frac{x+1}{x-1}\right|}+C$$
FunctionDomain,1(1-x^2),x,Reals]
is art for art's sake since an antiderivative can be used only for calculation of an definite integral $ \int_a^b\frac{1}{1-x^2}dx$, where both integration limits belong to the same interval. Antiderivatives on each interval can be found byIntegrate[1/(1 - x^2), x, Assumptions -> x <-1 ]
andIntegrate[1/(1 - x^2), x, Assumptions -> x>-1&&x <1]
andIntegrate[1/(1 - x^2), x, Assumptions -> x > 1]
. $\endgroup$