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

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

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 32, normalized size of antiderivative = 1.39, number of steps used = 7, number of rules used = 4, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {12, 14, 2176, 2194} \begin {gather*} \frac {x^2}{5}+\frac {2 x}{5}+\frac {e^x}{5}-\frac {1}{5} e^x (x+1)+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Int[((b_.)*(F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[((c + d*x)^m
*(b*F^(g*(e + f*x)))^n)/(f*g*n*Log[F]), x] - Dist[(d*m)/(f*g*n*Log[F]), 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] && GtQ[m, 0] && IntegerQ[2*m] &&  !$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]

Rubi steps

\begin {gather*} \begin {aligned} \text {integral} &=\frac {1}{5} \int \frac {5+2 x+2 x^2+e^x \left (-x-x^2\right )}{x} \, dx\\ &=\frac {1}{5} \int \left (-e^x (1+x)+\frac {5+2 x+2 x^2}{x}\right ) \, dx\\ &=-\left (\frac {1}{5} \int e^x (1+x) \, dx\right )+\frac {1}{5} \int \frac {5+2 x+2 x^2}{x} \, dx\\ &=-\frac {1}{5} e^x (1+x)+\frac {\int e^x \, dx}{5}+\frac {1}{5} \int \left (2+\frac {5}{x}+2 x\right ) \, dx\\ &=\frac {e^x}{5}+\frac {2 x}{5}+\frac {x^2}{5}-\frac {1}{5} e^x (1+x)+\log (x)\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 1.29, size = 16, normalized size = 0.70 \begin {gather*} \frac {1}{5} \, x^{2} - \frac {1}{5} \, x e^{x} + \frac {2}{5} \, x + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.24, size = 16, normalized size = 0.70 \begin {gather*} \frac {1}{5} \, x^{2} - \frac {1}{5} \, x e^{x} + \frac {2}{5} \, x + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.02, size = 17, normalized size = 0.74




method result size



default \(\frac {x^{2}}{5}+\frac {2 x}{5}+\ln \relax (x )-\frac {{\mathrm e}^{x} x}{5}\) \(17\)
norman \(\frac {x^{2}}{5}+\frac {2 x}{5}+\ln \relax (x )-\frac {{\mathrm e}^{x} x}{5}\) \(17\)
risch \(\frac {x^{2}}{5}+\frac {2 x}{5}+\ln \relax (x )-\frac {{\mathrm e}^{x} x}{5}\) \(17\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.43, size = 22, normalized size = 0.96 \begin {gather*} \frac {1}{5} \, x^{2} - \frac {1}{5} \, {\left (x - 1\right )} e^{x} + \frac {2}{5} \, x - \frac {1}{5} \, e^{x} + \log \relax (x) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.05, size = 16, normalized size = 0.70 \begin {gather*} \frac {2\,x}{5}+\ln \relax (x)-\frac {x\,{\mathrm {e}}^x}{5}+\frac {x^2}{5} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.13, size = 19, normalized size = 0.83 \begin {gather*} \frac {x^{2}}{5} - \frac {x e^{x}}{5} + \frac {2 x}{5} + \log {\relax (x )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________