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

   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 = 16, antiderivative size = 32 \[ \int \frac {(-1+x)^4 x^4}{1+x^2} \, dx=4 x-\frac {4 x^3}{3}+x^5-\frac {2 x^6}{3}+\frac {x^7}{7}-4 \arctan (x) \]

[Out]

4*x-4/3*x^3+x^5-2/3*x^6+1/7*x^7-4*arctan(x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {1643, 209} \[ \int \frac {(-1+x)^4 x^4}{1+x^2} \, dx=-4 \arctan (x)+\frac {x^7}{7}-\frac {2 x^6}{3}+x^5-\frac {4 x^3}{3}+4 x \]

[In]

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

[Out]

4*x - (4*x^3)/3 + x^5 - (2*x^6)/3 + x^7/7 - 4*ArcTan[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 1643

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

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

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int \frac {(-1+x)^4 x^4}{1+x^2} \, dx=4 x-\frac {4 x^3}{3}+x^5-\frac {2 x^6}{3}+\frac {x^7}{7}-4 \arctan (x) \]

[In]

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

[Out]

4*x - (4*x^3)/3 + x^5 - (2*x^6)/3 + x^7/7 - 4*ArcTan[x]

Maple [A] (verified)

Time = 0.83 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.84

method result size
default \(4 x -\frac {4 x^{3}}{3}+x^{5}-\frac {2 x^{6}}{3}+\frac {x^{7}}{7}-4 \arctan \left (x \right )\) \(27\)
risch \(4 x -\frac {4 x^{3}}{3}+x^{5}-\frac {2 x^{6}}{3}+\frac {x^{7}}{7}-4 \arctan \left (x \right )\) \(27\)
parallelrisch \(\frac {x^{7}}{7}-\frac {2 x^{6}}{3}+x^{5}-\frac {4 x^{3}}{3}+4 x +2 i \ln \left (x -i\right )-2 i \ln \left (x +i\right )\) \(39\)
meijerg \(-\frac {x \left (-45 x^{6}+63 x^{4}-105 x^{2}+315\right )}{315}-4 \arctan \left (x \right )-\frac {x^{2} \left (4 x^{4}-6 x^{2}+12\right )}{6}+\frac {2 x \left (21 x^{4}-35 x^{2}+105\right )}{35}+\frac {x^{2} \left (-3 x^{2}+6\right )}{3}-\frac {x \left (-5 x^{2}+15\right )}{15}\) \(80\)

[In]

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

[Out]

4*x-4/3*x^3+x^5-2/3*x^6+1/7*x^7-4*arctan(x)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81 \[ \int \frac {(-1+x)^4 x^4}{1+x^2} \, dx=\frac {1}{7} \, x^{7} - \frac {2}{3} \, x^{6} + x^{5} - \frac {4}{3} \, x^{3} + 4 \, x - 4 \, \arctan \left (x\right ) \]

[In]

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

[Out]

1/7*x^7 - 2/3*x^6 + x^5 - 4/3*x^3 + 4*x - 4*arctan(x)

Sympy [A] (verification not implemented)

Time = 0.05 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.91 \[ \int \frac {(-1+x)^4 x^4}{1+x^2} \, dx=\frac {x^{7}}{7} - \frac {2 x^{6}}{3} + x^{5} - \frac {4 x^{3}}{3} + 4 x - 4 \operatorname {atan}{\left (x \right )} \]

[In]

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

[Out]

x**7/7 - 2*x**6/3 + x**5 - 4*x**3/3 + 4*x - 4*atan(x)

Maxima [A] (verification not implemented)

none

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

[In]

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

[Out]

1/7*x^7 - 2/3*x^6 + x^5 - 4/3*x^3 + 4*x - 4*arctan(x)

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

1/7*x^7 - 2/3*x^6 + x^5 - 4/3*x^3 + 4*x - 4*arctan(x)

Mupad [B] (verification not implemented)

Time = 0.01 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.81 \[ \int \frac {(-1+x)^4 x^4}{1+x^2} \, dx=4\,x-4\,\mathrm {atan}\left (x\right )-\frac {4\,x^3}{3}+x^5-\frac {2\,x^6}{3}+\frac {x^7}{7} \]

[In]

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

[Out]

4*x - 4*atan(x) - (4*x^3)/3 + x^5 - (2*x^6)/3 + x^7/7