3.13.2 \(\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\)

Optimal. Leaf size=27 \[ 8-e^{-((-2+x) x)} \left (3-9 (-5+x)+e^5 \log (2+x)\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.92, antiderivative size = 46, normalized size of antiderivative = 1.70, number of steps used = 18, number of rules used = 9, integrand size = 55, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.164, Rules used = {6741, 6742, 2234, 2205, 2240, 2241, 2236, 2554, 12} \begin {gather*} 9 e^{2 x-x^2} x-48 e^{2 x-x^2}-e^{-x^2+2 x+5} \log (x+2) \end {gather*}

Antiderivative was successfully verified.

[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 2205

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 2234

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 2236

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 2240

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 2241

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 2554

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 6741

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

Rule 6742

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

Rubi steps

\begin {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]  time = 0.48, size = 23, normalized size = 0.85 \begin {gather*} e^{-((-2+x) x)} \left (-48+9 x-e^5 \log (2+x)\right ) \end {gather*}

Antiderivative was successfully verified.

[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)

________________________________________________________________________________________

fricas [A]  time = 0.71, size = 35, normalized size = 1.30 \begin {gather*} 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 ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

giac [A]  time = 0.31, size = 43, normalized size = 1.59 \begin {gather*} 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 )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

maple [A]  time = 0.19, size = 25, normalized size = 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\)
risch \(-\ln \left (2+x \right ) {\mathrm e}^{-x^{2}+2 x +5}+3 \left (3 x -16\right ) {\mathrm e}^{-\left (x -2\right ) x}\) \(33\)



Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

maxima [A]  time = 0.51, size = 31, normalized size = 1.15 \begin {gather*} {\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 )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

mupad [B]  time = 1.18, size = 24, normalized size = 0.89 \begin {gather*} -{\mathrm {e}}^{2\,x-x^2}\,\left (\ln \left (x+2\right )\,{\mathrm {e}}^5-9\,x+48\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________

sympy [A]  time = 0.48, size = 20, normalized size = 0.74 \begin {gather*} \left (9 x - e^{5} \log {\left (x + 2 \right )} - 48\right ) e^{- x^{2} + 2 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________