\(\int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx\) [7184]

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

Optimal result

Integrand size = 24, antiderivative size = 15 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=\frac {81+(4+2 x+\log (x))^2}{x} \]

[Out]

((ln(x)+4+2*x)^2+81)/x

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.87, number of steps used = 7, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {14, 2341, 2342} \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=4 x+\frac {97}{x}+\frac {\log ^2(x)}{x}+\frac {8 \log (x)}{x}+4 \log (x) \]

[In]

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

[Out]

97/x + 4*x + 4*Log[x] + (8*Log[x])/x + Log[x]^2/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 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 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 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] && GtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {-89+4 x+4 x^2}{x^2}-\frac {6 \log (x)}{x^2}-\frac {\log ^2(x)}{x^2}\right ) \, dx \\ & = -\left (6 \int \frac {\log (x)}{x^2} \, dx\right )+\int \frac {-89+4 x+4 x^2}{x^2} \, dx-\int \frac {\log ^2(x)}{x^2} \, dx \\ & = \frac {6}{x}+\frac {6 \log (x)}{x}+\frac {\log ^2(x)}{x}-2 \int \frac {\log (x)}{x^2} \, dx+\int \left (4-\frac {89}{x^2}+\frac {4}{x}\right ) \, dx \\ & = \frac {97}{x}+4 x+4 \log (x)+\frac {8 \log (x)}{x}+\frac {\log ^2(x)}{x} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.87 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=\frac {97}{x}+4 x+4 \log (x)+\frac {8 \log (x)}{x}+\frac {\log ^2(x)}{x} \]

[In]

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

[Out]

97/x + 4*x + 4*Log[x] + (8*Log[x])/x + Log[x]^2/x

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.67

method result size
norman \(\frac {97+\ln \left (x \right )^{2}+4 x \ln \left (x \right )+4 x^{2}+8 \ln \left (x \right )}{x}\) \(25\)
parallelrisch \(\frac {97+\ln \left (x \right )^{2}+4 x \ln \left (x \right )+4 x^{2}+8 \ln \left (x \right )}{x}\) \(25\)
default \(\frac {\ln \left (x \right )^{2}}{x}+\frac {8 \ln \left (x \right )}{x}+\frac {97}{x}+4 x +4 \ln \left (x \right )\) \(29\)
parts \(\frac {\ln \left (x \right )^{2}}{x}+\frac {8 \ln \left (x \right )}{x}+\frac {97}{x}+4 x +4 \ln \left (x \right )\) \(29\)
risch \(\frac {\ln \left (x \right )^{2}}{x}+\frac {8 \ln \left (x \right )}{x}+\frac {4 x \ln \left (x \right )+4 x^{2}+97}{x}\) \(33\)

[In]

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

[Out]

(97+ln(x)^2+4*x*ln(x)+4*x^2+8*ln(x))/x

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.47 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=\frac {4 \, x^{2} + 4 \, {\left (x + 2\right )} \log \left (x\right ) + \log \left (x\right )^{2} + 97}{x} \]

[In]

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

[Out]

(4*x^2 + 4*(x + 2)*log(x) + log(x)^2 + 97)/x

Sympy [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.60 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=4 x + 4 \log {\left (x \right )} + \frac {\log {\left (x \right )}^{2}}{x} + \frac {8 \log {\left (x \right )}}{x} + \frac {97}{x} \]

[In]

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

[Out]

4*x + 4*log(x) + log(x)**2/x + 8*log(x)/x + 97/x

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 34 vs. \(2 (15) = 30\).

Time = 0.21 (sec) , antiderivative size = 34, normalized size of antiderivative = 2.27 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=4 \, x + \frac {\log \left (x\right )^{2} + 2 \, \log \left (x\right ) + 2}{x} + \frac {6 \, \log \left (x\right )}{x} + \frac {95}{x} + 4 \, \log \left (x\right ) \]

[In]

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

[Out]

4*x + (log(x)^2 + 2*log(x) + 2)/x + 6*log(x)/x + 95/x + 4*log(x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.87 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=4 \, x + \frac {\log \left (x\right )^{2}}{x} + \frac {8 \, \log \left (x\right )}{x} + \frac {97}{x} + 4 \, \log \left (x\right ) \]

[In]

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

[Out]

4*x + log(x)^2/x + 8*log(x)/x + 97/x + 4*log(x)

Mupad [B] (verification not implemented)

Time = 12.79 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.47 \[ \int \frac {-89+4 x+4 x^2-6 \log (x)-\log ^2(x)}{x^2} \, dx=4\,x+4\,\ln \left (x\right )+\frac {{\ln \left (x\right )}^2+8\,\ln \left (x\right )+97}{x} \]

[In]

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

[Out]

4*x + 4*log(x) + (8*log(x) + log(x)^2 + 97)/x