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

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

[Out]

-1/4/(x^2+1)^2+2/(x^2+1)+arctan(x)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 23, 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 = {1828, 12, 209} \[ \int \frac {1-3 x+2 x^2-4 x^3+x^4}{\left (1+x^2\right )^3} \, dx=\arctan (x)+\frac {2}{x^2+1}-\frac {1}{4 \left (x^2+1\right )^2} \]

[In]

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

[Out]

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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 1828

Int[(Pq_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x^2, x], f = Coeff[P
olynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 1]}, Simp[(a*
g - b*f*x)*((a + b*x^2)^(p + 1)/(2*a*b*(p + 1))), x] + Dist[1/(2*a*(p + 1)), Int[(a + b*x^2)^(p + 1)*ExpandToS
um[2*a*(p + 1)*Q + f*(2*p + 3), x], x], x]] /; FreeQ[{a, b}, x] && PolyQ[Pq, x] && LtQ[p, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {1}{4 \left (1+x^2\right )^2}-\frac {1}{4} \int \frac {-4+16 x-4 x^2}{\left (1+x^2\right )^2} \, dx \\ & = -\frac {1}{4 \left (1+x^2\right )^2}+\frac {2}{1+x^2}+\frac {1}{8} \int \frac {8}{1+x^2} \, dx \\ & = -\frac {1}{4 \left (1+x^2\right )^2}+\frac {2}{1+x^2}+\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] (verified)

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

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.80 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83

method result size
default \(\frac {2 x^{2}+\frac {7}{4}}{\left (x^{2}+1\right )^{2}}+\arctan \left (x \right )\) \(19\)
risch \(\frac {2 x^{2}+\frac {7}{4}}{\left (x^{2}+1\right )^{2}}+\arctan \left (x \right )\) \(19\)
parallelrisch \(-\frac {2 i \ln \left (x -i\right ) x^{4}-2 i \ln \left (x +i\right ) x^{4}-3+4 i \ln \left (x -i\right ) x^{2}-4 i \ln \left (x +i\right ) x^{2}+4 x^{4}+2 i \ln \left (x -i\right )-2 i \ln \left (x +i\right )}{4 \left (x^{2}+1\right )^{2}}\) \(77\)
meijerg \(\frac {x \left (3 x^{2}+5\right )}{8 \left (x^{2}+1\right )^{2}}+\arctan \left (x \right )-\frac {x \left (25 x^{2}+15\right )}{40 \left (x^{2}+1\right )^{2}}-\frac {x^{4}}{\left (x^{2}+1\right )^{2}}-\frac {x \left (-3 x^{2}+3\right )}{12 \left (x^{2}+1\right )^{2}}-\frac {3 x^{2} \left (x^{2}+2\right )}{4 \left (x^{2}+1\right )^{2}}\) \(84\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 35, normalized size of antiderivative = 1.52 \[ \int \frac {1-3 x+2 x^2-4 x^3+x^4}{\left (1+x^2\right )^3} \, dx=\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 )}} \]

[In]

integrate((x^4-4*x^3+2*x^2-3*x+1)/(x^2+1)^3,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] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.87 \[ \int \frac {1-3 x+2 x^2-4 x^3+x^4}{\left (1+x^2\right )^3} \, dx=\frac {8 x^{2} + 7}{4 x^{4} + 8 x^{2} + 4} + \operatorname {atan}{\left (x \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 24, normalized size of antiderivative = 1.04 \[ \int \frac {1-3 x+2 x^2-4 x^3+x^4}{\left (1+x^2\right )^3} \, dx=\frac {8 \, x^{2} + 7}{4 \, {\left (x^{4} + 2 \, x^{2} + 1\right )}} + \arctan \left (x\right ) \]

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

Time = 0.35 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.83 \[ \int \frac {1-3 x+2 x^2-4 x^3+x^4}{\left (1+x^2\right )^3} \, dx=\frac {8 \, x^{2} + 7}{4 \, {\left (x^{2} + 1\right )}^{2}} + \arctan \left (x\right ) \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 9.25 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.00 \[ \int \frac {1-3 x+2 x^2-4 x^3+x^4}{\left (1+x^2\right )^3} \, dx=\mathrm {atan}\left (x\right )+\frac {2\,x^2+\frac {7}{4}}{x^4+2\,x^2+1} \]

[In]

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

[Out]

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