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

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 = 18, antiderivative size = 105 \[ \int \frac {(1-x)^n (1+x)^{-n}}{x^4} \, dx=-\frac {(1-x)^{1+n} (1+x)^{1-n}}{3 x^3}+\frac {n (1-x)^{1+n} (1+x)^{1-n}}{3 x^2}-\frac {2 \left (1+2 n^2\right ) (1-x)^{1+n} (1+x)^{-1-n} \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {1-x}{1+x}\right )}{3 (1+n)} \] Output:

-1/3*(1-x)^(1+n)*(1+x)^(1-n)/x^3+1/3*n*(1-x)^(1+n)*(1+x)^(1-n)/x^2-2*(2*n^ 
2+1)*(1-x)^(1+n)*(1+x)^(-1-n)*hypergeom([2, 1+n],[2+n],(1-x)/(1+x))/(3+3*n 
)
 

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 77, normalized size of antiderivative = 0.73 \[ \int \frac {(1-x)^n (1+x)^{-n}}{x^4} \, dx=-\frac {(1-x)^{1+n} (1+x)^{-1-n} \left (-\left ((1+n) (1+x)^2 (-1+n x)\right )+2 \left (1+2 n^2\right ) x^3 \operatorname {Hypergeometric2F1}\left (2,1+n,2+n,\frac {1-x}{1+x}\right )\right )}{3 (1+n) x^3} \] Input:

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

Output:

-1/3*((1 - x)^(1 + n)*(1 + x)^(-1 - n)*(-((1 + n)*(1 + x)^2*(-1 + n*x)) + 
2*(1 + 2*n^2)*x^3*Hypergeometric2F1[2, 1 + n, 2 + n, (1 - x)/(1 + x)]))/(( 
1 + n)*x^3)
 

Rubi [A] (verified)

Time = 0.20 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {114, 168, 27, 141}

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 \frac {(1-x)^n (x+1)^{-n}}{x^4} \, dx\)

\(\Big \downarrow \) 114

\(\displaystyle -\frac {1}{3} \int \frac {(1-x)^n (2 n-x) (x+1)^{-n}}{x^3}dx-\frac {(1-x)^{n+1} (x+1)^{1-n}}{3 x^3}\)

\(\Big \downarrow \) 168

\(\displaystyle \frac {1}{3} \left (\frac {1}{2} \int \frac {2 \left (2 n^2+1\right ) (1-x)^n (x+1)^{-n}}{x^2}dx+\frac {n (1-x)^{n+1} (x+1)^{1-n}}{x^2}\right )-\frac {(1-x)^{n+1} (x+1)^{1-n}}{3 x^3}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{3} \left (\left (2 n^2+1\right ) \int \frac {(1-x)^n (x+1)^{-n}}{x^2}dx+\frac {n (1-x)^{n+1} (x+1)^{1-n}}{x^2}\right )-\frac {(1-x)^{n+1} (x+1)^{1-n}}{3 x^3}\)

\(\Big \downarrow \) 141

\(\displaystyle \frac {1}{3} \left (\frac {n (1-x)^{n+1} (x+1)^{1-n}}{x^2}-\frac {2 \left (2 n^2+1\right ) (1-x)^{n+1} (x+1)^{-n-1} \operatorname {Hypergeometric2F1}\left (2,n+1,n+2,\frac {1-x}{x+1}\right )}{n+1}\right )-\frac {(1-x)^{n+1} (x+1)^{1-n}}{3 x^3}\)

Input:

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

Output:

-1/3*((1 - x)^(1 + n)*(1 + x)^(1 - n))/x^3 + ((n*(1 - x)^(1 + n)*(1 + x)^( 
1 - n))/x^2 - (2*(1 + 2*n^2)*(1 - x)^(1 + n)*(1 + x)^(-1 - n)*Hypergeometr 
ic2F1[2, 1 + n, 2 + n, (1 - x)/(1 + x)])/(1 + n))/3
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 114
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Simp[b*(a + b*x)^(m + 1)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1 
)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + Simp[1/((m + 1)*(b*c - a*d)*(b*e 
 - a*f))   Int[(a + b*x)^(m + 1)*(c + d*x)^n*(e + f*x)^p*Simp[a*d*f*(m + 1) 
 - b*(d*e*(m + n + 2) + c*f*(m + p + 2)) - b*d*f*(m + n + p + 3)*x, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && ILtQ[m, -1] && (IntegerQ[n] || 
 IntegersQ[2*n, 2*p] || ILtQ[m + n + p + 3, 0])
 

rule 141
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Simp[(b*c - a*d)^n*((a + b*x)^(m + 1)/((m + 1)*(b*e - a*f)^( 
n + 1)*(e + f*x)^(m + 1)))*Hypergeometric2F1[m + 1, -n, m + 2, (-(d*e - c*f 
))*((a + b*x)/((b*c - a*d)*(e + f*x)))], x] /; FreeQ[{a, b, c, d, e, f, m, 
p}, x] && EqQ[m + n + p + 2, 0] && ILtQ[n, 0] && (SumSimplerQ[m, 1] ||  !Su 
mSimplerQ[p, 1]) &&  !ILtQ[m, 0]
 

rule 168
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_)*((g_.) + (h_.)*(x_)), x_] :> Simp[(b*g - a*h)*(a + b*x)^(m + 1)*(c + 
 d*x)^(n + 1)*((e + f*x)^(p + 1)/((m + 1)*(b*c - a*d)*(b*e - a*f))), x] + S 
imp[1/((m + 1)*(b*c - a*d)*(b*e - a*f))   Int[(a + b*x)^(m + 1)*(c + d*x)^n 
*(e + f*x)^p*Simp[(a*d*f*g - b*(d*e + c*f)*g + b*c*e*h)*(m + 1) - (b*g - a* 
h)*(d*e*(n + 1) + c*f*(p + 1)) - d*f*(b*g - a*h)*(m + n + p + 3)*x, x], x], 
 x] /; FreeQ[{a, b, c, d, e, f, g, h, n, p}, x] && ILtQ[m, -1]
 
Maple [F]

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

Input:

int((1-x)^n/x^4/((1+x)^n),x)
 

Output:

int((1-x)^n/x^4/((1+x)^n),x)
 

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

Integral((1 - x)**n/(x**4*(x + 1)**n), x)
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

int((1-x)^n/x^4/((1+x)^n),x)
 

Output:

int(( - x + 1)**n/((x + 1)**n*x**4),x)