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

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

[Out]

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

Rubi [A] (verified)

Time = 1.85 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.07, number of steps used = 31, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.069, Rules used = {6820, 6874, 6838, 14, 2404, 2338, 2341} \[ \int \frac {e^{\frac {4}{x+\log (x)}} (-4-4 x)-2 x^2-x^3+x^4+\left (-4 x-4 x^2+2 x^3+2 x^4\right ) \log (x)+\left (-2-5 x+x^2+4 x^3\right ) \log ^2(x)+\left (-2+2 x^2\right ) \log ^3(x)}{x^3+2 x^2 \log (x)+x \log ^2(x)} \, dx=x^2 \log (x)-x-\log ^2(x)+e^{\frac {4}{x+\log (x)}}-2 \log (x) \]

[In]

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

[Out]

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

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 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2404

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 6820

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

Rule 6838

Int[(F_)^(v_)*(u_), x_Symbol] :> With[{q = DerivativeDivides[v, u, x]}, Simp[q*(F^v/Log[F]), x] /;  !FalseQ[q]
] /; FreeQ[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+x) \left (-4 e^{\frac {4}{x+\log (x)}}+(-2+x) x^2+2 x \left (-2+x^2\right ) \log (x)+\left (-2-3 x+4 x^2\right ) \log ^2(x)+2 (-1+x) \log ^3(x)\right )}{x (x+\log (x))^2} \, dx \\ & = \int \left (-\frac {4 e^{\frac {4}{x+\log (x)}} (1+x)}{x (x+\log (x))^2}+\frac {(-2+x) x (1+x)}{(x+\log (x))^2}+\frac {2 (1+x) \left (-2+x^2\right ) \log (x)}{(x+\log (x))^2}+\frac {(1+x) \left (-2-3 x+4 x^2\right ) \log ^2(x)}{x (x+\log (x))^2}+\frac {2 (-1+x) (1+x) \log ^3(x)}{x (x+\log (x))^2}\right ) \, dx \\ & = 2 \int \frac {(1+x) \left (-2+x^2\right ) \log (x)}{(x+\log (x))^2} \, dx+2 \int \frac {(-1+x) (1+x) \log ^3(x)}{x (x+\log (x))^2} \, dx-4 \int \frac {e^{\frac {4}{x+\log (x)}} (1+x)}{x (x+\log (x))^2} \, dx+\int \frac {(-2+x) x (1+x)}{(x+\log (x))^2} \, dx+\int \frac {(1+x) \left (-2-3 x+4 x^2\right ) \log ^2(x)}{x (x+\log (x))^2} \, dx \\ & = e^{\frac {4}{x+\log (x)}}+2 \int \left (-\frac {x \left (-2-2 x+x^2+x^3\right )}{(x+\log (x))^2}+\frac {(1+x) \left (-2+x^2\right )}{x+\log (x)}\right ) \, dx+2 \int \left (-2 \left (-1+x^2\right )+\frac {(-1+x) (1+x) \log (x)}{x}+\frac {x^2 \left (1-x^2\right )}{(x+\log (x))^2}+\frac {3 x \left (-1+x^2\right )}{x+\log (x)}\right ) \, dx+\int \left (-\frac {2 x}{(x+\log (x))^2}-\frac {x^2}{(x+\log (x))^2}+\frac {x^3}{(x+\log (x))^2}\right ) \, dx+\int \left (\frac {-2-5 x+x^2+4 x^3}{x}+\frac {x \left (-2-5 x+x^2+4 x^3\right )}{(x+\log (x))^2}-\frac {2 \left (-2-5 x+x^2+4 x^3\right )}{x+\log (x)}\right ) \, dx \\ & = e^{\frac {4}{x+\log (x)}}+2 \int \frac {(-1+x) (1+x) \log (x)}{x} \, dx-2 \int \frac {x}{(x+\log (x))^2} \, dx+2 \int \frac {x^2 \left (1-x^2\right )}{(x+\log (x))^2} \, dx-2 \int \frac {x \left (-2-2 x+x^2+x^3\right )}{(x+\log (x))^2} \, dx+2 \int \frac {(1+x) \left (-2+x^2\right )}{x+\log (x)} \, dx-2 \int \frac {-2-5 x+x^2+4 x^3}{x+\log (x)} \, dx-4 \int \left (-1+x^2\right ) \, dx+6 \int \frac {x \left (-1+x^2\right )}{x+\log (x)} \, dx+\int \frac {-2-5 x+x^2+4 x^3}{x} \, dx-\int \frac {x^2}{(x+\log (x))^2} \, dx+\int \frac {x^3}{(x+\log (x))^2} \, dx+\int \frac {x \left (-2-5 x+x^2+4 x^3\right )}{(x+\log (x))^2} \, dx \\ & = e^{\frac {4}{x+\log (x)}}+4 x-\frac {4 x^3}{3}-2 \int \frac {x}{(x+\log (x))^2} \, dx+2 \int \left (-\frac {\log (x)}{x}+x \log (x)\right ) \, dx+2 \int \left (\frac {x^2}{(x+\log (x))^2}-\frac {x^4}{(x+\log (x))^2}\right ) \, dx-2 \int \left (-\frac {2 x}{(x+\log (x))^2}-\frac {2 x^2}{(x+\log (x))^2}+\frac {x^3}{(x+\log (x))^2}+\frac {x^4}{(x+\log (x))^2}\right ) \, dx+2 \int \left (-\frac {2}{x+\log (x)}-\frac {2 x}{x+\log (x)}+\frac {x^2}{x+\log (x)}+\frac {x^3}{x+\log (x)}\right ) \, dx-2 \int \left (-\frac {2}{x+\log (x)}-\frac {5 x}{x+\log (x)}+\frac {x^2}{x+\log (x)}+\frac {4 x^3}{x+\log (x)}\right ) \, dx+6 \int \left (-\frac {x}{x+\log (x)}+\frac {x^3}{x+\log (x)}\right ) \, dx+\int \left (-5-\frac {2}{x}+x+4 x^2\right ) \, dx-\int \frac {x^2}{(x+\log (x))^2} \, dx+\int \frac {x^3}{(x+\log (x))^2} \, dx+\int \left (-\frac {2 x}{(x+\log (x))^2}-\frac {5 x^2}{(x+\log (x))^2}+\frac {x^3}{(x+\log (x))^2}+\frac {4 x^4}{(x+\log (x))^2}\right ) \, dx \\ & = e^{\frac {4}{x+\log (x)}}-x+\frac {x^2}{2}-2 \log (x)-2 \int \frac {\log (x)}{x} \, dx+2 \int x \log (x) \, dx-2 \left (2 \int \frac {x}{(x+\log (x))^2} \, dx\right )+2 \int \frac {x^2}{(x+\log (x))^2} \, dx-2 \int \frac {x^3}{(x+\log (x))^2} \, dx-2 \left (2 \int \frac {x^4}{(x+\log (x))^2} \, dx\right )+2 \int \frac {x^3}{x+\log (x)} \, dx+4 \int \frac {x}{(x+\log (x))^2} \, dx+4 \int \frac {x^2}{(x+\log (x))^2} \, dx+4 \int \frac {x^4}{(x+\log (x))^2} \, dx-4 \int \frac {x}{x+\log (x)} \, dx-5 \int \frac {x^2}{(x+\log (x))^2} \, dx-6 \int \frac {x}{x+\log (x)} \, dx+6 \int \frac {x^3}{x+\log (x)} \, dx-8 \int \frac {x^3}{x+\log (x)} \, dx+10 \int \frac {x}{x+\log (x)} \, dx-\int \frac {x^2}{(x+\log (x))^2} \, dx+2 \int \frac {x^3}{(x+\log (x))^2} \, dx \\ & = e^{\frac {4}{x+\log (x)}}-x-2 \log (x)+x^2 \log (x)-\log ^2(x)-2 \left (2 \int \frac {x}{(x+\log (x))^2} \, dx\right )+2 \int \frac {x^2}{(x+\log (x))^2} \, dx-2 \int \frac {x^3}{(x+\log (x))^2} \, dx-2 \left (2 \int \frac {x^4}{(x+\log (x))^2} \, dx\right )+2 \int \frac {x^3}{x+\log (x)} \, dx+4 \int \frac {x}{(x+\log (x))^2} \, dx+4 \int \frac {x^2}{(x+\log (x))^2} \, dx+4 \int \frac {x^4}{(x+\log (x))^2} \, dx-4 \int \frac {x}{x+\log (x)} \, dx-5 \int \frac {x^2}{(x+\log (x))^2} \, dx-6 \int \frac {x}{x+\log (x)} \, dx+6 \int \frac {x^3}{x+\log (x)} \, dx-8 \int \frac {x^3}{x+\log (x)} \, dx+10 \int \frac {x}{x+\log (x)} \, dx-\int \frac {x^2}{(x+\log (x))^2} \, dx+2 \int \frac {x^3}{(x+\log (x))^2} \, dx \\ \end{align*}

