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

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

Optimal result

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

[Out]

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

Rubi [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 0.29 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.95, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {6874, 2157, 212, 2158, 327, 222, 221} \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}} \, dx=-\frac {\arcsin \left (\sqrt [4]{-1} x\right )}{2 \sqrt {2}}+\frac {i \text {arcsinh}\left (\sqrt [4]{-1} x\right )}{2 \sqrt {2}}-\frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {\sqrt {x^4+1}+x^2}}\right )}{\sqrt {2}}+\left (\frac {1}{4}+\frac {i}{4}\right ) \sqrt {1-i x^2} x+\left (\frac {1}{4}-\frac {i}{4}\right ) \sqrt {1+i x^2} x \]

[In]

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

[Out]

(1/4 + I/4)*x*Sqrt[1 - I*x^2] + (1/4 - I/4)*x*Sqrt[1 + I*x^2] - ArcSin[(-1)^(1/4)*x]/(2*Sqrt[2]) + ((I/2)*ArcS
inh[(-1)^(1/4)*x])/Sqrt[2] - ArcTanh[(Sqrt[2]*x)/Sqrt[x^2 + Sqrt[1 + x^4]]]/Sqrt[2]

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 221

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

Rule 222

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

Rule 327

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

Rule 2157

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

Rule 2158

Int[(((c_.) + (d_.)*(x_))^(m_.)*Sqrt[(b_.)*(x_)^2 + Sqrt[(a_) + (e_.)*(x_)^4]])/Sqrt[(a_) + (e_.)*(x_)^4], x_S
ymbol] :> Dist[(1 - I)/2, Int[(c + d*x)^m/Sqrt[Sqrt[a] - I*b*x^2], x], x] + Dist[(1 + I)/2, Int[(c + d*x)^m/Sq
rt[Sqrt[a] + I*b*x^2], x], x] /; FreeQ[{a, b, c, d, m}, x] && EqQ[e, b^2] && GtQ[a, 0]

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {\sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}}+\frac {x^2 \sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}}\right ) \, dx \\ & = -\int \frac {\sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}} \, dx+\int \frac {x^2 \sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}} \, dx \\ & = \left (\frac {1}{2}-\frac {i}{2}\right ) \int \frac {x^2}{\sqrt {1-i x^2}} \, dx+\left (\frac {1}{2}+\frac {i}{2}\right ) \int \frac {x^2}{\sqrt {1+i x^2}} \, dx-\text {Subst}\left (\int \frac {1}{1-2 x^2} \, dx,x,\frac {x}{\sqrt {x^2+\sqrt {1+x^4}}}\right ) \\ & = \left (\frac {1}{4}+\frac {i}{4}\right ) x \sqrt {1-i x^2}+\left (\frac {1}{4}-\frac {i}{4}\right ) x \sqrt {1+i x^2}-\frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {x^2+\sqrt {1+x^4}}}\right )}{\sqrt {2}}+\left (-\frac {1}{4}-\frac {i}{4}\right ) \int \frac {1}{\sqrt {1-i x^2}} \, dx+\left (-\frac {1}{4}+\frac {i}{4}\right ) \int \frac {1}{\sqrt {1+i x^2}} \, dx \\ & = \left (\frac {1}{4}+\frac {i}{4}\right ) x \sqrt {1-i x^2}+\left (\frac {1}{4}-\frac {i}{4}\right ) x \sqrt {1+i x^2}-\frac {\arcsin \left (\sqrt [4]{-1} x\right )}{2 \sqrt {2}}+\frac {i \text {arcsinh}\left (\sqrt [4]{-1} x\right )}{2 \sqrt {2}}-\frac {\text {arctanh}\left (\frac {\sqrt {2} x}{\sqrt {x^2+\sqrt {1+x^4}}}\right )}{\sqrt {2}} \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [F]

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

[In]

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

[Out]

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

Fricas [F(-1)]

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

[In]

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

[Out]

Timed out

Sympy [A] (verification not implemented)

Time = 2.32 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.27 \[ \int \frac {\left (-1+x^2\right ) \sqrt {x^2+\sqrt {1+x^4}}}{\sqrt {1+x^4}} \, dx=- \frac {{G_{3, 3}^{2, 2}\left (\begin {matrix} 1, 1 & \frac {1}{2} \\\frac {1}{4}, \frac {3}{4} & 0 \end {matrix} \middle | {x^{4}} \right )}}{4 \sqrt {\pi }} + \frac {{G_{3, 3}^{2, 2}\left (\begin {matrix} \frac {3}{2}, 1 & 1 \\\frac {3}{4}, \frac {5}{4} & 0 \end {matrix} \middle | {x^{4}} \right )}}{4 \sqrt {\pi }} \]

[In]

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

[Out]

-meijerg(((1, 1), (1/2,)), ((1/4, 3/4), (0,)), x**4)/(4*sqrt(pi)) + meijerg(((3/2, 1), (1,)), ((3/4, 5/4), (0,
)), x**4)/(4*sqrt(pi))

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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