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

1:  ∫(((d x))^m) (Subscript[P, q])[x] (((a+b (x^2)+c (x^4)))^p)dx  when ¬(Subscript[P, q])[(x^2)]

Derivation: Algebraic expansion

Basis: (Subscript[P, q])[x]==(∑_(k=0)^(q/2+1))(Subscript[P, q])[x,2 k] (x^(2 k))+x (∑_(k=0)^((q-1)/2+1))(Subscript[P, q])[x,2 k+1] (x^(2 k))

Note: This rule transforms (Subscript[P, q])[x] into a sum of the form (Subscript[Q, r])[(x^2)]+x (Subscript[R, s])[(x^2)].

Rule 1.2.2.6.3: If ¬(Subscript[P, q])[(x^2)], then

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

Program code:

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

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

Derivation: Integration by substitution

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

Rule 1.2.2.6.4: If ((m-1)/2)∈ℤ, then

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

Program code:

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

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

Derivation: Algebraic expansion

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

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

Program code:

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

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

Derivation: Algebraic expansion

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

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

Program code:

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

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

Rule 1.2.2.6.5: If  a f (m+1)-b e (m+2 p+3)==0 ∧ a g (m+1)-c e (m+4 p+5)==0 ∧ m≠-1, then

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

Program code:

Int[(d_.*x_)^m_.*Pq_*(a_+b_.*x_^2+c_.*x_^4)^p_.,x_Symbol] :=
  With[{e=Coeff[Pq,x,0],f=Coeff[Pq,x,2],g=Coeff[Pq,x,4]},
  e*(d*x)^(m+1)*(a+b*x^2+c*x^4)^(p+1)/(a*d*(m+1)) /;
 EqQ[a*f*(m+1)-b*e*(m+2*p+3),0] && EqQ[a*g*(m+1)-c*e*(m+4*p+5),0] && NeQ[m,-1]] /;
FreeQ[{a,b,c,d,m,p},x] && PolyQ[Pq,x^2] && EqQ[Expon[Pq,x],4]

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

Derivation: Piecewise constant extraction

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

Rule 1.2.2.6.7: If  q>1 ∧ (b^2)-4 a c==0, then

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

Program code:

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

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

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

Derivation: Algebraic expansion and trinomial recurrence 2b

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

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

∫(d+e (x^2)) (((a+b (x^2)+c (x^4)))^p)dx+∫Q (((a+b (x^2)+c (x^4)))^(p+1))dx  ⟶  

((x (((a+b (x^2)+c (x^4)))^(p+1)) (a b e-d ((b^2)-2 a c)-c (b d-2 a e) (x^2)))/(2 a (p+1) ((b^2)-4 a c)))+
(1/(2 a (p+1) ((b^2)-4 a c)))∫(((a+b (x^2)+c (x^4)))^(p+1))·
(2 a (p+1) ((b^2)-4 a c) Q+(b^2) d (2 p+3)-2 a c d (4 p+5)-a b e+c (4 p+7)(b d-2 a e) (x^2)) dx

Program code:

Int[x_^m_*Pq_*(a_+b_.*x_^2+c_.*x_^4)^p_,x_Symbol] :=
  With[{d=Coeff[PolynomialRemainder[x^m*Pq,a+b*x^2+c*x^4,x],x,0],
        e=Coeff[PolynomialRemainder[x^m*Pq,a+b*x^2+c*x^4,x],x,2]},
  x*(a+b*x^2+c*x^4)^(p+1)*(a*b*e-d*(b^2-2*a*c)-c*(b*d-2*a*e)*x^2)/(2*a*(p+1)*(b^2-4*a*c)) + 
  1/(2*a*(p+1)*(b^2-4*a*c))*Int[(a+b*x^2+c*x^4)^(p+1)*
    ExpandToSum[2*a*(p+1)*(b^2-4*a*c)*PolynomialQuotient[x^m*Pq,a+b*x^2+c*x^4,x]+
      b^2*d*(2*p+3)-2*a*c*d*(4*p+5)-a*b*e+c*(4*p+7)*(b*d-2*a*e)*x^2,x],x]] /;
FreeQ[{a,b,c},x] && PolyQ[Pq,x^2] && GtQ[Expon[Pq,x^2],1] && NeQ[b^2-4*a*c,0] && LtQ[p,-1] && IGtQ[m/2,0]

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

Derivation: Algebraic expansion and trinomial recurrence 2b

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

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

∫(d+e (x^2)) (((a+b (x^2)+c (x^4)))^p)dx+∫Q (((a+b (x^2)+c (x^4)))^(p+1))dx  ⟶  

