\(\int \frac {1}{(-1+x^2)^2} \, dx\) [131]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 7, antiderivative size = 21 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=\frac {x}{2 \left (1-x^2\right )}+\frac {\text {arctanh}(x)}{2} \]

[Out]

1/2*x/(-x^2+1)+1/2*arctanh(x)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {205, 213} \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=\frac {\text {arctanh}(x)}{2}+\frac {x}{2 \left (1-x^2\right )} \]

[In]

Int[(-1 + x^2)^(-2),x]

[Out]

x/(2*(1 - x^2)) + ArcTanh[x]/2

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 213

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[b, 2])^(-1))*ArcTanh[Rt[b, 2]*(x/Rt[-a, 2])]
, x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (LtQ[a, 0] || GtQ[b, 0])

Rubi steps \begin{align*} \text {integral}& = \frac {x}{2 \left (1-x^2\right )}-\frac {1}{2} \int \frac {1}{-1+x^2} \, dx \\ & = \frac {x}{2 \left (1-x^2\right )}+\frac {\text {arctanh}(x)}{2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.29 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=\frac {1}{4} \left (-\frac {2 x}{-1+x^2}-\log (1-x)+\log (1+x)\right ) \]

[In]

Integrate[(-1 + x^2)^(-2),x]

[Out]

((-2*x)/(-1 + x^2) - Log[1 - x] + Log[1 + x])/4

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.05 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.10

method result size
meijerg \(-\frac {i \left (\frac {2 i x}{-2 x^{2}+2}+i \operatorname {arctanh}\left (x \right )\right )}{2}\) \(23\)
norman \(-\frac {x}{2 \left (x^{2}-1\right )}-\frac {\ln \left (-1+x \right )}{4}+\frac {\ln \left (1+x \right )}{4}\) \(24\)
risch \(-\frac {x}{2 \left (x^{2}-1\right )}-\frac {\ln \left (-1+x \right )}{4}+\frac {\ln \left (1+x \right )}{4}\) \(24\)
default \(-\frac {1}{4 \left (-1+x \right )}-\frac {\ln \left (-1+x \right )}{4}-\frac {1}{4 \left (1+x \right )}+\frac {\ln \left (1+x \right )}{4}\) \(28\)
parallelrisch \(-\frac {\ln \left (-1+x \right ) x^{2}-\ln \left (1+x \right ) x^{2}-\ln \left (-1+x \right )+\ln \left (1+x \right )+2 x}{4 \left (x^{2}-1\right )}\) \(41\)

[In]

int(1/(x^2-1)^2,x,method=_RETURNVERBOSE)

[Out]

-1/2*I*(2*I*x/(-2*x^2+2)+I*arctanh(x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (15) = 30\).

Time = 0.24 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.62 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=\frac {{\left (x^{2} - 1\right )} \log \left (x + 1\right ) - {\left (x^{2} - 1\right )} \log \left (x - 1\right ) - 2 \, x}{4 \, {\left (x^{2} - 1\right )}} \]

[In]

integrate(1/(x^2-1)^2,x, algorithm="fricas")

[Out]

1/4*((x^2 - 1)*log(x + 1) - (x^2 - 1)*log(x - 1) - 2*x)/(x^2 - 1)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.95 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=- \frac {x}{2 x^{2} - 2} - \frac {\log {\left (x - 1 \right )}}{4} + \frac {\log {\left (x + 1 \right )}}{4} \]

[In]

integrate(1/(x**2-1)**2,x)

[Out]

-x/(2*x**2 - 2) - log(x - 1)/4 + log(x + 1)/4

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.10 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=-\frac {x}{2 \, {\left (x^{2} - 1\right )}} + \frac {1}{4} \, \log \left (x + 1\right ) - \frac {1}{4} \, \log \left (x - 1\right ) \]

[In]

integrate(1/(x^2-1)^2,x, algorithm="maxima")

[Out]

-1/2*x/(x^2 - 1) + 1/4*log(x + 1) - 1/4*log(x - 1)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.19 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=-\frac {x}{2 \, {\left (x^{2} - 1\right )}} + \frac {1}{4} \, \log \left ({\left | x + 1 \right |}\right ) - \frac {1}{4} \, \log \left ({\left | x - 1 \right |}\right ) \]

[In]

integrate(1/(x^2-1)^2,x, algorithm="giac")

[Out]

-1/2*x/(x^2 - 1) + 1/4*log(abs(x + 1)) - 1/4*log(abs(x - 1))

Mupad [B] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.81 \[ \int \frac {1}{\left (-1+x^2\right )^2} \, dx=\frac {\mathrm {atanh}\left (x\right )}{2}-\frac {x}{2\,\left (x^2-1\right )} \]

[In]

int(1/(x^2 - 1)^2,x)

[Out]

atanh(x)/2 - x/(2*(x^2 - 1))