Mathematica [A] (verified)

Time = 0.41 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.07 \[ \int \frac {e^{\frac {4}{x+\log (x)}} (-4-4 x)-2 x^2-x^3+x^4+\left (-4 x-4 x^2+2 x^3+2 x^4\right ) \log (x)+\left (-2-5 x+x^2+4 x^3\right ) \log ^2(x)+\left (-2+2 x^2\right ) \log ^3(x)}{x^3+2 x^2 \log (x)+x \log ^2(x)} \, dx=e^{\frac {4}{x+\log (x)}}-x-2 \log (x)+x^2 \log (x)-\log ^2(x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 7.78 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.07

method result size
risch \(-\ln \left (x \right )^{2}+x^{2} \ln \left (x \right )-x -2 \ln \left (x \right )+{\mathrm e}^{\frac {4}{x +\ln \left (x \right )}}\) \(30\)
parallelrisch \(-\ln \left (x \right )^{2}+x^{2} \ln \left (x \right )-x -2 \ln \left (x \right )+{\mathrm e}^{\frac {4}{x +\ln \left (x \right )}}\) \(30\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

integrate(((-4-4*x)*exp(4/(x+log(x)))+(2*x^2-2)*log(x)^3+(4*x^3+x^2-5*x-2)*log(x)^2+(2*x^4+2*x^3-4*x^2-4*x)*lo
g(x)+x^4-x^3-2*x^2)/(x*log(x)^2+2*x^2*log(x)+x^3),x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.96 \[ \int \frac {e^{\frac {4}{x+\log (x)}} (-4-4 x)-2 x^2-x^3+x^4+\left (-4 x-4 x^2+2 x^3+2 x^4\right ) \log (x)+\left (-2-5 x+x^2+4 x^3\right ) \log ^2(x)+\left (-2+2 x^2\right ) \log ^3(x)}{x^3+2 x^2 \log (x)+x \log ^2(x)} \, dx={\left (x^{2} - 2\right )} \log \left (x\right ) - \log \left (x\right )^{2} - x + e^{\left (\frac {4}{x + \log \left (x\right )}\right )} \]

[In]

integrate(((-4-4*x)*exp(4/(x+log(x)))+(2*x^2-2)*log(x)^3+(4*x^3+x^2-5*x-2)*log(x)^2+(2*x^4+2*x^3-4*x^2-4*x)*lo
g(x)+x^4-x^3-2*x^2)/(x*log(x)^2+2*x^2*log(x)+x^3),x, algorithm="maxima")

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 14.32 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.04 \[ \int \frac {e^{\frac {4}{x+\log (x)}} (-4-4 x)-2 x^2-x^3+x^4+\left (-4 x-4 x^2+2 x^3+2 x^4\right ) \log (x)+\left (-2-5 x+x^2+4 x^3\right ) \log ^2(x)+\left (-2+2 x^2\right ) \log ^3(x)}{x^3+2 x^2 \log (x)+x \log ^2(x)} \, dx={\mathrm {e}}^{\frac {4}{x+\ln \left (x\right )}}-x-2\,\ln \left (x\right )+x^2\,\ln \left (x\right )-{\ln \left (x\right )}^2 \]

[In]

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

[Out]

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