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

   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 = 21, antiderivative size = 26 \[ \int \frac {-8+4 x-x^2+4 \log (x)}{4 x^2} \, dx=\frac {1+\frac {1}{4} \left (-x-x^2\right )-\log (x)}{x}+\log (x) \]

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.69, number of steps used = 6, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {12, 14, 2341} \[ \int \frac {-8+4 x-x^2+4 \log (x)}{4 x^2} \, dx=-\frac {x}{4}+\frac {1}{x}+\log (x)-\frac {\log (x)}{x} \]

[In]

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

[Out]

x^(-1) - x/4 + Log[x] - Log[x]/x

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, 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
]

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.69 \[ \int \frac {-8+4 x-x^2+4 \log (x)}{4 x^2} \, dx=\frac {1}{x}-\frac {x}{4}+\log (x)-\frac {\log (x)}{x} \]

[In]

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

[Out]

x^(-1) - x/4 + Log[x] - Log[x]/x

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.65

method result size
default \(-\frac {\ln \left (x \right )}{x}+\frac {1}{x}-\frac {x}{4}+\ln \left (x \right )\) \(17\)
parts \(-\frac {\ln \left (x \right )}{x}+\frac {1}{x}-\frac {x}{4}+\ln \left (x \right )\) \(17\)
norman \(\frac {1+x \ln \left (x \right )-\frac {x^{2}}{4}-\ln \left (x \right )}{x}\) \(20\)
parallelrisch \(\frac {-x^{2}+4 x \ln \left (x \right )+4-4 \ln \left (x \right )}{4 x}\) \(22\)
risch \(-\frac {\ln \left (x \right )}{x}+\frac {4 x \ln \left (x \right )-x^{2}+4}{4 x}\) \(26\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

-1/4*(x^2 - 4*(x - 1)*log(x) - 4)/x

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.54 \[ \int \frac {-8+4 x-x^2+4 \log (x)}{4 x^2} \, dx=- \frac {x}{4} + \log {\left (x \right )} - \frac {\log {\left (x \right )}}{x} + \frac {1}{x} \]

[In]

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

[Out]

-x/4 + log(x) - log(x)/x + 1/x

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.62 \[ \int \frac {-8+4 x-x^2+4 \log (x)}{4 x^2} \, dx=-\frac {1}{4} \, x - \frac {\log \left (x\right )}{x} + \frac {1}{x} + \log \left (x\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.62 \[ \int \frac {-8+4 x-x^2+4 \log (x)}{4 x^2} \, dx=-\frac {1}{4} \, x - \frac {\log \left (x\right )}{x} + \frac {1}{x} + \log \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

log(x) - x/4 - (log(x) - 1)/x