\(\int e^{3 x+3 x^2} (2 x+3 x^2+6 x^3) \, dx\) [9257]

   Optimal result
   Rubi [B] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [C] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 12 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=e^{3 x (1+x)} x^2 \]

[Out]

x^2*exp(x*(3*x+3))

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(27\) vs. \(2(12)=24\).

Time = 0.03 (sec) , antiderivative size = 27, normalized size of antiderivative = 2.25, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {1608, 2326} \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=\frac {e^{3 x^2+3 x} x \left (2 x^2+x\right )}{2 x+1} \]

[In]

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

[Out]

(E^(3*x + 3*x^2)*x*(x + 2*x^2))/(1 + 2*x)

Rule 1608

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

Rule 2326

Int[(y_.)*(F_)^(u_)*((v_) + (w_)), x_Symbol] :> With[{z = v*(y/(Log[F]*D[u, x]))}, Simp[F^u*z, x] /; EqQ[D[z,
x], w*y]] /; FreeQ[F, x]

Rubi steps \begin{align*} \text {integral}& = \int e^{3 x+3 x^2} x \left (2+3 x+6 x^2\right ) \, dx \\ & = \frac {e^{3 x+3 x^2} x \left (x+2 x^2\right )}{1+2 x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=e^{3 x (1+x)} x^2 \]

[In]

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

[Out]

E^(3*x*(1 + x))*x^2

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00

method result size
risch \({\mathrm e}^{3 \left (1+x \right ) x} x^{2}\) \(12\)
gosper \({\mathrm e}^{3 x^{2}+3 x} x^{2}\) \(15\)
default \({\mathrm e}^{3 x^{2}+3 x} x^{2}\) \(15\)
norman \({\mathrm e}^{3 x^{2}+3 x} x^{2}\) \(15\)
parallelrisch \({\mathrm e}^{3 x^{2}+3 x} x^{2}\) \(15\)
parts \(-i \sqrt {3}\, \sqrt {\pi }\, {\mathrm e}^{-\frac {3}{4}} \operatorname {erf}\left (i \sqrt {3}\, x +\frac {i \sqrt {3}}{2}\right ) x^{3}-\frac {i \sqrt {3}\, \sqrt {\pi }\, {\mathrm e}^{-\frac {3}{4}} \operatorname {erf}\left (i \sqrt {3}\, x +\frac {i \sqrt {3}}{2}\right ) x^{2}}{2}-\frac {i \sqrt {3}\, \sqrt {\pi }\, {\mathrm e}^{-\frac {3}{4}} \operatorname {erf}\left (i \sqrt {3}\, x +\frac {i \sqrt {3}}{2}\right ) x}{3}-\frac {i {\mathrm e}^{-\frac {3}{4}} \sqrt {3}\, \left (2 i x^{2} {\mathrm e}^{\frac {3 \left (1+2 x \right )^{2}}{4}} \sqrt {3}-6 x^{3} \operatorname {erf}\left (\frac {i \sqrt {3}\, \left (1+2 x \right )}{2}\right ) \sqrt {\pi }-3 \sqrt {\pi }\, x^{2} \operatorname {erf}\left (\frac {i \sqrt {3}\, \left (1+2 x \right )}{2}\right )-2 \sqrt {\pi }\, x \,\operatorname {erf}\left (\frac {i \sqrt {3}\, \left (1+2 x \right )}{2}\right )\right )}{6}\) \(173\)

[In]

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

[Out]

exp(3*(1+x)*x)*x^2

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.17 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=x^{2} e^{\left (3 \, x^{2} + 3 \, x\right )} \]

[In]

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

[Out]

x^2*e^(3*x^2 + 3*x)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.00 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=x^{2} e^{3 x^{2} + 3 x} \]

[In]

integrate((6*x**3+3*x**2+2*x)*exp(3*x**2+3*x),x)

[Out]

x**2*exp(3*x**2 + 3*x)

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.34 (sec) , antiderivative size = 268, normalized size of antiderivative = 22.33 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=\frac {1}{72} \, \sqrt {3} {\left (\frac {36 \, {\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {3}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}{\left (-{\left (2 \, x + 1\right )}^{2}\right )^{\frac {3}{2}}} - \frac {9 \, \sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {3} \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} + 18 \, \sqrt {3} e^{\left (\frac {3}{4} \, {\left (2 \, x + 1\right )}^{2}\right )} - 8 \, \sqrt {3} \Gamma \left (2, -\frac {3}{4} \, {\left (2 \, x + 1\right )}^{2}\right )\right )} e^{\left (-\frac {3}{4}\right )} - \frac {1}{24} \, \sqrt {3} {\left (\frac {4 \, {\left (2 \, x + 1\right )}^{3} \Gamma \left (\frac {3}{2}, -\frac {3}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}{\left (-{\left (2 \, x + 1\right )}^{2}\right )^{\frac {3}{2}}} - \frac {3 \, \sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {3} \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} + 4 \, \sqrt {3} e^{\left (\frac {3}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} e^{\left (-\frac {3}{4}\right )} - \frac {1}{18} \, \sqrt {3} {\left (\frac {3 \, \sqrt {\pi } {\left (2 \, x + 1\right )} {\left (\operatorname {erf}\left (\frac {1}{2} \, \sqrt {3} \sqrt {-{\left (2 \, x + 1\right )}^{2}}\right ) - 1\right )}}{\sqrt {-{\left (2 \, x + 1\right )}^{2}}} - 2 \, \sqrt {3} e^{\left (\frac {3}{4} \, {\left (2 \, x + 1\right )}^{2}\right )}\right )} e^{\left (-\frac {3}{4}\right )} \]

[In]

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

[Out]

1/72*sqrt(3)*(36*(2*x + 1)^3*gamma(3/2, -3/4*(2*x + 1)^2)/(-(2*x + 1)^2)^(3/2) - 9*sqrt(pi)*(2*x + 1)*(erf(1/2
*sqrt(3)*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-(2*x + 1)^2) + 18*sqrt(3)*e^(3/4*(2*x + 1)^2) - 8*sqrt(3)*gamma(2, -3/
4*(2*x + 1)^2))*e^(-3/4) - 1/24*sqrt(3)*(4*(2*x + 1)^3*gamma(3/2, -3/4*(2*x + 1)^2)/(-(2*x + 1)^2)^(3/2) - 3*s
qrt(pi)*(2*x + 1)*(erf(1/2*sqrt(3)*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-(2*x + 1)^2) + 4*sqrt(3)*e^(3/4*(2*x + 1)^2)
)*e^(-3/4) - 1/18*sqrt(3)*(3*sqrt(pi)*(2*x + 1)*(erf(1/2*sqrt(3)*sqrt(-(2*x + 1)^2)) - 1)/sqrt(-(2*x + 1)^2) -
 2*sqrt(3)*e^(3/4*(2*x + 1)^2))*e^(-3/4)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 24 vs. \(2 (11) = 22\).

Time = 0.28 (sec) , antiderivative size = 24, normalized size of antiderivative = 2.00 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=\frac {1}{4} \, {\left ({\left (2 \, x + 1\right )}^{2} - 4 \, x - 1\right )} e^{\left (3 \, x^{2} + 3 \, x\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.17 \[ \int e^{3 x+3 x^2} \left (2 x+3 x^2+6 x^3\right ) \, dx=x^2\,{\mathrm {e}}^{3\,x^2+3\,x} \]

[In]

int(exp(3*x + 3*x^2)*(2*x + 3*x^2 + 6*x^3),x)

[Out]

x^2*exp(3*x + 3*x^2)