3.39.68 \(\int \frac {-4-x^2+e^{e^x+x} x^2+e^{3+x} (-128+128 x-64 x^2)}{x^2} \, dx\)

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

________________________________________________________________________________________

Rubi [A]  time = 0.37, antiderivative size = 31, normalized size of antiderivative = 1.19, number of steps used = 14, number of rules used = 7, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.184, Rules used = {14, 6742, 2282, 2194, 2199, 2177, 2178} \begin {gather*} -x+e^{e^x}-64 e^{x+3}+\frac {128 e^{x+3}}{x}+\frac {4}{x} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^E^x - 64*E^(3 + x) + 4/x + (128*E^(3 + x))/x - x

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

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 2282

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]]]

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

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 31, normalized size = 1.19 \begin {gather*} e^{e^x}-64 e^{3+x}+\frac {4}{x}+\frac {128 e^{3+x}}{x}-x \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^E^x - 64*E^(3 + x) + 4/x + (128*E^(3 + x))/x - x

________________________________________________________________________________________

fricas [B]  time = 0.95, size = 50, normalized size = 1.92 \begin {gather*} \frac {{\left (x e^{\left ({\left (x e^{3} + e^{\left (x + 3\right )}\right )} e^{\left (-3\right )} + 3\right )} - 64 \, {\left (x - 2\right )} e^{\left (2 \, x + 6\right )} - {\left (x^{2} - 4\right )} e^{\left (x + 3\right )}\right )} e^{\left (-x - 3\right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x*e^((x*e^3 + e^(x + 3))*e^(-3) + 3) - 64*(x - 2)*e^(2*x + 6) - (x^2 - 4)*e^(x + 3))*e^(-x - 3)/x

________________________________________________________________________________________

giac [B]  time = 0.30, size = 45, normalized size = 1.73 \begin {gather*} -\frac {{\left (x^{2} e^{x} + 64 \, x e^{\left (2 \, x + 3\right )} - x e^{\left (x + e^{x}\right )} - 128 \, e^{\left (2 \, x + 3\right )} - 4 \, e^{x}\right )} e^{\left (-x\right )}}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-(x^2*e^x + 64*x*e^(2*x + 3) - x*e^(x + e^x) - 128*e^(2*x + 3) - 4*e^x)*e^(-x)/x

________________________________________________________________________________________

maple [A]  time = 0.04, size = 25, normalized size = 0.96




method result size



risch \(\frac {4}{x}-x -\frac {64 \left (x -2\right ) {\mathrm e}^{3+x}}{x}+{\mathrm e}^{{\mathrm e}^{x}}\) \(25\)
norman \(\frac {4+x \,{\mathrm e}^{{\mathrm e}^{x}}-x^{2}+128 \,{\mathrm e}^{x} {\mathrm e}^{3}-64 x \,{\mathrm e}^{3} {\mathrm e}^{x}}{x}\) \(30\)
default \({\mathrm e}^{{\mathrm e}^{x}}-x +\frac {4}{x}-64 \,{\mathrm e}^{x} {\mathrm e}^{3}-128 \,{\mathrm e}^{3} \left (-\frac {{\mathrm e}^{x}}{x}-\expIntegralEi \left (1, -x \right )\right )-128 \,{\mathrm e}^{3} \expIntegralEi \left (1, -x \right )\) \(47\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4/x-x-64*(x-2)/x*exp(3+x)+exp(exp(x))

________________________________________________________________________________________

maxima [C]  time = 0.38, size = 33, normalized size = 1.27 \begin {gather*} 128 \, {\rm Ei}\relax (x) e^{3} - 128 \, e^{3} \Gamma \left (-1, -x\right ) - x + \frac {4}{x} - 64 \, e^{\left (x + 3\right )} + e^{\left (e^{x}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

128*Ei(x)*e^3 - 128*e^3*gamma(-1, -x) - x + 4/x - 64*e^(x + 3) + e^(e^x)

________________________________________________________________________________________

mupad [B]  time = 0.21, size = 28, normalized size = 1.08 \begin {gather*} {\mathrm {e}}^{{\mathrm {e}}^x}-x+\frac {4}{x}+\frac {{\mathrm {e}}^x\,\left (128\,{\mathrm {e}}^3-64\,x\,{\mathrm {e}}^3\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(exp(x + 3)*(64*x^2 - 128*x + 128) + x^2 - x^2*exp(exp(x))*exp(x) + 4)/x^2,x)

[Out]

exp(exp(x)) - x + 4/x + (exp(x)*(128*exp(3) - 64*x*exp(3)))/x

________________________________________________________________________________________

sympy [A]  time = 0.19, size = 26, normalized size = 1.00 \begin {gather*} - x + e^{e^{x}} + \frac {\left (- 64 x e^{3} + 128 e^{3}\right ) e^{x}}{x} + \frac {4}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((x**2*exp(x)*exp(exp(x))+(-64*x**2+128*x-128)*exp(3+x)-x**2-4)/x**2,x)

[Out]

-x + exp(exp(x)) + (-64*x*exp(3) + 128*exp(3))*exp(x)/x + 4/x

________________________________________________________________________________________