3.3 \(\int x (1+2 x+x^2) \, dx\)

Optimal. Leaf size=22 \[ \frac{x^4}{4}+\frac{2 x^3}{3}+\frac{x^2}{2} \]

[Out]

x^2/2 + (2*x^3)/3 + x^4/4

________________________________________________________________________________________

Rubi [A]  time = 0.0043658, antiderivative size = 22, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.1, Rules used = {14} \[ \frac{x^4}{4}+\frac{2 x^3}{3}+\frac{x^2}{2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x^2/2 + (2*x^3)/3 + x^4/4

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

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

Mathematica [A]  time = 0.000666, size = 22, normalized size = 1. \[ \frac{x^4}{4}+\frac{2 x^3}{3}+\frac{x^2}{2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x^2/2 + (2*x^3)/3 + x^4/4

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 17, normalized size = 0.8 \begin{align*}{\frac{{x}^{2}}{2}}+{\frac{2\,{x}^{3}}{3}}+{\frac{{x}^{4}}{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*x^2+2/3*x^3+1/4*x^4

________________________________________________________________________________________

Maxima [A]  time = 0.948026, size = 22, normalized size = 1. \begin{align*} \frac{1}{4} \, x^{4} + \frac{2}{3} \, x^{3} + \frac{1}{2} \, x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x^4 + 2/3*x^3 + 1/2*x^2

________________________________________________________________________________________

Fricas [A]  time = 1.78135, size = 39, normalized size = 1.77 \begin{align*} \frac{1}{4} x^{4} + \frac{2}{3} x^{3} + \frac{1}{2} x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x^4 + 2/3*x^3 + 1/2*x^2

________________________________________________________________________________________

Sympy [A]  time = 0.051943, size = 15, normalized size = 0.68 \begin{align*} \frac{x^{4}}{4} + \frac{2 x^{3}}{3} + \frac{x^{2}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x**4/4 + 2*x**3/3 + x**2/2

________________________________________________________________________________________

Giac [A]  time = 1.09264, size = 22, normalized size = 1. \begin{align*} \frac{1}{4} \, x^{4} + \frac{2}{3} \, x^{3} + \frac{1}{2} \, x^{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*x^4 + 2/3*x^3 + 1/2*x^2