\(\int (1+6 x-7 x^2+4 x^3-x^4)^n \, dx\) [266]

Optimal result
Mathematica [F]
Rubi [B] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 22, antiderivative size = 52 \[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=3^n (-1+x) \operatorname {AppellF1}\left (\frac {1}{2},-n,-n,\frac {3}{2},-\frac {2 (-1+x)^2}{1+\sqrt {13}},\frac {2 (-1+x)^2}{-1+\sqrt {13}}\right ) \] Output:

3^n*(-1+x)*AppellF1(1/2,-n,-n,3/2,2*(-1+x)^2/(-1+13^(1/2)),-2*(-1+x)^2/(1+ 
13^(1/2)))
 

Mathematica [F]

\[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx \] Input:

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

Output:

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

Rubi [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(115\) vs. \(2(52)=104\).

Time = 0.44 (sec) , antiderivative size = 115, normalized size of antiderivative = 2.21, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {2458, 1418, 333}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \left (-x^4+4 x^3-7 x^2+6 x+1\right )^n \, dx\)

\(\Big \downarrow \) 2458

\(\displaystyle \int \left (-(x-1)^4-(x-1)^2+3\right )^nd(x-1)\)

\(\Big \downarrow \) 1418

\(\displaystyle \left (\frac {2 (x-1)^2}{1-\sqrt {13}}+1\right )^{-n} \left (\frac {2 (x-1)^2}{1+\sqrt {13}}+1\right )^{-n} \left (-(x-1)^4-(x-1)^2+3\right )^n \int \left (\frac {2 (x-1)^2}{1-\sqrt {13}}+1\right )^n \left (\frac {2 (x-1)^2}{1+\sqrt {13}}+1\right )^nd(x-1)\)

\(\Big \downarrow \) 333

\(\displaystyle (x-1) \left (\frac {2 (x-1)^2}{1-\sqrt {13}}+1\right )^{-n} \left (\frac {2 (x-1)^2}{1+\sqrt {13}}+1\right )^{-n} \left (-(x-1)^4-(x-1)^2+3\right )^n \operatorname {AppellF1}\left (\frac {1}{2},-n,-n,\frac {3}{2},-\frac {2 (x-1)^2}{1-\sqrt {13}},-\frac {2 (x-1)^2}{1+\sqrt {13}}\right )\)

Input:

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

Output:

((3 - (-1 + x)^2 - (-1 + x)^4)^n*(-1 + x)*AppellF1[1/2, -n, -n, 3/2, (-2*( 
-1 + x)^2)/(1 - Sqrt[13]), (-2*(-1 + x)^2)/(1 + Sqrt[13])])/((1 + (2*(-1 + 
 x)^2)/(1 - Sqrt[13]))^n*(1 + (2*(-1 + x)^2)/(1 + Sqrt[13]))^n)
 

Defintions of rubi rules used

rule 333
Int[((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_), x_Symbol] :> Sim 
p[a^p*c^q*x*AppellF1[1/2, -p, -q, 3/2, (-b)*(x^2/a), (-d)*(x^2/c)], x] /; F 
reeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && (IntegerQ[p] || GtQ[a, 
0]) && (IntegerQ[q] || GtQ[c, 0])
 

rule 1418
Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_), x_Symbol] :> With[{q = Rt[b^ 
2 - 4*a*c, 2]}, Simp[a^IntPart[p]*((a + b*x^2 + c*x^4)^FracPart[p]/((1 + 2* 
c*(x^2/(b + q)))^FracPart[p]*(1 + 2*c*(x^2/(b - q)))^FracPart[p]))   Int[(1 
 + 2*c*(x^2/(b + q)))^p*(1 + 2*c*(x^2/(b - q)))^p, x], x]] /; FreeQ[{a, b, 
c, p}, x] && NeQ[b^2 - 4*a*c, 0]
 

rule 2458
Int[(Pn_)^(p_.), x_Symbol] :> With[{S = Coeff[Pn, x, Expon[Pn, x] - 1]/(Exp 
on[Pn, x]*Coeff[Pn, x, Expon[Pn, x]])}, Subst[Int[ExpandToSum[Pn /. x -> x 
- S, x]^p, x], x, x + S] /; BinomialQ[Pn /. x -> x - S, x] || (IntegerQ[Exp 
on[Pn, x]/2] && TrinomialQ[Pn /. x -> x - S, x])] /; FreeQ[p, x] && PolyQ[P 
n, x] && GtQ[Expon[Pn, x], 2] && NeQ[Coeff[Pn, x, Expon[Pn, x] - 1], 0]
 
Maple [F]

\[\int \left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n}d x\]

Input:

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

Output:

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

Fricas [F]