((x (((a+b (x^2)+c (x^4)))^(p+1)) (a b e-d ((b^2)-2 a c)-c (b d-2 a e) (x^2)))/(2 a (p+1) ((b^2)-4 a c)))+
(1/(2 a (p+1) ((b^2)-4 a c)))∫(x^m) (((a+b (x^2)+c (x^4)))^(p+1))·
(2 a (p+1) ((b^2)-4 a c) (x^(-m)) Q+((b^2) d (2 p+3)-2 a c d (4 p+5)-a b e) (x^(-m))+c (4 p+7)(b d-2 a e) (x^(2-m))) dx

Program code:

Int[x_^m_*Pq_*(a_+b_.*x_^2+c_.*x_^4)^p_,x_Symbol] :=
  With[{d=Coeff[PolynomialRemainder[x^m*Pq,a+b*x^2+c*x^4,x],x,0],
        e=Coeff[PolynomialRemainder[x^m*Pq,a+b*x^2+c*x^4,x],x,2]},
  x*(a+b*x^2+c*x^4)^(p+1)*(a*b*e-d*(b^2-2*a*c)-c*(b*d-2*a*e)*x^2)/(2*a*(p+1)*(b^2-4*a*c)) + 
  1/(2*a*(p+1)*(b^2-4*a*c))*Int[x^m*(a+b*x^2+c*x^4)^(p+1)*
    ExpandToSum[2*a*(p+1)*(b^2-4*a*c)*x^(-m)*PolynomialQuotient[x^m*Pq,a+b*x^2+c*x^4,x]+
      (b^2*d*(2*p+3)-2*a*c*d*(4*p+5)-a*b*e)*x^(-m)+c*(4*p+7)*(b*d-2*a*e)*x^(2-m),x],x]] /;
FreeQ[{a,b,c},x] && PolyQ[Pq,x^2] && GtQ[Expon[Pq,x^2],1] && NeQ[b^2-4*a*c,0] && LtQ[p,-1] && ILtQ[m/2,0]

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

Derivation: Algebraic expansion and trinomial recurrence 2b

Note: Better to use the substitution x->(x^2).

Rule 1.2.2.6.8.2: If  q>1 ∧ (b^2)-4 a c≠0 ∧ p<-1 ∧ ((m-1)/2)∈ℤ, let Q->PolynomialQuotient[(x^m) (Subscript[P, q])[(x^2)],a+b (x^2)+c (x^4),x]and d x+e (x^3)->PolynomialRemainder[(x^m) (Subscript[P, q])[(x^2)],a+b (x^2)+c (x^4),x], then

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

∫(d x+e (x^3)) (((a+b (x^2)+c (x^4)))^p)dx+∫Q (((a+b (x^2)+c (x^4)))^(p+1))dx  ⟶  

(((x^2) (((a+b (x^2)+c (x^4)))^(p+1)) (a b e-d((b^2)-2 a c)-c (b d-2 a e) (x^2)))/(2 a (p+1) ((b^2)-4 a c)))+
(1/(a (p+1) ((b^2)-4 a c)))∫(x^m) (((a+b (x^2)+c (x^4)))^(p+1))·
(a(p+1) ((b^2)-4 a c) (x^(-m)) Q+((b^2) d (p+2)-2 a c d (2 p+3)-a b e) (x^(1-m))+2 c (p+2)(b d-2 a e) (x^(3-m))) dx

Program code:

(* Int[x_^m_.*Pq_*(a_+b_.*x_^2+c_.*x_^4)^p_,x_Symbol] :=
  With[{d=Coeff[PolynomialRemainder[x^m*Pq,a+b*x^2+c*x^4,x],x,1],
        e=Coeff[PolynomialRemainder[x^m*Pq,a+b*x^2+c*x^4,x],x,3]},
  x^2*(a+b*x^2+c*x^4)^(p+1)*(a*b*e-d*(b^2-2*a*c)-c*(b*d-2*a*e)*x^2)/(2*a*(p+1)*(b^2-4*a*c)) + 
  1/(a*(p+1)*(b^2-4*a*c))*Int[x^m*(a+b*x^2+c*x^4)^(p+1)*
    ExpandToSum[a*(p+1)*(b^2-4*a*c)*x^(-m)*PolynomialQuotient[x^m*Pq,a+b*x^2+c*x^4,x]+
      (b^2*d*(p+2)-2*a*c*d*(2*p+3)-a*b*e)*x^(1-m)+2*c*(p+2)*(b*d-2*a*e)*x^(3-m),x],x]] /;
FreeQ[{a,b,c},x] && PolyQ[Pq,x^2] && GtQ[Expon[Pq,x^2],1] && NeQ[b^2-4*a*c,0] && LtQ[p,-1] && IntegerQ[(m-1)/2] *)

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

Rule 1.2.2.6.U:

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

Program code:

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