\(\int x^{-1-n (-3+p)} (a+b x^n)^p (c+d x^n)^2 \, dx\) [554]

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

Optimal result

Integrand size = 29, antiderivative size = 188 \[ \int x^{-1-n (-3+p)} \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\frac {c^2 x^{n (3-p)} \left (a+b x^n\right )^{1+p}}{a n (3-p)}+\frac {d^2 x^{n (4-p)} \left (a+b x^n\right )^{1+p}}{5 b n}-\frac {\left (20 b^2 c^2-10 a b c d (3-p)+a^2 d^2 \left (12-7 p+p^2\right )\right ) x^{n (4-p)} \left (a+b x^n\right )^p \left (1+\frac {b x^n}{a}\right )^{-p} \operatorname {Hypergeometric2F1}\left (4-p,-p,5-p,-\frac {b x^n}{a}\right )}{5 a b n (3-p) (4-p)} \] Output:

c^2*x^(n*(3-p))*(a+b*x^n)^(p+1)/a/n/(3-p)+1/5*d^2*x^(n*(4-p))*(a+b*x^n)^(p 
+1)/b/n-1/5*(20*b^2*c^2-10*a*b*c*d*(3-p)+a^2*d^2*(p^2-7*p+12))*x^(n*(4-p)) 
*(a+b*x^n)^p*hypergeom([-p, 4-p],[5-p],-b*x^n/a)/a/b/n/(3-p)/(4-p)/((1+b*x 
^n/a)^p)
 

Mathematica [A] (verified)

Time = 5.25 (sec) , antiderivative size = 156, normalized size of antiderivative = 0.83 \[ \int x^{-1-n (-3+p)} \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=-\frac {x^{-n (-3+p)} \left (a+b x^n\right )^p \left (1+\frac {b x^n}{a}\right )^{-p} \left (c^2 \left (20-9 p+p^2\right ) \operatorname {Hypergeometric2F1}\left (3-p,-p,4-p,-\frac {b x^n}{a}\right )+d (-3+p) x^n \left (2 c (-5+p) \operatorname {Hypergeometric2F1}\left (4-p,-p,5-p,-\frac {b x^n}{a}\right )+d (-4+p) x^n \operatorname {Hypergeometric2F1}\left (5-p,-p,6-p,-\frac {b x^n}{a}\right )\right )\right )}{n (-5+p) (-4+p) (-3+p)} \] Input:

Integrate[x^(-1 - n*(-3 + p))*(a + b*x^n)^p*(c + d*x^n)^2,x]
 

Output:

-(((a + b*x^n)^p*(c^2*(20 - 9*p + p^2)*Hypergeometric2F1[3 - p, -p, 4 - p, 
 -((b*x^n)/a)] + d*(-3 + p)*x^n*(2*c*(-5 + p)*Hypergeometric2F1[4 - p, -p, 
 5 - p, -((b*x^n)/a)] + d*(-4 + p)*x^n*Hypergeometric2F1[5 - p, -p, 6 - p, 
 -((b*x^n)/a)])))/(n*(-5 + p)*(-4 + p)*(-3 + p)*x^(n*(-3 + p))*(1 + (b*x^n 
)/a)^p))
 

Rubi [A] (verified)

Time = 0.62 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.02, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {1008, 959, 882, 74}

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

\(\Big \downarrow \) 1008

