Rules for integrands of the form(d+e (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)

1:  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when p∈ℤ ∧ q<n

Rule: If  p∈ℤ ∧ q<n, then

∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ∫(x^(p q))(A+B (x^(n-q)))(((a+b (x^(n-q))+c (x^(2(n-q)))))^p)dx

Program code:

Int[(A_+B_.*x_^r_.)*(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^j_.)^p_.,x_Symbol] :=
  Int[x^(p*q)*(A+B*x^(n-q))*(a+b*x^(n-q)+c*x^(2*(n-q)))^p,x] /;
FreeQ[{a,b,c,A,B,n,q},x] && EqQ[r,n-q] && EqQ[j,2*n-q] && IntegerQ[p] && PosQ[n-q]

x.  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p+(1/2)∈ℤ

x:  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p+(1/2)∈(SuperPlus[ℤ])

Derivation: Piecewise constant extraction

Basis:  (∂_x)((Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))==0

Rule: If  q<n ∧ p+(1/2)∈(SuperPlus[ℤ]), then

∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ((Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))∫(x^(q p))(A+B (x^(n-q)))(((a+b (x^(n-q))+c (x^(2(n-q)))))^p)dx

Program code:

(* Int[(A_+B_.*x_^j_.)*(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  Sqrt[a*x^q+b*x^n+c*x^(2*n-q)]/(x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))])*
    Int[x^(q*p)*(A+B*x^(n-q))*(a+b*x^(n-q)+c*x^(2*(n-q)))^p,x] /;
FreeQ[{a,b,c,A,B,n,p,q},x] && EqQ[j,n-q] && EqQ[r,2*n-q] && PosQ[n-q] && IGtQ[p+1/2,0] *)

x:  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p-(1/2)∈(SuperMinus[ℤ])

Derivation: Piecewise constant extraction

Basis:  (∂_x)(((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))]))/(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))]))==0

Rule: If  q<n ∧ p-(1/2)∈(SuperMinus[ℤ]), then

∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  (((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))]))/(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))]))∫(x^(q p))(A+B (x^(n-q)))(((a+b (x^(n-q))+c (x^(2(n-q)))))^p)dx

Program code:

(* Int[(A_+B_.*x_^j_.)*(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))]/Sqrt[a*x^q+b*x^n+c*x^(2*n-q)]*
    Int[x^(q*p)*(A+B*x^(n-q))*(a+b*x^(n-q)+c*x^(2*(n-q)))^p,x] /;
FreeQ[{a,b,c,A,B,n,p,q},x] && EqQ[j,n-q] && EqQ[r,2*n-q] && PosQ[n-q] && ILtQ[p-1/2,0] *)

x:  ∫(A+B (x^(n-q)))(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])dx  when q<n

Derivation: Piecewise constant extraction

Basis:  (∂_x)((Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))==0

Rule: If  q<n, then

∫(A+B (x^(n-q)))(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])dx  ⟶  ((Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))∫(x^(q/2))(A+B (x^(n-q)))(Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])dx

Program code:

(* Int[(A_+B_.*x_^j_.)*Sqrt[a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.],x_Symbol] :=
  Sqrt[a*x^q+b*x^n+c*x^(2*n-q)]/(x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))])*
    Int[x^(q/2)*(A+B*x^(n-q))*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))],x] /;
FreeQ[{a,b,c,A,B,n,q},x] && EqQ[j,n-q] && EqQ[r,2*n-q] && PosQ[n-q] *)

2:  ∫((A+B (x^(n-q)))/(Sqrt[a (x^q)+b (x^n)+c (x^(2 n-q))]))dx  when q<n

Derivation: Piecewise constant extraction

Basis:  (∂_x)(((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))]))/(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))]))==0

Rule: If  q<n, then

∫((A+B (x^(n-q)))/(Sqrt[a (x^q)+b (x^n)+c (x^(2 n-q))]))dx  ⟶  (((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))]))/(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))]))∫((A+B (x^(n-q)))/((x^(q/2))(Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))dx

Program code:

Int[(A_+B_.*x_^j_.)/Sqrt[a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.],x_Symbol] :=
  x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))]/Sqrt[a*x^q+b*x^n+c*x^(2*n-q)]*
    Int[(A+B*x^(n-q))/(x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))]),x] /;
FreeQ[{a,b,c,A,B,n,q},x] && EqQ[j,n-q] && EqQ[r,2*n-q] && PosQ[n-q] && EqQ[n,3] && EqQ[q,2]

