\(\int (2 e^{-2+2 x}+2 x-6 x^2+4 x^3+e^{-1+x} (2-2 x-2 x^2)) \, dx\) [6021]

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

Optimal result

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

[Out]

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

Rubi [B] (verified)

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

Time = 0.04 (sec) , antiderivative size = 37, normalized size of antiderivative = 2.31, number of steps used = 10, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {2225, 2227, 2207} \[ \int \left (2 e^{-2+2 x}+2 x-6 x^2+4 x^3+e^{-1+x} \left (2-2 x-2 x^2\right )\right ) \, dx=x^4-2 x^3-2 e^{x-1} x^2+x^2+2 e^{x-1} x+e^{2 x-2} \]

[In]

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

[Out]

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [B] (verified)

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

Time = 0.14 (sec) , antiderivative size = 33, normalized size of antiderivative = 2.06

method result size
risch \({\mathrm e}^{-2+2 x}+\left (-2 x^{2}+2 x \right ) {\mathrm e}^{-1+x}+x^{4}-2 x^{3}+x^{2}\) \(33\)
norman \(x^{4}-2 x^{2} {\mathrm e}^{-1+x}-2 x^{3}+2 x \,{\mathrm e}^{-1+x}+x^{2}+{\mathrm e}^{-2+2 x}\) \(35\)
parallelrisch \(x^{4}-2 x^{2} {\mathrm e}^{-1+x}-2 x^{3}+2 x \,{\mathrm e}^{-1+x}+x^{2}+{\mathrm e}^{-2+2 x}\) \(35\)
default \(-2 \,{\mathrm e}^{-1+x} \left (-1+x \right )-2 \,{\mathrm e}^{-1+x} \left (-1+x \right )^{2}+x^{2}-2 x^{3}+x^{4}+{\mathrm e}^{-2+2 x}\) \(39\)
parts \(-2 \,{\mathrm e}^{-1+x} \left (-1+x \right )-2 \,{\mathrm e}^{-1+x} \left (-1+x \right )^{2}+x^{2}-2 x^{3}+x^{4}+{\mathrm e}^{-2+2 x}\) \(39\)
derivativedivides \(-2+2 x -2 \,{\mathrm e}^{-1+x} \left (-1+x \right )-2 \,{\mathrm e}^{-1+x} \left (-1+x \right )^{2}+\left (-1+x \right )^{2}-2 x^{3}+x^{4}+{\mathrm e}^{-2+2 x}\) \(45\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

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

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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