\(\int e^{-x} (e^x (1+e^2 (-4-2 x))+e^9 (-1+x)) \, dx\) [7529]

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

Optimal result

Integrand size = 29, antiderivative size = 18 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=x-e^2 x \left (4+e^{7-x}+x\right ) \]

[Out]

x-exp(2)*x*(exp(4)/exp(x)*exp(1)/exp(-2)+4+x)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.89, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {6820, 2207, 2225} \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=-e^2 (x+2)^2-e^{9-x}+e^{9-x} (1-x)+x \]

[In]

Int[(E^x*(1 + E^2*(-4 - 2*x)) + E^9*(-1 + x))/E^x,x]

[Out]

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

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 6820

Int[u_, x_Symbol] :> With[{v = SimplifyIntegrand[u, x]}, Int[v, x] /; SimplerIntegrandQ[v, u, x]]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.44 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=x-4 e^2 x-e^{9-x} x-e^2 x^2 \]

[In]

Integrate[(E^x*(1 + E^2*(-4 - 2*x)) + E^9*(-1 + x))/E^x,x]

[Out]

x - 4*E^2*x - E^(9 - x)*x - E^2*x^2

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.33

method result size
risch \(-x^{2} {\mathrm e}^{2}-4 \,{\mathrm e}^{2} x +x -x \,{\mathrm e}^{9-x}\) \(24\)
parts \(x -{\mathrm e}^{-x} {\mathrm e} \left ({\mathrm e}^{4}\right )^{2} x -x^{2} {\mathrm e}^{2}-4 \,{\mathrm e}^{2} x\) \(30\)
norman \(\left (\left (-4 \,{\mathrm e}^{2}+1\right ) x \,{\mathrm e}^{x}-x^{2} {\mathrm e}^{2} {\mathrm e}^{x}-{\mathrm e} \left ({\mathrm e}^{4}\right )^{2} x \right ) {\mathrm e}^{-x}\) \(37\)
parallelrisch \(-\left ({\mathrm e} \left ({\mathrm e}^{4}\right )^{2} x +x^{2} {\mathrm e}^{2} {\mathrm e}^{x}+4 x \,{\mathrm e}^{2} {\mathrm e}^{x}-{\mathrm e}^{x} x \right ) {\mathrm e}^{-x}\) \(38\)
default \(x +{\mathrm e} \left ({\mathrm e}^{4}\right )^{2} \left (-x \,{\mathrm e}^{-x}-{\mathrm e}^{-x}\right )-x^{2} {\mathrm e}^{2}+{\mathrm e}^{-x} {\mathrm e} \left ({\mathrm e}^{4}\right )^{2}-4 \,{\mathrm e}^{2} x\) \(51\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.56 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=-{\left (x e^{9} + {\left ({\left (x^{2} + 4 \, x\right )} e^{2} - x\right )} e^{x}\right )} e^{\left (-x\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.22 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=- x^{2} e^{2} + x \left (1 - 4 e^{2}\right ) - x e^{9} e^{- x} \]

[In]

integrate((((-2*x-4)*exp(2)+1)*exp(x)+(-1+x)*exp(1)*exp(2)**2*exp(4))/exp(x),x)

[Out]

-x**2*exp(2) + x*(1 - 4*exp(2)) - x*exp(9)*exp(-x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 33 vs. \(2 (16) = 32\).

Time = 0.22 (sec) , antiderivative size = 33, normalized size of antiderivative = 1.83 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=-x^{2} e^{2} - 4 \, x e^{2} - {\left (x e^{9} + e^{9}\right )} e^{\left (-x\right )} + x + e^{\left (-x + 9\right )} \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.22 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=-{\left (x^{2} + 4 \, x\right )} e^{2} - x e^{\left (-x + 9\right )} + x \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.42 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06 \[ \int e^{-x} \left (e^x \left (1+e^2 (-4-2 x)\right )+e^9 (-1+x)\right ) \, dx=-x\,\left (4\,{\mathrm {e}}^2+{\mathrm {e}}^{9-x}+x\,{\mathrm {e}}^2-1\right ) \]

[In]

int(-exp(-x)*(exp(x)*(exp(2)*(2*x + 4) - 1) - exp(9)*(x - 1)),x)

[Out]

-x*(4*exp(2) + exp(9 - x) + x*exp(2) - 1)