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

   Optimal result
   Rubi [C] (warning: unable to verify)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

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

[Out]

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

Rubi [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.

Time = 1.91 (sec) , antiderivative size = 1670, normalized size of antiderivative = 35.53, number of steps used = 52, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.351, Rules used = {6857, 1222, 1201, 1112, 1198, 1228, 1470, 554, 432, 430, 552, 551, 6860} \[ \int \frac {\left (1+x^4\right ) \sqrt {-1+2 x^2+x^4}}{\left (-1+x^4\right ) \left (-1+x^2+x^4\right )} \, dx=\frac {\sqrt {3-2 \sqrt {2}} \left (1-\sqrt {5}\right ) \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\left (1-2 \sqrt {2}+\sqrt {5}\right ) \sqrt {x^4+2 x^2-1}}+\frac {\sqrt {3-2 \sqrt {2}} \left (1+\sqrt {5}\right ) \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\left (1-2 \sqrt {2}-\sqrt {5}\right ) \sqrt {x^4+2 x^2-1}}+\frac {\sqrt {2 \left (3-2 \sqrt {2}\right )} \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\sqrt {x^4+2 x^2-1}}+\frac {\sqrt {2} \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\sqrt {x^4+2 x^2-1}}-\frac {\left (1+2 \sqrt {2}+\sqrt {5}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {\left (1+\sqrt {2}\right ) x^2-1} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {\left (1+\sqrt {2}\right ) x^2-1}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{2\ 2^{3/4} \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {x^4+2 x^2-1}}-\frac {\left (1-\sqrt {5}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {\left (1+\sqrt {2}\right ) x^2-1} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {\left (1+\sqrt {2}\right ) x^2-1}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{2^{3/4} \left (1-2 \sqrt {2}+\sqrt {5}\right ) \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {x^4+2 x^2-1}}-\frac {\left (1+\sqrt {5}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {\left (1+\sqrt {2}\right ) x^2-1} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {\left (1+\sqrt {2}\right ) x^2-1}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{2^{3/4} \left (1-2 \sqrt {2}-\sqrt {5}\right ) \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {x^4+2 x^2-1}}-\frac {\left (1+2 \sqrt {2}-\sqrt {5}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {\left (1+\sqrt {2}\right ) x^2-1} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {\left (1+\sqrt {2}\right ) x^2-1}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{2\ 2^{3/4} \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {x^4+2 x^2-1}}+\frac {\left (1+\sqrt {2}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {\left (1+\sqrt {2}\right ) x^2-1} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {\left (1+\sqrt {2}\right ) x^2-1}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\sqrt [4]{2} \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {x^4+2 x^2-1}}-\frac {\sqrt [4]{2} \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {\left (1+\sqrt {2}\right ) x^2-1} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {\left (1+\sqrt {2}\right ) x^2-1}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\left (2-\sqrt {2}\right ) \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {x^4+2 x^2-1}}-\frac {2 \sqrt {3-2 \sqrt {2}} \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticPi}\left (1-\sqrt {2},\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\sqrt {x^4+2 x^2-1}}-\frac {2 \sqrt {3-2 \sqrt {2}} \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticPi}\left (-1+\sqrt {2},\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\sqrt {x^4+2 x^2-1}}+\frac {\sqrt {3-2 \sqrt {2}} \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticPi}\left (\frac {2 \left (1-\sqrt {2}\right )}{1-\sqrt {5}},\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\sqrt {x^4+2 x^2-1}}+\frac {\sqrt {3-2 \sqrt {2}} \sqrt {x^2+\sqrt {2}+1} \sqrt {1-\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticPi}\left (\frac {2 \left (1-\sqrt {2}\right )}{1+\sqrt {5}},\arcsin \left (\sqrt {1+\sqrt {2}} x\right ),-3+2 \sqrt {2}\right )}{\sqrt {x^4+2 x^2-1}} \]

[In]

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

[Out]

(Sqrt[2]*Sqrt[1 + Sqrt[2] + x^2]*Sqrt[1 - (1 + Sqrt[2])*x^2]*EllipticF[ArcSin[Sqrt[1 + Sqrt[2]]*x], -3 + 2*Sqr
t[2]])/Sqrt[-1 + 2*x^2 + x^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S
qrt[2])*x^2]*EllipticPi[1 - Sqrt[2], ArcSin[Sqrt[1 + Sqrt[2]]*x], -3 + 2*Sqrt[2]])/Sqrt[-1 + 2*x^2 + x^4] - (2
*Sqrt[3 - 2*Sqrt[2]]*Sqrt[1 + Sqrt[2] + x^2]*Sqrt[1 - (1 + Sqrt[2])*x^2]*EllipticPi[-1 + Sqrt[2], ArcSin[Sqrt[
1 + Sqrt[2]]*x], -3 + 2*Sqrt[2]])/Sqrt[-1 + 2*x^2 + x^4] + (Sqrt[3 - 2*Sqrt[2]]*Sqrt[1 + Sqrt[2] + x^2]*Sqrt[1
 - (1 + Sqrt[2])*x^2]*EllipticPi[(2*(1 - Sqrt[2]))/(1 - Sqrt[5]), ArcSin[Sqrt[1 + Sqrt[2]]*x], -3 + 2*Sqrt[2]]
)/Sqrt[-1 + 2*x^2 + x^4] + (Sqrt[3 - 2*Sqrt[2]]*Sqrt[1 + Sqrt[2] + x^2]*Sqrt[1 - (1 + Sqrt[2])*x^2]*EllipticPi
[(2*(1 - Sqrt[2]))/(1 + Sqrt[5]), ArcSin[Sqrt[1 + Sqrt[2]]*x], -3 + 2*Sqrt[2]])/Sqrt[-1 + 2*x^2 + x^4]

Rule 430

Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> Simp[(1/(Sqrt[a]*Sqrt[c]*Rt[-d/c, 2]
))*EllipticF[ArcSin[Rt[-d/c, 2]*x], b*(c/(a*d))], x] /; FreeQ[{a, b, c, d}, x] && NegQ[d/c] && GtQ[c, 0] && Gt
Q[a, 0] &&  !(NegQ[b/a] && SimplerSqrtQ[-b/a, -d/c])

Rule 432

Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*Sqrt[(c_) + (d_.)*(x_)^2]), x_Symbol] :> Dist[Sqrt[1 + (d/c)*x^2]/Sqrt[c + d*
x^2], Int[1/(Sqrt[a + b*x^2]*Sqrt[1 + (d/c)*x^2]), x], x] /; FreeQ[{a, b, c, d}, x] &&  !GtQ[c, 0]

Rule 551

Int[1/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]*Sqrt[(e_) + (f_.)*(x_)^2]), x_Symbol] :> Simp[(1/(a*Sqr
t[c]*Sqrt[e]*Rt[-d/c, 2]))*EllipticPi[b*(c/(a*d)), ArcSin[Rt[-d/c, 2]*x], c*(f/(d*e))], x] /; FreeQ[{a, b, c,
d, e, f}, x] &&  !GtQ[d/c, 0] && GtQ[c, 0] && GtQ[e, 0] &&  !( !GtQ[f/e, 0] && SimplerSqrtQ[-f/e, -d/c])

Rule 552

Int[1/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]*Sqrt[(e_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[Sqrt[1 +
(d/c)*x^2]/Sqrt[c + d*x^2], Int[1/((a + b*x^2)*Sqrt[1 + (d/c)*x^2]*Sqrt[e + f*x^2]), x], x] /; FreeQ[{a, b, c,
 d, e, f}, x] &&  !GtQ[c, 0]

Rule 554

Int[Sqrt[(c_) + (d_.)*(x_)^2]/(((a_) + (b_.)*(x_)^2)*Sqrt[(e_) + (f_.)*(x_)^2]), x_Symbol] :> Dist[d/b, Int[1/
(Sqrt[c + d*x^2]*Sqrt[e + f*x^2]), x], x] + Dist[(b*c - a*d)/b, Int[1/((a + b*x^2)*Sqrt[c + d*x^2]*Sqrt[e + f*
x^2]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NegQ[d/c]

Rule 1112

Int[1/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[Sqrt[(2*a + (
b - q)*x^2)/(2*a + (b + q)*x^2)]*(Sqrt[(2*a + (b + q)*x^2)/q]/(2*Sqrt[a + b*x^2 + c*x^4]*Sqrt[a/(2*a + (b + q)
*x^2)]))*EllipticF[ArcSin[x/Sqrt[(2*a + (b + q)*x^2)/(2*q)]], (b + q)/(2*q)], x]] /; FreeQ[{a, b, c}, x] && Gt
Q[b^2 - 4*a*c, 0] && LtQ[a, 0] && GtQ[c, 0]

Rule 1198

Int[((d_) + (e_.)*(x_)^2)/Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4], x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}
, Simp[e*x*((b + q + 2*c*x^2)/(2*c*Sqrt[a + b*x^2 + c*x^4])), x] - Simp[e*q*Sqrt[(2*a + (b - q)*x^2)/(2*a + (b
 + q)*x^2)]*(Sqrt[(2*a + (b + q)*x^2)/q]/(2*c*Sqrt[a + b*x^2 + c*x^4]*Sqrt[a/(2*a + (b + q)*x^2)]))*EllipticE[
ArcSin[x/Sqrt[(2*a + (b + q)*x^2)/(2*q)]], (b + q)/(2*q)], x] /; EqQ[2*c*d - e*(b - q), 0]] /; FreeQ[{a, b, c,
 d, e}, x] && GtQ[b^2 - 4*a*c, 0] && LtQ[a, 0] && GtQ[c, 0]

Rule 1201

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

Rule 1222

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[-(e^2)^(-1), Int[(c*d -
 b*e - c*e*x^2)*(a + b*x^2 + c*x^4)^(p - 1), x], x] + Dist[(c*d^2 - b*d*e + a*e^2)/e^2, Int[(a + b*x^2 + c*x^4
)^(p - 1)/(d + e*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2
, 0] && IGtQ[p + 1/2, 0]

Rule 1228

Int[1/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4]), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c,
 2]}, Dist[2*(c/(2*c*d - e*(b - q))), Int[1/Sqrt[a + b*x^2 + c*x^4], x], x] - Dist[e/(2*c*d - e*(b - q)), Int[
(b - q + 2*c*x^2)/((d + e*x^2)*Sqrt[a + b*x^2 + c*x^4]), x], x]] /; FreeQ[{a, b, c, d, e}, x] && GtQ[b^2 - 4*a
*c, 0] &&  !LtQ[c, 0]

Rule 1470

Int[((d_) + (e_.)*(x_)^(n_))^(q_.)*((f_) + (g_.)*(x_)^(n_))^(r_.)*((a_) + (b_.)*(x_)^(n_) + (c_.)*(x_)^(n2_))^
(p_), x_Symbol] :> Dist[(a + b*x^n + c*x^(2*n))^FracPart[p]/((d + e*x^n)^FracPart[p]*(a/d + (c*x^n)/e)^FracPar
t[p]), Int[(d + e*x^n)^(p + q)*(f + g*x^n)^r*(a/d + (c/e)*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p,
q, r}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && EqQ[c*d^2 - b*d*e + a*e^2, 0] &&  !IntegerQ[p]

Rule 6857

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rule 6860

Int[(u_)/((a_.) + (b_.)*(x_)^(n_.) + (c_.)*(x_)^(n2_.)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a +
b*x^n + c*x^(2*n)), x]}, Int[v, x] /; SumQ[v]] /; FreeQ[{a, b, c}, x] && EqQ[n2, 2*n] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {\sqrt {-1+2 x^2+x^4}}{-1+x^2}+\frac {\sqrt {-1+2 x^2+x^4}}{1+x^2}+\frac {\left (-1-2 x^2\right ) \sqrt {-1+2 x^2+x^4}}{-1+x^2+x^4}\right ) \, dx \\ & = \int \frac {\sqrt {-1+2 x^2+x^4}}{-1+x^2} \, dx+\int \frac {\sqrt {-1+2 x^2+x^4}}{1+x^2} \, dx+\int \frac {\left (-1-2 x^2\right ) \sqrt {-1+2 x^2+x^4}}{-1+x^2+x^4} \, dx \\ & = 2 \int \frac {1}{\left (-1+x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx-2 \int \frac {1}{\left (1+x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx-\int \frac {-3-x^2}{\sqrt {-1+2 x^2+x^4}} \, dx-\int \frac {-1-x^2}{\sqrt {-1+2 x^2+x^4}} \, dx+\int \left (-\frac {2 \sqrt {-1+2 x^2+x^4}}{1-\sqrt {5}+2 x^2}-\frac {2 \sqrt {-1+2 x^2+x^4}}{1+\sqrt {5}+2 x^2}\right ) \, dx \\ & = 2 \left (\frac {1}{2} \int \frac {2-2 \sqrt {2}+2 x^2}{\sqrt {-1+2 x^2+x^4}} \, dx\right )-2 \int \frac {\sqrt {-1+2 x^2+x^4}}{1-\sqrt {5}+2 x^2} \, dx-2 \int \frac {\sqrt {-1+2 x^2+x^4}}{1+\sqrt {5}+2 x^2} \, dx+\frac {\int \frac {2-2 \sqrt {2}+2 x^2}{\left (1+x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx}{\sqrt {2}}+\left (2+\sqrt {2}\right ) \int \frac {1}{\sqrt {-1+2 x^2+x^4}} \, dx-\frac {2 \int \frac {2-2 \sqrt {2}+2 x^2}{\left (-1+x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx}{-4+2 \sqrt {2}}+\frac {4 \int \frac {1}{\sqrt {-1+2 x^2+x^4}} \, dx}{-4+2 \sqrt {2}} \\ & = 2 \left (\frac {x \left (1+\sqrt {2}+x^2\right )}{\sqrt {-1+2 x^2+x^4}}-\frac {2^{3/4} \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+\left (1+\sqrt {2}\right ) x^2} E\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {-1+\left (1+\sqrt {2}\right ) x^2}}\right )|\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+2 x^2+x^4}}\right )-\frac {\sqrt [4]{2} \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {-1+\left (1+\sqrt {2}\right ) x^2}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\left (2-\sqrt {2}\right ) \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+2 x^2+x^4}}+\frac {\left (1+\sqrt {2}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {-1+\left (1+\sqrt {2}\right ) x^2}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\sqrt [4]{2} \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+2 x^2+x^4}}+\frac {1}{2} \int \frac {-3-\sqrt {5}-2 x^2}{\sqrt {-1+2 x^2+x^4}} \, dx+\frac {1}{2} \int \frac {-3+\sqrt {5}-2 x^2}{\sqrt {-1+2 x^2+x^4}} \, dx-\left (-1-\sqrt {5}\right ) \int \frac {1}{\left (1+\sqrt {5}+2 x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx-\left (-1+\sqrt {5}\right ) \int \frac {1}{\left (1-\sqrt {5}+2 x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx+\frac {\left (\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}\right ) \int \frac {\sqrt {2-2 \sqrt {2}+2 x^2}}{\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \left (1+x^2\right )} \, dx}{\sqrt {2} \sqrt {-1+2 x^2+x^4}}-\frac {\left (2 \sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}\right ) \int \frac {\sqrt {2-2 \sqrt {2}+2 x^2}}{\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \left (-1+x^2\right )} \, dx}{\left (-4+2 \sqrt {2}\right ) \sqrt {-1+2 x^2+x^4}} \\ & = 2 \left (\frac {x \left (1+\sqrt {2}+x^2\right )}{\sqrt {-1+2 x^2+x^4}}-\frac {2^{3/4} \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+\left (1+\sqrt {2}\right ) x^2} E\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {-1+\left (1+\sqrt {2}\right ) x^2}}\right )|\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+2 x^2+x^4}}\right )-\frac {\sqrt [4]{2} \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {-1+\left (1+\sqrt {2}\right ) x^2}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\left (2-\sqrt {2}\right ) \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+2 x^2+x^4}}+\frac {\left (1+\sqrt {2}\right ) \sqrt {\frac {1-\left (1-\sqrt {2}\right ) x^2}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+\left (1+\sqrt {2}\right ) x^2} \operatorname {EllipticF}\left (\arcsin \left (\frac {2^{3/4} x}{\sqrt {-1+\left (1+\sqrt {2}\right ) x^2}}\right ),\frac {1}{4} \left (2+\sqrt {2}\right )\right )}{\sqrt [4]{2} \sqrt {\frac {1}{1-\left (1+\sqrt {2}\right ) x^2}} \sqrt {-1+2 x^2+x^4}}-2 \left (\frac {1}{2} \int \frac {2-2 \sqrt {2}+2 x^2}{\sqrt {-1+2 x^2+x^4}} \, dx\right )+\frac {1}{2} \left (-1-2 \sqrt {2}-\sqrt {5}\right ) \int \frac {1}{\sqrt {-1+2 x^2+x^4}} \, dx-\frac {\left (1+\sqrt {5}\right ) \int \frac {1}{\sqrt {-1+2 x^2+x^4}} \, dx}{1-2 \sqrt {2}-\sqrt {5}}+\frac {\left (1+\sqrt {5}\right ) \int \frac {2-2 \sqrt {2}+2 x^2}{\left (1+\sqrt {5}+2 x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx}{1-2 \sqrt {2}-\sqrt {5}}+\frac {1}{2} \left (-1-2 \sqrt {2}+\sqrt {5}\right ) \int \frac {1}{\sqrt {-1+2 x^2+x^4}} \, dx-\frac {\left (1-\sqrt {5}\right ) \int \frac {1}{\sqrt {-1+2 x^2+x^4}} \, dx}{1-2 \sqrt {2}+\sqrt {5}}+\frac {\left (1-\sqrt {5}\right ) \int \frac {2-2 \sqrt {2}+2 x^2}{\left (1-\sqrt {5}+2 x^2\right ) \sqrt {-1+2 x^2+x^4}} \, dx}{1-2 \sqrt {2}+\sqrt {5}}-\frac {\left (2 \sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}\right ) \int \frac {1}{\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \left (1+x^2\right ) \sqrt {2-2 \sqrt {2}+2 x^2}} \, dx}{\sqrt {-1+2 x^2+x^4}}+\frac {\left (\sqrt {2} \sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}\right ) \int \frac {1}{\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}} \, dx}{\sqrt {-1+2 x^2+x^4}}-\frac {\left (4 \sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}\right ) \int \frac {1}{\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}} \, dx}{\left (-4+2 \sqrt {2}\right ) \sqrt {-1+2 x^2+x^4}}-\frac {\left (4 \left (2-\sqrt {2}\right ) \sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \sqrt {2-2 \sqrt {2}+2 x^2}\right ) \int \frac {1}{\sqrt {-\frac {1}{2-2 \sqrt {2}}+\frac {x^2}{2}} \left (-1+x^2\right ) \sqrt {2-2 \sqrt {2}+2 x^2}} \, dx}{\left (-4+2 \sqrt {2}\right ) \sqrt {-1+2 x^2+x^4}} \\ & = \text {Too large to display} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.30 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00 \[ \int \frac {\left (1+x^4\right ) \sqrt {-1+2 x^2+x^4}}{\left (-1+x^4\right ) \left (-1+x^2+x^4\right )} \, dx=\text {arctanh}\left (\frac {x}{\sqrt {-1+2 x^2+x^4}}\right )-\sqrt {2} \text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {-1+2 x^2+x^4}}\right ) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 3.92 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.62

