\(\int (a+8 x-8 x^2+4 x^3-x^4)^2 \, dx\) [118]

   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 = 22, antiderivative size = 72 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=a^2 x+8 a x^2+\frac {16}{3} (4-a) x^3-2 (16-a) x^4+\frac {2}{5} (64-a) x^5-\frac {40 x^6}{3}+\frac {32 x^7}{7}-x^8+\frac {x^9}{9} \]

[Out]

a^2*x+8*a*x^2+16/3*(4-a)*x^3-2*(16-a)*x^4+2/5*(64-a)*x^5-40/3*x^6+32/7*x^7-x^8+1/9*x^9

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.045, Rules used = {2086} \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=a^2 x+\frac {2}{5} (64-a) x^5-2 (16-a) x^4+\frac {16}{3} (4-a) x^3+8 a x^2+\frac {x^9}{9}-x^8+\frac {32 x^7}{7}-\frac {40 x^6}{3} \]

[In]

Int[(a + 8*x - 8*x^2 + 4*x^3 - x^4)^2,x]

[Out]

a^2*x + 8*a*x^2 + (16*(4 - a)*x^3)/3 - 2*(16 - a)*x^4 + (2*(64 - a)*x^5)/5 - (40*x^6)/3 + (32*x^7)/7 - x^8 + x
^9/9

Rule 2086

Int[(P_)^(p_), x_Symbol] :> Int[ExpandToSum[P^p, x], x] /; PolyQ[P, x] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (a^2+16 a x+16 (4-a) x^2-8 (16-a) x^3+2 (64-a) x^4-80 x^5+32 x^6-8 x^7+x^8\right ) \, dx \\ & = a^2 x+8 a x^2+\frac {16}{3} (4-a) x^3-2 (16-a) x^4+\frac {2}{5} (64-a) x^5-\frac {40 x^6}{3}+\frac {32 x^7}{7}-x^8+\frac {x^9}{9} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 66, normalized size of antiderivative = 0.92 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=a^2 x+8 a x^2-\frac {16}{3} (-4+a) x^3+2 (-16+a) x^4-\frac {2}{5} (-64+a) x^5-\frac {40 x^6}{3}+\frac {32 x^7}{7}-x^8+\frac {x^9}{9} \]

[In]

Integrate[(a + 8*x - 8*x^2 + 4*x^3 - x^4)^2,x]

[Out]

a^2*x + 8*a*x^2 - (16*(-4 + a)*x^3)/3 + 2*(-16 + a)*x^4 - (2*(-64 + a)*x^5)/5 - (40*x^6)/3 + (32*x^7)/7 - x^8
+ x^9/9

Maple [A] (verified)

Time = 0.03 (sec) , antiderivative size = 60, normalized size of antiderivative = 0.83

method result size
norman \(\frac {x^{9}}{9}-x^{8}+\frac {32 x^{7}}{7}-\frac {40 x^{6}}{3}+\left (-\frac {2 a}{5}+\frac {128}{5}\right ) x^{5}+\left (2 a -32\right ) x^{4}+\left (-\frac {16 a}{3}+\frac {64}{3}\right ) x^{3}+8 a \,x^{2}+a^{2} x\) \(60\)
default \(\frac {x^{9}}{9}-x^{8}+\frac {32 x^{7}}{7}-\frac {40 x^{6}}{3}+\frac {\left (-2 a +128\right ) x^{5}}{5}+\frac {\left (8 a -128\right ) x^{4}}{4}+\frac {\left (-16 a +64\right ) x^{3}}{3}+8 a \,x^{2}+a^{2} x\) \(63\)
gosper \(\frac {1}{9} x^{9}-x^{8}+\frac {32}{7} x^{7}-\frac {40}{3} x^{6}-\frac {2}{5} a \,x^{5}+\frac {128}{5} x^{5}+2 a \,x^{4}-32 x^{4}-\frac {16}{3} a \,x^{3}+\frac {64}{3} x^{3}+8 a \,x^{2}+a^{2} x\) \(66\)
risch \(\frac {1}{9} x^{9}-x^{8}+\frac {32}{7} x^{7}-\frac {40}{3} x^{6}-\frac {2}{5} a \,x^{5}+\frac {128}{5} x^{5}+2 a \,x^{4}-32 x^{4}-\frac {16}{3} a \,x^{3}+\frac {64}{3} x^{3}+8 a \,x^{2}+a^{2} x\) \(66\)
parallelrisch \(\frac {1}{9} x^{9}-x^{8}+\frac {32}{7} x^{7}-\frac {40}{3} x^{6}-\frac {2}{5} a \,x^{5}+\frac {128}{5} x^{5}+2 a \,x^{4}-32 x^{4}-\frac {16}{3} a \,x^{3}+\frac {64}{3} x^{3}+8 a \,x^{2}+a^{2} x\) \(66\)

