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

   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 = 26, antiderivative size = 37 \[ \int \frac {-1+x}{\sqrt {-1+4 x+2 x^2-4 x^3+x^4}} \, dx=-\frac {1}{2} \log \left (1+2 x-x^2+\sqrt {-1+4 x+2 x^2-4 x^3+x^4}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 33, normalized size of antiderivative = 0.89, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {1694, 1121, 635, 212} \[ \int \frac {-1+x}{\sqrt {-1+4 x+2 x^2-4 x^3+x^4}} \, dx=-\frac {1}{2} \text {arctanh}\left (\frac {2-(x-1)^2}{\sqrt {(x-1)^4-4 (x-1)^2+2}}\right ) \]

[In]

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

[Out]

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

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*} \text {integral}& = \text {Subst}\left (\int \frac {x}{\sqrt {2-4 x^2+x^4}} \, dx,x,-1+x\right ) \\ & = \frac {1}{2} \text {Subst}\left (\int \frac {1}{\sqrt {2-4 x+x^2}} \, dx,x,(-1+x)^2\right ) \\ & = \text {Subst}\left (\int \frac {1}{4-x^2} \, dx,x,\frac {2 \left (-2+(-1+x)^2\right )}{\sqrt {2-4 (-1+x)^2+(-1+x)^4}}\right ) \\ & = \frac {1}{2} \text {arctanh}\left (\frac {-2+(-1+x)^2}{\sqrt {2-4 (-1+x)^2+(-1+x)^4}}\right ) \\ \end{align*}

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 1.54 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.86

method result size
default \(\frac {\ln \left (x^{2}-2 x -1+\sqrt {x^{4}-4 x^{3}+2 x^{2}+4 x -1}\right )}{2}\) \(32\)
pseudoelliptic \(\frac {\ln \left (x^{2}-2 x -1+\sqrt {x^{4}-4 x^{3}+2 x^{2}+4 x -1}\right )}{2}\) \(32\)
trager \(-\frac {\ln \left (1+2 x -x^{2}+\sqrt {x^{4}-4 x^{3}+2 x^{2}+4 x -1}\right )}{2}\) \(34\)
elliptic \(\text {Expression too large to display}\) \(1020\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [F]

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

[In]

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

[Out]

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

Giac [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Mupad [F(-1)]

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

[In]

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

[Out]

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