### 3.186 $$\int \frac{-3+5 x+6 x^2}{-3 x+2 x^2+x^3} \, dx$$

Optimal. Leaf size=17 $2 \log (1-x)+\log (x)+3 \log (x+3)$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0398629, antiderivative size = 17, 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} $2 \log (1-x)+\log (x)+3 \log (x+3)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

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{-3+5 x+6 x^2}{-3 x+2 x^2+x^3} \, dx &=\int \frac{-3+5 x+6 x^2}{x \left (-3+2 x+x^2\right )} \, dx\\ &=\int \left (\frac{2}{-1+x}+\frac{1}{x}+\frac{3}{3+x}\right ) \, dx\\ &=2 \log (1-x)+\log (x)+3 \log (3+x)\\ \end{align*}

Mathematica [A]  time = 0.0061575, size = 17, normalized size = 1. $2 \log (1-x)+\log (x)+3 \log (x+3)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.008, size = 16, normalized size = 0.9 \begin{align*} \ln \left ( x \right ) +3\,\ln \left ( 3+x \right ) +2\,\ln \left ( -1+x \right ) \end{align*}

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

[In]

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

[Out]

ln(x)+3*ln(3+x)+2*ln(-1+x)

________________________________________________________________________________________

Maxima [A]  time = 0.933435, size = 20, normalized size = 1.18 \begin{align*} 3 \, \log \left (x + 3\right ) + 2 \, \log \left (x - 1\right ) + \log \left (x\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.86743, size = 51, normalized size = 3. \begin{align*} 3 \, \log \left (x + 3\right ) + 2 \, \log \left (x - 1\right ) + \log \left (x\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.120574, size = 15, normalized size = 0.88 \begin{align*} \log{\left (x \right )} + 2 \log{\left (x - 1 \right )} + 3 \log{\left (x + 3 \right )} \end{align*}

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

[In]

integrate((6*x**2+5*x-3)/(x**3+2*x**2-3*x),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.06984, size = 24, normalized size = 1.41 \begin{align*} 3 \, \log \left ({\left | x + 3 \right |}\right ) + 2 \, \log \left ({\left | x - 1 \right |}\right ) + \log \left ({\left | x \right |}\right ) \end{align*}

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

[In]

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

[Out]

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