\(\int \frac {e^{2 x-x^2} (-174-e^5+141 x+78 x^2-18 x^3+e^5 (-4+2 x+2 x^2) \log (2+x))}{2+x} \, dx\) [1202]

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

Optimal result

Integrand size = 55, antiderivative size = 27 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=8-e^{-((-2+x) x)} \left (3-9 (-5+x)+e^5 \log (2+x)\right ) \]

[Out]

8-(ln(2+x)*exp(5)+48-9*x)/exp((-2+x)*x)

Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.70, number of steps used = 18, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.164, Rules used = {6873, 6874, 2266, 2236, 2272, 2273, 2268, 2634, 12} \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=9 e^{2 x-x^2} x-48 e^{2 x-x^2}-e^{-x^2+2 x+5} \log (x+2) \]

[In]

Int[(E^(2*x - x^2)*(-174 - E^5 + 141*x + 78*x^2 - 18*x^3 + E^5*(-4 + 2*x + 2*x^2)*Log[2 + x]))/(2 + x),x]

[Out]

-48*E^(2*x - x^2) + 9*E^(2*x - x^2)*x - E^(5 + 2*x - x^2)*Log[2 + x]

Rule 12

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

Rule 2236

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[F^a*Sqrt[Pi]*(Erf[(c + d*x)*Rt[(-b)*Log[F],
 2]]/(2*d*Rt[(-b)*Log[F], 2])), x] /; FreeQ[{F, a, b, c, d}, x] && NegQ[b]

Rule 2266

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2268

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[e*(F^(a + b*x + c*x^2)/(2
*c*Log[F])), x] /; FreeQ[{F, a, b, c, d, e}, x] && EqQ[b*e - 2*c*d, 0]

Rule 2272

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[e*(F^(a + b*x + c*x^2)/(2
*c*Log[F])), x] - Dist[(b*e - 2*c*d)/(2*c), Int[F^(a + b*x + c*x^2), x], x] /; FreeQ[{F, a, b, c, d, e}, x] &&
 NeQ[b*e - 2*c*d, 0]

Rule 2273

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)*((d_.) + (e_.)*(x_))^(m_), x_Symbol] :> Simp[e*(d + e*x)^(m - 1)*
(F^(a + b*x + c*x^2)/(2*c*Log[F])), x] + (-Dist[(b*e - 2*c*d)/(2*c), Int[(d + e*x)^(m - 1)*F^(a + b*x + c*x^2)
, x], x] - Dist[(m - 1)*(e^2/(2*c*Log[F])), Int[(d + e*x)^(m - 2)*F^(a + b*x + c*x^2), x], x]) /; FreeQ[{F, a,
 b, c, d, e}, x] && NeQ[b*e - 2*c*d, 0] && GtQ[m, 1]

Rule 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 6873

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

Rule 6874

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

