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

Optimal. Leaf size=32 \[ \frac{x^7}{7}-\frac{2 x^6}{3}+x^5-\frac{4 x^3}{3}+4 x-4 \tan ^{-1}(x) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0400596, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.125, Rules used = {1629, 203} \[ \frac{x^7}{7}-\frac{2 x^6}{3}+x^5-\frac{4 x^3}{3}+4 x-4 \tan ^{-1}(x) \]

Antiderivative was successfully verified.

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

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]

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+x)^4 x^4}{1+x^2} \, dx &=\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]  time = 0.0240289, size = 32, normalized size = 1. \[ \frac{x^7}{7}-\frac{2 x^6}{3}+x^5-\frac{4 x^3}{3}+4 x-4 \tan ^{-1}(x) \]

Antiderivative was successfully verified.

[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]  time = 0.003, size = 27, normalized size = 0.8 \begin{align*} 4\,x-{\frac{4\,{x}^{3}}{3}}+{x}^{5}-{\frac{2\,{x}^{6}}{3}}+{\frac{{x}^{7}}{7}}-4\,\arctan \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.71845, size = 35, normalized size = 1.09 \begin{align*} \frac{1}{7} \, x^{7} - \frac{2}{3} \, x^{6} + x^{5} - \frac{4}{3} \, x^{3} + 4 \, x - 4 \, \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

Fricas [A]  time = 1.44205, size = 74, normalized size = 2.31 \begin{align*} \frac{1}{7} \, x^{7} - \frac{2}{3} \, x^{6} + x^{5} - \frac{4}{3} \, x^{3} + 4 \, x - 4 \, \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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]  time = 0.090415, size = 29, normalized size = 0.91 \begin{align*} \frac{x^{7}}{7} - \frac{2 x^{6}}{3} + x^{5} - \frac{4 x^{3}}{3} + 4 x - 4 \operatorname{atan}{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

Giac [A]  time = 1.43134, size = 35, normalized size = 1.09 \begin{align*} \frac{1}{7} \, x^{7} - \frac{2}{3} \, x^{6} + x^{5} - \frac{4}{3} \, x^{3} + 4 \, x - 4 \, \arctan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

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