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

Optimal. Leaf size=33 \[ -\log \left (-2+x-x^2+\sqrt {-4-4 x+5 x^2-2 x^3+x^4}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 37, normalized size of antiderivative = 1.12, number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {1694, 12, 1121, 635, 212} \begin {gather*} \tanh ^{-1}\left (\frac {4 \left (x-\frac {1}{2}\right )^2+7}{\sqrt {16 \left (x-\frac {1}{2}\right )^4+56 \left (x-\frac {1}{2}\right )^2-79}}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTanh[(7 + 4*(-1/2 + x)^2)/Sqrt[-79 + 56*(-1/2 + x)^2 + 16*(-1/2 + x)^4]]

Rule 12

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

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 635

Int[1/Sqrt[(a_) + (b_.)*(x_) + (c_.)*(x_)^2], x_Symbol] :> Dist[2, Subst[Int[1/(4*c - x^2), x], x, (b + 2*c*x)
/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*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*} \int \frac {-1+2 x}{\sqrt {-4-4 x+5 x^2-2 x^3+x^4}} \, dx &=\text {Subst}\left (\int \frac {8 x}{\sqrt {-79+56 x^2+16 x^4}} \, dx,x,-\frac {1}{2}+x\right )\\ &=8 \text {Subst}\left (\int \frac {x}{\sqrt {-79+56 x^2+16 x^4}} \, dx,x,-\frac {1}{2}+x\right )\\ &=4 \text {Subst}\left (\int \frac {1}{\sqrt {-79+56 x+16 x^2}} \, dx,x,\left (-\frac {1}{2}+x\right )^2\right )\\ &=8 \text {Subst}\left (\int \frac {1}{64-x^2} \, dx,x,\frac {8 \left (7+4 \left (-\frac {1}{2}+x\right )^2\right )}{\sqrt {-79+(1-2 x)^4+56 \left (-\frac {1}{2}+x\right )^2}}\right )\\ &=\tanh ^{-1}\left (\frac {7+(-1+2 x)^2}{\sqrt {-79+14 (1-2 x)^2+(1-2 x)^4}}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 33, normalized size = 1.00 \begin {gather*} -\log \left (-2+x-x^2+\sqrt {-4-4 x+5 x^2-2 x^3+x^4}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 1.86, size = 1382, normalized size = 41.88

method result size
trager \(\ln \left (x^{2}+\sqrt {x^{4}-2 x^{3}+5 x^{2}-4 x -4}-x +2\right )\) \(30\)
default \(\text {Expression too large to display}\) \(1382\)
elliptic \(\text {Expression too large to display}\) \(1382\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*I*(-1/2*I*(7+8*2^(1/2))^(1/2)-1/2*(-7+8*2^(1/2))^(1/2))*((1/2*(-7+8*2^(1/2))^(1/2)-1/2*I*(7+8*2^(1/2))^(1/2)
)*(x-1/2+1/2*I*(7+8*2^(1/2))^(1/2))/(1/2*(-7+8*2^(1/2))^(1/2)+1/2*I*(7+8*2^(1/2))^(1/2))/(x-1/2-1/2*I*(7+8*2^(
1/2))^(1/2)))^(1/2)*(x-1/2-1/2*I*(7+8*2^(1/2))^(1/2))^2*(I*(7+8*2^(1/2))^(1/2)*(x-1/2+1/2*(-7+8*2^(1/2))^(1/2)
)/(-1/2*(-7+8*2^(1/2))^(1/2)+1/2*I*(7+8*2^(1/2))^(1/2))/(x-1/2-1/2*I*(7+8*2^(1/2))^(1/2)))^(1/2)*(I*(7+8*2^(1/
2))^(1/2)*(x-1/2-1/2*(-7+8*2^(1/2))^(1/2))/(1/2*(-7+8*2^(1/2))^(1/2)+1/2*I*(7+8*2^(1/2))^(1/2))/(x-1/2-1/2*I*(
7+8*2^(1/2))^(1/2)))^(1/2)/(1/2*(-7+8*2^(1/2))^(1/2)-1/2*I*(7+8*2^(1/2))^(1/2))/(7+8*2^(1/2))^(1/2)/((x-1/2+1/
2*I*(7+8*2^(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1/2)-1/2*(-7+8*
2^(1/2))^(1/2))/(1/2*(-7+8*2^(1/2))^(1/2)-1/2*I*(7+8*2^(1/2))^(1/2))/(-1/2*(-7+8*2^(1/2))^(1/2)+1/2*I*(7+8*2^(
1/2))^(1/2)))^(1/2)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.44, size = 29, normalized size = 0.88 \begin {gather*} \log \left (x^{2} - x + \sqrt {x^{4} - 2 \, x^{3} + 5 \, x^{2} - 4 \, x - 4} + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {2 x - 1}{\sqrt {x^{4} - 2 x^{3} + 5 x^{2} - 4 x - 4}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 66 vs. \(2 (31) = 62\).
time = 0.40, size = 66, normalized size = 2.00 \begin {gather*} \frac {1}{2} \, \sqrt {{\left (x^{2} - x\right )}^{2} + 4 \, x^{2} - 4 \, x - 4} {\left (x^{2} - x + 2\right )} + 4 \, \log \left (x^{2} - x - \sqrt {{\left (x^{2} - x\right )}^{2} + 4 \, x^{2} - 4 \, x - 4} + 2\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.03 \begin {gather*} \int \frac {2\,x-1}{\sqrt {x^4-2\,x^3+5\,x^2-4\,x-4}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________