3:  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when  p∉ℤ ∧ (b^2)-4a c≠0 ∧ p>0 ∧ p (2 n-q)+1≠0 ∧ p q+(n-q) (2 p+1)+1≠0

Derivation: Trinomial recurrence 1b with m=0

Rule: If  p∉ℤ ∧ (b^2)-4a c≠0 ∧ p>0 ∧ p (2 n-q)+1≠0 ∧ p q+(n-q) (2 p+1)+1≠0, then

∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  
((x (b B (n-q) p+A c (p q+(n-q) (2 p+1)+1)+B c (p (2 n-q)+1) (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2 n-q))))^p))/(c (p (2 n-q)+1) (p q+(n-q) (2 p+1)+1)))+(((n-q) p)/(c (p (2 n-q)+1) (p q+(n-q) (2 p+1)+1)))·
∫(x^q) (2 a A c (p q+(n-q) (2 p+1)+1)-a b B (p q+1)+(2 a B c (p (2 n-q)+1)+A b c (p q+(n-q) (2 p+1)+1)-(b^2) B (p q+(n-q) p+1)) (x^(n-q)))·
(((a (x^q)+b (x^n)+c (x^(2 n-q))))^(p-1))dx

Program code:

Int[(A_+B_.*x_^r_.)*(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^j_.)^p_,x_Symbol] :=
  x*(b*B*(n-q)*p+A*c*(p*q+(n-q)*(2*p+1)+1)+B*c*(p*(2*n-q)+1)*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^p/
    (c*(p*(2*n-q)+1)*(p*q+(n-q)*(2*p+1)+1)) + 
  (n-q)*p/(c*(p*(2*n-q)+1)*(p*q+(n-q)*(2*p+1)+1))*
    Int[x^q*
      (2*a*A*c*(p*q+(n-q)*(2*p+1)+1)-a*b*B*(p*q+1)+(2*a*B*c*(p*(2*n-q)+1)+A*b*c*(p*q+(n-q)*(2*p+1)+1)-b^2*B*(p*q+(n-q)*p+1))*x^(n-q))*
      (a*x^q+b*x^n+c*x^(2*n-q))^(p-1),x] /;
FreeQ[{a,b,c,A,B,n,q},x] && EqQ[r,n-q] && EqQ[j,2*n-q] && Not[IntegerQ[p]] && NeQ[b^2-4*a*c,0] && GtQ[p,0] && 
  NeQ[p*(2*n-q)+1,0] && NeQ[p*q+(n-q)*(2*p+1)+1,0]

Int[(A_+B_.*x_^r_.)*(a_.*x_^q_.+c_.*x_^j_.)^p_,x_Symbol] :=
  With[{n=q+r},
  x*(A*(p*q+(n-q)*(2*p+1)+1)+B*(p*(2*n-q)+1)*x^(n-q))*(a*x^q+c*x^(2*n-q))^p/((p*(2*n-q)+1)*(p*q+(n-q)*(2*p+1)+1)) + 
  (n-q)*p/((p*(2*n-q)+1)*(p*q+(n-q)*(2*p+1)+1))*
    Int[x^q*(2*a*A*(p*q+(n-q)*(2*p+1)+1)+(2*a*B*(p*(2*n-q)+1))*x^(n-q))*(a*x^q+c*x^(2*n-q))^(p-1),x] /;
 EqQ[j,2*n-q] && NeQ[p*(2*n-q)+1,0] && NeQ[p*q+(n-q)*(2*p+1)+1,0]] /;
FreeQ[{a,c,A,B,q},x] && Not[IntegerQ[p]] && GtQ[p,0]

4:  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when  p∉ℤ ∧ (b^2)-4 a c≠0 ∧ p<-1

Derivation: Trinomial recurrence 2b with m=0

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

∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  
-(((x^(-q+1)) (A (b^2)-a b B-2 a A c+(A b-2 a B) c (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2 n-q))))^(p+1)))/(a (n-q)(p+1) ((b^2)-4 a c)))+(1/(a (n-q)(p+1) ((b^2)-4 a c)))·
∫(x^(-q)) (A (b^2)(p q+(n-q) (p+1)+1)-a b B(p q+1)-2a A c(p q+2(n-q) (p+1)+1)+(p q+(n-q) (2p+3)+1)(A b-2 a B) c (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2 n-q))))^(p+1))dx

Program code:

