\(\int (-3 e^{3 x}+e^{2 x} (-2+4 e^4-4 x)+e^x (-e^8-2 x-x^2+e^4 (2+2 x))) \, dx\) [3604]

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

Optimal result

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

[Out]

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

Rubi [B] (verified)

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

Time = 0.05 (sec) , antiderivative size = 62, normalized size of antiderivative = 3.26, number of steps used = 14, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.059, Rules used = {2225, 2207, 2227} \[ \int \left (-3 e^{3 x}+e^{2 x} \left (-2+4 e^4-4 x\right )+e^x \left (-e^8-2 x-x^2+e^4 (2+2 x)\right )\right ) \, dx=-e^x x^2+e^{2 x}-e^{3 x}-2 e^{x+4}-e^{x+8}+2 e^{x+4} (x+1)-e^{2 x} \left (2 x-2 e^4+1\right ) \]

[In]

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

[Out]

E^(2*x) - E^(3*x) - 2*E^(4 + x) - E^(8 + x) - E^x*x^2 + 2*E^(4 + x)*(1 + x) - E^(2*x)*(1 - 2*E^4 + 2*x)

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [B] (verified)

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

Time = 0.50 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.05

method result size
risch \(-{\mathrm e}^{3 x}+\left (2 \,{\mathrm e}^{4}-2 x \right ) {\mathrm e}^{2 x}+\left (-{\mathrm e}^{8}+2 x \,{\mathrm e}^{4}-x^{2}\right ) {\mathrm e}^{x}\) \(39\)
norman \(2 x \,{\mathrm e}^{4} {\mathrm e}^{x}-{\mathrm e}^{x} x^{2}+2 \,{\mathrm e}^{2 x} {\mathrm e}^{4}-2 x \,{\mathrm e}^{2 x}-{\mathrm e}^{8} {\mathrm e}^{x}-{\mathrm e}^{3 x}\) \(45\)
parallelrisch \(2 x \,{\mathrm e}^{4} {\mathrm e}^{x}-{\mathrm e}^{x} x^{2}+2 \,{\mathrm e}^{2 x} {\mathrm e}^{4}-2 x \,{\mathrm e}^{2 x}-{\mathrm e}^{8} {\mathrm e}^{x}-{\mathrm e}^{3 x}\) \(45\)
default \(-2 x \,{\mathrm e}^{2 x}+2 \,{\mathrm e}^{2 x} {\mathrm e}^{4}-{\mathrm e}^{x} x^{2}+2 \,{\mathrm e}^{4} {\mathrm e}^{x}-{\mathrm e}^{8} {\mathrm e}^{x}+2 \,{\mathrm e}^{4} \left ({\mathrm e}^{x} x -{\mathrm e}^{x}\right )-{\mathrm e}^{3 x}\) \(57\)
parts \(-2 x \,{\mathrm e}^{2 x}+2 \,{\mathrm e}^{2 x} {\mathrm e}^{4}-{\mathrm e}^{x} x^{2}+2 \,{\mathrm e}^{4} {\mathrm e}^{x}-{\mathrm e}^{8} {\mathrm e}^{x}+2 \,{\mathrm e}^{4} \left ({\mathrm e}^{x} x -{\mathrm e}^{x}\right )-{\mathrm e}^{3 x}\) \(57\)
meijerg \(2-{\mathrm e}^{3 x}-\left (2 \,{\mathrm e}^{4}-1\right ) \left (1-{\mathrm e}^{2 x}\right )-\left (-{\mathrm e}^{8}+2 \,{\mathrm e}^{4}\right ) \left (1-{\mathrm e}^{x}\right )-\frac {\left (3 x^{2}-6 x +6\right ) {\mathrm e}^{x}}{3}+\frac {\left (-4 x +2\right ) {\mathrm e}^{2 x}}{2}-\left (-2 \,{\mathrm e}^{4}+2\right ) \left (1-\frac {\left (2-2 x \right ) {\mathrm e}^{x}}{2}\right )\) \(86\)

