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

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

Optimal result

Integrand size = 11, antiderivative size = 8 \[ \int \frac {1}{-x^2+x^4} \, dx=\frac {1}{x}-\text {arctanh}(x) \]

[Out]

1/x-arctanh(x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 8, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {1607, 331, 213} \[ \int \frac {1}{-x^2+x^4} \, dx=\frac {1}{x}-\text {arctanh}(x) \]

[In]

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

[Out]

x^(-1) - ArcTanh[x]

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])

Rule 331

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c*x)^(m + 1)*((a + b*x^n)^(p + 1)/(a*c
*(m + 1))), x] - Dist[b*((m + n*(p + 1) + 1)/(a*c^n*(m + 1))), Int[(c*x)^(m + n)*(a + b*x^n)^p, x], x] /; Free
Q[{a, b, c, p}, x] && IGtQ[n, 0] && LtQ[m, -1] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

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

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(22\) vs. \(2(8)=16\).

Time = 0.00 (sec) , antiderivative size = 22, normalized size of antiderivative = 2.75 \[ \int \frac {1}{-x^2+x^4} \, dx=\frac {1}{x}+\frac {1}{2} \log (1-x)-\frac {1}{2} \log (1+x) \]

[In]

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

[Out]

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

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.15 (sec) , antiderivative size = 16, normalized size of antiderivative = 2.00

method result size
meijerg \(-\frac {i \left (\frac {2 i}{x}-2 i \operatorname {arctanh}\left (x \right )\right )}{2}\) \(16\)
default \(\frac {\ln \left (-1+x \right )}{2}+\frac {1}{x}-\frac {\ln \left (1+x \right )}{2}\) \(17\)
norman \(\frac {\ln \left (-1+x \right )}{2}+\frac {1}{x}-\frac {\ln \left (1+x \right )}{2}\) \(17\)
risch \(\frac {\ln \left (-1+x \right )}{2}+\frac {1}{x}-\frac {\ln \left (1+x \right )}{2}\) \(17\)
parallelrisch \(\frac {\ln \left (-1+x \right ) x -\ln \left (1+x \right ) x +2}{2 x}\) \(21\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 20 vs. \(2 (8) = 16\).

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 18 vs. \(2 (8) = 16\).

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

1/x - atanh(x)