Int[(A_+B_.*x_^r_.)*(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^j_.)^p_,x_Symbol] :=
  -x^(-q+1)*(A*b^2-a*b*B-2*a*A*c+(A*b-2*a*B)*c*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^(p+1)/(a*(n-q)*(p+1)*(b^2-4*a*c)) + 
  1/(a*(n-q)*(p+1)*(b^2-4*a*c))*
    Int[x^(-q)*
      ((A*b^2*(p*q+(n-q)*(p+1)+1)-a*b*B*(p*q+1)-2*a*A*c*(p*q+2*(n-q)*(p+1)+1)+(p*q+(n-q)*(2*p+3)+1)*(A*b-2*a*B)*c*x^(n-q))*
      (a*x^q+b*x^n+c*x^(2*n-q))^(p+1)),x] /;
FreeQ[{a,b,c,A,B,n,q},x] && EqQ[r,n-q] && EqQ[j,2*n-q] && Not[IntegerQ[p]] && NeQ[b^2-4*a*c,0] && LtQ[p,-1]

Int[(A_+B_.*x_^r_.)*(a_.*x_^q_.+c_.*x_^j_.)^p_,x_Symbol] :=
  With[{n=q+r},
  -x^(-q+1)*(a*A*c+a*B*c*x^(n-q))*(a*x^q+c*x^(2*n-q))^(p+1)/(a*(n-q)*(p+1)*(2*a*c)) + 
  1/(a*(n-q)*(p+1)*(2*a*c))*
    Int[x^(-q)*((a*A*c*(p*q+2*(n-q)*(p+1)+1)+a*B*c*(p*q+(n-q)*(2*p+3)+1)*x^(n-q))*(a*x^q+c*x^(2*n-q))^(p+1)),x] /;
 EqQ[j,2*n-q]] /;
FreeQ[{a,c,A,B,q},x] && Not[IntegerQ[p]] && LtQ[p,-1]

x:  ∫(A+B (x^(k-j)))(((a (x^j)+b (x^k)+c (x^(2k-j))))^p)dx  when k>j ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis:  (∂_x)((((a (x^j)+b (x^k)+c (x^(2k-j))))^p)/((x^(j p)) (((a+b (x^(k-j))+c (x^(2(k-j)))))^p)))==0

Rule: If  k>j ∧ p∉ℤ, then

∫(x^m)(A+B (x^(k-j)))(((a (x^j)+b (x^k)+c (x^(2k-j))))^p)dx  ⟶  ((((a (x^j)+b (x^k)+c (x^(2k-j))))^p)/((x^(j p)) (((a+b (x^(k-j))+c (x^(2(k-j)))))^p)))∫(x^(m+j p))(A+B (x^(k-j)))(((a+b (x^(k-j))+c (x^(2(k-j)))))^p)dx

Program code:

(* Int[(A_+B_.*x_^q_)*(a_.*x_^j_.+b_.*x_^k_.+c_.*x_^n_.)^p_,x_Symbol] :=
  (a*x^j+b*x^k+c*x^n)^p/(x^(j*p)*(a+b*x^(k-j)+c*x^(2*(k-j)))^p)*
    Int[x^(j*p)*(A+B*x^(k-j))*(a+b*x^(k-j)+c*x^(2*(k-j)))^p,x] /;
FreeQ[{a,b,c,A,B,j,k,p},x] && EqQ[q,k-j] && EqQ[n,2*k-j] && PosQ[k-j] && Not[IntegerQ[p]] *)

X:  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx

Rule:

∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx

Program code:

Int[(A_+B_.*x_^j_.)*(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_.,x_Symbol] :=
  Unintegrable[(A+B*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^p,x] /;
FreeQ[{a,b,c,A,B,n,p,q},x] && EqQ[j,n-q] && EqQ[r,2*n-q]

S:  ∫(A+B (u^(n-q)))(((a (u^q)+b (u^n)+c (u^(2n-q))))^p)dx  when  u==d+e x

Derivation: Integration by substitution

Rule: If  u==d+e x, then

∫(A+B (u^(n-q)))(((a (u^q)+b (u^n)+c (u^(2n-q))))^p)dx  ⟶  (1/e)Subst[∫(A+B (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx,x,u]

Program code:

Int[(A_+B_.*u_^j_.)*(a_.*u_^q_.+b_.*u_^n_.+c_.*u_^r_.)^p_.,x_Symbol] :=
  1/Coefficient[u,x,1]*Subst[Int[(A+B*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^p,x],x,u] /;
FreeQ[{a,b,c,A,B,n,p,q},x] && EqQ[j,n-q] && EqQ[r,2*n-q] && LinearQ[u,x] && NeQ[u,x]