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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.89, number of steps used = 13, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {14, 6874, 2230, 2225, 2209, 2207, 2634} \[ \int \frac {1+e^x (1-x)-e^x x^2 \log (x)}{x} \, dx=e^x \log (x)-e^x x \log (x)+\log (x) \]

[In]

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

[Out]

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

Rule 6874

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

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

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68 \[ \int \frac {1+e^x (1-x)-e^x x^2 \log (x)}{x} \, dx=\log (x)-e^x (-1+x) \log (x) \]

[In]

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

[Out]

Log[x] - E^x*(-1 + x)*Log[x]

Maple [A] (verified)

Time = 0.21 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.68

method result size
risch \(-\left (-1+x \right ) {\mathrm e}^{x} \ln \left (x \right )+\ln \left (x \right )\) \(13\)
default \(\ln \left (x \right )+{\mathrm e}^{x} \ln \left (x \right )-x \,{\mathrm e}^{x} \ln \left (x \right )\) \(16\)
norman \(\ln \left (x \right )+{\mathrm e}^{x} \ln \left (x \right )-x \,{\mathrm e}^{x} \ln \left (x \right )\) \(16\)
parallelrisch \(\ln \left (x \right )+{\mathrm e}^{x} \ln \left (x \right )-x \,{\mathrm e}^{x} \ln \left (x \right )\) \(16\)
parts \(\ln \left (x \right )+{\mathrm e}^{x} \ln \left (x \right )-x \,{\mathrm e}^{x} \ln \left (x \right )\) \(16\)

[In]

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

[Out]

-(-1+x)*exp(x)*ln(x)+ln(x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

-((x - 1)*e^x - 1)*log(x)

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

(-x*log(x) + log(x))*exp(x) + log(x)

Maxima [F]

\[ \int \frac {1+e^x (1-x)-e^x x^2 \log (x)}{x} \, dx=\int { -\frac {x^{2} e^{x} \log \left (x\right ) + {\left (x - 1\right )} e^{x} - 1}{x} \,d x } \]

[In]

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

[Out]

-(x - 1)*e^x*log(x) + Ei(x) - e^x + integrate((x - 1)*e^x/x, x) + log(x)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

-x*e^x*log(x) + e^x*log(x) + log(x)

Mupad [B] (verification not implemented)

Time = 9.11 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.63 \[ \int \frac {1+e^x (1-x)-e^x x^2 \log (x)}{x} \, dx=\ln \left (x\right )\,\left ({\mathrm {e}}^x-x\,{\mathrm {e}}^x+1\right ) \]

[In]

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

[Out]

log(x)*(exp(x) - x*exp(x) + 1)