3.101.68 \(\int (2+e^{-2 e^x+2 x} (2 e^2-2 e^{2+x})-2 x) \, dx\)

Optimal. Leaf size=21 \[ e^{2-2 e^x+2 x}+2 x-x^2 \]

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 5, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {2282, 12, 2196, 2176, 2194} \begin {gather*} -x^2+2 x+e^{2 x-2 e^x+2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2176

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] &&  !$UseGamma === True

Rule 2194

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 2196

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] &&  !$UseGamma === True

Rule 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=2 x-x^2+\int e^{-2 e^x+2 x} \left (2 e^2-2 e^{2+x}\right ) \, dx\\ &=2 x-x^2+\operatorname {Subst}\left (\int 2 e^{2-2 x} (1-x) x \, dx,x,e^x\right )\\ &=2 x-x^2+2 \operatorname {Subst}\left (\int e^{2-2 x} (1-x) x \, dx,x,e^x\right )\\ &=2 x-x^2+2 \operatorname {Subst}\left (\int \left (e^{2-2 x} x-e^{2-2 x} x^2\right ) \, dx,x,e^x\right )\\ &=2 x-x^2+2 \operatorname {Subst}\left (\int e^{2-2 x} x \, dx,x,e^x\right )-2 \operatorname {Subst}\left (\int e^{2-2 x} x^2 \, dx,x,e^x\right )\\ &=-e^{2-2 e^x+x}+e^{2-2 e^x+2 x}+2 x-x^2-2 \operatorname {Subst}\left (\int e^{2-2 x} x \, dx,x,e^x\right )+\operatorname {Subst}\left (\int e^{2-2 x} \, dx,x,e^x\right )\\ &=-\frac {1}{2} e^{2-2 e^x}+e^{2-2 e^x+2 x}+2 x-x^2-\operatorname {Subst}\left (\int e^{2-2 x} \, dx,x,e^x\right )\\ &=e^{2-2 e^x+2 x}+2 x-x^2\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 21, normalized size = 1.00 \begin {gather*} e^{2-2 e^x+2 x}+2 x-x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.54, size = 27, normalized size = 1.29 \begin {gather*} -x^{2} + 2 \, x + e^{\left (2 \, {\left (x e^{2} - e^{\left (x + 2\right )}\right )} e^{\left (-2\right )} + 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.15, size = 19, normalized size = 0.90 \begin {gather*} -x^{2} + 2 \, x + e^{\left (2 \, x - 2 \, e^{x} + 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.04, size = 20, normalized size = 0.95




method result size



risch \(2 x -x^{2}+{\mathrm e}^{2-2 \,{\mathrm e}^{x}+2 x}\) \(20\)
norman \(2 x -x^{2}+{\mathrm e}^{2} {\mathrm e}^{-2 \,{\mathrm e}^{x}+2 x}\) \(24\)
default \(2 x +2 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{x} {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{2}-\frac {{\mathrm e}^{-2 \,{\mathrm e}^{x}}}{4}\right )-2 \,{\mathrm e}^{2} \left (-\frac {{\mathrm e}^{2 x} {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{2}-\frac {{\mathrm e}^{x} {\mathrm e}^{-2 \,{\mathrm e}^{x}}}{2}-\frac {{\mathrm e}^{-2 \,{\mathrm e}^{x}}}{4}\right )-x^{2}\) \(67\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.38, size = 19, normalized size = 0.90 \begin {gather*} -x^{2} + 2 \, x + e^{\left (2 \, x - 2 \, e^{x} + 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 5.97, size = 21, normalized size = 1.00 \begin {gather*} 2\,x-x^2+{\mathrm {e}}^{2\,x}\,{\mathrm {e}}^2\,{\mathrm {e}}^{-2\,{\mathrm {e}}^x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.17, size = 19, normalized size = 0.90 \begin {gather*} - x^{2} + 2 x + e^{2} e^{2 x - 2 e^{x}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________