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

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (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 = 14, antiderivative size = 24 \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {1}{3} \sqrt {2} \arctan \left (\frac {x}{\sqrt {2}}\right )-\frac {\text {arctanh}(x)}{3} \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 24, 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.214, Rules used = {1144, 209, 213} \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {1}{3} \sqrt {2} \arctan \left (\frac {x}{\sqrt {2}}\right )-\frac {\text {arctanh}(x)}{3} \]

[In]

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

[Out]

(Sqrt[2]*ArcTan[x/Sqrt[2]])/3 - ArcTanh[x]/3

Rule 209

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

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 1144

Int[((d_.)*(x_))^(m_)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[(
d^2/2)*(b/q + 1), Int[(d*x)^(m - 2)/(b/2 + q/2 + c*x^2), x], x] - Dist[(d^2/2)*(b/q - 1), Int[(d*x)^(m - 2)/(b
/2 - q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[b^2 - 4*a*c, 0] && GeQ[m, 2]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

(2*Sqrt[2]*ArcTan[x/Sqrt[2]] + Log[1 - x] - Log[1 + x])/6

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.08

method result size
default \(\frac {\ln \left (-1+x \right )}{6}+\frac {\arctan \left (\frac {x \sqrt {2}}{2}\right ) \sqrt {2}}{3}-\frac {\ln \left (1+x \right )}{6}\) \(26\)
risch \(\frac {\ln \left (-1+x \right )}{6}+\frac {\arctan \left (\frac {x \sqrt {2}}{2}\right ) \sqrt {2}}{3}-\frac {\ln \left (1+x \right )}{6}\) \(26\)

[In]

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

[Out]

1/6*ln(-1+x)+1/3*arctan(1/2*x*2^(1/2))*2^(1/2)-1/6*ln(1+x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04 \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {1}{3} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - \frac {1}{6} \, \log \left (x + 1\right ) + \frac {1}{6} \, \log \left (x - 1\right ) \]

[In]

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

[Out]

1/3*sqrt(2)*arctan(1/2*sqrt(2)*x) - 1/6*log(x + 1) + 1/6*log(x - 1)

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.21 \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {\log {\left (x - 1 \right )}}{6} - \frac {\log {\left (x + 1 \right )}}{6} + \frac {\sqrt {2} \operatorname {atan}{\left (\frac {\sqrt {2} x}{2} \right )}}{3} \]

[In]

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

[Out]

log(x - 1)/6 - log(x + 1)/6 + sqrt(2)*atan(sqrt(2)*x/2)/3

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.04 \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {1}{3} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - \frac {1}{6} \, \log \left (x + 1\right ) + \frac {1}{6} \, \log \left (x - 1\right ) \]

[In]

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

[Out]

1/3*sqrt(2)*arctan(1/2*sqrt(2)*x) - 1/6*log(x + 1) + 1/6*log(x - 1)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.12 \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {1}{3} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} x\right ) - \frac {1}{6} \, \log \left ({\left | x + 1 \right |}\right ) + \frac {1}{6} \, \log \left ({\left | x - 1 \right |}\right ) \]

[In]

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

[Out]

1/3*sqrt(2)*arctan(1/2*sqrt(2)*x) - 1/6*log(abs(x + 1)) + 1/6*log(abs(x - 1))

Mupad [B] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.71 \[ \int \frac {x^2}{-2+x^2+x^4} \, dx=\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,x}{2}\right )}{3}-\frac {\mathrm {atanh}\left (x\right )}{3} \]

[In]

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

[Out]

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