3.7.91 \(\int e^{3 x} (-x+x^2) \, dx\) [691]

Optimal. Leaf size=32 \[ \frac {5 e^{3 x}}{27}-\frac {5}{9} e^{3 x} x+\frac {1}{3} e^{3 x} x^2 \]

[Out]

5/27*exp(3*x)-5/9*exp(3*x)*x+1/3*exp(3*x)*x^2

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {1607, 2227, 2207, 2225} \begin {gather*} \frac {1}{3} e^{3 x} x^2-\frac {5}{9} e^{3 x} x+\frac {5 e^{3 x}}{27} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(5*E^(3*x))/27 - (5*E^(3*x)*x)/9 + (E^(3*x)*x^2)/3

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 2207

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(c + d*x)^m*
((b*F^(g*(e + f*x)))^n/(f*g*n*Log[F])), x] - Dist[d*(m/(f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*(b*F^(g*(e + f*x
)))^n, x], x] /; FreeQ[{F, b, c, d, e, f, g, n}, x] && GtQ[m, 0] && IntegerQ[2*m] &&  !TrueQ[$UseGamma]

Rule 2225

Int[((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.), x_Symbol] :> Simp[(F^(c*(a + b*x)))^n/(b*c*n*Log[F]), x] /; Fre
eQ[{F, a, b, c, n}, x]

Rule 2227

Int[(F_)^((c_.)*(v_))*(u_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), u, x], x] /; FreeQ[{F, c
}, x] && PolynomialQ[u, x] && LinearQ[v, x] &&  !TrueQ[$UseGamma]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 19, normalized size = 0.59 \begin {gather*} \frac {1}{27} e^{3 x} \left (5-15 x+9 x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(E^(3*x)*(5 - 15*x + 9*x^2))/27

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 24, normalized size = 0.75

method result size
risch \(\left (\frac {1}{3} x^{2}-\frac {5}{9} x +\frac {5}{27}\right ) {\mathrm e}^{3 x}\) \(16\)
gosper \(\frac {{\mathrm e}^{3 x} \left (9 x^{2}-15 x +5\right )}{27}\) \(17\)
derivativedivides \(\frac {5 \,{\mathrm e}^{3 x}}{27}-\frac {5 \,{\mathrm e}^{3 x} x}{9}+\frac {{\mathrm e}^{3 x} x^{2}}{3}\) \(24\)
default \(\frac {5 \,{\mathrm e}^{3 x}}{27}-\frac {5 \,{\mathrm e}^{3 x} x}{9}+\frac {{\mathrm e}^{3 x} x^{2}}{3}\) \(24\)
norman \(\frac {5 \,{\mathrm e}^{3 x}}{27}-\frac {5 \,{\mathrm e}^{3 x} x}{9}+\frac {{\mathrm e}^{3 x} x^{2}}{3}\) \(24\)
meijerg \(-\frac {5}{27}+\frac {\left (27 x^{2}-18 x +6\right ) {\mathrm e}^{3 x}}{81}+\frac {\left (2-6 x \right ) {\mathrm e}^{3 x}}{18}\) \(30\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

5/27*exp(3*x)-5/9*exp(3*x)*x+1/3*exp(3*x)*x^2

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 28, normalized size = 0.88 \begin {gather*} \frac {1}{27} \, {\left (9 \, x^{2} - 6 \, x + 2\right )} e^{\left (3 \, x\right )} - \frac {1}{9} \, {\left (3 \, x - 1\right )} e^{\left (3 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/27*(9*x^2 - 6*x + 2)*e^(3*x) - 1/9*(3*x - 1)*e^(3*x)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 16, normalized size = 0.50 \begin {gather*} \frac {1}{27} \, {\left (9 \, x^{2} - 15 \, x + 5\right )} e^{\left (3 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/27*(9*x^2 - 15*x + 5)*e^(3*x)

________________________________________________________________________________________

Sympy [A]
time = 0.02, size = 15, normalized size = 0.47 \begin {gather*} \frac {\left (9 x^{2} - 15 x + 5\right ) e^{3 x}}{27} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(3*x)*(x**2-x),x)

[Out]

(9*x**2 - 15*x + 5)*exp(3*x)/27

________________________________________________________________________________________

Giac [A]
time = 4.65, size = 16, normalized size = 0.50 \begin {gather*} \frac {1}{27} \, {\left (9 \, x^{2} - 15 \, x + 5\right )} e^{\left (3 \, x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/27*(9*x^2 - 15*x + 5)*e^(3*x)

________________________________________________________________________________________

Mupad [B]
time = 3.53, size = 16, normalized size = 0.50 \begin {gather*} \frac {{\mathrm {e}}^{3\,x}\,\left (9\,x^2-15\,x+5\right )}{27} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-exp(3*x)*(x - x^2),x)

[Out]

(exp(3*x)*(9*x^2 - 15*x + 5))/27

________________________________________________________________________________________