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

Optimal. Leaf size=21 \[ \left (1+e^x+x\right ) \log \left (\frac {e^{e^x+3 x}}{x}\right ) \]

[Out]

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

________________________________________________________________________________________

Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(45\) vs. \(2(21)=42\).
time = 0.30, antiderivative size = 45, normalized size of antiderivative = 2.14, number of steps used = 29, number of rules used = 8, integrand size = 55, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.146, Rules used = {14, 2225, 6874, 2230, 2209, 2207, 2634, 2628} \begin {gather*} 3 x+e^x+x \log \left (\frac {e^{3 x+e^x}}{x}\right )+e^x \log \left (\frac {e^{3 x+e^x}}{x}\right )-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

E^x + 3*x + E^x*Log[E^(E^x + 3*x)/x] + x*Log[E^(E^x + 3*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 2628

Int[Log[u_], x_Symbol] :> Simp[x*Log[u], x] - Int[SimplifyIntegrand[x*(D[u, x]/u), x], x] /; InverseFunctionFr
eeQ[u, 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]

Rule 6874

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

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 31, normalized size = 1.48 \begin {gather*} e^x+3 x+\left (e^x+x\right ) \log \left (\frac {e^{e^x+3 x}}{x}\right )-\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(64\) vs. \(2(18)=36\).
time = 0.24, size = 65, normalized size = 3.10

method result size
default \({\mathrm e}^{2 x}+\left (\ln \left (\frac {{\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )-3 x -{\mathrm e}^{x}+\ln \left (x \right )\right ) {\mathrm e}^{x}+3 \,{\mathrm e}^{x} x -{\mathrm e}^{x} \ln \left (x \right )+3 x -\ln \left (x \right )+\ln \left (\frac {{\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right ) x +{\mathrm e}^{x}\) \(65\)
risch \(\left ({\mathrm e}^{x}+x \right ) \ln \left ({\mathrm e}^{3 x +{\mathrm e}^{x}}\right )-x \ln \left (x \right )-{\mathrm e}^{x} \ln \left (x \right )+\frac {i \pi x \,\mathrm {csgn}\left (i {\mathrm e}^{3 x +{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )^{2}}{2}-\frac {i \pi x \,\mathrm {csgn}\left (i {\mathrm e}^{3 x +{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right ) \mathrm {csgn}\left (\frac {i}{x}\right )}{2}-\frac {i \pi x \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )^{3}}{2}+\frac {i \pi x \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )^{2} \mathrm {csgn}\left (\frac {i}{x}\right )}{2}+3 x -\ln \left (x \right )+\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{3 x +{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )^{2} {\mathrm e}^{x}}{2}-\frac {i \pi \,\mathrm {csgn}\left (i {\mathrm e}^{3 x +{\mathrm e}^{x}}\right ) \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right ) \mathrm {csgn}\left (\frac {i}{x}\right ) {\mathrm e}^{x}}{2}-\frac {i \pi \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )^{3} {\mathrm e}^{x}}{2}+\frac {i \pi \mathrm {csgn}\left (\frac {i {\mathrm e}^{3 x +{\mathrm e}^{x}}}{x}\right )^{2} \mathrm {csgn}\left (\frac {i}{x}\right ) {\mathrm e}^{x}}{2}+{\mathrm e}^{x}\) \(275\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((exp(x)*x+x)*log(exp(3*x+exp(x))/x)+x*exp(x)^2+(x^2+4*x-1)*exp(x)+3*x^2+2*x-1)/x,x, algorithm="maxi
ma")

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 18, normalized size = 0.86 \begin {gather*} {\left (x + e^{x} + 1\right )} \log \left (\frac {e^{\left (3 \, x + e^{x}\right )}}{x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(((exp(x)*x+x)*log(exp(3*x+exp(x))/x)+x*exp(x)^2+(x^2+4*x-1)*exp(x)+3*x^2+2*x-1)/x,x, algorithm="fric
as")

[Out]

(x + e^x + 1)*log(e^(3*x + e^x)/x)

________________________________________________________________________________________

Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 35, normalized size = 1.67 \begin {gather*} 3 \, x^{2} + 4 \, x e^{x} - x \log \left (x\right ) - e^{x} \log \left (x\right ) + 3 \, x + e^{\left (2 \, x\right )} + e^{x} - \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 1.61, size = 37, normalized size = 1.76 \begin {gather*} 3\,x+{\mathrm {e}}^{2\,x}+{\mathrm {e}}^x-\ln \left (x\right )+x\,\ln \left (\frac {1}{x}\right )+\ln \left (\frac {1}{x}\right )\,{\mathrm {e}}^x+4\,x\,{\mathrm {e}}^x+3\,x^2 \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________