3.110 \(\int \frac{6 x+4 x^2+x^3}{2+4 x+3 x^2+2 x^3+x^4} \, dx\)

Optimal. Leaf size=41 \[ \frac{2}{3} \log \left (x^2+2\right )+\frac{1}{x+1}-\frac{1}{3} \log (x+1)+\frac{4}{3} \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right ) \]

[Out]

(1 + x)^(-1) + (4*Sqrt[2]*ArcTan[x/Sqrt[2]])/3 - Log[1 + x]/3 + (2*Log[2 + x^2])/3

________________________________________________________________________________________

Rubi [A]  time = 0.0870716, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.152, Rules used = {1594, 2075, 635, 203, 260} \[ \frac{2}{3} \log \left (x^2+2\right )+\frac{1}{x+1}-\frac{1}{3} \log (x+1)+\frac{4}{3} \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(1 + x)^(-1) + (4*Sqrt[2]*ArcTan[x/Sqrt[2]])/3 - Log[1 + x]/3 + (2*Log[2 + x^2])/3

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 2075

Int[(P_)^(p_)*(Qm_), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Qm, x], x] /; QuadraticProdu
ctQ[PP, x]] /; PolyQ[Qm, x] && PolyQ[P, x] && ILtQ[p, 0]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

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

Mathematica [A]  time = 0.0209546, size = 41, normalized size = 1. \[ \frac{2}{3} \log \left (x^2+2\right )+\frac{1}{x+1}-\frac{1}{3} \log (x+1)+\frac{4}{3} \sqrt{2} \tan ^{-1}\left (\frac{x}{\sqrt{2}}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

(1 + x)^(-1) + (4*Sqrt[2]*ArcTan[x/Sqrt[2]])/3 - Log[1 + x]/3 + (2*Log[2 + x^2])/3

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 33, normalized size = 0.8 \begin{align*} \left ( 1+x \right ) ^{-1}-{\frac{\ln \left ( 1+x \right ) }{3}}+{\frac{2\,\ln \left ({x}^{2}+2 \right ) }{3}}+{\frac{4\,\sqrt{2}}{3}\arctan \left ({\frac{x\sqrt{2}}{2}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.42998, size = 43, normalized size = 1.05 \begin{align*} \frac{4}{3} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + \frac{1}{x + 1} + \frac{2}{3} \, \log \left (x^{2} + 2\right ) - \frac{1}{3} \, \log \left (x + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4/3*sqrt(2)*arctan(1/2*sqrt(2)*x) + 1/(x + 1) + 2/3*log(x^2 + 2) - 1/3*log(x + 1)

________________________________________________________________________________________

Fricas [A]  time = 2.17671, size = 142, normalized size = 3.46 \begin{align*} \frac{4 \, \sqrt{2}{\left (x + 1\right )} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + 2 \,{\left (x + 1\right )} \log \left (x^{2} + 2\right ) -{\left (x + 1\right )} \log \left (x + 1\right ) + 3}{3 \,{\left (x + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/3*(4*sqrt(2)*(x + 1)*arctan(1/2*sqrt(2)*x) + 2*(x + 1)*log(x^2 + 2) - (x + 1)*log(x + 1) + 3)/(x + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.138548, size = 39, normalized size = 0.95 \begin{align*} - \frac{\log{\left (x + 1 \right )}}{3} + \frac{2 \log{\left (x^{2} + 2 \right )}}{3} + \frac{4 \sqrt{2} \operatorname{atan}{\left (\frac{\sqrt{2} x}{2} \right )}}{3} + \frac{1}{x + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(x + 1)/3 + 2*log(x**2 + 2)/3 + 4*sqrt(2)*atan(sqrt(2)*x/2)/3 + 1/(x + 1)

________________________________________________________________________________________

Giac [A]  time = 1.05185, size = 45, normalized size = 1.1 \begin{align*} \frac{4}{3} \, \sqrt{2} \arctan \left (\frac{1}{2} \, \sqrt{2} x\right ) + \frac{1}{x + 1} + \frac{2}{3} \, \log \left (x^{2} + 2\right ) - \frac{1}{3} \, \log \left ({\left | x + 1 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

4/3*sqrt(2)*arctan(1/2*sqrt(2)*x) + 1/(x + 1) + 2/3*log(x^2 + 2) - 1/3*log(abs(x + 1))