\(\displaystyle \frac {\int x^{n (3-p)-1} \left (b x^n+a\right )^p \left (d n (6 b c-a d (4-p)) x^n+c n (5 b c-a d (3-p))\right )dx}{5 b n}+\frac {d x^{n (3-p)} \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{5 b n}\)

\(\Big \downarrow \) 959

\(\displaystyle \frac {\frac {n \left (a^2 d^2 \left (p^2-7 p+12\right )-10 a b c d (3-p)+20 b^2 c^2\right ) \int x^{n (3-p)-1} \left (b x^n+a\right )^pdx}{4 b}+\frac {d x^{n (3-p)} (6 b c-a d (4-p)) \left (a+b x^n\right )^{p+1}}{4 b}}{5 b n}+\frac {d x^{n (3-p)} \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{5 b n}\)

\(\Big \downarrow \) 882

\(\displaystyle \frac {\frac {a^3 x^{-n p} \left (a^2 d^2 \left (p^2-7 p+12\right )-10 a b c d (3-p)+20 b^2 c^2\right ) \left (\frac {x^n}{a+b x^n}\right )^p \left (a+b x^n\right )^p \int \frac {\left (\frac {x^n}{b x^n+a}\right )^{2-p}}{\left (1-\frac {b x^n}{b x^n+a}\right )^4}d\frac {x^n}{b x^n+a}}{4 b}+\frac {d x^{n (3-p)} (6 b c-a d (4-p)) \left (a+b x^n\right )^{p+1}}{4 b}}{5 b n}+\frac {d x^{n (3-p)} \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{5 b n}\)

\(\Big \downarrow \) 74

\(\displaystyle \frac {\frac {a^3 x^{3 n-n p} \left (a^2 d^2 \left (p^2-7 p+12\right )-10 a b c d (3-p)+20 b^2 c^2\right ) \left (a+b x^n\right )^{p-3} \operatorname {Hypergeometric2F1}\left (4,3-p,4-p,\frac {b x^n}{b x^n+a}\right )}{4 b (3-p)}+\frac {d x^{n (3-p)} (6 b c-a d (4-p)) \left (a+b x^n\right )^{p+1}}{4 b}}{5 b n}+\frac {d x^{n (3-p)} \left (c+d x^n\right ) \left (a+b x^n\right )^{p+1}}{5 b n}\)

Input:

Int[x^(-1 - n*(-3 + p))*(a + b*x^n)^p*(c + d*x^n)^2,x]
 

Output:

(d*x^(n*(3 - p))*(a + b*x^n)^(1 + p)*(c + d*x^n))/(5*b*n) + ((d*(6*b*c - a 
*d*(4 - p))*x^(n*(3 - p))*(a + b*x^n)^(1 + p))/(4*b) + (a^3*(20*b^2*c^2 - 
10*a*b*c*d*(3 - p) + a^2*d^2*(12 - 7*p + p^2))*x^(3*n - n*p)*(a + b*x^n)^( 
-3 + p)*Hypergeometric2F1[4, 3 - p, 4 - p, (b*x^n)/(a + b*x^n)])/(4*b*(3 - 
 p)))/(5*b*n)
 

Defintions of rubi rules used

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

rule 882
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[a^Simplify[ 
(m + 1)/n + p]*x^m*(a + b*x^n)^p*((x^n/(a + b*x^n))^p/(n*x^Simplify[m + n*p 
]))   Subst[Int[x^((m + 1)/n - 1)/(1 - b*x)^(Simplify[(m + 1)/n + p] + 1), 
x], x, x^n/(a + b*x^n)], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simpli 
fy[(m + 1)/n + p]]
 

rule 959
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n 
_)), x_Symbol] :> Simp[d*(e*x)^(m + 1)*((a + b*x^n)^(p + 1)/(b*e*(m + n*(p 
+ 1) + 1))), x] - Simp[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m + n*(p 
 + 1) + 1))   Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, 
 n, p}, x] && NeQ[b*c - a*d, 0] && NeQ[m + n*(p + 1) + 1, 0]
 

rule 1008
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_ 
))^(q_), x_Symbol] :> Simp[d*(e*x)^(m + 1)*(a + b*x^n)^(p + 1)*((c + d*x^n) 
^(q - 1)/(b*e*(m + n*(p + q) + 1))), x] + Simp[1/(b*(m + n*(p + q) + 1)) 
Int[(e*x)^m*(a + b*x^n)^p*(c + d*x^n)^(q - 2)*Simp[c*((c*b - a*d)*(m + 1) + 
 c*b*n*(p + q)) + (d*(c*b - a*d)*(m + 1) + d*n*(q - 1)*(b*c - a*d) + c*b*d* 
n*(p + q))*x^n, x], x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c 
 - a*d, 0] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, e, m, n, p, q, x]
 
Maple [F]

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

Input:

int(x^(-1-n*(-3+p))*(a+b*x^n)^p*(c+d*x^n)^2,x)
 

Output:

int(x^(-1-n*(-3+p))*(a+b*x^n)^p*(c+d*x^n)^2,x)
 

Fricas [F]

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

integrate(x^(-1-n*(-3+p))*(a+b*x^n)^p*(c+d*x^n)^2,x, algorithm="fricas")
 

Output:

integral((d^2*x^(-n*p + 3*n - 1)*x^(2*n) + 2*c*d*x^(-n*p + 3*n - 1)*x^n + 
c^2*x^(-n*p + 3*n - 1))*(b*x^n + a)^p, x)
 

Sympy [F(-1)]

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

integrate(x**(-1-n*(-3+p))*(a+b*x**n)**p*(c+d*x**n)**2,x)
 

