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

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

Optimal result

Integrand size = 17, antiderivative size = 43 \[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=-\frac {1}{2} \arctan \left (\frac {x}{\sqrt {2+x^2}}\right )-\frac {\text {arctanh}\left (\frac {\sqrt {3} x}{\sqrt {2+x^2}}\right )}{2 \sqrt {3}} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {1189, 385, 212, 209} \[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=-\frac {1}{2} \arctan \left (\frac {x}{\sqrt {x^2+2}}\right )-\frac {\text {arctanh}\left (\frac {\sqrt {3} x}{\sqrt {x^2+2}}\right )}{2 \sqrt {3}} \]

[In]

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

[Out]

-1/2*ArcTan[x/Sqrt[2 + x^2]] - ArcTanh[(Sqrt[3]*x)/Sqrt[2 + x^2]]/(2*Sqrt[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 212

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

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)/((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Subst[Int[1/(c - (b*c - a*d)*x^n), x]
, x, x/(a + b*x^n)^(1/n)] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && EqQ[n*p + 1, 0] && IntegerQ[n]

Rule 1189

Int[((d_) + (e_.)*(x_)^2)^(q_)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{r = Rt[(-a)*c, 2]}, Dist[-c/(2*r), In
t[(d + e*x^2)^q/(r - c*x^2), x], x] - Dist[c/(2*r), Int[(d + e*x^2)^q/(r + c*x^2), x], x]] /; FreeQ[{a, c, d,
e, q}, x] && NeQ[c*d^2 + a*e^2, 0] &&  !IntegerQ[q]

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

Mathematica [A] (verified)

Time = 0.16 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.33 \[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=\frac {1}{6} \left (3 \arctan \left (1+x^2-x \sqrt {2+x^2}\right )-\sqrt {3} \text {arctanh}\left (\frac {1-x^2+x \sqrt {2+x^2}}{\sqrt {3}}\right )\right ) \]

[In]

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

[Out]

(3*ArcTan[1 + x^2 - x*Sqrt[2 + x^2]] - Sqrt[3]*ArcTanh[(1 - x^2 + x*Sqrt[2 + x^2])/Sqrt[3]])/6

Maple [A] (verified)

Time = 0.60 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.86

method result size
pseudoelliptic \(-\frac {\sqrt {3}\, \operatorname {arctanh}\left (\frac {\sqrt {3}\, \sqrt {x^{2}+2}}{3 x}\right )}{6}+\frac {\arctan \left (\frac {\sqrt {x^{2}+2}}{x}\right )}{2}\) \(37\)
default \(-\frac {\sqrt {3}\, \operatorname {arctanh}\left (\frac {\left (2 x +4\right ) \sqrt {3}}{6 \sqrt {\left (-1+x \right )^{2}+1+2 x}}\right )}{12}+\frac {\sqrt {3}\, \operatorname {arctanh}\left (\frac {\left (-2 x +4\right ) \sqrt {3}}{6 \sqrt {\left (1+x \right )^{2}+1-2 x}}\right )}{12}-\frac {\arctan \left (\frac {x}{\sqrt {x^{2}+2}}\right )}{2}\) \(70\)
trager \(-\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (\frac {\sqrt {x^{2}+2}\, x +\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )}{x^{2}+1}\right )}{4}+\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) \ln \left (-\frac {-2 \operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right ) x^{2}+3 \sqrt {x^{2}+2}\, x -\operatorname {RootOf}\left (\textit {\_Z}^{2}-3\right )}{\left (-1+x \right ) \left (1+x \right )}\right )}{12}\) \(86\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 72 vs. \(2 (31) = 62\).

Time = 0.25 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.67 \[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=\frac {1}{12} \, \sqrt {3} \log \left (\frac {4 \, x^{2} - \sqrt {3} {\left (2 \, x^{2} + 1\right )} - \sqrt {x^{2} + 2} {\left (2 \, \sqrt {3} x - 3 \, x\right )} + 2}{x^{2} - 1}\right ) - \frac {1}{2} \, \arctan \left (-x^{2} + \sqrt {x^{2} + 2} x - 1\right ) \]

[In]

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

[Out]

1/12*sqrt(3)*log((4*x^2 - sqrt(3)*(2*x^2 + 1) - sqrt(x^2 + 2)*(2*sqrt(3)*x - 3*x) + 2)/(x^2 - 1)) - 1/2*arctan
(-x^2 + sqrt(x^2 + 2)*x - 1)

Sympy [F]

\[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=\int \frac {1}{\left (x - 1\right ) \left (x + 1\right ) \left (x^{2} + 1\right ) \sqrt {x^{2} + 2}}\, dx \]

[In]

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

[Out]

Integral(1/((x - 1)*(x + 1)*(x**2 + 1)*sqrt(x**2 + 2)), x)

Maxima [F]

\[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=\int { \frac {1}{{\left (x^{4} - 1\right )} \sqrt {x^{2} + 2}} \,d x } \]

[In]

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

[Out]

integrate(1/((x^4 - 1)*sqrt(x^2 + 2)), x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (31) = 62\).

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

[In]

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

[Out]

-1/12*sqrt(3)*log(abs(2*(x - sqrt(x^2 + 2))^2 - 4*sqrt(3) - 8)/abs(2*(x - sqrt(x^2 + 2))^2 + 4*sqrt(3) - 8)) +
 1/2*arctan(1/2*(x - sqrt(x^2 + 2))^2)

Mupad [B] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 107, normalized size of antiderivative = 2.49 \[ \int \frac {1}{\sqrt {2+x^2} \left (-1+x^4\right )} \, dx=\frac {\sqrt {3}\,\left (\ln \left (x-1\right )-\ln \left (x+\sqrt {3}\,\sqrt {x^2+2}+2\right )\right )}{12}-\frac {\sqrt {3}\,\left (\ln \left (x+1\right )-\ln \left (\sqrt {3}\,\sqrt {x^2+2}-x+2\right )\right )}{12}+\frac {\ln \left (\sqrt {x^2+2}+2-x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4}-\frac {\ln \left (\sqrt {x^2+2}+2+x\,1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4}+\frac {\ln \left (x-\mathrm {i}\right )\,1{}\mathrm {i}}{4}-\frac {\ln \left (x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{4} \]

[In]

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

[Out]

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