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

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

Optimal result

Integrand size = 41, antiderivative size = 19 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=\left (-e^x+e^{e^{2 x}+x}\right ) x^2 \]

[Out]

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(44\) vs. \(2(19)=38\).

Time = 0.06 (sec) , antiderivative size = 44, normalized size of antiderivative = 2.32, number of steps used = 10, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.122, Rules used = {1607, 2227, 2207, 2225, 2326} \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=\frac {e^{x+e^{2 x}} \left (2 e^{2 x} x^2+x^2\right )}{2 e^{2 x}+1}-e^x x^2 \]

[In]

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

[Out]

-(E^x*x^2) + (E^(E^(2*x) + x)*(x^2 + 2*E^(2*x)*x^2))/(1 + 2*E^(2*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 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]

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^x \left (-2 x-x^2\right ) \, dx+\int e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right ) \, dx \\ & = \frac {e^{e^{2 x}+x} \left (x^2+2 e^{2 x} x^2\right )}{1+2 e^{2 x}}+\int e^x (-2-x) x \, dx \\ & = \frac {e^{e^{2 x}+x} \left (x^2+2 e^{2 x} x^2\right )}{1+2 e^{2 x}}+\int \left (-2 e^x x-e^x x^2\right ) \, dx \\ & = \frac {e^{e^{2 x}+x} \left (x^2+2 e^{2 x} x^2\right )}{1+2 e^{2 x}}-2 \int e^x x \, dx-\int e^x x^2 \, dx \\ & = -2 e^x x-e^x x^2+\frac {e^{e^{2 x}+x} \left (x^2+2 e^{2 x} x^2\right )}{1+2 e^{2 x}}+2 \int e^x \, dx+2 \int e^x x \, dx \\ & = 2 e^x-e^x x^2+\frac {e^{e^{2 x}+x} \left (x^2+2 e^{2 x} x^2\right )}{1+2 e^{2 x}}-2 \int e^x \, dx \\ & = -e^x x^2+\frac {e^{e^{2 x}+x} \left (x^2+2 e^{2 x} x^2\right )}{1+2 e^{2 x}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.11 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.84 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=e^x \left (-1+e^{e^{2 x}}\right ) x^2 \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05

method result size
default \({\mathrm e}^{{\mathrm e}^{2 x}+x} x^{2}-{\mathrm e}^{x} x^{2}\) \(20\)
norman \({\mathrm e}^{{\mathrm e}^{2 x}+x} x^{2}-{\mathrm e}^{x} x^{2}\) \(20\)
risch \({\mathrm e}^{{\mathrm e}^{2 x}+x} x^{2}-{\mathrm e}^{x} x^{2}\) \(20\)
parallelrisch \({\mathrm e}^{{\mathrm e}^{2 x}+x} x^{2}-{\mathrm e}^{x} x^{2}\) \(20\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=x^{2} e^{\left (x + e^{\left (2 \, x\right )}\right )} - x^{2} e^{x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=- x^{2} e^{x} + x^{2} e^{x + e^{2 x}} \]

[In]

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

[Out]

-x**2*exp(x) + x**2*exp(x + exp(2*x))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.63 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=x^{2} e^{\left (x + e^{\left (2 \, x\right )}\right )} - {\left (x^{2} - 2 \, x + 2\right )} e^{x} - 2 \, {\left (x - 1\right )} e^{x} \]

[In]

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

[Out]

x^2*e^(x + e^(2*x)) - (x^2 - 2*x + 2)*e^x - 2*(x - 1)*e^x

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=x^{2} e^{\left (x + e^{\left (2 \, x\right )}\right )} - x^{2} e^{x} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 13.36 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68 \[ \int \left (e^x \left (-2 x-x^2\right )+e^{e^{2 x}+x} \left (2 x+x^2+2 e^{2 x} x^2\right )\right ) \, dx=x^2\,{\mathrm {e}}^x\,\left ({\mathrm {e}}^{{\mathrm {e}}^{2\,x}}-1\right ) \]

[In]

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

[Out]

x^2*exp(x)*(exp(exp(2*x)) - 1)