Rules for integrands of the form(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)

1:  ∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  m-n+1==0

Derivation: Integration by substitution

Basis: (x^(n-1))F[(x^n)]==(1/n) Subst[F[x],x,(x^n)] (∂_x)(x^n)

Rule: If  m-n+1==0, then

∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (1/n) Subst[∫(Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx,x,(x^n)]

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_.,x_Symbol] :=
  1/n*Subst[Int[SubstFor[x^n,Pq,x]*(a+b*x+c*x^2)^p,x],x,x^n] /;
FreeQ[{a,b,c,m,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && EqQ[Simplify[m-n+1],0]

2:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when p∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule: If  p∈(SuperPlus[ℤ]), then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ∫ ExpandIntegrand[(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p),x]dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_.,x_Symbol] :=
  Int[ExpandIntegrand[(d*x)^m*Pq*(a+b*x^n+c*x^(2*n))^p,x],x] /;
FreeQ[{a,b,c,d,m,n},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && IGtQ[p,0]

3:  ∫(((g x))^m) (d+e (x^n)+f (x^(2 n))) (((a+b (x^n)+c (x^(2 n))))^p)dx  when a e (m+1)-b d (m+n (p+1)+1)==0 ∧ a f (m+1)-c d (m+2 n (p+1)+1)==0∧ m≠-1

Rule: If  a e (m+1)-b d (m+n (p+1)+1)==0 ∧ a f (m+1)-c d (m+2 n (p+1)+1)==0∧ m≠-1, then

∫(((g x))^m) (d+e (x^n)+f (x^(2 n))) (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ((d (((g x))^(m+1)) (((a+b (x^n)+c (x^(2 n))))^(p+1)))/(a g (m+1)))

Program code:

Int[(g_.*x_)^m_.*(d_+e_.*x_^n_.+f_.*x_^n2_.)*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_.,x_Symbol] :=
  d*(g*x)^(m+1)*(a+b*x^n+c*x^(2*n))^(p+1)/(a*g*(m+1)) /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && EqQ[n2,2*n] && EqQ[a*e*(m+1)-b*d*(m+n*(p+1)+1),0] && EqQ[a*f*(m+1)-c*d*(m+2*n*(p+1)+1),0] && NeQ[m,-1]

Int[(g_.*x_)^m_.*(d_+f_.*x_^n2_.)*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_.,x_Symbol] :=
  d*(g*x)^(m+1)*(a+b*x^n+c*x^(2*n))^(p+1)/(a*g*(m+1)) /;
FreeQ[{a,b,c,d,f,g,m,n,p},x] && EqQ[n2,2*n] && EqQ[m+n*(p+1)+1,0] && EqQ[c*d+a*f,0] && NeQ[m,-1]

4:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c==0 ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis: If  (b^2)-4 a c==0, then (∂_x)((((a+b (x^n)+c (x^(2 n))))^p)/(((b+2 c (x^n)))^(2 p)))==0

Basis: If  (b^2)-4 a c==0, then ((((a+b (x^n)+c (x^(2 n))))^p)/(((b+2 c (x^n)))^(2 p)))==((((a+b (x^n)+c (x^(2 n))))^(FracPart[p]))/((((4 c))^(IntPart[p])) (((b+2 c (x^n)))^(2 FracPart[p]))))

Rule: If  (b^2)-4 a c==0 ∧ p∉ℤ, then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ((((a+b (x^n)+c (x^(2 n))))^(FracPart[p]))/((((4 c))^(IntPart[p])) (((b+2 c (x^n)))^(2 FracPart[p]))))∫(((d x))^m) (Subscript[P, q])[x](((b+2 c (x^n)))^(2 p))dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_,x_Symbol] :=
  (a+b*x^n+c*x^(2*n))^FracPart[p]/((4*c)^IntPart[p]*(b+2*c*x^n)^(2*FracPart[p]))*Int[(d*x)^m*Pq*(b+2*c*x^n)^(2*p),x] /;
FreeQ[{a,b,c,d,m,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && EqQ[b^2-4*a*c,0] && Not[IntegerQ[2*p]]

5.  ∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ ((m+1)/n)∈ℤ

1:  ∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ ((m+1)/n)∈ℤ

Derivation: Integration by substitution

Basis: If ((m+1)/n)∈ℤ, then (x^m)F[(x^n)]==(1/n) Subst[(x^(((m+1)/n)-1)) F[x],x,(x^n)] (∂_x)(x^n)

Note: If  n∈ℤ ∧ ((m+1)/n)∈ℤ, then m∈ℤ, and (((d x))^m) automatically evaluates to (d^m)(x^m).

Rule: If  (b^2)-4 a c≠0 ∧ ((m+1)/n)∈ℤ, then

∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (1/n) Subst[∫(x^(((m+1)/n)-1)) (Subscript[P, q])[x] (((a+b x+c (x^2)))^p)dx,x,(x^n)]

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  1/n*Subst[Int[x^(Simplify[(m+1)/n]-1)*SubstFor[x^n,Pq,x]*(a+b*x+c*x^2)^p,x],x,x^n] /;
FreeQ[{a,b,c,m,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IntegerQ[Simplify[(m+1)/n]]

2:  ∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ ((m+1)/n)∈ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((d x))^m)/(x^m))==0

Rule: If  (b^2)-4 a c≠0 ∧ ((m+1)/n)∈ℤ, then

∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ((((d x))^m)/(x^m))∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_*x_)^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  (d*x)^m/x^m*Int[x^m*Pq*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,m,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IntegerQ[Simplify[(m+1)/n]]

6:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (Subscript[P, q])[x,0]==0

Derivation: Algebraic simplification

Rule: If  (Subscript[P, q])[x,0]==0, then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (1/d) ∫(((d x))^(m+1)) PolynomialQuotient[(Subscript[P, q])[x],x,x] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_,x_Symbol] :=
  1/d*Int[(d*x)^(m+1)*PolynomialQuotient[Pq,x,x]*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,m,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && EqQ[Coeff[Pq,x,0],0]

7.  ∫(((((d x))^m) (e+f (x^(n/2))+g (x^(3 n/2))+h (x^(2 n))))/(((a+b (x^n)+c (x^(2 n))))^(3/2)))dx  when (b^2)-4 a c==0 ∧ 2 m-n+2==0 ∧ c e+a h==0

1:  ∫(((x^m) (e+f (x^(n/2))+g (x^(3 n/2))+h (x^(2 n))))/(((a+b (x^n)+c (x^(2 n))))^(3/2)))dx  when (b^2)-4 a c==0 ∧ 2 m-n+2==0 ∧ c e+a h==0

Rule: If  (b^2)-4 a c==0 ∧ 2 m-n+2==0 ∧ c e+a h==0, then

∫(((x^m) (e+f (x^(n/2))+g (x^(3 n/2))+h (x^(2 n))))/(((a+b (x^n)+c (x^(2 n))))^(3/2)))dx  ⟶  -((2 c (b f-2 a g)+2 h ((b^2)-4 a c) (x^(n/2))+2 c (2 c f-b g) (x^n))/(c n ((b^2)-4 a c) (Sqrt[a+b (x^n)+c (x^(2 n))])))

Program code:

Int[x_^m_.*(e_+f_.*x_^q_.+g_.*x_^r_.+h_.*x_^s_.)/(a_+b_.*x_^n_.+c_.*x_^n2_.)^(3/2),x_Symbol] :=
  -(2*c*(b*f-2*a*g)+2*h*(b^2-4*a*c)*x^(n/2)+2*c*(2*c*f-b*g)*x^n)/(c*n*(b^2-4*a*c)*Sqrt[a+b*x^n+c*x^(2*n)]) /;
FreeQ[{a,b,c,e,f,g,h,m,n},x] && EqQ[n2,2*n] && EqQ[q,n/2] && EqQ[r,3*n/2] && EqQ[s,2*n] && 
  NeQ[b^2-4*a*c,0] && EqQ[2*m-n+2,0] && EqQ[c*e+a*h,0]

2:  ∫(((((d x))^m) (e+f (x^(n/2))+g (x^(3 n/2))+h (x^(2 n))))/(((a+b (x^n)+c (x^(2 n))))^(3/2)))dx  when (b^2)-4 a c==0 ∧ 2 m-n+2==0 ∧ c e+a h==0

Rule: If  (b^2)-4 a c==0 ∧ 2 m-n+2==0 ∧ c e+a h==0, then

∫(((((d x))^m) (e+f (x^(n/2))+g (x^(3 n/2))+h (x^(2 n))))/(((a+b (x^n)+c (x^(2 n))))^(3/2)))dx  ⟶  ((((d x))^m)/(x^m)) ∫(((x^m) (e+f (x^(n/2))+g (x^(3 n/2))+h (x^(2 n))))/(((a+b (x^n)+c (x^(2 n))))^(3/2)))dx

Program code:

Int[(d_*x_)^m_.*(e_+f_.*x_^q_.+g_.*x_^r_.+h_.*x_^s_.)/(a_+b_.*x_^n_.+c_.*x_^n2_.)^(3/2),x_Symbol] :=
  (d*x)^m/x^m*Int[x^m*(e+f*x^(n/2)+g*x^((3*n)/2)+h*x^(2*n))/(a+b*x^n+c*x^(2*n))^(3/2),x] /;
FreeQ[{a,b,c,d,e,f,g,h,m,n},x] && EqQ[n2,2*n] && EqQ[q,n/2] && EqQ[r,3*n/2] && EqQ[s,2*n] && 
  NeQ[b^2-4*a*c,0] && EqQ[2*m-n+2,0] && EqQ[c*e+a*h,0]

8.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈ℤ

1.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])

1:  ∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ p<-1 ∧ m∈(SuperMinus[ℤ])

Derivation: Algebraic expansion and trinomial recurrence 2b applied n-1 times

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ p<-1 ∧ m∈(SuperMinus[ℤ]), let (Subscript[Q, q-2 n])[x]=PolynomialQuotient[(x^m) (Subscript[P, q])[x],a+b (x^n)+c (x^(2 n)),x] and (Subscript[R, 2 n-1])[x]=PolynomialRemainder[(x^m) (Subscript[P, q])[x],a+b (x^n)+c (x^(2 n)),x], then

∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  

∫(Subscript[R, 2 n-1])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx+∫(Subscript[Q, q-2 n])[x] (((a+b (x^n)+c (x^(2 n))))^(p+1))dx  ⟶  

-((x (((a+b (x^n)+c (x^(2 n))))^(p+1)) (∑_(i=0)^(n-1))((((b^2)-2 a c) (Subscript[R, 2 n-1])[x,i]-a b (Subscript[R, 2 n-1])[x,n+i]) (x^i)+c (b (Subscript[R, 2 n-1])[x,i]-2 a (Subscript[R, 2 n-1])[x,n+i]) (x^(n+i))))/(a n(p+1) ((b^2)-4 a c)))+
(1/(a n(p+1) ((b^2)-4 a c)))∫(x^m) (((a+b (x^n)+c (x^(2 n))))^(p+1))(a n(p+1) ((b^2)-4 a c) (x^(-m)) (Subscript[Q, q-2 n])[x]+
(∑_(i=0)^(n-1))((((b^2) (n(p+1)+i+1)-2 a c (2n(p+1)+i+1)) (Subscript[R, 2 n-1])[x,i]-a b (i+1) (Subscript[R, 2 n-1])[x,n+i]) (x^(i-m))+c (n(2p+3)+i+1)(b (Subscript[R, 2 n-1])[x,i]-2 a (Subscript[R, 2 n-1])[x,n+i]) (x^(n+i-m)))) dx

Program code:

Int[x_^m_*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_)^p_,x_Symbol] :=
  Module[{q=Expon[Pq,x]},
  Module[{Q=PolynomialQuotient[a*(b*c)^(Floor[(q-1)/n]+1)*x^m*Pq,a+b*x^n+c*x^(2*n),x],
          R=PolynomialRemainder[a*(b*c)^(Floor[(q-1)/n]+1)*x^m*Pq,a+b*x^n+c*x^(2*n),x],i},
  -x*(a+b*x^n+c*x^(2*n))^(p+1)/(a^2*n*(p+1)*(b^2-4*a*c)*(b*c)^(Floor[(q-1)/n]+1))*
    Sum[((b^2-2*a*c)*Coeff[R,x,i]-a*b*Coeff[R,x,n+i])*x^i+
      c*(b*Coeff[R,x,i]-2*a*Coeff[R,x,n+i])*x^(n+i),{i,0,n-1}] + 
  1/(a*n*(p+1)*(b^2-4*a*c)*(b*c)^(Floor[(q-1)/n]+1))*Int[x^m*(a+b*x^n+c*x^(2*n))^(p+1)*
    ExpandToSum[n*(p+1)*(b^2-4*a*c)*x^(-m)*Q+
      Sum[((b^2*(n*(p+1)+i+1)/a-2*c*(2*n*(p+1)+i+1))*Coeff[R,x,i]-b*(i+1)*Coeff[R,x,n+i])*x^(i-m)+
       c*(n*(2*p+3)+i+1)*(b/a*Coeff[R,x,i]-2*Coeff[R,x,n+i])*x^(n+i-m),{i,0,n-1}],x],x]] /;
 GeQ[q,2*n]] /;
FreeQ[{a,b,c},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && IGtQ[n,0] && LtQ[p,-1] && ILtQ[m,0]

2.  ∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])