Rubi steps \begin{align*} \text {integral}& = \int \frac {e^{2 x-x^2} \left (-174 \left (1+\frac {e^5}{174}\right )+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx \\ & = \int \left (\frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3\right )}{2+x}+2 e^{5+2 x-x^2} (-1+x) \log (2+x)\right ) \, dx \\ & = 2 \int e^{5+2 x-x^2} (-1+x) \log (2+x) \, dx+\int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3\right )}{2+x} \, dx \\ & = -e^{5+2 x-x^2} \log (2+x)-2 \int -\frac {e^{5+2 x-x^2}}{2 (2+x)} \, dx+\int \left (-87 e^{2 x-x^2}+114 e^{2 x-x^2} x-18 e^{2 x-x^2} x^2-\frac {e^{5+2 x-x^2}}{2+x}\right ) \, dx \\ & = -e^{5+2 x-x^2} \log (2+x)-18 \int e^{2 x-x^2} x^2 \, dx-87 \int e^{2 x-x^2} \, dx+114 \int e^{2 x-x^2} x \, dx \\ & = -57 e^{2 x-x^2}+9 e^{2 x-x^2} x-e^{5+2 x-x^2} \log (2+x)-9 \int e^{2 x-x^2} \, dx-18 \int e^{2 x-x^2} x \, dx+114 \int e^{2 x-x^2} \, dx-(87 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx \\ & = -48 e^{2 x-x^2}+9 e^{2 x-x^2} x+\frac {87}{2} e \sqrt {\pi } \text {erf}(1-x)-e^{5+2 x-x^2} \log (2+x)-18 \int e^{2 x-x^2} \, dx-(9 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx+(114 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx \\ & = -48 e^{2 x-x^2}+9 e^{2 x-x^2} x-9 e \sqrt {\pi } \text {erf}(1-x)-e^{5+2 x-x^2} \log (2+x)-(18 e) \int e^{-\frac {1}{4} (2-2 x)^2} \, dx \\ & = -48 e^{2 x-x^2}+9 e^{2 x-x^2} x-e^{5+2 x-x^2} \log (2+x) \\ \end{align*}

Mathematica [A] (verified)

Time = 1.95 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=e^{-((-2+x) x)} \left (-48+9 x-e^5 \log (2+x)\right ) \]

[In]

Integrate[(E^(2*x - x^2)*(-174 - E^5 + 141*x + 78*x^2 - 18*x^3 + E^5*(-4 + 2*x + 2*x^2)*Log[2 + x]))/(2 + x),x
]

[Out]

(-48 + 9*x - E^5*Log[2 + x])/E^((-2 + x)*x)

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.93

method result size
norman \(\left (-48+9 x -\ln \left (2+x \right ) {\mathrm e}^{5}\right ) {\mathrm e}^{-x^{2}+2 x}\) \(25\)
parallelrisch \(-\left (\ln \left (2+x \right ) {\mathrm e}^{5}+48-9 x \right ) {\mathrm e}^{-x^{2}+2 x}\) \(25\)
risch \(-\ln \left (2+x \right ) {\mathrm e}^{-x^{2}+2 x +5}+3 \left (3 x -16\right ) {\mathrm e}^{-\left (-2+x \right ) x}\) \(33\)

[In]

int(((2*x^2+2*x-4)*exp(5)*ln(2+x)-exp(5)-18*x^3+78*x^2+141*x-174)/(2+x)/exp(x^2-2*x),x,method=_RETURNVERBOSE)

[Out]

(-48+9*x-ln(2+x)*exp(5))/exp(x^2-2*x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.30 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=3 \, {\left (3 \, x - 16\right )} e^{\left (-x^{2} + 2 \, x\right )} - e^{\left (-x^{2} + 2 \, x + 5\right )} \log \left (x + 2\right ) \]

[In]

integrate(((2*x^2+2*x-4)*exp(5)*log(2+x)-exp(5)-18*x^3+78*x^2+141*x-174)/(2+x)/exp(x^2-2*x),x, algorithm="fric
as")

[Out]

3*(3*x - 16)*e^(-x^2 + 2*x) - e^(-x^2 + 2*x + 5)*log(x + 2)

Sympy [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.74 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=\left (9 x - e^{5} \log {\left (x + 2 \right )} - 48\right ) e^{- x^{2} + 2 x} \]

[In]

integrate(((2*x**2+2*x-4)*exp(5)*ln(2+x)-exp(5)-18*x**3+78*x**2+141*x-174)/(2+x)/exp(x**2-2*x),x)

[Out]

(9*x - exp(5)*log(x + 2) - 48)*exp(-x**2 + 2*x)

Maxima [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.15 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx={\left (3 \, {\left (3 \, x - 16\right )} e^{\left (2 \, x\right )} - e^{\left (2 \, x + 5\right )} \log \left (x + 2\right )\right )} e^{\left (-x^{2}\right )} \]

[In]

integrate(((2*x^2+2*x-4)*exp(5)*log(2+x)-exp(5)-18*x^3+78*x^2+141*x-174)/(2+x)/exp(x^2-2*x),x, algorithm="maxi
ma")

[Out]

(3*(3*x - 16)*e^(2*x) - e^(2*x + 5)*log(x + 2))*e^(-x^2)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 43, normalized size of antiderivative = 1.59 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=9 \, x e^{\left (-x^{2} + 2 \, x\right )} - e^{\left (-x^{2} + 2 \, x + 5\right )} \log \left (x + 2\right ) - 48 \, e^{\left (-x^{2} + 2 \, x\right )} \]

[In]

integrate(((2*x^2+2*x-4)*exp(5)*log(2+x)-exp(5)-18*x^3+78*x^2+141*x-174)/(2+x)/exp(x^2-2*x),x, algorithm="giac
")

[Out]

9*x*e^(-x^2 + 2*x) - e^(-x^2 + 2*x + 5)*log(x + 2) - 48*e^(-x^2 + 2*x)

Mupad [B] (verification not implemented)

Time = 8.28 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.89 \[ \int \frac {e^{2 x-x^2} \left (-174-e^5+141 x+78 x^2-18 x^3+e^5 \left (-4+2 x+2 x^2\right ) \log (2+x)\right )}{2+x} \, dx=-{\mathrm {e}}^{2\,x-x^2}\,\left (\ln \left (x+2\right )\,{\mathrm {e}}^5-9\,x+48\right ) \]

[In]

int((exp(2*x - x^2)*(141*x - exp(5) + 78*x^2 - 18*x^3 + log(x + 2)*exp(5)*(2*x + 2*x^2 - 4) - 174))/(x + 2),x)

[Out]

-exp(2*x - x^2)*(log(x + 2)*exp(5) - 9*x + 48)