[In]

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

[Out]

-exp(3*x)+(2*exp(4)-2*x)*exp(2*x)+(-exp(8)+2*x*exp(4)-x^2)*exp(x)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (14) = 28\).

Time = 0.24 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \left (-3 e^{3 x}+e^{2 x} \left (-2+4 e^4-4 x\right )+e^x \left (-e^8-2 x-x^2+e^4 (2+2 x)\right )\right ) \, dx=-2 \, {\left (x - e^{4}\right )} e^{\left (2 \, x\right )} - {\left (x^{2} - 2 \, x e^{4} + e^{8}\right )} e^{x} - e^{\left (3 \, x\right )} \]

[In]

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

[Out]

-2*(x - e^4)*e^(2*x) - (x^2 - 2*x*e^4 + e^8)*e^x - e^(3*x)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (14) = 28\).

Time = 0.09 (sec) , antiderivative size = 34, normalized size of antiderivative = 1.79 \[ \int \left (-3 e^{3 x}+e^{2 x} \left (-2+4 e^4-4 x\right )+e^x \left (-e^8-2 x-x^2+e^4 (2+2 x)\right )\right ) \, dx=\left (- 2 x + 2 e^{4}\right ) e^{2 x} + \left (- x^{2} + 2 x e^{4} - e^{8}\right ) e^{x} - e^{3 x} \]

[In]

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

[Out]

(-2*x + 2*exp(4))*exp(2*x) + (-x**2 + 2*x*exp(4) - exp(8))*exp(x) - exp(3*x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (14) = 28\).

Time = 0.20 (sec) , antiderivative size = 63, normalized size of antiderivative = 3.32 \[ \int \left (-3 e^{3 x}+e^{2 x} \left (-2+4 e^4-4 x\right )+e^x \left (-e^8-2 x-x^2+e^4 (2+2 x)\right )\right ) \, dx=-2 \, {\left (x - e^{4}\right )} e^{\left (2 \, x\right )} - {\left (x^{2} - 2 \, x + 2\right )} e^{x} + 2 \, {\left (x e^{4} - e^{4}\right )} e^{x} - 2 \, {\left (x - 1\right )} e^{x} - e^{\left (3 \, x\right )} - e^{\left (x + 8\right )} + 2 \, e^{\left (x + 4\right )} \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 42 vs. \(2 (14) = 28\).

Time = 0.26 (sec) , antiderivative size = 42, normalized size of antiderivative = 2.21 \[ \int \left (-3 e^{3 x}+e^{2 x} \left (-2+4 e^4-4 x\right )+e^x \left (-e^8-2 x-x^2+e^4 (2+2 x)\right )\right ) \, dx=-x^{2} e^{x} - 2 \, x e^{\left (2 \, x\right )} + 2 \, x e^{\left (x + 4\right )} - e^{\left (3 \, x\right )} + 2 \, e^{\left (2 \, x + 4\right )} - e^{\left (x + 8\right )} \]

[In]

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

[Out]

-x^2*e^x - 2*x*e^(2*x) + 2*x*e^(x + 4) - e^(3*x) + 2*e^(2*x + 4) - e^(x + 8)

Mupad [B] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.74 \[ \int \left (-3 e^{3 x}+e^{2 x} \left (-2+4 e^4-4 x\right )+e^x \left (-e^8-2 x-x^2+e^4 (2+2 x)\right )\right ) \, dx=-{\mathrm {e}}^x\,{\left (x-{\mathrm {e}}^4+{\mathrm {e}}^x\right )}^2 \]

[In]

int(- 3*exp(3*x) - exp(2*x)*(4*x - 4*exp(4) + 2) - exp(x)*(2*x + exp(8) + x^2 - exp(4)*(2*x + 2)),x)

[Out]

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