\(\int \frac {-10+x^2+e^x (2-2 x+x^2)-2 \log (3)}{x^2} \, dx\) [233]

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

Optimal result

Integrand size = 25, antiderivative size = 25 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=-e^3+x+\frac {(2-x) \left (5-e^x+\log (3)\right )}{x} \]

[Out]

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

Rubi [A] (verified)

Time = 0.09 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88, number of steps used = 10, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {14, 2230, 2225, 2208, 2209} \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=x+e^x-\frac {2 e^x}{x}+\frac {2 (5+\log (3))}{x} \]

[In]

Int[(-10 + x^2 + E^x*(2 - 2*x + x^2) - 2*Log[3])/x^2,x]

[Out]

E^x - (2*E^x)/x + x + (2*(5 + Log[3]))/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 2208

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] &&  !TrueQ[$UseGamm
a]

Rule 2209

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(F^(g*(e - c*(f/d)))/d)*ExpInteg
ralEi[f*g*(c + d*x)*(Log[F]/d)], x] /; FreeQ[{F, c, d, e, f, g}, x] &&  !TrueQ[$UseGamma]

Rule 2225

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 2230

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] &&  !TrueQ[$UseGamma]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {e^x \left (2-2 x+x^2\right )}{x^2}+\frac {-10+x^2-2 \log (3)}{x^2}\right ) \, dx \\ & = \int \frac {e^x \left (2-2 x+x^2\right )}{x^2} \, dx+\int \frac {-10+x^2-2 \log (3)}{x^2} \, dx \\ & = \int \left (e^x+\frac {2 e^x}{x^2}-\frac {2 e^x}{x}\right ) \, dx+\int \left (1-\frac {2 (5+\log (3))}{x^2}\right ) \, dx \\ & = x+\frac {2 (5+\log (3))}{x}+2 \int \frac {e^x}{x^2} \, dx-2 \int \frac {e^x}{x} \, dx+\int e^x \, dx \\ & = e^x-\frac {2 e^x}{x}+x-2 \operatorname {ExpIntegralEi}(x)+\frac {2 (5+\log (3))}{x}+2 \int \frac {e^x}{x} \, dx \\ & = e^x-\frac {2 e^x}{x}+x+\frac {2 (5+\log (3))}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.72 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=\frac {10+e^x (-2+x)+x^2+\log (9)}{x} \]

[In]

Integrate[(-10 + x^2 + E^x*(2 - 2*x + x^2) - 2*Log[3])/x^2,x]

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.88

method result size
norman \(\frac {x^{2}+{\mathrm e}^{x} x -2 \,{\mathrm e}^{x}+2 \ln \left (3\right )+10}{x}\) \(22\)
parallelrisch \(\frac {x^{2}+{\mathrm e}^{x} x -2 \,{\mathrm e}^{x}+2 \ln \left (3\right )+10}{x}\) \(22\)
parts \(-\frac {2 \,{\mathrm e}^{x}}{x}+{\mathrm e}^{x}+x +\frac {2 \ln \left (3\right )+10}{x}\) \(22\)
default \(x +\frac {10}{x}+\frac {2 \ln \left (3\right )}{x}-\frac {2 \,{\mathrm e}^{x}}{x}+{\mathrm e}^{x}\) \(24\)
risch \(x +\frac {2 \ln \left (3\right )}{x}+\frac {10}{x}+\frac {\left (-2+x \right ) {\mathrm e}^{x}}{x}\) \(24\)

[In]

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

[Out]

(x^2+exp(x)*x-2*exp(x)+2*ln(3)+10)/x

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.76 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=\frac {x^{2} + {\left (x - 2\right )} e^{x} + 2 \, \log \left (3\right ) + 10}{x} \]

[In]

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

[Out]

(x^2 + (x - 2)*e^x + 2*log(3) + 10)/x

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.68 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=x + \frac {\left (x - 2\right ) e^{x}}{x} + \frac {2 \log {\left (3 \right )} + 10}{x} \]

[In]

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

[Out]

x + (x - 2)*exp(x)/x + (2*log(3) + 10)/x

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.22 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.08 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=x + \frac {2 \, \log \left (3\right )}{x} + \frac {10}{x} - 2 \, {\rm Ei}\left (x\right ) + e^{x} + 2 \, \Gamma \left (-1, -x\right ) \]

[In]

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

[Out]

x + 2*log(3)/x + 10/x - 2*Ei(x) + e^x + 2*gamma(-1, -x)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=\frac {x^{2} + x e^{x} - 2 \, e^{x} + 2 \, \log \left (3\right ) + 10}{x} \]

[In]

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

[Out]

(x^2 + x*e^x - 2*e^x + 2*log(3) + 10)/x

Mupad [B] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {-10+x^2+e^x \left (2-2 x+x^2\right )-2 \log (3)}{x^2} \, dx=x+{\mathrm {e}}^x+\frac {\ln \left (9\right )-2\,{\mathrm {e}}^x+10}{x} \]

[In]

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

[Out]

x + exp(x) + (log(9) - 2*exp(x) + 10)/x