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

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

[Out]

x-5+ln(6*(-1+2*x)/exp(5+x)*exp(x)*x)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.67, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {1607, 907} \[ \int \frac {-1+3 x+2 x^2}{-x+2 x^2} \, dx=x+\log (1-2 x)+\log (x) \]

[In]

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

[Out]

x + Log[1 - 2*x] + Log[x]

Rule 907

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :
> Int[ExpandIntegrand[(d + e*x)^m*(f + g*x)^n*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] &
& NeQ[e*f - d*g, 0] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && I
ntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.67 \[ \int \frac {-1+3 x+2 x^2}{-x+2 x^2} \, dx=x+\log (1-2 x)+\log (x) \]

[In]

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

[Out]

x + Log[1 - 2*x] + Log[x]

Maple [A] (verified)

Time = 1.33 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.60

method result size
parallelrisch \(x +\ln \left (x \right )+\ln \left (x -\frac {1}{2}\right )\) \(9\)
default \(x +\ln \left (-1+2 x \right )+\ln \left (x \right )\) \(11\)
norman \(x +\ln \left (-1+2 x \right )+\ln \left (x \right )\) \(11\)
risch \(x +\ln \left (2 x^{2}-x \right )\) \(13\)
meijerg \(\ln \left (x \right )+\ln \left (2\right )+i \pi +\ln \left (1-2 x \right )+x\) \(17\)

[In]

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

[Out]

x+ln(x)+ln(x-1/2)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

x + log(2*x^2 - x)

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

x + log(2*x - 1) + log(x)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

x + log(abs(2*x - 1)) + log(abs(x))

Mupad [B] (verification not implemented)

Time = 9.72 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.67 \[ \int \frac {-1+3 x+2 x^2}{-x+2 x^2} \, dx=x+\ln \left (x\,\left (2\,x-1\right )\right ) \]

[In]

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

[Out]

x + log(x*(2*x - 1))