Output:

Timed out
 

Maxima [F]

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

integrate(x^(-1-n*(-3+p))*(a+b*x^n)^p*(c+d*x^n)^2,x, algorithm="maxima")
 

Output:

integrate((d*x^n + c)^2*(b*x^n + a)^p*x^(-n*(p - 3) - 1), x)
 

Giac [F(-2)]

Exception generated. \[ \int x^{-1-n (-3+p)} \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx=\text {Exception raised: TypeError} \] Input:

integrate(x^(-1-n*(-3+p))*(a+b*x^n)^p*(c+d*x^n)^2,x, algorithm="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Unable to divide, perhaps due to ro 
unding error%%%{-1,[1,0,4,3,1,3,3,2,0]%%%}+%%%{-3,[1,0,4,3,1,3,2,2,0]%%%}+ 
%%%{-3,[1
 

Mupad [F(-1)]

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

int(((a + b*x^n)^p*(c + d*x^n)^2)/x^(n*(p - 3) + 1),x)
 

Output:

int(((a + b*x^n)^p*(c + d*x^n)^2)/x^(n*(p - 3) + 1), x)
 

Reduce [F]

\[ \int x^{-1-n (-3+p)} \left (a+b x^n\right )^p \left (c+d x^n\right )^2 \, dx =\text {Too large to display} \] Input:

int(x^(-1-n*(-3+p))*(a+b*x^n)^p*(c+d*x^n)^2,x)
 

Output:

(24*x**(5*n)*(x**n*b + a)**p*b**4*d**2 + 6*x**(4*n)*(x**n*b + a)**p*a*b**3 
*d**2*p + 60*x**(4*n)*(x**n*b + a)**p*b**4*c*d + 2*x**(3*n)*(x**n*b + a)** 
p*a**2*b**2*d**2*p**2 - 8*x**(3*n)*(x**n*b + a)**p*a**2*b**2*d**2*p + 20*x 
**(3*n)*(x**n*b + a)**p*a*b**3*c*d*p + 40*x**(3*n)*(x**n*b + a)**p*b**4*c* 
*2 + x**(2*n)*(x**n*b + a)**p*a**3*b*d**2*p**3 - 7*x**(2*n)*(x**n*b + a)** 
p*a**3*b*d**2*p**2 + 12*x**(2*n)*(x**n*b + a)**p*a**3*b*d**2*p + 10*x**(2* 
n)*(x**n*b + a)**p*a**2*b**2*c*d*p**2 - 30*x**(2*n)*(x**n*b + a)**p*a**2*b 
**2*c*d*p + 20*x**(2*n)*(x**n*b + a)**p*a*b**3*c**2*p + x**n*(x**n*b + a)* 
*p*a**4*d**2*p**4 - 9*x**n*(x**n*b + a)**p*a**4*d**2*p**3 + 26*x**n*(x**n* 
b + a)**p*a**4*d**2*p**2 - 24*x**n*(x**n*b + a)**p*a**4*d**2*p + 10*x**n*( 
x**n*b + a)**p*a**3*b*c*d*p**3 - 50*x**n*(x**n*b + a)**p*a**3*b*c*d*p**2 + 
 60*x**n*(x**n*b + a)**p*a**3*b*c*d*p + 20*x**n*(x**n*b + a)**p*a**2*b**2* 
c**2*p**2 - 40*x**n*(x**n*b + a)**p*a**2*b**2*c**2*p + x**(n*p)*int((x**n* 
(x**n*b + a)**p)/(x**(n*p + n)*b*x + x**(n*p)*a*x),x)*a**5*d**2*n*p**5 - 1 
0*x**(n*p)*int((x**n*(x**n*b + a)**p)/(x**(n*p + n)*b*x + x**(n*p)*a*x),x) 
*a**5*d**2*n*p**4 + 35*x**(n*p)*int((x**n*(x**n*b + a)**p)/(x**(n*p + n)*b 
*x + x**(n*p)*a*x),x)*a**5*d**2*n*p**3 - 50*x**(n*p)*int((x**n*(x**n*b + a 
)**p)/(x**(n*p + n)*b*x + x**(n*p)*a*x),x)*a**5*d**2*n*p**2 + 24*x**(n*p)* 
int((x**n*(x**n*b + a)**p)/(x**(n*p + n)*b*x + x**(n*p)*a*x),x)*a**5*d**2* 
n*p + 10*x**(n*p)*int((x**n*(x**n*b + a)**p)/(x**(n*p + n)*b*x + x**(n*...