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

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

Optimal result

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

[Out]

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

Rubi [F]

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

[In]

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

[Out]

(2*Sqrt[x]*Sqrt[1 + x^3]*ArcSinh[x^(3/2)])/(3*Sqrt[x + x^4]) + (x*(1 + x)*Sqrt[(1 - x + x^2)/(1 + (1 + Sqrt[3]
)*x)^2]*EllipticF[ArcCos[(1 + (1 - Sqrt[3])*x)/(1 + (1 + Sqrt[3])*x)], (2 + Sqrt[3])/4])/(3^(1/4)*Sqrt[(x*(1 +
 x))/(1 + (1 + Sqrt[3])*x)^2]*Sqrt[x + x^4]) - (3*Sqrt[x]*Sqrt[1 + x^3]*Defer[Subst][Defer[Int][1/((1 - Sqrt[2
]*x)*Sqrt[1 + x^6]), x], x, Sqrt[x]])/Sqrt[x + x^4] - (3*Sqrt[x]*Sqrt[1 + x^3]*Defer[Subst][Defer[Int][1/((1 +
 Sqrt[2]*x)*Sqrt[1 + x^6]), x], x, Sqrt[x]])/Sqrt[x + x^4]

Rubi steps \begin{align*} \text {integral}& = \frac {\left (\sqrt {x} \sqrt {1+x^3}\right ) \int \frac {2+x+2 x^2}{\sqrt {x} (-1+2 x) \sqrt {1+x^3}} \, dx}{\sqrt {x+x^4}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {2+x^2+2 x^4}{\left (-1+2 x^2\right ) \sqrt {1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \left (\frac {1}{\sqrt {1+x^6}}+\frac {x^2}{\sqrt {1+x^6}}+\frac {3}{\left (-1+2 x^2\right ) \sqrt {1+x^6}}\right ) \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}} \\ & = \frac {\left (2 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}}+\frac {\left (2 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {x^2}{\sqrt {1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}}+\frac {\left (6 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\left (-1+2 x^2\right ) \sqrt {1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}} \\ & = \frac {x (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\left (1+\sqrt {3}\right ) x\right )^2}} \operatorname {EllipticF}\left (\arccos \left (\frac {1+\left (1-\sqrt {3}\right ) x}{1+\left (1+\sqrt {3}\right ) x}\right ),\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {\frac {x (1+x)}{\left (1+\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {x+x^4}}+\frac {\left (2 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1+x^2}} \, dx,x,x^{3/2}\right )}{3 \sqrt {x+x^4}}+\frac {\left (6 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \left (-\frac {1}{2 \left (1-\sqrt {2} x\right ) \sqrt {1+x^6}}-\frac {1}{2 \left (1+\sqrt {2} x\right ) \sqrt {1+x^6}}\right ) \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}} \\ & = \frac {2 \sqrt {x} \sqrt {1+x^3} \text {arcsinh}\left (x^{3/2}\right )}{3 \sqrt {x+x^4}}+\frac {x (1+x) \sqrt {\frac {1-x+x^2}{\left (1+\left (1+\sqrt {3}\right ) x\right )^2}} \operatorname {EllipticF}\left (\arccos \left (\frac {1+\left (1-\sqrt {3}\right ) x}{1+\left (1+\sqrt {3}\right ) x}\right ),\frac {1}{4} \left (2+\sqrt {3}\right )\right )}{\sqrt [4]{3} \sqrt {\frac {x (1+x)}{\left (1+\left (1+\sqrt {3}\right ) x\right )^2}} \sqrt {x+x^4}}-\frac {\left (3 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\left (1-\sqrt {2} x\right ) \sqrt {1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}}-\frac {\left (3 \sqrt {x} \sqrt {1+x^3}\right ) \text {Subst}\left (\int \frac {1}{\left (1+\sqrt {2} x\right ) \sqrt {1+x^6}} \, dx,x,\sqrt {x}\right )}{\sqrt {x+x^4}} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(44\) vs. \(2(17)=34\).

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

[In]

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

[Out]

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

Maple [B] (verified)

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

Time = 3.66 (sec) , antiderivative size = 45, normalized size of antiderivative = 2.65

method result size
trager \(\ln \left (-\frac {2 x^{3}+2 x \sqrt {x^{4}+x}-4 x^{2}-4 \sqrt {x^{4}+x}+4 x +1}{\left (-1+2 x \right )^{2}}\right )\) \(45\)
default \(-\frac {2 \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {\frac {\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) x}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}\, \left (1+x \right )^{2} \sqrt {-\frac {x -\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\left (\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}\, \sqrt {-\frac {x -\frac {1}{2}-\frac {i \sqrt {3}}{2}}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}\, \operatorname {EllipticF}\left (\sqrt {\frac {\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) x}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}, \sqrt {\frac {\left (-\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}{\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (-\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\right )}{\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) \sqrt {x \left (1+x \right ) \left (x -\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (x -\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}}-\frac {\ln \left (2 x^{3}-2 x \sqrt {x^{4}+x}+1\right )}{3}+\frac {2 \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \sqrt {\frac {\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) x}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}\, \left (1+x \right )^{2} \sqrt {-\frac {x -\frac {1}{2}+\frac {i \sqrt {3}}{2}}{\left (\frac {1}{2}-\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}\, \sqrt {-\frac {x -\frac {1}{2}-\frac {i \sqrt {3}}{2}}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}\, \left (\operatorname {EllipticF}\left (\sqrt {\frac {\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) x}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}, \sqrt {\frac {\left (-\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}{\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (-\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\right )+2 \operatorname {EllipticPi}\left (\sqrt {\frac {\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) x}{\left (\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (1+x \right )}}, \frac {\frac {3}{2}+\frac {3 i \sqrt {3}}{2}}{\frac {3}{2}+\frac {i \sqrt {3}}{2}}, \sqrt {\frac {\left (-\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) \left (-\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}{\left (-\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (-\frac {3}{2}-\frac {i \sqrt {3}}{2}\right )}}\right )\right )}{\left (\frac {3}{2}+\frac {i \sqrt {3}}{2}\right ) \sqrt {x \left (1+x \right ) \left (x -\frac {1}{2}+\frac {i \sqrt {3}}{2}\right ) \left (x -\frac {1}{2}-\frac {i \sqrt {3}}{2}\right )}}\) \(512\)
elliptic \(\text {Expression too large to display}\) \(781\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

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

Time = 0.27 (sec) , antiderivative size = 70, normalized size of antiderivative = 4.12 \[ \int \frac {2+x+2 x^2}{(-1+2 x) \sqrt {x+x^4}} \, dx=\frac {1}{3} \, \log \left (-2 \, x^{3} - 2 \, \sqrt {x^{4} + x} x - 1\right ) + \frac {2}{3} \, \log \left (-\frac {10 \, x^{3} - 6 \, x^{2} - 6 \, \sqrt {x^{4} + x} {\left (x + 1\right )} + 12 \, x + 1}{8 \, x^{3} - 12 \, x^{2} + 6 \, x - 1}\right ) \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [F]

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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