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

   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 [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96, number of steps used = 10, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.233, Rules used = {14, 2230, 2225, 2208, 2209, 2436, 2332} \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=x+e^x+\frac {5 e^x}{x}+x \log (3)-(x+5) \log (x+5) \]

[In]

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

[Out]

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

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

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

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96 \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=e^x+\frac {5 e^x}{x}+x+x \log (3)-(5+x) \log (5+x) \]

[In]

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

[Out]

E^x + (5*E^x)/x + x + x*Log[3] - (5 + x)*Log[5 + x]

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96

method result size
default \(\frac {5 \,{\mathrm e}^{x}}{x}+{\mathrm e}^{x}-3 \ln \left (\frac {5}{3}+\frac {x}{3}\right ) \left (\frac {5}{3}+\frac {x}{3}\right )+5+x\) \(26\)
parts \(\frac {5 \,{\mathrm e}^{x}}{x}+{\mathrm e}^{x}-3 \ln \left (\frac {5}{3}+\frac {x}{3}\right ) \left (\frac {5}{3}+\frac {x}{3}\right )+5+x\) \(26\)
norman \(\frac {x^{2}+{\mathrm e}^{x} x -5 x \ln \left (\frac {5}{3}+\frac {x}{3}\right )-x^{2} \ln \left (\frac {5}{3}+\frac {x}{3}\right )+5 \,{\mathrm e}^{x}}{x}\) \(37\)
risch \(-x \ln \left (\frac {5}{3}+\frac {x}{3}\right )-\frac {5 x \ln \left (5+x \right )-x^{2}-{\mathrm e}^{x} x -5 \,{\mathrm e}^{x}}{x}\) \(38\)
parallelrisch \(\frac {-x^{2} \ln \left (\frac {5}{3}+\frac {x}{3}\right )+x^{2}+{\mathrm e}^{x} x -5 x \ln \left (\frac {5}{3}+\frac {x}{3}\right )-5 x +5 \,{\mathrm e}^{x}}{x}\) \(40\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.07 \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=\frac {x^{2} + {\left (x + 5\right )} e^{x} - {\left (x^{2} + 5 \, x\right )} \log \left (\frac {1}{3} \, x + \frac {5}{3}\right )}{x} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96 \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=- x \log {\left (\frac {x}{3} + \frac {5}{3} \right )} + x - 5 \log {\left (x + 5 \right )} + \frac {\left (x + 5\right ) e^{x}}{x} \]

[In]

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

[Out]

-x*log(x/3 + 5/3) + x - 5*log(x + 5) + (x + 5)*exp(x)/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.00 \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=-{\left (x + 5\right )} \log \left (\frac {1}{3} \, x + \frac {5}{3}\right ) + x + 5 \, {\rm Ei}\left (x\right ) + e^{x} - 5 \, \Gamma \left (-1, -x\right ) + 5 \]

[In]

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

[Out]

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

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (22) = 44\).

Time = 0.28 (sec) , antiderivative size = 68, normalized size of antiderivative = 2.52 \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=-\frac {{\left (x + 5\right )}^{2} e^{5} \log \left (\frac {1}{3} \, x + \frac {5}{3}\right ) - {\left (x + 5\right )}^{2} e^{5} - 5 \, {\left (x + 5\right )} e^{5} \log \left (\frac {1}{3} \, x + \frac {5}{3}\right ) + 5 \, {\left (x + 5\right )} e^{5} - {\left (x + 5\right )} e^{\left (x + 5\right )}}{{\left (x + 5\right )} e^{5} - 5 \, e^{5}} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.52 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.96 \[ \int \frac {e^x \left (-5+5 x+x^2\right )-x^2 \log \left (\frac {5+x}{3}\right )}{x^2} \, dx=x-5\,\ln \left (x+5\right )+{\mathrm {e}}^x+\frac {5\,{\mathrm {e}}^x}{x}-x\,\ln \left (\frac {x}{3}+\frac {5}{3}\right ) \]

[In]

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

[Out]

x - 5*log(x + 5) + exp(x) + (5*exp(x))/x - x*log(x/3 + 5/3)