3.934 \(\int \sqrt{x^2+x^3-x^4} \, dx\)

Optimal. Leaf size=107 \[ -\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}-\frac{5 \sqrt{-x^4+x^3+x^2} \sin ^{-1}\left (\frac{1-2 x}{\sqrt{5}}\right )}{16 x \sqrt{-x^2+x+1}} \]

[Out]

-((1 - 2*x)*Sqrt[x^2 + x^3 - x^4])/(8*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])

________________________________________________________________________________________

Rubi [A]  time = 0.0288431, antiderivative size = 107, normalized size of antiderivative = 1., 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 = {1903, 640, 612, 619, 216} \[ -\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}-\frac{5 \sqrt{-x^4+x^3+x^2} \sin ^{-1}\left (\frac{1-2 x}{\sqrt{5}}\right )}{16 x \sqrt{-x^2+x+1}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-((1 - 2*x)*Sqrt[x^2 + x^3 - x^4])/(8*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 1903

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]

Rule 640

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 612

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 619

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 216

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]

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 ) \operatorname{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.0275871, size = 84, normalized size = 0.79 \[ \frac{\sqrt{-x^4+x^3+x^2} \left (2 \sqrt{x^2-x-1} \left (8 x^2-2 x-11\right )-15 \tanh ^{-1}\left (\frac{2 x-1}{2 \sqrt{x^2-x-1}}\right )\right )}{48 x \sqrt{x^2-x-1}} \]

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*ArcTanh[(-1 + 2*x)/(2*Sqrt[-1 - x + x^2]
)]))/(48*x*Sqrt[-1 - x + x^2])

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 81, normalized size = 0.8 \begin{align*}{\frac{1}{48\,x}\sqrt{-{x}^{4}+{x}^{3}+{x}^{2}} \left ( -16\, \left ( -{x}^{2}+x+1 \right ) ^{3/2}+12\,x\sqrt{-{x}^{2}+x+1}+15\,\arcsin \left ( 1/5\, \left ( 2\,x-1 \right ) \sqrt{5} \right ) -6\,\sqrt{-{x}^{2}+x+1} \right ){\frac{1}{\sqrt{-{x}^{2}+x+1}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[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)+15*arcsin(1/5*(2*x-1)*5^(1/2))-6*(-x^2+x
+1)^(1/2))/x/(-x^2+x+1)^(1/2)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{-x^{4} + x^{3} + x^{2}}\,{d x} \end{align*}

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 = 1.63206, size = 147, normalized size = 1.37 \begin{align*} -\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{align*}

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., size = 0, normalized size = 0. \begin{align*} \int \sqrt{- x^{4} + x^{3} + x^{2}}\, dx \end{align*}

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 = 1.12201, size = 81, normalized size = 0.76 \begin{align*} \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{align*}

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)