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

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

Derivation: Algebraic expansion

Rule 1.1.2.x.1: If  p+2∈(SuperPlus[ℤ]), then

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

Program code:

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

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

Derivation: Algebraic simplification

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

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

Program code:

Int[Pq_*(a_+b_.*x_^2)^p_,x_Symbol] :=
  Int[x*PolynomialQuotient[Pq,x,x]*(a+b*x^2)^p,x] /;
FreeQ[{a,b,p},x] && PolyQ[Pq,x] && EqQ[Coeff[Pq,x,0],0] && Not[MatchQ[Pq,x^m_.*u_. /; IntegerQ[m]]]

3:  ∫(Subscript[P, q])[x] (((a+b (x^2)))^p)dx  when  PolynomialRemainder[(Subscript[P, q])[x],a+b (x^2),x]==0

Derivation: Algebraic expansion

Rule: If  PolynomialRemainder[(Subscript[P, q])[x],a+b (x^2),x]==0, then

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

Program code:

Int[Px_*(a_+b_.*x_^2)^p_.,x_Symbol] :=
  Int[PolynomialQuotient[Px,a+b*x^2,x]*(a+b*x^2)^(p+1),x] /;
FreeQ[{a,b,p},x] && PolyQ[Px,x] && EqQ[PolynomialRemainder[Px,a+b*x^2,x],0]

4.  ∫(Subscript[P, q])[x] (((a+b (x^2)))^p)dx  when p<-1

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

Derivation: Algebraic expansion and binomial recurrence 3b

Basis: ∫(((a+b (x^2)))^p)dx==((x (((a+b (x^2)))^(p+1)))/a)-((b (2 p+3))/a) ∫(x^2) (((a+b (x^2)))^p)dx

Note: Interestingly this rule eleminates the constant term of (Subscript[P, q])[(x^2)] rather than the highest degree term.

Rule 1.1.2.x.4.1: If  p+(1/2)∈(SuperMinus[ℤ])∧ 2 q+2 p+1<0, let A->(Subscript[P, q])[(x^2),0] and (Subscript[Q, q-1])[(x^2)]->PolynomialQuotient[(Subscript[P, q])[(x^2)]-A,(x^2),x], then

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

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

((A x (((a+b (x^2)))^(p+1)))/a)+ (1/a)∫(x^2) (((a+b (x^2)))^p) (a (Subscript[Q, q-1])[(x^2)]-A b (2 p+3))dx

Program code:

Int[Pq_*(a_+b_.*x_^2)^p_,x_Symbol] :=
  With[{A=Coeff[Pq,x,0],Q=PolynomialQuotient[Pq-Coeff[Pq,x,0],x^2,x]},
  A*x*(a+b*x^2)^(p+1)/a + 1/a*Int[x^2*(a+b*x^2)^p*(a*Q-A*b*(2*p+3)),x]] /;
FreeQ[{a,b},x] && PolyQ[Pq,x^2] && ILtQ[p+1/2,0] && LtQ[Expon[Pq,x]+2*p+1,0]

2:  ∫(Subscript[P, q])[x] (((a+b (x^2)))^p)dx  when p<-1

Derivation: Algebraic expansion and quadratic recurrence 2a

Rule 1.1.2.x.4.2: If  p<-1, 
    let (Subscript[Q, q-2])[x]->PolynomialQuotient[(Subscript[P, q])[x],a+b (x^2),x]and f+g x->PolynomialRemainder[(Subscript[P, q])[x],a+b (x^2),x], then

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

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

(((a g-b f x) (((a+b (x^2)))^(p+1)))/(2 a b (p+1)))+(1/(2 a (p+1)))∫(((a+b (x^2)))^(p+1))(2 a (p+1) (Subscript[Q, q-2])[x]+f (2 p+3)) dx

Program code:

Int[Pq_*(a_+b_.*x_^2)^p_,x_Symbol] :=
  With[{Q=PolynomialQuotient[Pq,a+b*x^2,x],
        f=Coeff[PolynomialRemainder[Pq,a+b*x^2,x],x,0],
        g=Coeff[PolynomialRemainder[Pq,a+b*x^2,x],x,1]},
  (a*g-b*f*x)*(a+b*x^2)^(p+1)/(2*a*b*(p+1)) + 
  1/(2*a*(p+1))*Int[(a+b*x^2)^(p+1)*ExpandToSum[2*a*(p+1)*Q+f*(2*p+3),x],x]] /;
FreeQ[{a,b},x] && PolyQ[Pq,x] && LtQ[p,-1]

5:  ∫(Subscript[P, q])[x] (((a+b (x^2)))^p)dx  when p≰-1

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 1.1.2.x.5: If  p≰-1, let e->(Subscript[P, q])[x,q], then

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

∫((Subscript[P, q])[x]-e (x^q)) (((a+b (x^2)))^p)dx+e∫(x^q) (((a+b (x^2)))^p)dx  ⟶  

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

Program code:

Int[Pq_*(a_+b_.*x_^2)^p_,x_Symbol] :=
  With[{q=Expon[Pq,x],e=Coeff[Pq,x,Expon[Pq,x]]},
  e*x^(q-1)*(a+b*x^2)^(p+1)/(b*(q+2*p+1)) + 
  1/(b*(q+2*p+1))*Int[(a+b*x^2)^p*ExpandToSum[b*(q+2*p+1)*Pq-a*e*(q-1)*x^(q-2)-b*e*(q+2*p+1)*x^q,x],x]] /;
FreeQ[{a,b,p},x] && PolyQ[Pq,x] && Not[LeQ[p,-1]]