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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0387941, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 3, integrand size = 36, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {2073, 261, 203} \[ \frac{2}{x^2+1}-\frac{1}{4 \left (x^2+1\right )^2}+\tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2073

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P /. x -> Sqrt[x]]}, Int[ExpandIntegrand[(PP /. x ->
x^2)^p*Q^q, x], x] /;  !SumQ[NonfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x^2] && PolyQ[Q, x] && ILtQ[p,
 0]

Rule 261

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

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

Rubi steps

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

Mathematica [A]  time = 0.0054313, size = 23, normalized size = 1. \[ \frac{2}{x^2+1}-\frac{1}{4 \left (x^2+1\right )^2}+\tan ^{-1}(x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.005, size = 19, normalized size = 0.8 \begin{align*}{\frac{1}{ \left ({x}^{2}+1 \right ) ^{2}} \left ( 2\,{x}^{2}+{\frac{7}{4}} \right ) }+\arctan \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*x^2+7/4)/(x^2+1)^2+arctan(x)

________________________________________________________________________________________

Maxima [A]  time = 1.49552, size = 32, normalized size = 1.39 \begin{align*} \frac{8 \, x^{2} + 7}{4 \,{\left (x^{4} + 2 \, x^{2} + 1\right )}} + \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(8*x^2 + 7)/(x^4 + 2*x^2 + 1) + arctan(x)

________________________________________________________________________________________

Fricas [A]  time = 1.45886, size = 90, normalized size = 3.91 \begin{align*} \frac{8 \, x^{2} + 4 \,{\left (x^{4} + 2 \, x^{2} + 1\right )} \arctan \left (x\right ) + 7}{4 \,{\left (x^{4} + 2 \, x^{2} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(8*x^2 + 4*(x^4 + 2*x^2 + 1)*arctan(x) + 7)/(x^4 + 2*x^2 + 1)

________________________________________________________________________________________

Sympy [A]  time = 0.122828, size = 20, normalized size = 0.87 \begin{align*} \frac{8 x^{2} + 7}{4 x^{4} + 8 x^{2} + 4} + \operatorname{atan}{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(8*x**2 + 7)/(4*x**4 + 8*x**2 + 4) + atan(x)

________________________________________________________________________________________

Giac [A]  time = 1.15276, size = 26, normalized size = 1.13 \begin{align*} \frac{8 \, x^{2} + 7}{4 \,{\left (x^{2} + 1\right )}^{2}} + \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(8*x^2 + 7)/(x^2 + 1)^2 + arctan(x)