method result size
elliptic \(\frac {\left (\ln \left (\frac {\sqrt {x^{4}+2 x^{2}-1}\, \sqrt {2}}{2 x}-1\right )+\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {x^{4}+2 x^{2}-1}}{x}\right )-\ln \left (1+\frac {\sqrt {x^{4}+2 x^{2}-1}\, \sqrt {2}}{2 x}\right )\right ) \sqrt {2}}{2}\) \(76\)
default \(-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\left (1+i\right ) x^{2}+\left (2-2 i\right ) x -1+i\right )}{2 \sqrt {x^{4}+2 x^{2}-1}}\right )}{2}+\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (\left (1+i\right ) x^{2}+\left (-2+2 i\right ) x -1+i\right ) \sqrt {2}}{2 \sqrt {x^{4}+2 x^{2}-1}}\right )}{2}+\operatorname {arctanh}\left (\frac {\sqrt {x^{4}+2 x^{2}-1}}{x}\right )\) \(97\)
pseudoelliptic \(-\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {2}\, \left (\left (1+i\right ) x^{2}+\left (2-2 i\right ) x -1+i\right )}{2 \sqrt {x^{4}+2 x^{2}-1}}\right )}{2}+\frac {\sqrt {2}\, \operatorname {arctanh}\left (\frac {\left (\left (1+i\right ) x^{2}+\left (-2+2 i\right ) x -1+i\right ) \sqrt {2}}{2 \sqrt {x^{4}+2 x^{2}-1}}\right )}{2}+\operatorname {arctanh}\left (\frac {\sqrt {x^{4}+2 x^{2}-1}}{x}\right )\) \(97\)
trager \(-\frac {\ln \left (-\frac {-x^{4}+2 x \sqrt {x^{4}+2 x^{2}-1}-3 x^{2}+1}{x^{4}+x^{2}-1}\right )}{2}+\frac {\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) \ln \left (-\frac {-\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x^{4}-4 \operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right ) x^{2}+4 x \sqrt {x^{4}+2 x^{2}-1}+\operatorname {RootOf}\left (\textit {\_Z}^{2}-2\right )}{\left (x -1\right ) \left (1+x \right ) \left (x^{2}+1\right )}\right )}{2}\) \(116\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 109 vs. \(2 (39) = 78\).

Time = 0.29 (sec) , antiderivative size = 109, normalized size of antiderivative = 2.32 \[ \int \frac {\left (1+x^4\right ) \sqrt {-1+2 x^2+x^4}}{\left (-1+x^4\right ) \left (-1+x^2+x^4\right )} \, dx=\frac {1}{4} \, \sqrt {2} \log \left (-\frac {x^{8} + 16 \, x^{6} + 30 \, x^{4} - 4 \, \sqrt {2} {\left (x^{5} + 4 \, x^{3} - x\right )} \sqrt {x^{4} + 2 \, x^{2} - 1} - 16 \, x^{2} + 1}{x^{8} - 2 \, x^{4} + 1}\right ) + \frac {1}{2} \, \log \left (\frac {x^{4} + 3 \, x^{2} + 2 \, \sqrt {x^{4} + 2 \, x^{2} - 1} x - 1}{x^{4} + x^{2} - 1}\right ) \]

[In]

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

[Out]

1/4*sqrt(2)*log(-(x^8 + 16*x^6 + 30*x^4 - 4*sqrt(2)*(x^5 + 4*x^3 - x)*sqrt(x^4 + 2*x^2 - 1) - 16*x^2 + 1)/(x^8
 - 2*x^4 + 1)) + 1/2*log((x^4 + 3*x^2 + 2*sqrt(x^4 + 2*x^2 - 1)*x - 1)/(x^4 + x^2 - 1))

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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