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

Optimal. Leaf size=33 \[ -2-e^{2-e^x-x}-e^{3+\log ^2\left (\frac {4}{e^4}\right )}+2 x \]

[Out]

2*x-2-exp(ln(4/exp(4))^2)*exp(3)-exp(-exp(x)+2-x)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 18, normalized size of antiderivative = 0.55, number of steps used = 3, number of rules used = 2, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2320, 2228} \begin {gather*} 2 x-e^{-x-e^x+2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2228

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> With[{b = Coefficient[v, x, 1], d = Coefficient[u, x, 0],
e = Coefficient[u, x, 1], f = Coefficient[w, x, 0], g = Coefficient[w, x, 1]}, Simp[g*u^(m + 1)*(F^(c*v)/(b*c*
e*Log[F])), x] /; EqQ[e*g*(m + 1) - b*c*(e*f - d*g)*Log[F], 0]] /; FreeQ[{F, c, m}, x] && LinearQ[{u, v, w}, x
]

Rule 2320

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 18, normalized size = 0.55 \begin {gather*} -e^{2-e^x-x}+2 x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 0.05, size = 32, normalized size = 0.97

method result size
norman \(2 x -{\mathrm e}^{-{\mathrm e}^{x}+2-x}\) \(17\)
risch \(2 x -{\mathrm e}^{-{\mathrm e}^{x}+2-x}\) \(17\)
default \(2 x -{\mathrm e}^{2} \expIntegral \left (1, {\mathrm e}^{x}\right )+{\mathrm e}^{2} \left (-{\mathrm e}^{-{\mathrm e}^{x}} {\mathrm e}^{-x}+\expIntegral \left (1, {\mathrm e}^{x}\right )\right )\) \(32\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*x-exp(2)*Ei(1,exp(x))+exp(2)*(-1/exp(exp(x))/exp(x)+Ei(1,exp(x)))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 16, normalized size = 0.48 \begin {gather*} 2 \, x - e^{\left (-x - e^{x} + 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 16, normalized size = 0.48 \begin {gather*} 2 \, x - e^{\left (-x - e^{x} + 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.04, size = 10, normalized size = 0.30 \begin {gather*} 2 x - e^{- x - e^{x} + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.40, size = 16, normalized size = 0.48 \begin {gather*} 2 \, x - e^{\left (-x - e^{x} + 2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.07, size = 17, normalized size = 0.52 \begin {gather*} 2\,x-{\mathrm {e}}^{-x}\,{\mathrm {e}}^2\,{\mathrm {e}}^{-{\mathrm {e}}^x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________