1
$\begingroup$
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}]

enter image description here

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$$

$\endgroup$
13
  • 1
    $\begingroup$ Plot just shows the real part. Use ReImPlot of ComplexPlot3D if you want to plot the whole function. $\endgroup$ Commented Nov 10, 2021 at 10:20
  • $\begingroup$ @DanielHuber As I know $\int\frac{1}{x^2-1}dx=\frac{1}{2}\ln{\left|\frac{x-1}{x+1}\right|}+C$, so I don't need use ReImPlot? $\endgroup$
    – yode
    Commented Nov 10, 2021 at 10:25
  • 1
    $\begingroup$ ? ArcTanh has branch cuts along -Infinity..-1 and 1..Infinity $\endgroup$ Commented Nov 10, 2021 at 10:28
  • $\begingroup$ @DanielHuber Yes, I know. But could I don't want this cuts result? I want to get that complete primary function. Is it possible? $\endgroup$
    – yode
    Commented Nov 10, 2021 at 10:31
  • 1
    $\begingroup$ The derivation of the general formula $$ \int\frac{1}{1-x^2}dx=\frac{1}{2}\ln{\left|\frac{x+1}{x-1}\right|}$$ which holds on each of three intervals of 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 by Integrate[1/(1 - x^2), x, Assumptions -> x <-1 ] and Integrate[1/(1 - x^2), x, Assumptions -> x>-1&&x <1] and Integrate[1/(1 - x^2), x, Assumptions -> x > 1]. $\endgroup$
    – user64494
    Commented Nov 10, 2021 at 11:30

1 Answer 1

3
$\begingroup$

I answer the question for sportive interest (see the above discussion). The antiderivative of the required form valid on the whole real axis except the points $x=\pm1$ can be obtained as

Integrate[1/(1-t^2),{t,0,x},PrincipalValue->True]

under assumptions on x. Indeed,

Integrate[1/(1 - t^2), {t, 0, x}, PrincipalValue -> True, Assumptions -> x < -1]

-(1/2) Log[(-1 + x)/(1 + x)]

FullSimplify[-(1/2) Log[(-1 + x)/(1 + x)] - 
1/2*Log[RealAbs[(x + 1)/(x - 1)]], Assumptions -> x < -1]

0

Integrate[1/(1 - t^2), {t, 0, x},Assumptions -> x > -1 && x < 1] // TrigToExp

-(1/2) Log[1 - x] + 1/2 Log[1 + x]

Integrate[1/(1 - t^2), {t, 0, x}, PrincipalValue -> True, Assumptions -> x > 1]

1/2 Log[(1 + x)/(-1 + x)]

I leave the remaining simplifications on your own.

$\endgroup$
1
  • $\begingroup$ Thanks....... :) $\endgroup$
    – yode
    Commented Nov 11, 2021 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.