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

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

[Out]

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

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.52, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {12, 14} \[ \int \frac {-4+2 x-5 x^2}{2 x^2} \, dx=-\frac {5 x}{2}+\frac {2}{x}+\log (x) \]

[In]

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

[Out]

2/x - (5*x)/2 + Log[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]]

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

Mathematica [A] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.48

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

[In]

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

[Out]

-5/2*x+2/x+ln(x)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

-5/2*x + 2/x + log(abs(x))

Mupad [B] (verification not implemented)

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

[In]

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

[Out]

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