3.10.34 \(\int \sqrt {x^2+x^3-x^4} \, dx\) [934]

Optimal. Leaf size=107 \[ -\frac {(1-2 x) \sqrt {x^2+x^3-x^4}}{8 x}-\frac {\left (1+x-x^2\right ) \sqrt {x^2+x^3-x^4}}{3 x}-\frac {5 \sqrt {x^2+x^3-x^4} \sin ^{-1}\left (\frac {1-2 x}{\sqrt {5}}\right )}{16 x \sqrt {1+x-x^2}} \]

[Out]

-1/8*(1-2*x)*(-x^4+x^3+x^2)^(1/2)/x-1/3*(-x^2+x+1)*(-x^4+x^3+x^2)^(1/2)/x-5/16*arcsin(1/5*(1-2*x)*5^(1/2))*(-x
^4+x^3+x^2)^(1/2)/x/(-x^2+x+1)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 107, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {1917, 654, 626, 633, 222} \begin {gather*} -\frac {5 \sqrt {-x^4+x^3+x^2} \text {ArcSin}\left (\frac {1-2 x}{\sqrt {5}}\right )}{16 x \sqrt {-x^2+x+1}}-\frac {\sqrt {-x^4+x^3+x^2} (1-2 x)}{8 x}-\frac {\left (-x^2+x+1\right ) \sqrt {-x^4+x^3+x^2}}{3 x} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[x^2 + x^3 - x^4],x]

[Out]

-1/8*((1 - 2*x)*Sqrt[x^2 + x^3 - x^4])/x - ((1 + x - x^2)*Sqrt[x^2 + x^3 - x^4])/(3*x) - (5*Sqrt[x^2 + x^3 - x
^4]*ArcSin[(1 - 2*x)/Sqrt[5]])/(16*x*Sqrt[1 + x - x^2])

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 626

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

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 654