[In]

int((-x^4+4*x^3-8*x^2+a+8*x)^2,x,method=_RETURNVERBOSE)

[Out]

1/9*x^9-x^8+32/7*x^7-40/3*x^6+(-2/5*a+128/5)*x^5+(2*a-32)*x^4+(-16/3*a+64/3)*x^3+8*a*x^2+a^2*x

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.78 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=\frac {1}{9} \, x^{9} - x^{8} + \frac {32}{7} \, x^{7} - \frac {2}{5} \, {\left (a - 64\right )} x^{5} - \frac {40}{3} \, x^{6} + 2 \, {\left (a - 16\right )} x^{4} - \frac {16}{3} \, {\left (a - 4\right )} x^{3} + a^{2} x + 8 \, a x^{2} \]

[In]

integrate((-x^4+4*x^3-8*x^2+a+8*x)^2,x, algorithm="fricas")

[Out]

1/9*x^9 - x^8 + 32/7*x^7 - 2/5*(a - 64)*x^5 - 40/3*x^6 + 2*(a - 16)*x^4 - 16/3*(a - 4)*x^3 + a^2*x + 8*a*x^2

Sympy [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.90 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=a^{2} x + 8 a x^{2} + \frac {x^{9}}{9} - x^{8} + \frac {32 x^{7}}{7} - \frac {40 x^{6}}{3} + x^{5} \cdot \left (\frac {128}{5} - \frac {2 a}{5}\right ) + x^{4} \cdot \left (2 a - 32\right ) + x^{3} \cdot \left (\frac {64}{3} - \frac {16 a}{3}\right ) \]

[In]

integrate((-x**4+4*x**3-8*x**2+a+8*x)**2,x)

[Out]

a**2*x + 8*a*x**2 + x**9/9 - x**8 + 32*x**7/7 - 40*x**6/3 + x**5*(128/5 - 2*a/5) + x**4*(2*a - 32) + x**3*(64/
3 - 16*a/3)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.90 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=\frac {1}{9} \, x^{9} - x^{8} + \frac {32}{7} \, x^{7} - \frac {40}{3} \, x^{6} + \frac {128}{5} \, x^{5} - 32 \, x^{4} + a^{2} x + \frac {64}{3} \, x^{3} - \frac {2}{15} \, {\left (3 \, x^{5} - 15 \, x^{4} + 40 \, x^{3} - 60 \, x^{2}\right )} a \]

[In]

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

[Out]

1/9*x^9 - x^8 + 32/7*x^7 - 40/3*x^6 + 128/5*x^5 - 32*x^4 + a^2*x + 64/3*x^3 - 2/15*(3*x^5 - 15*x^4 + 40*x^3 -
60*x^2)*a

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.90 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=\frac {1}{9} \, x^{9} - x^{8} + \frac {32}{7} \, x^{7} - \frac {2}{5} \, a x^{5} - \frac {40}{3} \, x^{6} + 2 \, a x^{4} + \frac {128}{5} \, x^{5} - \frac {16}{3} \, a x^{3} - 32 \, x^{4} + a^{2} x + 8 \, a x^{2} + \frac {64}{3} \, x^{3} \]

[In]

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

[Out]

1/9*x^9 - x^8 + 32/7*x^7 - 2/5*a*x^5 - 40/3*x^6 + 2*a*x^4 + 128/5*x^5 - 16/3*a*x^3 - 32*x^4 + a^2*x + 8*a*x^2
+ 64/3*x^3

Mupad [B] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.85 \[ \int \left (a+8 x-8 x^2+4 x^3-x^4\right )^2 \, dx=x^4\,\left (2\,a-32\right )-x^3\,\left (\frac {16\,a}{3}-\frac {64}{3}\right )-x^5\,\left (\frac {2\,a}{5}-\frac {128}{5}\right )+8\,a\,x^2+a^2\,x-\frac {40\,x^6}{3}+\frac {32\,x^7}{7}-x^8+\frac {x^9}{9} \]

[In]

int((a + 8*x - 8*x^2 + 4*x^3 - x^4)^2,x)

[Out]

x^4*(2*a - 32) - x^3*((16*a)/3 - 64/3) - x^5*((2*a)/5 - 128/5) + 8*a*x^2 + a^2*x - (40*x^6)/3 + (32*x^7)/7 - x
^8 + x^9/9