\[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\int { {\left (-x^{4} + 4 \, x^{3} - 7 \, x^{2} + 6 \, x + 1\right )}^{n} \,d x } \] Input:

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

Output:

integral((-x^4 + 4*x^3 - 7*x^2 + 6*x + 1)^n, x)
 

Sympy [F]

\[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\int \left (- x^{4} + 4 x^{3} - 7 x^{2} + 6 x + 1\right )^{n}\, dx \] Input:

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

Output:

Integral((-x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n, x)
 

Maxima [F]

\[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\int { {\left (-x^{4} + 4 \, x^{3} - 7 \, x^{2} + 6 \, x + 1\right )}^{n} \,d x } \] Input:

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

Output:

integrate((-x^4 + 4*x^3 - 7*x^2 + 6*x + 1)^n, x)
 

Giac [F]

\[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\int { {\left (-x^{4} + 4 \, x^{3} - 7 \, x^{2} + 6 \, x + 1\right )}^{n} \,d x } \] Input:

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

Output:

integrate((-x^4 + 4*x^3 - 7*x^2 + 6*x + 1)^n, x)
 

Mupad [F(-1)]

Timed out. \[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\int {\left (-x^4+4\,x^3-7\,x^2+6\,x+1\right )}^n \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \left (1+6 x-7 x^2+4 x^3-x^4\right )^n \, dx=\frac {6 \left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n} x -7 \left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n}-264 \left (\int \frac {\left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n}}{4 n \,x^{4}-16 n \,x^{3}+x^{4}+28 n \,x^{2}-4 x^{3}-24 n x +7 x^{2}-4 n -6 x -1}d x \right ) n^{2}-66 \left (\int \frac {\left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n}}{4 n \,x^{4}-16 n \,x^{3}+x^{4}+28 n \,x^{2}-4 x^{3}-24 n x +7 x^{2}-4 n -6 x -1}d x \right ) n +16 \left (\int \frac {\left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n} x^{3}}{4 n \,x^{4}-16 n \,x^{3}+x^{4}+28 n \,x^{2}-4 x^{3}-24 n x +7 x^{2}-4 n -6 x -1}d x \right ) n^{2}+4 \left (\int \frac {\left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n} x^{3}}{4 n \,x^{4}-16 n \,x^{3}+x^{4}+28 n \,x^{2}-4 x^{3}-24 n x +7 x^{2}-4 n -6 x -1}d x \right ) n -40 \left (\int \frac {\left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n} x}{4 n \,x^{4}-16 n \,x^{3}+x^{4}+28 n \,x^{2}-4 x^{3}-24 n x +7 x^{2}-4 n -6 x -1}d x \right ) n^{2}-10 \left (\int \frac {\left (-x^{4}+4 x^{3}-7 x^{2}+6 x +1\right )^{n} x}{4 n \,x^{4}-16 n \,x^{3}+x^{4}+28 n \,x^{2}-4 x^{3}-24 n x +7 x^{2}-4 n -6 x -1}d x \right ) n}{24 n +6} \] Input:

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

Output:

(6*( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n*x - 7*( - x**4 + 4*x**3 - 7*x* 
*2 + 6*x + 1)**n - 264*int(( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n/(4*n*x 
**4 - 16*n*x**3 + 28*n*x**2 - 24*n*x - 4*n + x**4 - 4*x**3 + 7*x**2 - 6*x 
- 1),x)*n**2 - 66*int(( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n/(4*n*x**4 - 
 16*n*x**3 + 28*n*x**2 - 24*n*x - 4*n + x**4 - 4*x**3 + 7*x**2 - 6*x - 1), 
x)*n + 16*int((( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n*x**3)/(4*n*x**4 - 
16*n*x**3 + 28*n*x**2 - 24*n*x - 4*n + x**4 - 4*x**3 + 7*x**2 - 6*x - 1),x 
)*n**2 + 4*int((( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n*x**3)/(4*n*x**4 - 
 16*n*x**3 + 28*n*x**2 - 24*n*x - 4*n + x**4 - 4*x**3 + 7*x**2 - 6*x - 1), 
x)*n - 40*int((( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n*x)/(4*n*x**4 - 16* 
n*x**3 + 28*n*x**2 - 24*n*x - 4*n + x**4 - 4*x**3 + 7*x**2 - 6*x - 1),x)*n 
**2 - 10*int((( - x**4 + 4*x**3 - 7*x**2 + 6*x + 1)**n*x)/(4*n*x**4 - 16*n 
*x**3 + 28*n*x**2 - 24*n*x - 4*n + x**4 - 4*x**3 + 7*x**2 - 6*x - 1),x)*n) 
/(6*(4*n + 1))