Int[((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[e*((a + b*x + c*x^2)^(p +
 1)/(2*c*(p + 1))), x] + Dist[(2*c*d - b*e)/(2*c), Int[(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}
, x] && NeQ[2*c*d - b*e, 0] && NeQ[p, -1]

Rule 1917

Int[Sqrt[(b_.)*(x_)^(n_.) + (a_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.)], x_Symbol] :> Dist[Sqrt[a*x^q + b*x^n + c*x^(
2*n - q)]/(x^(q/2)*Sqrt[a + b*x^(n - q) + c*x^(2*(n - q))]), Int[x^(q/2)*Sqrt[a + b*x^(n - q) + c*x^(2*(n - q)
)], x], x] /; FreeQ[{a, b, c, n, q}, x] && EqQ[r, 2*n - q] && PosQ[n - q]

Rubi steps

\begin {align*} \int \sqrt {x^2+x^3-x^4} \, dx &=\frac {\sqrt {x^2+x^3-x^4} \int x \sqrt {1+x-x^2} \, dx}{x \sqrt {1+x-x^2}}\\ &=-\frac {\left (1+x-x^2\right ) \sqrt {x^2+x^3-x^4}}{3 x}+\frac {\sqrt {x^2+x^3-x^4} \int \sqrt {1+x-x^2} \, dx}{2 x \sqrt {1+x-x^2}}\\ &=-\frac {(1-2 x) \sqrt {x^2+x^3-x^4}}{8 x}-\frac {\left (1+x-x^2\right ) \sqrt {x^2+x^3-x^4}}{3 x}+\frac {\left (5 \sqrt {x^2+x^3-x^4}\right ) \int \frac {1}{\sqrt {1+x-x^2}} \, dx}{16 x \sqrt {1+x-x^2}}\\ &=-\frac {(1-2 x) \sqrt {x^2+x^3-x^4}}{8 x}-\frac {\left (1+x-x^2\right ) \sqrt {x^2+x^3-x^4}}{3 x}-\frac {\left (\sqrt {5} \sqrt {x^2+x^3-x^4}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-\frac {x^2}{5}}} \, dx,x,1-2 x\right )}{16 x \sqrt {1+x-x^2}}\\ &=-\frac {(1-2 x) \sqrt {x^2+x^3-x^4}}{8 x}-\frac {\left (1+x-x^2\right ) \sqrt {x^2+x^3-x^4}}{3 x}-\frac {5 \sqrt {x^2+x^3-x^4} \sin ^{-1}\left (\frac {1-2 x}{\sqrt {5}}\right )}{16 x \sqrt {1+x-x^2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 82, normalized size = 0.77 \begin {gather*} \frac {\sqrt {x^2+x^3-x^4} \left (2 \sqrt {-1-x+x^2} \left (-11-2 x+8 x^2\right )+15 \log \left (1-2 x+2 \sqrt {-1-x+x^2}\right )\right )}{48 x \sqrt {-1-x+x^2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[x^2 + x^3 - x^4],x]

[Out]

(Sqrt[x^2 + x^3 - x^4]*(2*Sqrt[-1 - x + x^2]*(-11 - 2*x + 8*x^2) + 15*Log[1 - 2*x + 2*Sqrt[-1 - x + x^2]]))/(4
8*x*Sqrt[-1 - x + x^2])

________________________________________________________________________________________

Maple [A]
time = 0.12, size = 81, normalized size = 0.76

method result size
default \(-\frac {\sqrt {-x^{4}+x^{3}+x^{2}}\, \left (16 \left (-x^{2}+x +1\right )^{\frac {3}{2}}-12 x \sqrt {-x^{2}+x +1}+6 \sqrt {-x^{2}+x +1}-15 \arcsin \left (\frac {\sqrt {5}\, \left (2 x -1\right )}{5}\right )\right )}{48 x \sqrt {-x^{2}+x +1}}\) \(81\)
risch \(\frac {\left (8 x^{2}-2 x -11\right ) \sqrt {-x^{2} \left (x^{2}-x -1\right )}}{24 x}-\frac {5 \arcsin \left (\frac {2 \sqrt {5}\, \left (x -\frac {1}{2}\right )}{5}\right ) \sqrt {-x^{2} \left (x^{2}-x -1\right )}\, \sqrt {-x^{2}+x +1}}{16 x \left (x^{2}-x -1\right )}\) \(81\)
trager \(\frac {\left (8 x^{2}-2 x -11\right ) \sqrt {-x^{4}+x^{3}+x^{2}}}{24 x}+\frac {5 \RootOf \left (\textit {\_Z}^{2}+1\right ) \ln \left (-\frac {2 \RootOf \left (\textit {\_Z}^{2}+1\right ) x^{2}-x \RootOf \left (\textit {\_Z}^{2}+1\right )-2 \sqrt {-x^{4}+x^{3}+x^{2}}}{x}\right )}{16}\) \(82\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/48*(-x^4+x^3+x^2)^(1/2)*(16*(-x^2+x+1)^(3/2)-12*x*(-x^2+x+1)^(1/2)+6*(-x^2+x+1)^(1/2)-15*arcsin(1/5*5^(1/2)
*(2*x-1)))/x/(-x^2+x+1)^(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((-x^4+x^3+x^2)^(1/2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 62, normalized size = 0.58 \begin {gather*} -\frac {15 \, x \arctan \left (-\frac {x - \sqrt {-x^{4} + x^{3} + x^{2}}}{x^{2}}\right ) - \sqrt {-x^{4} + x^{3} + x^{2}} {\left (8 \, x^{2} - 2 \, x - 11\right )} + 11 \, x}{24 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/24*(15*x*arctan(-(x - sqrt(-x^4 + x^3 + x^2))/x^2) - sqrt(-x^4 + x^3 + x^2)*(8*x^2 - 2*x - 11) + 11*x)/x

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 4.08, size = 60, normalized size = 0.56 \begin {gather*} \frac {1}{48} \, {\left (15 \, \arcsin \left (\frac {1}{5} \, \sqrt {5}\right ) + 22\right )} \mathrm {sgn}\left (x\right ) + \frac {5}{16} \, \arcsin \left (\frac {1}{5} \, \sqrt {5} {\left (2 \, x - 1\right )}\right ) \mathrm {sgn}\left (x\right ) + \frac {1}{24} \, {\left (2 \, {\left (4 \, x \mathrm {sgn}\left (x\right ) - \mathrm {sgn}\left (x\right )\right )} x - 11 \, \mathrm {sgn}\left (x\right )\right )} \sqrt {-x^{2} + x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/48*(15*arcsin(1/5*sqrt(5)) + 22)*sgn(x) + 5/16*arcsin(1/5*sqrt(5)*(2*x - 1))*sgn(x) + 1/24*(2*(4*x*sgn(x) -
sgn(x))*x - 11*sgn(x))*sqrt(-x^2 + x + 1)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________