\(\int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx\) [8132]

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

[Out]

-7+x/(1+x)-ln(x)-x^2*(5/x-3)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.80, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {1608, 27, 1634} \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=3 x^2-5 x-\frac {1}{x+1}-\log (x) \]

[In]

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

[Out]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.80 \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=-5 x+3 x^2-\frac {1}{1+x}-\log (x) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84

method result size
default \(3 x^{2}-5 x -\ln \left (x \right )-\frac {1}{1+x}\) \(21\)
risch \(3 x^{2}-5 x -\ln \left (x \right )-\frac {1}{1+x}\) \(21\)
norman \(\frac {3 x^{3}-2 x^{2}+4}{1+x}-\ln \left (x \right )\) \(24\)
parallelrisch \(-\frac {-3 x^{3}+x \ln \left (x \right )+2 x^{2}-4+\ln \left (x \right )}{1+x}\) \(26\)

[In]

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

[Out]

3*x^2-5*x-ln(x)-1/(1+x)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.12 \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=\frac {3 \, x^{3} - 2 \, x^{2} - {\left (x + 1\right )} \log \left (x\right ) - 5 \, x - 1}{x + 1} \]

[In]

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

[Out]

(3*x^3 - 2*x^2 - (x + 1)*log(x) - 5*x - 1)/(x + 1)

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 15, normalized size of antiderivative = 0.60 \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=3 x^{2} - 5 x - \log {\left (x \right )} - \frac {1}{x + 1} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.80 \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=3 \, x^{2} - 5 \, x - \frac {1}{x + 1} - \log \left (x\right ) \]

[In]

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

[Out]

3*x^2 - 5*x - 1/(x + 1) - log(x)

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.84 \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=3 \, x^{2} - 5 \, x - \frac {1}{x + 1} - \log \left ({\left | x \right |}\right ) \]

[In]

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

[Out]

3*x^2 - 5*x - 1/(x + 1) - log(abs(x))

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.80 \[ \int \frac {-1-6 x-5 x^2+7 x^3+6 x^4}{x+2 x^2+x^3} \, dx=3\,x^2-\ln \left (x\right )-\frac {1}{x+1}-5\,x \]

[In]

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

[Out]

3*x^2 - log(x) - 1/(x + 1) - 5*x