\(\int \frac {-2-2 x+2 x \log (3 x)+(1-3 x+64 x^2) \log ^2(3 x)}{x \log ^2(3 x)} \, dx\) [1543]

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

[Out]

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

Rubi [A] (verified)

Time = 0.14 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.04, number of steps used = 11, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {6874, 14, 2395, 2334, 2335, 2339, 30} \[ \int \frac {-2-2 x+2 x \log (3 x)+\left (1-3 x+64 x^2\right ) \log ^2(3 x)}{x \log ^2(3 x)} \, dx=32 x^2-3 x+\frac {2 x}{\log (3 x)}+\log (x)+\frac {2}{\log (3 x)} \]

[In]

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

[Out]

-3*x + 32*x^2 + Log[x] + 2/Log[3*x] + (2*x)/Log[3*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 30

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

Rule 2334

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

Rule 2335

Int[Log[(c_.)*(x_)]^(-1), x_Symbol] :> Simp[LogIntegral[c*x]/c, x] /; FreeQ[c, x]

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 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 (\frac {1-3 x+64 x^2}{x}-\frac {2 (1+x)}{x \log ^2(3 x)}+\frac {2}{\log (3 x)}\right ) \, dx \\ & = -\left (2 \int \frac {1+x}{x \log ^2(3 x)} \, dx\right )+2 \int \frac {1}{\log (3 x)} \, dx+\int \frac {1-3 x+64 x^2}{x} \, dx \\ & = \frac {2 \operatorname {LogIntegral}(3 x)}{3}-2 \int \left (\frac {1}{\log ^2(3 x)}+\frac {1}{x \log ^2(3 x)}\right ) \, dx+\int \left (-3+\frac {1}{x}+64 x\right ) \, dx \\ & = -3 x+32 x^2+\log (x)+\frac {2 \operatorname {LogIntegral}(3 x)}{3}-2 \int \frac {1}{\log ^2(3 x)} \, dx-2 \int \frac {1}{x \log ^2(3 x)} \, dx \\ & = -3 x+32 x^2+\log (x)+\frac {2 x}{\log (3 x)}+\frac {2 \operatorname {LogIntegral}(3 x)}{3}-2 \int \frac {1}{\log (3 x)} \, dx-2 \text {Subst}\left (\int \frac {1}{x^2} \, dx,x,\log (3 x)\right ) \\ & = -3 x+32 x^2+\log (x)+\frac {2}{\log (3 x)}+\frac {2 x}{\log (3 x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.04 \[ \int \frac {-2-2 x+2 x \log (3 x)+\left (1-3 x+64 x^2\right ) \log ^2(3 x)}{x \log ^2(3 x)} \, dx=-3 x+32 x^2+\log (x)+\frac {2}{\log (3 x)}+\frac {2 x}{\log (3 x)} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85

method result size
risch \(32 x^{2}-3 x +\ln \left (x \right )+\frac {2+2 x}{\ln \left (3 x \right )}\) \(23\)
parts \(32 x^{2}-3 x +\ln \left (x \right )+\frac {2}{\ln \left (3 x \right )}+\frac {2 x}{\ln \left (3 x \right )}\) \(29\)
derivativedivides \(32 x^{2}-3 x +\ln \left (3 x \right )+\frac {2 x}{\ln \left (3 x \right )}+\frac {2}{\ln \left (3 x \right )}\) \(31\)
default \(32 x^{2}-3 x +\ln \left (3 x \right )+\frac {2 x}{\ln \left (3 x \right )}+\frac {2}{\ln \left (3 x \right )}\) \(31\)
norman \(\frac {2+\ln \left (3 x \right )^{2}+2 x -3 x \ln \left (3 x \right )+32 x^{2} \ln \left (3 x \right )}{\ln \left (3 x \right )}\) \(35\)
parallelrisch \(\frac {2+\ln \left (3 x \right )^{2}+2 x -3 x \ln \left (3 x \right )+32 x^{2} \ln \left (3 x \right )}{\ln \left (3 x \right )}\) \(35\)

[In]

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

[Out]

32*x^2-3*x+ln(x)+2*(1+x)/ln(3*x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

((32*x^2 - 3*x)*log(3*x) + log(3*x)^2 + 2*x + 2)/log(3*x)

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

32*x**2 - 3*x + (2*x + 2)/log(3*x) + log(x)

Maxima [C] (verification not implemented)

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

Time = 0.22 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.33 \[ \int \frac {-2-2 x+2 x \log (3 x)+\left (1-3 x+64 x^2\right ) \log ^2(3 x)}{x \log ^2(3 x)} \, dx=32 \, x^{2} - 3 \, x + \frac {2}{\log \left (3 \, x\right )} + \frac {2}{3} \, {\rm Ei}\left (\log \left (3 \, x\right )\right ) - \frac {2}{3} \, \Gamma \left (-1, -\log \left (3 \, x\right )\right ) + \log \left (x\right ) \]

[In]

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

[Out]

32*x^2 - 3*x + 2/log(3*x) + 2/3*Ei(log(3*x)) - 2/3*gamma(-1, -log(3*x)) + log(x)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 8.59 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.85 \[ \int \frac {-2-2 x+2 x \log (3 x)+\left (1-3 x+64 x^2\right ) \log ^2(3 x)}{x \log ^2(3 x)} \, dx=\ln \left (x\right )-3\,x+\frac {2\,x+2}{\ln \left (3\,x\right )}+32\,x^2 \]

[In]

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

[Out]

log(x) - 3*x + (2*x + 2)/log(3*x) + 32*x^2