\(\int \frac {1+x+2 x^2+2 x^3}{x^2+x^3+x^4} \, dx\) [333]

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

[Out]

-1/x+ln(x^2+x+1)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {1608, 1642, 642} \[ \int \frac {1+x+2 x^2+2 x^3}{x^2+x^3+x^4} \, dx=\log \left (x^2+x+1\right )-\frac {1}{x} \]

[In]

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

[Out]

-x^(-1) + Log[1 + x + x^2]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

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 1642

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \frac {1+x+2 x^2+2 x^3}{x^2+x^3+x^4} \, dx=-\frac {1}{x}+\log \left (1+x+x^2\right ) \]

[In]

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

[Out]

-x^(-1) + Log[1 + x + x^2]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.08

method result size
default \(-\frac {1}{x}+\ln \left (x^{2}+x +1\right )\) \(14\)
norman \(-\frac {1}{x}+\ln \left (x^{2}+x +1\right )\) \(14\)
risch \(-\frac {1}{x}+\ln \left (x^{2}+x +1\right )\) \(14\)
parallelrisch \(\frac {\ln \left (x^{2}+x +1\right ) x -1}{x}\) \(16\)

[In]

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

[Out]

-1/x+ln(x^2+x+1)

Fricas [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \frac {1+x+2 x^2+2 x^3}{x^2+x^3+x^4} \, dx=-\frac {1}{x} + \log \left (x^{2} + x + 1\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \frac {1+x+2 x^2+2 x^3}{x^2+x^3+x^4} \, dx=-\frac {1}{x} + \log \left (x^{2} + x + 1\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.26 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \frac {1+x+2 x^2+2 x^3}{x^2+x^3+x^4} \, dx=\ln \left (x^2+x+1\right )-\frac {1}{x} \]

[In]

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

[Out]

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