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

Optimal. Leaf size=27 \[ \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]
time = 0.05, antiderivative size = 26, normalized size of antiderivative = 0.96, number of steps used = 10, number of rules used = 7, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.233, Rules used = {14, 2230, 2225, 2208, 2209, 2436, 2332} \begin {gather*} x+e^x+\frac {5 e^x}{x}+x \log (3)-(x+5) \log (x+5) \end {gather*}

Antiderivative was successfully verified.

[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 {gather*} \begin {aligned} \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 {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 30, normalized size = 1.11 \begin {gather*} e^x+\frac {5 e^x}{x}+x+x \log (3)-5 \log (5+x)-x \log (5+x) \end {gather*}

Antiderivative was successfully verified.

[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*Log[5 + x] - x*Log[5 + x]

________________________________________________________________________________________

Maple [A]
time = 0.26, size = 26, normalized size = 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\)
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\)

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Maxima [C] Result contains higher order function than in optimal. Order 4 vs. order 3.
time = 0.39, size = 27, normalized size = 1.00 \begin {gather*} -{\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 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 29, normalized size = 1.07 \begin {gather*} \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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 0.07, size = 26, normalized size = 0.96 \begin {gather*} - 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} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 68 vs. \(2 (22) = 44\).
time = 0.41, size = 68, normalized size = 2.52 \begin {gather*} -\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}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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]
time = 4.20, size = 26, normalized size = 0.96 \begin {gather*} 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 ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[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)

________________________________________________________________________________________