\(\int \frac {4-x-3 e^x x}{x} \, dx\) [6832]

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.50, number of steps used = 5, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {14, 2225, 45} \[ \int \frac {4-x-3 e^x x}{x} \, dx=-x-3 e^x+4 \log (x) \]

[In]

Int[(4 - x - 3*E^x*x)/x,x]

[Out]

-3*E^x - x + 4*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 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

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]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.50 \[ \int \frac {4-x-3 e^x x}{x} \, dx=-3 e^x-x+4 \log (x) \]

[In]

Integrate[(4 - x - 3*E^x*x)/x,x]

[Out]

-3*E^x - x + 4*Log[x]

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.50

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

[In]

int((-3*exp(x)*x-x+4)/x,x,method=_RETURNVERBOSE)

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.46 \[ \int \frac {4-x-3 e^x x}{x} \, dx=-x - 3 \, e^{x} + 4 \, \log \left (x\right ) \]

[In]

integrate((-3*exp(x)*x-x+4)/x,x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.38 \[ \int \frac {4-x-3 e^x x}{x} \, dx=- x - 3 e^{x} + 4 \log {\left (x \right )} \]

[In]

integrate((-3*exp(x)*x-x+4)/x,x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.46 \[ \int \frac {4-x-3 e^x x}{x} \, dx=-x - 3 \, e^{x} + 4 \, \log \left (x\right ) \]

[In]

integrate((-3*exp(x)*x-x+4)/x,x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

integrate((-3*exp(x)*x-x+4)/x,x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.46 \[ \int \frac {4-x-3 e^x x}{x} \, dx=4\,\ln \left (x\right )-3\,{\mathrm {e}}^x-x \]

[In]

int(-(x + 3*x*exp(x) - 4)/x,x)

[Out]

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