3.20.48 \(\int \frac {e^{-x} (-2-2 x-x^2+e^5 x^2-2 e^x x^2)}{2 x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.39, antiderivative size = 29, normalized size of antiderivative = 0.97, number of steps used = 10, number of rules used = 7, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.189, Rules used = {6, 12, 6742, 2199, 2194, 2177, 2178} \begin {gather*} -x+\frac {1}{2} \left (1-e^5\right ) e^{-x}+\frac {e^{-x}}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, 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 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 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^{-x} \left (-2-2 x-2 e^x x^2+\left (-1+e^5\right ) x^2\right )}{2 x^2} \, dx\\ &=\frac {1}{2} \int \frac {e^{-x} \left (-2-2 x-2 e^x x^2+\left (-1+e^5\right ) x^2\right )}{x^2} \, dx\\ &=\frac {1}{2} \int \left (-2+\frac {e^{-x} \left (-2-2 x-\left (1-e^5\right ) x^2\right )}{x^2}\right ) \, dx\\ &=-x+\frac {1}{2} \int \frac {e^{-x} \left (-2-2 x-\left (1-e^5\right ) x^2\right )}{x^2} \, dx\\ &=-x+\frac {1}{2} \int \left (e^{-x} \left (-1+e^5\right )-\frac {2 e^{-x}}{x^2}-\frac {2 e^{-x}}{x}\right ) \, dx\\ &=-x+\frac {1}{2} \left (-1+e^5\right ) \int e^{-x} \, dx-\int \frac {e^{-x}}{x^2} \, dx-\int \frac {e^{-x}}{x} \, dx\\ &=\frac {1}{2} e^{-x} \left (1-e^5\right )+\frac {e^{-x}}{x}-x-\text {Ei}(-x)+\int \frac {e^{-x}}{x} \, dx\\ &=\frac {1}{2} e^{-x} \left (1-e^5\right )+\frac {e^{-x}}{x}-x\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.72, size = 32, normalized size = 1.07 \begin {gather*} -\frac {{\left (x^{2} e^{\left (x + \log \relax (2)\right )} + x e^{5} - x - 2\right )} e^{\left (-x - \log \relax (2)\right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.23, size = 32, normalized size = 1.07 \begin {gather*} -\frac {2 \, x^{2} - x e^{\left (-x\right )} + x e^{\left (-x + 5\right )} - 2 \, e^{\left (-x\right )}}{2 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.10, size = 23, normalized size = 0.77




method result size



risch \(-x -\frac {\left (x \,{\mathrm e}^{5}-x -2\right ) {\mathrm e}^{-x}}{2 x}\) \(23\)
norman \(\frac {\left (2+\left (1-{\mathrm e}^{5}\right ) x -x^{2} {\mathrm e}^{\ln \relax (2)+x}\right ) {\mathrm e}^{-x}}{2 x}\) \(32\)
derivativedivides \(-{\mathrm e}^{5} {\mathrm e}^{-x -\ln \relax (2)}-\ln \relax (2)-x +\frac {2 \,{\mathrm e}^{-x -\ln \relax (2)}}{x}+{\mathrm e}^{-x -\ln \relax (2)}\) \(45\)
default \(-{\mathrm e}^{5} {\mathrm e}^{-x -\ln \relax (2)}-\ln \relax (2)-x +\frac {2 \,{\mathrm e}^{-x -\ln \relax (2)}}{x}+{\mathrm e}^{-x -\ln \relax (2)}\) \(45\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x^2*exp(ln(2)+x)+x^2*exp(5)-x^2-2*x-2)/x^2/exp(ln(2)+x),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [C]  time = 0.38, size = 27, normalized size = 0.90 \begin {gather*} -x - {\rm Ei}\left (-x\right ) + \frac {1}{2} \, e^{\left (-x\right )} - \frac {1}{2} \, e^{\left (-x + 5\right )} + \Gamma \left (-1, x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x - Ei(-x) + 1/2*e^(-x) - 1/2*e^(-x + 5) + gamma(-1, x)

________________________________________________________________________________________

mupad [B]  time = 1.19, size = 24, normalized size = 0.80 \begin {gather*} \frac {{\mathrm {e}}^{-x}}{x}-x-{\mathrm {e}}^{-x}\,\left (\frac {{\mathrm {e}}^5}{2}-\frac {1}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(exp(- x - log(2))*(2*x - x^2*exp(5) + x^2 + x^2*exp(x + log(2)) + 2))/x^2,x)

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.12, size = 15, normalized size = 0.50 \begin {gather*} - x + \frac {\left (- x e^{5} + x + 2\right ) e^{- x}}{2 x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x**2*exp(ln(2)+x)+x**2*exp(5)-x**2-2*x-2)/x**2/exp(ln(2)+x),x)

[Out]

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

________________________________________________________________________________________