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

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

Optimal result

Integrand size = 12, antiderivative size = 99 \[ \int \left (1-3 x^2+x^4\right )^n \, dx=x \left (1-\frac {2 x^2}{3-\sqrt {5}}\right )^{-n} \left (1-\frac {2 x^2}{3+\sqrt {5}}\right )^{-n} \left (1-3 x^2+x^4\right )^n \operatorname {AppellF1}\left (\frac {1}{2},-n,-n,\frac {3}{2},\frac {2 x^2}{3+\sqrt {5}},\frac {2 x^2}{3-\sqrt {5}}\right ) \] Output:

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

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.43 \[ \int \left (1-3 x^2+x^4\right )^n \, dx=\left (3+\sqrt {5}\right )^n x \left (-\left (3+\sqrt {5}-2 x^2\right )^2\right )^{-n} \left (-3-\sqrt {5}+2 x^2\right )^n \left (-3+\sqrt {5}+2 x^2\right )^n \left (\frac {\left (-3+\sqrt {5}+2 x^2\right )^2}{-3+\sqrt {5}}\right )^{-n} \left (1-3 x^2+x^4\right )^n \operatorname {AppellF1}\left (\frac {1}{2},-n,-n,\frac {3}{2},-\frac {2 x^2}{-3+\sqrt {5}},\frac {2 x^2}{3+\sqrt {5}}\right ) \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.23 (sec) , antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {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-3 x^2+1\right )^n \, dx\)

\(\Big \downarrow \) 1418

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

\(\Big \downarrow \) 333

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

Input:

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

Output:

(x*(1 - 3*x^2 + x^4)^n*AppellF1[1/2, -n, -n, 3/2, (2*x^2)/(3 - Sqrt[5]), ( 
2*x^2)/(3 + Sqrt[5])])/((1 - (2*x^2)/(3 - Sqrt[5]))^n*(1 - (2*x^2)/(3 + Sq 
rt[5]))^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]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

((x**4 - 3*x**2 + 1)**n*x + 16*int((x**4 - 3*x**2 + 1)**n/(4*n*x**4 - 12*n 
*x**2 + 4*n + x**4 - 3*x**2 + 1),x)*n**2 + 4*int((x**4 - 3*x**2 + 1)**n/(4 
*n*x**4 - 12*n*x**2 + 4*n + x**4 - 3*x**2 + 1),x)*n - 24*int(((x**4 - 3*x* 
*2 + 1)**n*x**2)/(4*n*x**4 - 12*n*x**2 + 4*n + x**4 - 3*x**2 + 1),x)*n**2 
- 6*int(((x**4 - 3*x**2 + 1)**n*x**2)/(4*n*x**4 - 12*n*x**2 + 4*n + x**4 - 
 3*x**2 + 1),x)*n)/(4*n + 1)