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

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

Optimal result

Integrand size = 25, antiderivative size = 17 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x+\frac {5}{\log (x)}-\frac {4}{x \log (x)} \]

[Out]

x-4/x/ln(x)+5/ln(x)

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.280, Rules used = {6874, 2395, 2343, 2346, 2209, 2339, 30} \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x+\frac {5}{\log (x)}-\frac {4}{x \log (x)} \]

[In]

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

[Out]

x + 5/Log[x] - 4/(x*Log[x])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

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 2339

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/(x_), x_Symbol] :> Dist[1/(b*n), Subst[Int[x^p, x], x, a + b*L
og[c*x^n]], x] /; FreeQ[{a, b, c, n, p}, x]

Rule 2343

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

Rule 2346

Int[((a_.) + Log[(c_.)*(x_)]*(b_.))^(p_)*(x_)^(m_.), x_Symbol] :> Dist[1/c^(m + 1), Subst[Int[E^((m + 1)*x)*(a
 + b*x)^p, x], x, Log[c*x]], x] /; FreeQ[{a, b, c, p}, x] && IntegerQ[m]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rule 6874

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

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

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 17, normalized size of antiderivative = 1.00 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x+\frac {5}{\log (x)}-\frac {4}{x \log (x)} \]

[In]

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

[Out]

x + 5/Log[x] - 4/(x*Log[x])

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.94

method result size
risch \(x +\frac {5 x -4}{x \ln \left (x \right )}\) \(16\)
default \(x -\frac {4}{x \ln \left (x \right )}+\frac {5}{\ln \left (x \right )}\) \(18\)
parts \(x -\frac {4}{x \ln \left (x \right )}+\frac {5}{\ln \left (x \right )}\) \(18\)
norman \(\frac {-4+x^{2} \ln \left (x \right )+5 x}{x \ln \left (x \right )}\) \(20\)
parallelrisch \(\frac {-4+x^{2} \ln \left (x \right )+5 x}{x \ln \left (x \right )}\) \(20\)

[In]

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

[Out]

x+1/x*(5*x-4)/ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.12 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=\frac {x^{2} \log \left (x\right ) + 5 \, x - 4}{x \log \left (x\right )} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.59 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x + \frac {5 x - 4}{x \log {\left (x \right )}} \]

[In]

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

[Out]

x + (5*x - 4)/(x*log(x))

Maxima [C] (verification not implemented)

Result contains higher order function than in optimal. Order 4 vs. order 3.

Time = 0.21 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.24 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x + \frac {5}{\log \left (x\right )} + 4 \, {\rm Ei}\left (-\log \left (x\right )\right ) - 4 \, \Gamma \left (-1, \log \left (x\right )\right ) \]

[In]

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

[Out]

x + 5/log(x) + 4*Ei(-log(x)) - 4*gamma(-1, log(x))

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x + \frac {5 \, x - 4}{x \log \left (x\right )} \]

[In]

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

[Out]

x + (5*x - 4)/(x*log(x))

Mupad [B] (verification not implemented)

Time = 9.16 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.88 \[ \int \frac {4-5 x+4 \log (x)+x^2 \log ^2(x)}{x^2 \log ^2(x)} \, dx=x+\frac {5\,x-4}{x\,\ln \left (x\right )} \]

[In]

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

[Out]

x + (5*x - 4)/(x*log(x))