### 3.155 $$\int \frac{-1+2 x+x^2}{-2 x+3 x^2+2 x^3} \, dx$$

Optimal. Leaf size=25 $\frac{1}{10} \log (1-2 x)+\frac{\log (x)}{2}-\frac{1}{10} \log (x+2)$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.041823, antiderivative size = 25, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 25, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.08, Rules used = {1594, 1628} $\frac{1}{10} \log (1-2 x)+\frac{\log (x)}{2}-\frac{1}{10} \log (x+2)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1594

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

Rule 1628

Int[(Pq_)*((d_.) + (e_.)*(x_))^(m_.)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegra
nd[(d + e*x)^m*Pq*(a + b*x + c*x^2)^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rubi steps

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

Mathematica [A]  time = 0.0058306, size = 25, normalized size = 1. $\frac{1}{10} \log (1-2 x)+\frac{\log (x)}{2}-\frac{1}{10} \log (x+2)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 20, normalized size = 0.8 \begin{align*} -{\frac{\ln \left ( 2+x \right ) }{10}}+{\frac{\ln \left ( x \right ) }{2}}+{\frac{\ln \left ( 2\,x-1 \right ) }{10}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.918427, size = 26, normalized size = 1.04 \begin{align*} \frac{1}{10} \, \log \left (2 \, x - 1\right ) - \frac{1}{10} \, \log \left (x + 2\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.13412, size = 68, normalized size = 2.72 \begin{align*} \frac{1}{10} \, \log \left (2 \, x - 1\right ) - \frac{1}{10} \, \log \left (x + 2\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.122663, size = 19, normalized size = 0.76 \begin{align*} \frac{\log{\left (x \right )}}{2} + \frac{\log{\left (x - \frac{1}{2} \right )}}{10} - \frac{\log{\left (x + 2 \right )}}{10} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(x)/2 + log(x - 1/2)/10 - log(x + 2)/10

________________________________________________________________________________________

Giac [A]  time = 1.04813, size = 30, normalized size = 1.2 \begin{align*} \frac{1}{10} \, \log \left ({\left | 2 \, x - 1 \right |}\right ) - \frac{1}{10} \, \log \left ({\left | x + 2 \right |}\right ) + \frac{1}{2} \, \log \left ({\left | x \right |}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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