\(\int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx\) [6412]

   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 = 35, antiderivative size = 25 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=-4-x+x^2-\frac {2 (2-x) x}{3+x}-\log (x) \]

[Out]

x^2-2*(2-x)*x/(3+x)-ln(x)-x-4

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.086, Rules used = {1608, 27, 1634} \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=x^2+x+\frac {30}{x+3}-\log (x) \]

[In]

Int[(-9 - 27*x + 23*x^2 + 13*x^3 + 2*x^4)/(9*x + 6*x^2 + x^3),x]

[Out]

x + x^2 + 30/(3 + x) - Log[x]

Rule 27

Int[(u_.)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[u*Cancel[(b/2 + c*x)^(2*p)/c^p], x] /; Fr
eeQ[{a, b, c}, x] && EqQ[b^2 - 4*a*c, 0] && IntegerQ[p]

Rule 1608

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 1634

Int[(Px_)*((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[Px*(a + b*x)
^m*(c + d*x)^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && PolyQ[Px, x] && (IntegersQ[m, n] || IGtQ[m, -2]) &&
GtQ[Expon[Px, x], 2]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=x+x^2+\frac {30}{3+x}-\log (x) \]

[In]

Integrate[(-9 - 27*x + 23*x^2 + 13*x^3 + 2*x^4)/(9*x + 6*x^2 + x^3),x]

[Out]

x + x^2 + 30/(3 + x) - Log[x]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.68

method result size
default \(x +x^{2}+\frac {30}{3+x}-\ln \left (x \right )\) \(17\)
risch \(x +x^{2}+\frac {30}{3+x}-\ln \left (x \right )\) \(17\)
norman \(\frac {x^{3}+4 x^{2}+21}{3+x}-\ln \left (x \right )\) \(22\)
parallelrisch \(-\frac {-x^{3}+x \ln \left (x \right )-4 x^{2}-21+3 \ln \left (x \right )}{3+x}\) \(28\)

[In]

int((2*x^4+13*x^3+23*x^2-27*x-9)/(x^3+6*x^2+9*x),x,method=_RETURNVERBOSE)

[Out]

x+x^2+30/(3+x)-ln(x)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 26, normalized size of antiderivative = 1.04 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=\frac {x^{3} + 4 \, x^{2} - {\left (x + 3\right )} \log \left (x\right ) + 3 \, x + 30}{x + 3} \]

[In]

integrate((2*x^4+13*x^3+23*x^2-27*x-9)/(x^3+6*x^2+9*x),x, algorithm="fricas")

[Out]

(x^3 + 4*x^2 - (x + 3)*log(x) + 3*x + 30)/(x + 3)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.48 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=x^{2} + x - \log {\left (x \right )} + \frac {30}{x + 3} \]

[In]

integrate((2*x**4+13*x**3+23*x**2-27*x-9)/(x**3+6*x**2+9*x),x)

[Out]

x**2 + x - log(x) + 30/(x + 3)

Maxima [A] (verification not implemented)

none

Time = 0.17 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=x^{2} + x + \frac {30}{x + 3} - \log \left (x\right ) \]

[In]

integrate((2*x^4+13*x^3+23*x^2-27*x-9)/(x^3+6*x^2+9*x),x, algorithm="maxima")

[Out]

x^2 + x + 30/(x + 3) - log(x)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.68 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=x^{2} + x + \frac {30}{x + 3} - \log \left ({\left | x \right |}\right ) \]

[In]

integrate((2*x^4+13*x^3+23*x^2-27*x-9)/(x^3+6*x^2+9*x),x, algorithm="giac")

[Out]

x^2 + x + 30/(x + 3) - log(abs(x))

Mupad [B] (verification not implemented)

Time = 13.60 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.64 \[ \int \frac {-9-27 x+23 x^2+13 x^3+2 x^4}{9 x+6 x^2+x^3} \, dx=x-\ln \left (x\right )+\frac {30}{x+3}+x^2 \]

[In]

int((23*x^2 - 27*x + 13*x^3 + 2*x^4 - 9)/(9*x + 6*x^2 + x^3),x)

[Out]

x - log(x) + 30/(x + 3) + x^2