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

   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 = 33, antiderivative size = 28 \[ \int \frac {-1-2 x-2 e^3 x+e^x \left (-1-2 e^3 x\right )}{x+e^x x} \, dx=-\log \left (\frac {e^{2 \left (x+e^3 x+\log \left (\frac {x}{1+e^x}\right )\right )}}{x}\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.79, number of steps used = 9, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.212, Rules used = {6, 6874, 2320, 36, 29, 31, 45} \[ \int \frac {-1-2 x-2 e^3 x+e^x \left (-1-2 e^3 x\right )}{x+e^x x} \, dx=-2 e^3 x-2 x+2 \log \left (e^x+1\right )-\log (x) \]

[In]

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

[Out]

-2*x - 2*E^3*x + 2*Log[1 + E^x] - Log[x]

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

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 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 6874

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

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

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.75 \[ \int \frac {-1-2 x-2 e^3 x+e^x \left (-1-2 e^3 x\right )}{x+e^x x} \, dx=-2 e^3 x+4 \text {arctanh}\left (1+2 e^x\right )-\log (x) \]

[In]

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

[Out]

-2*E^3*x + 4*ArcTanh[1 + 2*E^x] - Log[x]

Maple [A] (verified)

Time = 0.68 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.75

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

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 12.28 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.75 \[ \int \frac {-1-2 x-2 e^3 x+e^x \left (-1-2 e^3 x\right )}{x+e^x x} \, dx=2\,\ln \left ({\mathrm {e}}^x+1\right )-\ln \left (x\right )-x\,\left (2\,{\mathrm {e}}^3+2\right ) \]

[In]

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

[Out]

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