\(\int \frac {e^x (-1+7 x+x^2-x^3)-e^x x \log (x)}{x} \, dx\) [7556]

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

Optimal result

Integrand size = 30, antiderivative size = 18 \[ \int \frac {e^x \left (-1+7 x+x^2-x^3\right )-e^x x \log (x)}{x} \, dx=e^x \left (4+3 x-x^2-\log (x)\right ) \]

[Out]

exp(x)*(4+3*x-ln(x)-x^2)

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.50, number of steps used = 11, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {14, 2225, 2209, 2207, 2634} \[ \int \frac {e^x \left (-1+7 x+x^2-x^3\right )-e^x x \log (x)}{x} \, dx=-e^x x^2+3 e^x x+4 e^x-e^x \log (x) \]

[In]

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

[Out]

4*E^x + 3*E^x*x - E^x*x^2 - E^x*Log[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 2207

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

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 2634

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[w*(D[u, x]
/u), x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

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

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.83 \[ \int \frac {e^x \left (-1+7 x+x^2-x^3\right )-e^x x \log (x)}{x} \, dx=-e^x \left (-4-3 x+x^2+\log (x)\right ) \]

[In]

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

[Out]

-(E^x*(-4 - 3*x + x^2 + Log[x]))

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.11

method result size
risch \(-{\mathrm e}^{x} \ln \left (x \right )-\left (x^{2}-3 x -4\right ) {\mathrm e}^{x}\) \(20\)
norman \(3 \,{\mathrm e}^{x} x -{\mathrm e}^{x} x^{2}-{\mathrm e}^{x} \ln \left (x \right )+4 \,{\mathrm e}^{x}\) \(24\)
parallelrisch \(3 \,{\mathrm e}^{x} x -{\mathrm e}^{x} x^{2}-{\mathrm e}^{x} \ln \left (x \right )+4 \,{\mathrm e}^{x}\) \(24\)

[In]

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

[Out]

-exp(x)*ln(x)-(x^2-3*x-4)*exp(x)

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.06 \[ \int \frac {e^x \left (-1+7 x+x^2-x^3\right )-e^x x \log (x)}{x} \, dx=-{\left (x^{2} - 3 \, x - 4\right )} e^{x} - e^{x} \log \left (x\right ) \]

[In]

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

[Out]

-(x^2 - 3*x - 4)*e^x - e^x*log(x)

Sympy [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.78 \[ \int \frac {e^x \left (-1+7 x+x^2-x^3\right )-e^x x \log (x)}{x} \, dx=\left (- x^{2} + 3 x - \log {\left (x \right )} + 4\right ) e^{x} \]

[In]

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

[Out]

(-x**2 + 3*x - log(x) + 4)*exp(x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 29 vs. \(2 (14) = 28\).

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

[In]

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

[Out]

-(x^2 - 2*x + 2)*e^x + (x - 1)*e^x - e^x*log(x) + 7*e^x

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

-x^2*e^x + 3*x*e^x - e^x*log(x) + 4*e^x

Mupad [B] (verification not implemented)

Time = 13.07 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.94 \[ \int \frac {e^x \left (-1+7 x+x^2-x^3\right )-e^x x \log (x)}{x} \, dx={\mathrm {e}}^x\,\left (3\,x-\ln \left (x\right )-x^2+4\right ) \]

[In]

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

[Out]

exp(x)*(3*x - log(x) - x^2 + 4)