3.30.16 \(\int \frac {e^{-x} (e^x (-4-4 x-x^2)+e (-2+2 x+x^2))}{4+4 x+x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.22, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {27, 6688, 2199, 2194, 2177, 2178} \begin {gather*} -x-e^{1-x}+\frac {2 e^{1-x}}{x+2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 2177

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[((c + d*x)^(m
 + 1)*(b*F^(g*(e + f*x)))^n)/(d*(m + 1)), x] - Dist[(f*g*n*Log[F])/(d*(m + 1)), 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] && LtQ[m, -1] && IntegerQ[2*m] &&  !$UseGamma ===
True

Rule 2178

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - (c*f)/d))*ExpIntegral
Ei[(f*g*(c + d*x)*Log[F])/d])/d, x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !$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 2199

Int[(F_)^((c_.)*(v_))*(u_)^(m_.)*(w_), x_Symbol] :> Int[ExpandIntegrand[F^(c*ExpandToSum[v, x]), w*NormalizePo
werOfLinear[u, x]^m, x], x] /; FreeQ[{F, c}, x] && PolynomialQ[w, x] && LinearQ[v, x] && PowerOfLinearQ[u, x]
&& IntegerQ[m] &&  !$UseGamma === True

Rule 6688

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 25, normalized size = 0.93 \begin {gather*} -x-\frac {e^{1-x} \left (2 x+x^2\right )}{(2+x)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.68, size = 26, normalized size = 0.96 \begin {gather*} -\frac {{\left (x e + {\left (x^{2} + 2 \, x\right )} e^{x}\right )} e^{\left (-x\right )}}{x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.25, size = 22, normalized size = 0.81 \begin {gather*} -\frac {x^{2} + x e^{\left (-x + 1\right )} + 2 \, x}{x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.52, size = 19, normalized size = 0.70




method result size



risch \(-x -\frac {x \,{\mathrm e}^{1-x}}{2+x}\) \(19\)
norman \(\frac {\left (4 \,{\mathrm e}^{x}-x \,{\mathrm e}-{\mathrm e}^{x} x^{2}\right ) {\mathrm e}^{-x}}{2+x}\) \(28\)
default \({\mathrm e} \left (-{\mathrm e}^{-x}-\frac {4 \,{\mathrm e}^{-x}}{2+x}+8 \,{\mathrm e}^{2} \expIntegralEi \left (1, 2+x \right )\right )-x -2 \,{\mathrm e} \left (-\frac {{\mathrm e}^{-x}}{2+x}+{\mathrm e}^{2} \expIntegralEi \left (1, 2+x \right )\right )+2 \,{\mathrm e} \left (\frac {2 \,{\mathrm e}^{-x}}{2+x}-3 \,{\mathrm e}^{2} \expIntegralEi \left (1, 2+x \right )\right )\) \(84\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {2 \, e^{3} E_{2}\left (x + 2\right )}{x + 2} - \frac {x^{2} + x e^{\left (-x + 1\right )} + 2 \, x}{x + 2} + 2 \, \int \frac {e^{\left (-x + 1\right )}}{x^{2} + 4 \, x + 4}\,{d x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*e^3*exp_integral_e(2, x + 2)/(x + 2) - (x^2 + x*e^(-x + 1) + 2*x)/(x + 2) + 2*integrate(e^(-x + 1)/(x^2 + 4*
x + 4), x)

________________________________________________________________________________________

mupad [B]  time = 0.11, size = 33, normalized size = 1.22 \begin {gather*} -\frac {2\,x}{x+2}-\frac {x^2}{x+2}-\frac {x\,{\mathrm {e}}^{1-x}}{x+2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.14, size = 14, normalized size = 0.52 \begin {gather*} - x - \frac {e x e^{- x}}{x + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________