3.8.63 \(\int (1+2 x) (x+x^2)^3 \sqrt {1-(x+x^2)^2} \, dx\) [763]

Optimal. Leaf size=42 \[ -\frac {1}{15} \left (1-x^2-2 x^3-x^4\right )^{3/2} \left (2+3 x^2+6 x^3+3 x^4\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.16, antiderivative size = 59, normalized size of antiderivative = 1.40, number of steps used = 6, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {1607, 1694, 12, 1261, 706, 643} \begin {gather*} -\frac {1}{5} x^2 \left (-x^4-2 x^3-x^2+1\right )^{3/2} (x+1)^2-\frac {2}{15} \left (-x^4-2 x^3-x^2+1\right )^{3/2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

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

Rule 643

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

Rule 706

Int[((d_) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Simp[2*d*(d + e*x)^(m - 1
)*((a + b*x + c*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] + Dist[d^2*(m - 1)*((b^2 - 4*a*c)/(b^2*(m + 2*p + 1))), In
t[(d + e*x)^(m - 2)*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b^2 - 4*a*c, 0] && EqQ[
2*c*d - b*e, 0] && NeQ[m + 2*p + 3, 0] && GtQ[m, 1] && NeQ[m + 2*p + 1, 0] && (IntegerQ[2*p] || (IntegerQ[m] &
& RationalQ[p]) || OddQ[m])

Rule 1261

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

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

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 (1+2 x) \left (x+x^2\right )^3 \sqrt {1-\left (x+x^2\right )^2} \, dx &=\int x^3 (1+x)^3 (1+2 x) \sqrt {1-\left (x+x^2\right )^2} \, dx\\ &=\text {Subst}\left (\int \frac {1}{128} x \left (-1+4 x^2\right )^3 \sqrt {15+8 x^2-16 x^4} \, dx,x,\frac {1}{2}+x\right )\\ &=\frac {1}{128} \text {Subst}\left (\int x \left (-1+4 x^2\right )^3 \sqrt {15+8 x^2-16 x^4} \, dx,x,\frac {1}{2}+x\right )\\ &=\frac {1}{256} \text {Subst}\left (\int (-1+4 x)^3 \sqrt {15+8 x-16 x^2} \, dx,x,\left (\frac {1}{2}+x\right )^2\right )\\ &=-\frac {1}{5} x^2 (1+x)^2 \left (1-x^2-2 x^3-x^4\right )^{3/2}+\frac {1}{40} \text {Subst}\left (\int (-1+4 x) \sqrt {15+8 x-16 x^2} \, dx,x,\left (\frac {1}{2}+x\right )^2\right )\\ &=-\frac {2}{15} \left (1-x^2-2 x^3-x^4\right )^{3/2}-\frac {1}{5} x^2 (1+x)^2 \left (1-x^2-2 x^3-x^4\right )^{3/2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 30, normalized size = 0.71 \begin {gather*} \frac {1}{15} \left (-2-3 \left (x+x^2\right )^2\right ) \left (1-\left (x+x^2\right )^2\right )^{3/2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

((-2 - 3*(x + x^2)^2)*(1 - (x + x^2)^2)^(3/2))/15

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(190\) vs. \(2(38)=76\).
time = 0.52, size = 191, normalized size = 4.55

method result size
gosper \(\frac {\left (x^{2}+x +1\right ) \left (x^{2}+x -1\right ) \left (3 x^{4}+6 x^{3}+3 x^{2}+2\right ) \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}\) \(51\)
trager \(\left (\frac {1}{5} x^{8}+\frac {4}{5} x^{7}+\frac {6}{5} x^{6}+\frac {4}{5} x^{5}+\frac {2}{15} x^{4}-\frac {2}{15} x^{3}-\frac {1}{15} x^{2}-\frac {2}{15}\right ) \sqrt {-x^{4}-2 x^{3}-x^{2}+1}\) \(58\)
risch \(-\frac {\left (3 x^{8}+12 x^{7}+18 x^{6}+12 x^{5}+2 x^{4}-2 x^{3}-x^{2}-2\right ) \left (x^{4}+2 x^{3}+x^{2}-1\right )}{15 \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}\) \(72\)
default \(-\frac {x^{2} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}-\frac {2 \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}+\frac {x^{8} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {4 x^{7} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {6 x^{6} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {4 x^{5} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {2 x^{4} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}-\frac {2 x^{3} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}\) \(191\)
elliptic \(-\frac {x^{2} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}-\frac {2 \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}+\frac {x^{8} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {4 x^{7} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {6 x^{6} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {4 x^{5} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{5}+\frac {2 x^{4} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}-\frac {2 x^{3} \sqrt {-x^{4}-2 x^{3}-x^{2}+1}}{15}\) \(191\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/15*x^2*(-x^4-2*x^3-x^2+1)^(1/2)-2/15*(-x^4-2*x^3-x^2+1)^(1/2)+1/5*x^8*(-x^4-2*x^3-x^2+1)^(1/2)+4/5*x^7*(-x^
4-2*x^3-x^2+1)^(1/2)+6/5*x^6*(-x^4-2*x^3-x^2+1)^(1/2)+4/5*x^5*(-x^4-2*x^3-x^2+1)^(1/2)+2/15*x^4*(-x^4-2*x^3-x^
2+1)^(1/2)-2/15*x^3*(-x^4-2*x^3-x^2+1)^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.31, size = 59, normalized size = 1.40 \begin {gather*} \frac {1}{15} \, {\left (3 \, x^{8} + 12 \, x^{7} + 18 \, x^{6} + 12 \, x^{5} + 2 \, x^{4} - 2 \, x^{3} - x^{2} - 2\right )} \sqrt {x^{2} + x + 1} \sqrt {-x^{2} - x + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/15*(3*x^8 + 12*x^7 + 18*x^6 + 12*x^5 + 2*x^4 - 2*x^3 - x^2 - 2)*sqrt(x^2 + x + 1)*sqrt(-x^2 - x + 1)

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 58, normalized size = 1.38 \begin {gather*} \frac {1}{15} \, {\left (3 \, x^{8} + 12 \, x^{7} + 18 \, x^{6} + 12 \, x^{5} + 2 \, x^{4} - 2 \, x^{3} - x^{2} - 2\right )} \sqrt {-x^{4} - 2 \, x^{3} - x^{2} + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/15*(3*x^8 + 12*x^7 + 18*x^6 + 12*x^5 + 2*x^4 - 2*x^3 - x^2 - 2)*sqrt(-x^4 - 2*x^3 - x^2 + 1)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 182 vs. \(2 (36) = 72\).
time = 1.00, size = 182, normalized size = 4.33 \begin {gather*} \frac {x^{8} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{5} + \frac {4 x^{7} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{5} + \frac {6 x^{6} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{5} + \frac {4 x^{5} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{5} + \frac {2 x^{4} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{15} - \frac {2 x^{3} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{15} - \frac {x^{2} \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{15} - \frac {2 \sqrt {- x^{4} - 2 x^{3} - x^{2} + 1}}{15} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**8*sqrt(-x**4 - 2*x**3 - x**2 + 1)/5 + 4*x**7*sqrt(-x**4 - 2*x**3 - x**2 + 1)/5 + 6*x**6*sqrt(-x**4 - 2*x**3
 - x**2 + 1)/5 + 4*x**5*sqrt(-x**4 - 2*x**3 - x**2 + 1)/5 + 2*x**4*sqrt(-x**4 - 2*x**3 - x**2 + 1)/15 - 2*x**3
*sqrt(-x**4 - 2*x**3 - x**2 + 1)/15 - x**2*sqrt(-x**4 - 2*x**3 - x**2 + 1)/15 - 2*sqrt(-x**4 - 2*x**3 - x**2 +
 1)/15

________________________________________________________________________________________

Giac [A]
time = 2.62, size = 58, normalized size = 1.38 \begin {gather*} \frac {1}{5} \, {\left (x^{4} + 2 \, x^{3} + x^{2} - 1\right )}^{2} \sqrt {-x^{4} - 2 \, x^{3} - x^{2} + 1} - \frac {1}{3} \, {\left (-x^{4} - 2 \, x^{3} - x^{2} + 1\right )}^{\frac {3}{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 3.42, size = 51, normalized size = 1.21 \begin {gather*} \sqrt {1-{\left (x^2+x\right )}^2}\,\left (\frac {x^8}{5}+\frac {4\,x^7}{5}+\frac {6\,x^6}{5}+\frac {4\,x^5}{5}+\frac {2\,x^4}{15}-\frac {2\,x^3}{15}-\frac {x^2}{15}-\frac {2}{15}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(1 - (x + x^2)^2)^(1/2)*((2*x^4)/15 - (2*x^3)/15 - x^2/15 + (4*x^5)/5 + (6*x^6)/5 + (4*x^7)/5 + x^8/5 - 2/15)

________________________________________________________________________________________