3.2.10 \(\int \frac {6 x+4 x^2+x^3}{2+4 x+3 x^2+2 x^3+x^4} \, dx\) [110]

Optimal. Leaf size=41 \[ \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 ) \]

[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)

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 41, normalized size of antiderivative = 1.00, 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 = {1608, 2100, 649, 209, 266} \begin {gather*} \frac {4}{3} \sqrt {2} \text {ArcTan}\left (\frac {x}{\sqrt {2}}\right )+\frac {2}{3} \log \left (x^2+2\right )+\frac {1}{x+1}-\frac {1}{3} \log (x+1) \end {gather*}

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 209

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

Rule 266

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]

Rule 649

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 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 2100

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]

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.02, size = 41, normalized size = 1.00 \begin {gather*} \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 {gather*}

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.02, size = 33, normalized size = 0.80

method result size
default \(\frac {1}{1+x}-\frac {\ln \left (1+x \right )}{3}+\frac {2 \ln \left (x^{2}+2\right )}{3}+\frac {4 \arctan \left (\frac {x \sqrt {2}}{2}\right ) \sqrt {2}}{3}\) \(33\)
risch \(\frac {1}{1+x}-\frac {\ln \left (1+x \right )}{3}+\frac {2 \ln \left (x^{2}+2\right )}{3}+\frac {4 \arctan \left (\frac {x \sqrt {2}}{2}\right ) \sqrt {2}}{3}\) \(33\)

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,method=_RETURNVERBOSE)

[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 = 2.01, size = 32, normalized size = 0.78 \begin {gather*} \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 {gather*}

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 = 0.55, size = 44, normalized size = 1.07 \begin {gather*} \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 {gather*}

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.06, size = 39, normalized size = 0.95 \begin {gather*} - \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 {gather*}

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 = 0.79, size = 33, normalized size = 0.80 \begin {gather*} \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 {gather*}

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))

________________________________________________________________________________________

Mupad [B]
time = 0.25, size = 49, normalized size = 1.20 \begin {gather*} \frac {1}{x+1}-\frac {\ln \left (x+1\right )}{3}-\ln \left (x-\sqrt {2}\,1{}\mathrm {i}\right )\,\left (-\frac {2}{3}+\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right )+\ln \left (x+\sqrt {2}\,1{}\mathrm {i}\right )\,\left (\frac {2}{3}+\frac {\sqrt {2}\,2{}\mathrm {i}}{3}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________