### 3.191 $$\int \frac{18-2 x-4 x^2}{-6+x+4 x^2+x^3} \, dx$$

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0267347, antiderivative size = 19, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 24, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.042, Rules used = {2074} $\log (1-x)-2 \log (x+2)-3 \log (x+3)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 2074

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps

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

Mathematica [A]  time = 0.0066508, size = 25, normalized size = 1.32 $-2 \left (-\frac{1}{2} \log (1-x)+\log (x+2)+\frac{3}{2} \log (x+3)\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-2*(-Log[1 - x]/2 + Log[2 + x] + (3*Log[3 + x])/2)

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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

________________________________________________________________________________________

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

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

[In]

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

[Out]

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