1:  ∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ m∈ℤ ∧ GCD[m+1,n]≠1

Derivation: Integration by substitution

Basis: If  n∈ℤ ∧ m∈ℤ, let g=GCD[m+1,n], then (x^m)F[(x^n)]==(1/g)Subst[(x^(((m+1)/g)-1))F[(x^(n/g))],x,(x^g)](∂_x)(x^g)

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ m∈ℤ, let g=GCD[m+1,n], if g≠1, then

∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (1/g) Subst[∫(x^(((m+1)/g)-1)) (Subscript[P, q])[(x^(n/g))] (((a+b (x^(n/g))+c (x^((2 n)/g))))^p)dx,x,(x^g)]

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_)^p_,x_Symbol] :=
  With[{g=GCD[m+1,n]},
  1/g*Subst[Int[x^((m+1)/g-1)*ReplaceAll[Pq,x->x^(1/g)]*(a+b*x^(n/g)+c*x^(2*n/g))^p,x],x,x^g] /;
 NeQ[g,1]] /;
FreeQ[{a,b,c,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IGtQ[n,0] && IntegerQ[m]

2:  ∫(((((d x))^m) (Subscript[P, q])[(x^n)])/(a+b (x^n)+c (x^(2 n))))dx  when  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ NiceSqrtQ[(b^2)-4 a c]

Derivation: Algebraic expansion

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ NiceSqrtQ[(b^2)-4 a c], then

∫(((((d x))^m) (Subscript[P, q])[(x^n)])/(a+b (x^n)+c (x^(2 n))))dx  ⟶  ∫ExpandIntegrand[(((((d x))^m) (Subscript[P, q])[(x^n)])/(a+b (x^n)+c (x^(2 n)))),x]dx

Program code:

Int[(d_.*x_)^m_.*Pq_/(a_+b_.*x_^n_.+c_.*x_^n2_),x_Symbol] :=
  Int[ExpandIntegrand[(d*x)^m*Pq/(a+b*x^n+c*x^(2*n)),x],x] /;
FreeQ[{a,b,c,d,m},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IGtQ[n,0] && NiceSqrtQ[b^2-4*a*c]

3:  ∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ q≥2 n ∧ m+q+2 n p+1≠0

Reference: G&R 2.160.3

Derivation: Trinomial recurrence 3a with A=0, B=1 and m=m-n

Reference: G&R 2.104

Note: This special case of the Ostrogradskiy-Hermite integration method reduces the degree of the polynomial in the resulting integrand.

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ q≥2 n ∧ m+q+2 n p+1≠0, then

∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  

∫(((d x))^m) ((Subscript[P, q])[(x^n)]-(Subscript[P, q])[x,q] (x^q))(((a+b (x^n)+c (x^(2 n))))^p)dx+(((Subscript[P, q])[x,q])/(d^q))∫(((d x))^(m+q))(((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  

(((Subscript[P, q])[x,q] (((d x))^(m+q-2 n+1)) (((a+b (x^n)+c (x^(2 n))))^(p+1)))/(c (d^(q-2 n+1)) (m+q+2 n p+1)))+
∫(((d x))^m) ((Subscript[P, q])[(x^n)]-(Subscript[P, q])[x,q] (x^q)-(((Subscript[P, q])[x,q] (a (m+q-2 n+1) (x^(q-2 n))+b (m+q+n (p-1)+1) (x^(q-n))))/(c (m+q+2 n p+1)))) (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_.+c_.*x_^n2_)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x]},
    With[{Pqq=Coeff[Pq,x,q]},
    Pqq*(d*x)^(m+q-2*n+1)*(a+b*x^n+c*x^(2*n))^(p+1)/(c*d^(q-2*n+1)*(m+q+2*n*p+1)) + 
    Int[(d*x)^m*ExpandToSum[Pq-Pqq*x^q-Pqq*(a*(m+q-2*n+1)*x^(q-2*n)+b*(m+q+n*(p-1)+1)*x^(q-n))/(c*(m+q+2*n*p+1)),x]*
      (a+b*x^n+c*x^(2*n))^p,x]] /;
  GeQ[q,2*n] && NeQ[m+q+2*n*p+1,0] && (IntegerQ[2*p] || EqQ[n,1] && IntegerQ[4*p] || IntegerQ[p+(q+1)/(2*n)])] /;
FreeQ[{a,b,c,d,m,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IGtQ[n,0]

3:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ ¬PolynomialQ[(Subscript[P, q])[x],(x^n)]

Derivation: Algebraic expansion

Basis: If  n∈(SuperPlus[ℤ]) , then (Subscript[P, q])[x]==(∑_(j=0)^(n-1))(x^j)(∑_(k=0)^((q-j)/n+1))(Subscript[P, q])[x,j+k n] (x^(k n))

Note: This rule transform integrand into a sum of terms of the form (((d x))^k) (Subscript[Q, r])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p).

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])∧ ¬PolynomialQ[(Subscript[P, q])[x],(x^n)], then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ∫ (∑_(j=0)^(n-1))(1/(d^j))(((d x))^(m+j))((∑_(k=0)^((q-j)/n+1))(Subscript[P, q])[x,j+k n] (x^(k n)))(((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_)^p_,x_Symbol] :=
  Module[{q=Expon[Pq,x],j,k},
  Int[Sum[1/d^j*(d*x)^(m+j)*Sum[Coeff[Pq,x,j+k*n]*x^(k*n),{k,0,(q-j)/n+1}]*(a+b*x^n+c*x^(2*n))^p,{j,0,n-1}],x]] /;
FreeQ[{a,b,c,d,m,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && IGtQ[n,0] && Not[PolyQ[Pq,x^n]]

4:  ∫(((((d x))^m) (Subscript[P, q])[x])/(a+b (x^n)+c (x^(2 n))))dx  when (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperPlus[ℤ]), then

∫(((((d x))^m) (Subscript[P, q])[x])/(a+b (x^n)+c (x^(2 n))))dx  ⟶  ∫ RationalFunctionExpand[(((((d x))^m) (Subscript[P, q])[x])/(a+b (x^n)+c (x^(2 n)))),x]dx

Program code:

Int[(d_.*x_)^m_.*Pq_/(a_+b_.*x_^n_.+c_.*x_^n2_.),x_Symbol] :=
  Int[RationalFunctionExpand[(d*x)^m*Pq/(a+b*x^n+c*x^(2*n)),x],x] /;
FreeQ[{a,b,c,d,m},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && IGtQ[n,0]

2.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])

1.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈ℚ

1:  ∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈ℤ

Derivation: Integration by substitution

Basis: F[x]==-Subst[((F[(x^(-1))] )/(x^2)),x,(1/x)](∂_x)(1/x)

Note: (x^q) (Subscript[P, q])[(x^(-1))] is a polynomial in x.

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈ℤ, then

∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  -Subst[∫(((x^q) (Subscript[P, q])[(x^(-1))] (((a+b (x^(-n))+c (x^(-2 n))))^p))/(x^(m+q+2)))dx,x,(1/x)]

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x]},
  -Subst[Int[ExpandToSum[x^q*ReplaceAll[Pq,x->x^(-1)],x]*(a+b*x^(-n)+c*x^(-2*n))^p/x^(m+q+2),x],x,1/x]] /;
FreeQ[{a,b,c,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && ILtQ[n,0] && IntegerQ[m]

2:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈𝔽

Derivation: Integration by substitution

Basis: If  g>1, then (((d x))^m) F[x]==-(g/d)Subst[ ((F[(d^(-1)) (x^(-g))])/(x^(g (m+1)+1))),x,(1/(((d x))^(1/g)))] (∂_x)(1/(((d x))^(1/g)))

Note: (x^(g q)) (Subscript[P, q])[(d^(-1)) (x^(-g))] is a polynomial in x.

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∈𝔽, let g=Denominator[m], then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  -(g/d)Subst[∫(((x^(g q)) (Subscript[P, q])[(d^(-1)) (x^(-g))] (((a+b (d^(-n)) (x^(-g n))+c (d^(-2 n)) (x^(-2 g n))))^p))/(x^(g (m+q+1)+1)))dx,x,(1/(((d x))^(1/g)))]

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  With[{g=Denominator[m],q=Expon[Pq,x]},
  -g/d*Subst[Int[ExpandToSum[x^(g*q)*ReplaceAll[Pq,x->d^(-1)*x^(-g)],x]*
    (a+b*d^(-n)*x^(-g*n)+c*d^(-2*n)*x^(-2*g*n))^p/x^(g*(m+q+1)+1),x],x,1/(d*x)^(1/g)]] /;
FreeQ[{a,b,c,d,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && ILtQ[n,0] && FractionQ[m]

2:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∉ℚ

Derivation:  Piecewise constant extraction and integration by substitution

Basis: (∂_x)((((d x))^m) ((((x^(-1))))^m))==0

Basis: F[x]==-Subst[((F[(x^(-1))] )/(x^2)),x,(1/x)](∂_x)(1/x)

Note: (x^q) (Subscript[P, q])[(x^(-1))] is a polynomial in x.

Rule: If  (b^2)-4 a c≠0 ∧ n∈(SuperMinus[ℤ])∧ m∉ℚ, then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (((d x))^m) ((((x^(-1))))^m)∫(((Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p))/((((x^(-1))))^m))dx
  ⟶  -(((d x))^m) ((((x^(-1))))^m) Subst[∫(((x^q) (Subscript[P, q])[(x^(-1))] (((a+b (x^(-n))+c (x^(-2 n))))^p))/(x^(m+q+2)))dx,x,(1/x)]

Program code:

Int[(d_.*x_)^m_*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x]},
  -(d*x)^m*(x^(-1))^m*Subst[Int[ExpandToSum[x^q*ReplaceAll[Pq,x->x^(-1)],x]*(a+b*x^(-n)+c*x^(-2*n))^p/x^(m+q+2),x],x,1/x]] /;
FreeQ[{a,b,c,d,m,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && ILtQ[n,0] && Not[RationalQ[m]]

9.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽

1:  ∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽

Derivation: Integration by substitution

Basis: If  g∈(SuperPlus[ℤ]), then (x^m)(Subscript[P, q])[x] F[(x^n)]==g Subst[(x^(g(m+1)-1)) (Subscript[P, q])[(x^g)] F[(x^(g n))],x,(x^(1/g))] (∂_x)(x^(1/g))

Rule: If  (b^2)-4 a c≠0 ∧ n∈𝔽, let g=Denominator[n], then

∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  g Subst[∫(x^(g(m+1)-1)) (Subscript[P, q])[(x^g)] (((a+b (x^(g n))+c (x^(2 g n))))^p)dx,x,(x^(1/g))]

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  With[{g=Denominator[n]},
  g*Subst[Int[x^(g*(m+1)-1)*ReplaceAll[Pq,x->x^g]*(a+b*x^(g*n)+c*x^(2*g*n))^p,x],x,x^(1/g)]] /;
FreeQ[{a,b,c,m,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && FractionQ[n]

2.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽

1.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽 ∧ m-(1/2)∈ℤ

1:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽 ∧ m+(1/2)∈(SuperPlus[ℤ])

Derivation: Piecewise constant extraction

Basis: (∂_x)((Sqrt[d x])/(Sqrt[x]))==0

Rule: If  (b^2)-4 a c≠0 ∧ n∈𝔽 ∧ m+(1/2)∈(SuperPlus[ℤ]), then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (((d^(m-(1/2))) (Sqrt[d x]))/(Sqrt[x]))∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_*x_)^m_*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  d^(m-1/2)*Sqrt[d*x]/Sqrt[x]*Int[x^m*Pq*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && FractionQ[n] && IGtQ[m+1/2,0]

2:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽 ∧ m-(1/2)∈(SuperMinus[ℤ])

Derivation: Piecewise constant extraction

Basis: (∂_x)((Sqrt[x])/(Sqrt[d x]))==0

Rule: If  (b^2)-4 a c≠0 ∧ n∈𝔽 ∧ m-(1/2)∈(SuperMinus[ℤ]), then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (((d^(m+(1/2))) (Sqrt[x]))/(Sqrt[d x]))∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_*x_)^m_*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  d^(m+1/2)*Sqrt[x]/Sqrt[d*x]*Int[x^m*Pq*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && FractionQ[n] && ILtQ[m-1/2,0]

2:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ n∈𝔽

Derivation: Piecewise constant extraction

Basis: (∂_x)((((d x))^m)/(x^m))==0

Rule: If  (b^2)-4 a c≠0 ∧ n∈𝔽, then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ((((d x))^m)/(x^m))∫(x^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_*x_)^m_*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  (d*x)^m/x^m*Int[x^m*Pq*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,m,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0] && FractionQ[n]

10.  ∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ (n/(m+1))∈ℤ

1:  ∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ (n/(m+1))∈ℤ

Derivation: Integration by substitution

Basis: If (n/(m+1))∈ℤ, then (x^m)F[(x^n)]==(1/(m+1))Subst[F[(x^(n/(m+1)))],x,(x^(m+1))](∂_x)(x^(m+1))

Rule: If  (b^2)-4 a c≠0 ∧ (n/(m+1))∈ℤ

∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  (1/(m+1))Subst[∫(Subscript[P, q])[(x^(n/(m+1)))] (((a+b (x^(n/(m+1)))+c (x^((2 n)/(m+1)))))^p)dx,x,(x^(m+1))]

Program code:

Int[x_^m_.*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  1/(m+1)*Subst[Int[ReplaceAll[SubstFor[x^n,Pq,x],x->x^Simplify[n/(m+1)]]*(a+b*x^Simplify[n/(m+1)]+c*x^Simplify[2*n/(m+1)])^p,x],x,x^(m+1)] /;
FreeQ[{a,b,c,m,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IntegerQ[Simplify[n/(m+1)]] && Not[IntegerQ[n]]

2:  ∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ (n/(m+1))∈ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((d x))^m)/(x^m))==0

Rule: If  (b^2)-4 a c≠0 ∧ (n/(m+1))∈ℤ, then

∫(((d x))^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ((((d x))^m)/(x^m))∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_*x_)^m_*Pq_*(a_+b_.*x_^n_+c_.*x_^n2_.)^p_,x_Symbol] :=
  (d*x)^m/x^m*Int[x^m*Pq*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,m,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x^n] && NeQ[b^2-4*a*c,0] && IntegerQ[Simplify[n/(m+1)]] && Not[IntegerQ[n]]

11.  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when  (b^2)-4 a c≠0 ∧ p∈(SuperMinus[ℤ])

1:  ∫(((((d x))^m) (Subscript[P, q])[x])/(a+b (x^n)+c (x^(2 n))))dx  when (b^2)-4 a c≠0

Reference: G&R 2.161.1a

Derivation: Algebraic expansion

Basis: Let q=(Sqrt[(b^2)-4 a c]), then (1/(a+b z+c (z^2)))==((2 c)/q)(1/(b-q+2 c z))-((2 c)/q)(1/(b+q+2 c z))

Rule: If  (b^2)-4 a c≠0, let q=(Sqrt[(b^2)-4 a c]), then

∫(((((d x))^m) (Subscript[P, q])[x])/(a+b (x^n)+c (x^(2 n))))dx  ⟶  ((2 c)/q)∫(((((d x))^m) (Subscript[P, q])[x])/(b-q+2 c (x^n)))dx-((2 c)/q)∫(((((d x))^m) (Subscript[P, q])[x])/(b+q+2 c (x^n)))dx

Program code:

Int[(d_.*x_)^m_.*Pq_/(a_+b_.*x_^n_.+c_.*x_^n2_.),x_Symbol] :=
  With[{q=Rt[b^2-4*a*c,2]},
  2*c/q*Int[(d*x)^m*Pq/(b-q+2*c*x^n),x] -
  2*c/q*Int[(d*x)^m*Pq/(b+q+2*c*x^n),x]] /;
FreeQ[{a,b,c,d,m,n},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && NeQ[b^2-4*a*c,0]

2:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  when p∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Rule: If  p∈(SuperMinus[ℤ]), then

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ∫ ExpandIntegrand[(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p),x]dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_,x_Symbol] :=
  Int[ExpandIntegrand[(d*x)^m*Pq*(a+b*x^n+c*x^(2*n))^p,x],x] /;
FreeQ[{a,b,c,d,m,n},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && ILtQ[p+1,0]

X:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx

Rule:

∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx  ⟶  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^n)+c (x^(2 n))))^p)dx

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^n_.+c_.*x_^n2_.)^p_.,x_Symbol] :=
  Unintegrable[(d*x)^m*Pq*(a+b*x^n+c*x^(2*n))^p,x] /;
FreeQ[{a,b,c,d,m,n,p},x] && EqQ[n2,2*n] && (PolyQ[Pq,x] || PolyQ[Pq,x^n])

S:  ∫(u^m) (Subscript[P, q])[(v^n)] (((a+b (v^n)+c (v^(2 n))))^p)dx  when  v==f+g x ∧ u==h v

Derivation: Integration by substitution and piecewise constant extraction

Basis: If  u==h v, then (∂_x)((u^m)/(v^m))==0

Rule: If  v==f+g x ∧ u==h v, then

∫(u^m) (Subscript[P, q])[(v^n)] (((a+b (v^n)+c (v^(2 n))))^p)dx  ⟶  ((u^m)/(g (v^m)))Subst[∫(x^m) (Subscript[P, q])[(x^n)] (((a+b (x^n)+c (x^(2 n))))^p)dx,x,v]

Program code:

Int[u_^m_.*Pq_*(a_+b_.*v_^n_+c_.*v_^n2_.)^p_.,x_Symbol] :=
  u^m/(Coefficient[v,x,1]*v^m)*Subst[Int[x^m*SubstFor[v,Pq,x]*(a+b*x^n+c*x^(2*n))^p,x],x,v] /;
FreeQ[{a,b,c,m,n,p},x] && EqQ[n2,2*n] && LinearPairQ[u,v,x] && PolyQ[Pq,v^n]