3.1.88 \(\int (-1+x) (-1+2 x+3 x^2)^2 \, dx\) [88]

Optimal. Leaf size=39 \[ -x+\frac {5 x^2}{2}-\frac {2 x^3}{3}-\frac {7 x^4}{2}+\frac {3 x^5}{5}+\frac {3 x^6}{2} \]

[Out]

-x+5/2*x^2-2/3*x^3-7/2*x^4+3/5*x^5+3/2*x^6

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {645} \begin {gather*} \frac {3 x^6}{2}+\frac {3 x^5}{5}-\frac {7 x^4}{2}-\frac {2 x^3}{3}+\frac {5 x^2}{2}-x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 645

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

Rubi steps

\begin {align*} \int (-1+x) \left (-1+2 x+3 x^2\right )^2 \, dx &=\int \left (-1+5 x-2 x^2-14 x^3+3 x^4+9 x^5\right ) \, dx\\ &=-x+\frac {5 x^2}{2}-\frac {2 x^3}{3}-\frac {7 x^4}{2}+\frac {3 x^5}{5}+\frac {3 x^6}{2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 39, normalized size = 1.00 \begin {gather*} -x+\frac {5 x^2}{2}-\frac {2 x^3}{3}-\frac {7 x^4}{2}+\frac {3 x^5}{5}+\frac {3 x^6}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 30, normalized size = 0.77

method result size
gosper \(\frac {x \left (45 x^{5}+18 x^{4}-105 x^{3}-20 x^{2}+75 x -30\right )}{30}\) \(29\)
default \(-x +\frac {5}{2} x^{2}-\frac {2}{3} x^{3}-\frac {7}{2} x^{4}+\frac {3}{5} x^{5}+\frac {3}{2} x^{6}\) \(30\)
norman \(-x +\frac {5}{2} x^{2}-\frac {2}{3} x^{3}-\frac {7}{2} x^{4}+\frac {3}{5} x^{5}+\frac {3}{2} x^{6}\) \(30\)
risch \(-x +\frac {5}{2} x^{2}-\frac {2}{3} x^{3}-\frac {7}{2} x^{4}+\frac {3}{5} x^{5}+\frac {3}{2} x^{6}\) \(30\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x+5/2*x^2-2/3*x^3-7/2*x^4+3/5*x^5+3/2*x^6

________________________________________________________________________________________

Maxima [A]
time = 0.75, size = 29, normalized size = 0.74 \begin {gather*} \frac {3}{2} \, x^{6} + \frac {3}{5} \, x^{5} - \frac {7}{2} \, x^{4} - \frac {2}{3} \, x^{3} + \frac {5}{2} \, x^{2} - x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/2*x^6 + 3/5*x^5 - 7/2*x^4 - 2/3*x^3 + 5/2*x^2 - x

________________________________________________________________________________________

Fricas [A]
time = 0.46, size = 29, normalized size = 0.74 \begin {gather*} \frac {3}{2} \, x^{6} + \frac {3}{5} \, x^{5} - \frac {7}{2} \, x^{4} - \frac {2}{3} \, x^{3} + \frac {5}{2} \, x^{2} - x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/2*x^6 + 3/5*x^5 - 7/2*x^4 - 2/3*x^3 + 5/2*x^2 - x

________________________________________________________________________________________

Sympy [A]
time = 0.01, size = 34, normalized size = 0.87 \begin {gather*} \frac {3 x^{6}}{2} + \frac {3 x^{5}}{5} - \frac {7 x^{4}}{2} - \frac {2 x^{3}}{3} + \frac {5 x^{2}}{2} - x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3*x**6/2 + 3*x**5/5 - 7*x**4/2 - 2*x**3/3 + 5*x**2/2 - x

________________________________________________________________________________________

Giac [A]
time = 0.58, size = 29, normalized size = 0.74 \begin {gather*} \frac {3}{2} \, x^{6} + \frac {3}{5} \, x^{5} - \frac {7}{2} \, x^{4} - \frac {2}{3} \, x^{3} + \frac {5}{2} \, x^{2} - x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

3/2*x^6 + 3/5*x^5 - 7/2*x^4 - 2/3*x^3 + 5/2*x^2 - x

________________________________________________________________________________________

Mupad [B]
time = 0.03, size = 29, normalized size = 0.74 \begin {gather*} \frac {3\,x^6}{2}+\frac {3\,x^5}{5}-\frac {7\,x^4}{2}-\frac {2\,x^3}{3}+\frac {5\,x^2}{2}-x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________