\(\int \frac {(-a+b x^n)^p (a+b x^n)^p}{x} \, dx\) [579]

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 = 24, antiderivative size = 72 \[ \int \frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p}{x} \, dx=-\frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (a^2-b^2 x^{2 n}\right ) \operatorname {Hypergeometric2F1}\left (1,1+p,2+p,1-\frac {b^2 x^{2 n}}{a^2}\right )}{2 a^2 n (1+p)} \] Output:

-1/2*(-a+b*x^n)^p*(a+b*x^n)^p*(a^2-b^2*x^(2*n))*hypergeom([1, p+1],[2+p],1 
-b^2*x^(2*n)/a^2)/a^2/n/(p+1)
 

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.01 \[ \int \frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p}{x} \, dx=\frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p \left (-a^2+b^2 x^{2 n}\right ) \operatorname {Hypergeometric2F1}\left (1,1+p,2+p,1-\frac {b^2 x^{2 n}}{a^2}\right )}{2 a^2 n (1+p)} \] Input:

Integrate[((-a + b*x^n)^p*(a + b*x^n)^p)/x,x]
 

Output:

((-a + b*x^n)^p*(a + b*x^n)^p*(-a^2 + b^2*x^(2*n))*Hypergeometric2F1[1, 1 
+ p, 2 + p, 1 - (b^2*x^(2*n))/a^2])/(2*a^2*n*(1 + p))
 

Rubi [A] (verified)

Time = 0.36 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.01, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {799, 136, 243, 75}

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 {\left (b x^n-a\right )^p \left (a+b x^n\right )^p}{x} \, dx\)

\(\Big \downarrow \) 799

\(\displaystyle \frac {\int x^{-n} \left (b x^n-a\right )^p \left (b x^n+a\right )^pdx^n}{n}\)

\(\Big \downarrow \) 136

\(\displaystyle \frac {\left (b x^n-a\right )^p \left (a+b x^n\right )^p \left (b^2 x^{2 n}-a^2\right )^{-p} \int x^{-n} \left (b^2 x^{2 n}-a^2\right )^pdx^n}{n}\)

\(\Big \downarrow \) 243

\(\displaystyle \frac {\left (b x^n-a\right )^p \left (a+b x^n\right )^p \left (b^2 x^{2 n}-a^2\right )^{-p} \int x^{-n} \left (b^2 x^{2 n}-a^2\right )^pdx^{2 n}}{2 n}\)

\(\Big \downarrow \) 75

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

Input:

Int[((-a + b*x^n)^p*(a + b*x^n)^p)/x,x]
 

Output:

((-a + b*x^n)^p*(a + b*x^n)^p*(-a^2 + b^2*x^(2*n))*Hypergeometric2F1[1, 1 
+ p, 2 + p, 1 - (b^2*x^(2*n))/a^2])/(2*a^2*n*(1 + p))
 

Defintions of rubi rules used

rule 75
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x 
)^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))*Hypergeometric2F1[-m, n + 1, n + 2, 1 + 
 d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (IntegerQ[m] 
 || GtQ[-d/(b*c), 0])
 

rule 136
Int[((f_.)*(x_))^(p_)*((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), 
x_] :> Simp[(a + b*x)^FracPart[m]*((c + d*x)^FracPart[m]/(a*c + b*d*x^2)^Fr 
acPart[m])   Int[(a*c + b*d*x^2)^m*(f*x)^p, x], x] /; FreeQ[{a, b, c, d, f, 
 m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[n, m]
 

rule 243
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[1/2   Subst[In 
t[x^((m - 1)/2)*(a + b*x)^p, x], x, x^2], x] /; FreeQ[{a, b, m, p}, x] && I 
ntegerQ[(m - 1)/2]
 

rule 799
Int[(x_)^(m_.)*((a1_) + (b1_.)*(x_)^(n_))^(p_)*((a2_) + (b2_.)*(x_)^(n_))^( 
p_), x_Symbol] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a1 + b1 
*x)^p*(a2 + b2*x)^p, x], x, x^n], x] /; FreeQ[{a1, b1, a2, b2, m, n, p}, x] 
 && EqQ[a2*b1 + a1*b2, 0] && IntegerQ[Simplify[(m + 1)/(2*n)]]
 
Maple [F]

\[\int \frac {\left (-a +b \,x^{n}\right )^{p} \left (a +b \,x^{n}\right )^{p}}{x}d x\]

Input:

int((-a+b*x^n)^p*(a+b*x^n)^p/x,x)
 

Output:

int((-a+b*x^n)^p*(a+b*x^n)^p/x,x)
 

Fricas [F]

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

integrate((-a+b*x^n)^p*(a+b*x^n)^p/x,x, algorithm="fricas")
 

Output:

integral((b*x^n + a)^p*(b*x^n - a)^p/x, x)
 

Sympy [F]

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

integrate((-a+b*x**n)**p*(a+b*x**n)**p/x,x)
 

Output:

Integral((-a + b*x**n)**p*(a + b*x**n)**p/x, x)
 

Maxima [F]

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

integrate((-a+b*x^n)^p*(a+b*x^n)^p/x,x, algorithm="maxima")
 

Output:

integrate((b*x^n + a)^p*(b*x^n - a)^p/x, x)
 

Giac [F]

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

integrate((-a+b*x^n)^p*(a+b*x^n)^p/x,x, algorithm="giac")
 

Output:

integrate((b*x^n + a)^p*(b*x^n - a)^p/x, x)
 

Mupad [F(-1)]

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

int(((a + b*x^n)^p*(b*x^n - a)^p)/x,x)
 

Output:

int(((a + b*x^n)^p*(b*x^n - a)^p)/x, x)
 

Reduce [F]

\[ \int \frac {\left (-a+b x^n\right )^p \left (a+b x^n\right )^p}{x} \, dx=\frac {\left (x^{n} b +a \right )^{p} \left (x^{n} b -a \right )^{p}-2 \left (\int \frac {\left (x^{n} b +a \right )^{p} \left (x^{n} b -a \right )^{p}}{x^{2 n} b^{2} x -a^{2} x}d x \right ) a^{2} n p}{2 n p} \] Input:

int((-a+b*x^n)^p*(a+b*x^n)^p/x,x)
 

Output:

((x**n*b + a)**p*(x**n*b - a)**p - 2*int(((x**n*b + a)**p*(x**n*b - a)**p) 
/(x**(2*n)*b**2*x - a**2*x),x)*a**2*n*p)/(2*n*p)