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

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

Optimal result

Integrand size = 21, antiderivative size = 30 \[ \int \frac {-1+2 x}{\sqrt {1+x-2 x^3+x^4}} \, dx=-\log \left (1+2 x-2 x^2+2 \sqrt {1+x-2 x^3+x^4}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.77, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {1694, 12, 1121, 633, 221} \[ \int \frac {-1+2 x}{\sqrt {1+x-2 x^3+x^4}} \, dx=-\text {arcsinh}\left (\frac {3-4 \left (x-\frac {1}{2}\right )^2}{2 \sqrt {3}}\right ) \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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 633

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[1/(2*c*(-4*(c/(b^2 - 4*a*c)))^p), Subst[Int[Si
mp[1 - x^2/(b^2 - 4*a*c), x]^p, x], x, b + 2*c*x], x] /; FreeQ[{a, b, c, p}, x] && GtQ[4*a - b^2/c, 0]

Rule 1121

Int[(x_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Dist[1/2, Subst[Int[(a + b*x + c*x^2)^p, x],
 x, x^2], x] /; FreeQ[{a, b, c, p}, x]

Rule 1694

Int[(Pq_)*(Q4_)^(p_), x_Symbol] :> With[{a = Coeff[Q4, x, 0], b = Coeff[Q4, x, 1], c = Coeff[Q4, x, 2], d = Co
eff[Q4, x, 3], e = Coeff[Q4, x, 4]}, Subst[Int[SimplifyIntegrand[(Pq /. x -> -d/(4*e) + x)*(a + d^4/(256*e^3)
- b*(d/(8*e)) + (c - 3*(d^2/(8*e)))*x^2 + e*x^4)^p, x], x], x, d/(4*e) + x] /; EqQ[d^3 - 4*c*d*e + 8*b*e^2, 0]
 && NeQ[d, 0]] /; FreeQ[p, x] && PolyQ[Pq, x] && PolyQ[Q4, x, 4] &&  !IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {8 x}{\sqrt {21-24 x^2+16 x^4}} \, dx,x,-\frac {1}{2}+x\right ) \\ & = 8 \text {Subst}\left (\int \frac {x}{\sqrt {21-24 x^2+16 x^4}} \, dx,x,-\frac {1}{2}+x\right ) \\ & = 4 \text {Subst}\left (\int \frac {1}{\sqrt {21-24 x+16 x^2}} \, dx,x,\left (-\frac {1}{2}+x\right )^2\right ) \\ & = \frac {\text {Subst}\left (\int \frac {1}{\sqrt {1+\frac {x^2}{768}}} \, dx,x,8 \left (-3+4 \left (-\frac {1}{2}+x\right )^2\right )\right )}{16 \sqrt {3}} \\ & = -\text {arcsinh}\left (\frac {3-(-1+2 x)^2}{2 \sqrt {3}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 28, normalized size of antiderivative = 0.93 \[ \int \frac {-1+2 x}{\sqrt {1+x-2 x^3+x^4}} \, dx=\log \left (-1-2 x+2 x^2+2 \sqrt {1+x-2 x^3+x^4}\right ) \]

[In]

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

[Out]

Log[-1 - 2*x + 2*x^2 + 2*Sqrt[1 + x - 2*x^3 + x^4]]

Maple [A] (verified)

Time = 1.84 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.57

method result size
default \(\operatorname {arcsinh}\left (\frac {\sqrt {3}\, \left (2 x^{2}-2 x -1\right )}{3}\right )\) \(17\)
pseudoelliptic \(\operatorname {arcsinh}\left (\frac {\sqrt {3}\, \left (2 x^{2}-2 x -1\right )}{3}\right )\) \(17\)
trager \(\ln \left (2 x^{2}+2 \sqrt {x^{4}-2 x^{3}+x +1}-2 x -1\right )\) \(27\)
elliptic \(\text {Expression too large to display}\) \(1358\)

[In]

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

[Out]

arcsinh(1/3*3^(1/2)*(2*x^2-2*x-1))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.87 \[ \int \frac {-1+2 x}{\sqrt {1+x-2 x^3+x^4}} \, dx=\log \left (2 \, x^{2} - 2 \, x + 2 \, \sqrt {x^{4} - 2 \, x^{3} + x + 1} - 1\right ) \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (28) = 56\).

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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