?.  ∫P[x] (x^m) (((a+b (x^n)))^p)dx  when p-1∈(SuperPlus[ℤ])∧ n∈(SuperPlus[ℤ])∧ n-m∈(SuperPlus[ℤ])∧ P[x,n-m-1]≠0

1:  ∫P[x] (((a+b (x^n)))^p)dx  when p-1∈(SuperPlus[ℤ])∧ n-1∈(SuperPlus[ℤ])∧ P[x,n-1]≠0

Derivation: Algebraic expansion and power rule for integration

Note: If  P[x] has a n-1 degree term, this rule removes it from P[x].

Rule: If  p-1∈(SuperPlus[ℤ])∧ n-1∈(SuperPlus[ℤ])∧ P[x,n-m-1]≠0, then

∫P[x] (((a+b (x^n)))^p)dx  ⟶  P[x,n-1] ∫(x^(n-1)) (((a+b (x^n)))^p)dx+∫(P[x]-P[x,n-1] (x^(n-1))) (((a+b (x^n)))^p)dx

  ⟶  ((P[x,n-1] (((a+b (x^n)))^(p+1)))/(b n(p+1)))+∫(P[x]-P[x,n-1](x^(n-1))) (((a+b (x^n)))^p)dx

Program code:

Int[Px_*(a_+b_.*x_^n_)^p_,x_Symbol] :=
  Coeff[Px,x,n-1]*(a+b*x^n)^(p+1)/(b*n*(p+1)) + 
  Int[(Px-Coeff[Px,x,n-1]*x^(n-1))*(a+b*x^n)^p,x] /;
FreeQ[{a,b},x] && PolyQ[Px,x] && IGtQ[p,1] && IGtQ[n,1] && NeQ[Coeff[Px,x,n-1],0] && NeQ[Px,Coeff[Px,x,n-1]*x^(n-1)] && 
  Not[MatchQ[Px,Qx_.*(c_+d_.*x^m_)^q_ /; 
    FreeQ[{c,d},x] && PolyQ[Qx,x] && IGtQ[q,1] && IGtQ[m,1] && NeQ[Coeff[Qx*(a+b*x^n)^p,x,m-1],0] && GtQ[m*q,n*p]]]

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

Derivation: Algebraic expansion and power rule for integration

Note: If  P[x] has a n-m-1 degree term, this rule removes it from P[x].

Rule: If  p-1∈(SuperPlus[ℤ])∧ n-m∈(SuperPlus[ℤ])∧ P[x,n-m-1]≠0, then

∫P[x] (x^m) (((a+b (x^n)))^p)dx  ⟶  P[x,n-m-1] ∫(x^(n-1)) (((a+b (x^n)))^p)dx+∫(P[x]-P[x,n-m-1] (x^(n-m-1))) (x^m) (((a+b (x^n)))^p)dx

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

Program code:

Int[Px_*x_^m_.*(a_+b_.*x_^n_.)^p_,x_Symbol] :=
  Coeff[Px,x,n-m-1]*(a+b*x^n)^(p+1)/(b*n*(p+1)) + 
  Int[(Px-Coeff[Px,x,n-m-1]*x^(n-m-1))*x^m*(a+b*x^n)^p,x] /;
FreeQ[{a,b,m,n},x] && PolyQ[Px,x] && IGtQ[p,1] && IGtQ[n-m,0] && NeQ[Coeff[Px,x,n-m-1],0]

?:  ∫u (x^m) (((a (x^p)+b (x^q)+⋯))^n)dx  when n∈ℤ

Derivation: Algebraic simplification

Basis:  a (x^p)+b (x^q)+⋯==(x^p)(a+b (x^(q-p))+⋯)

Rule: If  n∈ℤ, then

∫u (x^m) (((a (x^p)+b (x^q)+⋯))^n)dx  ⟶  ∫u (x^(m+n p)) (((a+b (x^(q-p))+⋯))^n)dx

Program code:

Int[u_.*x_^m_.*(a_.*x_^p_.+b_.*x_^q_.)^n_.,x_Symbol] :=
  Int[u*x^(m+n*p)*(a+b*x^(q-p))^n,x] /;
FreeQ[{a,b,m,p,q},x] && IntegerQ[n] && PosQ[q-p]

Int[u_.*x_^m_.*(a_.*x_^p_.+b_.*x_^q_.+c_.*x_^r_.)^n_.,x_Symbol] :=
  Int[u*x^(m+n*p)*(a+b*x^(q-p)+c*x^(r-p))^n,x] /;
FreeQ[{a,b,c,m,p,q,r},x] && IntegerQ[n] && PosQ[q-p] && PosQ[r-p]

?:  ∫u ((P[x])^p) ((Q[x])^q)dx  when PolynomialRemainder[P[x],Q[x],x]==0 ∧ p∈ℤ ∧ p q<0

Derivation: Algebraic simplification

Basis: If  PolynomialRemainder[P[x],Q[x],x]==0 ∧ p∈ℤ, then ((P[x])^p) ((Q[x])^q)==((PolynomialQuotient[P[x],Q[x],x])^p) ((Q[x])^(p+q))

Rule: If  PolynomialRemainder[P[x],Q[x],x]==0 ∧ p∈ℤ ∧ p q<0, then

∫u ((P[x])^p) ((Q[x])^q)dx  ⟶  ∫u ((PolynomialQuotient[P[x],Q[x],x])^p) ((Q[x])^(p+q)) dx

Program code:

Int[u_.*Px_^p_.*Qx_^q_.,x_Symbol] :=
  Int[u*PolynomialQuotient[Px,Qx,x]^p*Qx^(p+q),x] /;
FreeQ[q,x] && PolyQ[Px,x] && PolyQ[Qx,x] && EqQ[PolynomialRemainder[Px,Qx,x],0] && IntegerQ[p] && LtQ[p*q,0]

?.  ∫(Subscript[Q, r])[x] F[(Subscript[P, q])[x]]dx

1:  ∫(((Subscript[P, p])[x])/((Subscript[Q, q])[x]))dx  when  p==q-1 ∧ (Subscript[P, p])[x]==(((Subscript[P, p])[x,p])/(q (Subscript[Q, q])[x,q])) (∂_x)(Subscript[Q, q])[x]

Derivation: Reciprocal integration rule

Rule: If  p==q-1 ∧ (Subscript[P, p])[x]==(((Subscript[P, p])[x,p])/(q (Subscript[Q, q])[x,q])) (∂_x)(Subscript[Q, q])[x], then

∫(((Subscript[P, p])[x])/((Subscript[Q, q])[x]))dx  ⟶  (((Subscript[P, p])[x,p])/(q (Subscript[Q, q])[x,q])) ∫(((∂_x)(Subscript[Q, q])[x])/((Subscript[Q, q])[x]))dx  ⟶  (((Subscript[P, p])[x,p] Log[(Subscript[Q, q])[x]])/(q (Subscript[Q, q])[x,q]))

Program code:

Int[Pp_/Qq_,x_Symbol] :=
  With[{p=Expon[Pp,x],q=Expon[Qq,x]},
  Coeff[Pp,x,p]*Log[RemoveContent[Qq,x]]/(q*Coeff[Qq,x,q])/;
 EqQ[p,q-1] && EqQ[Pp,Simplify[Coeff[Pp,x,p]/(q*Coeff[Qq,x,q])*D[Qq,x]]]] /;
PolyQ[Pp,x] && PolyQ[Qq,x]

2:  ∫(Subscript[P, p])[x] (((Subscript[Q, q])[x])^m)dx  when  m≠-1 ∧ p+m q+1≠0 ∧ (p+m q+1) (Subscript[Q, q])[x,q] (Subscript[P, p])[x]==(Subscript[P, p])[x,p] (x^(p-q)) ((p-q+1) (Subscript[Q, q])[x]+(m+1) x (∂_x)(Subscript[Q, q])[x])

Derivation: Derivative divides

Basis: (x^(p-q)) (((Subscript[Q, q])[x])^m) ((p-q+1) (Subscript[Q, q])[x]+(m+1) x (∂_x)(Subscript[Q, q])[x])==(∂_x)((x^(p-q+1)) (((Subscript[Q, q])[x])^(m+1)))

Note: The degree of the polynomial  (x^(p-q)) ((p-q+1) (Subscript[Q, q])[x]+(m+1) x (∂_x)(Subscript[Q, q])[x]) is p and the leading coefficient is (p+m q+1) (Subscript[Q, q])[x,q].

Rule: If m≠-1 ∧ p+m q+1≠0 ∧ (p+m q+1) (Subscript[Q, q])[x,q] (Subscript[P, p])[x]==(Subscript[P, p])[x,p] (x^(p-q)) ((p-q+1) (Subscript[Q, q])[x]+(m+1) x (∂_x)(Subscript[Q, q])[x]), then

∫(Subscript[P, p])[x] (((Subscript[Q, q])[x])^m)dx  ⟶  (((Subscript[P, p])[x,p])/((p+m q+1) (Subscript[Q, q])[x,q])) ∫(x^(p-q)) (((Subscript[Q, q])[x])^m) ((p-q+1) (Subscript[Q, q])[x]+(m+1) x (∂_x)(Subscript[Q, q])[x])dx  ⟶  (((Subscript[P, p])[x,p] (x^(p-q+1)) (((Subscript[Q, q])[x])^(m+1)))/((p+m q+1) (Subscript[Q, q])[x,q]))

Program code:

Int[Pp_*Qq_^m_.,x_Symbol] :=
  With[{p=Expon[Pp,x],q=Expon[Qq,x]},
  Coeff[Pp,x,p]*x^(p-q+1)*Qq^(m+1)/((p+m*q+1)*Coeff[Qq,x,q]) /;
 NeQ[p+m*q+1,0] && EqQ[(p+m*q+1)*Coeff[Qq,x,q]*Pp,Coeff[Pp,x,p]*x^(p-q)*((p-q+1)*Qq+(m+1)*x*D[Qq,x])]] /;
FreeQ[m,x] && PolyQ[Pp,x] && PolyQ[Qq,x] && NeQ[m,-1]

Int[x_^m_.*(a1_+b1_.*x_^n_.)^p_*(a2_+b2_.*x_^n_.)^p_,x_Symbol] :=
  (a1+b1*x^n)^(p+1)*(a2+b2*x^n)^(p+1)/(2*b1*b2*n*(p+1)) /;
FreeQ[{a1,b1,a2,b2,m,n,p},x] && EqQ[a2*b1+a1*b2,0] && EqQ[m-2*n+1,0] && NeQ[p,-1]

3:  ∫(Subscript[P, p])[x] (((Subscript[Q, q])[x])^m) (((Subscript[R, r])[x])^n)dx  when   m≠-1 ∧ n≠-1 ∧ p+m q+n r+1≠0 ∧
	 (p+m q+n r+1) (Subscript[Q, q])[x,q] (Subscript[R, r])[x,r] (Subscript[P, p])[x]==(Subscript[P, p])[x,p] (x^(p-q-r)) ((p-q-r+1) (Subscript[Q, q])[x] (Subscript[R, r])[x]+(m+1) x (Subscript[R, r])[x] (∂_x)(Subscript[Q, q])[x]+(n+1) x (Subscript[Q, q])[x] (∂_x)(Subscript[R, r])[x])

Derivation: Derivative divides

Basis: (x^(p-q-r)) (((Subscript[Q, q])[x])^m) (((Subscript[R, r])[x])^n) ((p-q-r+1) (Subscript[Q, q])[x] (Subscript[R, r])[x]+(m+1) x (Subscript[R, r])[x] (∂_x)(Subscript[Q, q])[x]+(n+1) x (Subscript[Q, q])[x] (∂_x)(Subscript[R, r])[x])==(∂_x)((x^(p-q-r+1)) (((Subscript[Q, q])[x])^(m+1)) (((Subscript[R, r])[x])^(n+1)))

Note: The degree of the polynomial  (x^(p-q-r)) ((p-q-r+1) (Subscript[Q, q])[x] (Subscript[R, r])[x]+(m+1) x (Subscript[R, r])[x] (∂_x)(Subscript[Q, q])[x]+(n+1) x (Subscript[Q, q])[x] (∂_x)(Subscript[R, r])[x]) is p and the leading coefficient is (p+m q+n r+1) (Subscript[Q, q])[x,q] (Subscript[R, r])[x,r].

Rule: If m≠-1 ∧ n≠-1 ∧ p+m q+n r+1≠0 ∧ (p+m q+n r+1) (Subscript[Q, q])[x,q] (Subscript[R, r])[x,r] (Subscript[P, p])[x]==(Subscript[P, p])[x,p] (x^(p-q-r)) ((p-q-r+1) (Subscript[Q, q])[x] (Subscript[R, r])[x]+(m+1) x (Subscript[R, r])[x] (∂_x)(Subscript[Q, q])[x]+(n+1) x (Subscript[Q, q])[x] (∂_x)(Subscript[R, r])[x]), then

∫(Subscript[P, p])[x] (((Subscript[Q, q])[x])^m) (((Subscript[R, r])[x])^n)dx  ⟶  
(((Subscript[P, p])[x,p])/((p+m q+n r+1) (Subscript[Q, q])[x,q] (Subscript[R, r])[x,r])) ∫(x^(p-q-r)) (((Subscript[Q, q])[x])^m) (((Subscript[R, r])[x])^n) ((p-q-r+1) (Subscript[Q, q])[x] (Subscript[R, r])[x]+(m+1) x (Subscript[R, r])[x] (∂_x)(Subscript[Q, q])[x]+(n+1) x (Subscript[Q, q])[x] (∂_x)(Subscript[R, r])[x])dx  ⟶  
(((Subscript[P, p])[x,p] (x^(p-q-r+1)) (((Subscript[Q, q])[x])^(m+1)) (((Subscript[R, r])[x])^(n+1)))/((p+m q+n r+1) (Subscript[Q, q])[x,q] (Subscript[R, r])[x,r]))

Program code:

Int[Pp_*Qq_^m_.*Rr_^n_.,x_Symbol] :=
  With[{p=Expon[Pp,x],q=Expon[Qq,x],r=Expon[Rr,x]},
  Coeff[Pp,x,p]*x^(p-q-r+1)*Qq^(m+1)*Rr^(n+1)/((p+m*q+n*r+1)*Coeff[Qq,x,q]*Coeff[Rr,x,r]) /;
 NeQ[p+m*q+n*r+1,0] && 
 EqQ[(p+m*q+n*r+1)*Coeff[Qq,x,q]*Coeff[Rr,x,r]*Pp,Coeff[Pp,x,p]*x^(p-q-r)*((p-q-r+1)*Qq*Rr+(m+1)*x*Rr*D[Qq,x]+(n+1)*x*Qq*D[Rr,x])]] /;
FreeQ[{m,n},x] && PolyQ[Pp,x] && PolyQ[Qq,x] && PolyQ[Rr,x] && NeQ[m,-1] && NeQ[n,-1]

4:  ∫(Subscript[Q, r])[x] (((a+b (((Subscript[P, q])[x])^n)))^p)dx  when (((Subscript[Q, r])[x])/((∂_x)(Subscript[P, q])[x]))==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q]))

Derivation: Integration by substitution (derivative divides)

Basis: If (((Subscript[Q, r])[x])/((∂_x)(Subscript[P, q])[x]))==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])), then F[(Subscript[P, q])[x]] (Subscript[Q, r])[x]==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])) Subst[F[x],x,(Subscript[P, q])[x]] (∂_x)(Subscript[P, q])[x]

Rule: If (((Subscript[Q, r])[x])/((∂_x)(Subscript[P, q])[x]))==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])), then

∫(Subscript[Q, r])[x] (((a+b (((Subscript[P, q])[x])^n)))^p)dx  ⟶  (((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])) Subst[∫(((a+b (x^n)))^p)dx,x,(Subscript[P, q])[x]]

Program code:

Int[Qr_*(a_.+b_.*Pq_^n_.)^p_.,x_Symbol] :=
  With[{q=Expon[Pq,x],r=Expon[Qr,x]},
  Coeff[Qr,x,r]/(q*Coeff[Pq,x,q])*Subst[Int[(a+b*x^n)^p,x],x,Pq] /;
 EqQ[r,q-1] && EqQ[Coeff[Qr,x,r]*D[Pq,x],q*Coeff[Pq,x,q]*Qr]] /;
FreeQ[{a,b,n,p},x] && PolyQ[Pq,x] && PolyQ[Qr,x]

5:  ∫(Subscript[Q, r])[x] (((a+b (((Subscript[P, q])[x])^n)+c (((Subscript[P, q])[x])^(2 n))))^p) dx  when (((Subscript[Q, r])[x])/((∂_x)(Subscript[P, q])[x]))==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q]))

Derivation: Integration by substitution (derivative divides)

Basis: If (((Subscript[Q, r])[x])/((∂_x)(Subscript[P, q])[x]))==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])), then F[(Subscript[P, q])[x]] (Subscript[Q, r])[x]==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])) Subst[F[x],x,(Subscript[P, q])[x]] (∂_x)(Subscript[P, q])[x]

Rule: If (((Subscript[Q, r])[x])/((∂_x)(Subscript[P, q])[x]))==(((Subscript[Q, r])[x,r])/(q (Subscript[P, q])[x,q])), then

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

Program code:

Int[Qr_*(a_.+b_.*Pq_^n_.+c_.*Pq_^n2_.)^p_.,x_Symbol] :=
  Module[{q=Expon[Pq,x],r=Expon[Qr,x]},
  Coeff[Qr,x,r]/(q*Coeff[Pq,x,q])*Subst[Int[(a+b*x^n+c*x^(2*n))^p,x],x,Pq] /;
 EqQ[r,q-1] && EqQ[Coeff[Qr,x,r]*D[Pq,x],q*Coeff[Pq,x,q]*Qr]] /;
FreeQ[{a,b,c,n,p},x] && EqQ[n2,2*n] && PolyQ[Pq,x] && PolyQ[Qr,x]

?:  ∫u(((a (x^p)+b (x^q)+⋯))^n)dx  when n∈ℤ

Derivation: Algebraic simplification

Basis:  a (x^p)+b (x^q)==(x^p)(a+b (x^(q-p)))

Rule: If  n∈ℤ, then

∫u (((a (x^p)+b (x^q)+⋯))^n)dx  ⟶  ∫u (x^(n p))(((a+b (x^(q-p))+⋯))^n)dx

Program code:

Int[u_.*(a_.*x_^p_.+b_.*x_^q_.)^n_.,x_Symbol] :=
  Int[u*x^(n*p)*(a+b*x^(q-p))^n,x] /;
FreeQ[{a,b,p,q},x] && IntegerQ[n] && PosQ[q-p]

Int[u_.*(a_.*x_^p_.+b_.*x_^q_.+c_.*x_^r_.)^n_.,x_Symbol] :=
  Int[u*x^(n*p)*(a+b*x^(q-p)+c*x^(r-p))^n,x] /;
FreeQ[{a,b,c,p,q,r},x] && IntegerQ[n] && PosQ[q-p] && PosQ[r-p]

Rules for integrands of the formP[x] (((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)

1.  ∫(((((a+b x))^m) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ

1.  ∫(((((a+b x))^m) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m>0

1.  ∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

x:  ∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 A d f-B (d e+c f)==0

Rule: If  2 A d f-B (d e+c f)==0, then

∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((B (Sqrt[a+b x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/(f h (Sqrt[c+d x])))-((B (b g-a h))/(2 f h)) ∫((Sqrt[e+f x])/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[g+h x])))dx+((B (d e-c f) (d g-c h))/(2 d f h)) ∫((Sqrt[a+b x])/((((c+d x))^(3/2)) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Program code:

(* Int[Sqrt[a_.+b_.*x_]*(A_.+B_.*x_)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  B*Sqrt[a+b*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(f*h*Sqrt[c+d*x]) - 
  B*(b*g-a*h)/(2*f*h)*Int[Sqrt[e+f*x]/(Sqrt[a+b*x]*Sqrt[c+d*x]*Sqrt[g+h*x]),x] + 
  B*(d*e-c*f)*(d*g-c*h)/(2*d*f*h)*Int[Sqrt[a+b*x]/((c+d*x)^(3/2)*Sqrt[e+f*x]*Sqrt[g+h*x]),x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x] && EqQ[2*A*d*f-B*(d*e+c*f),0] *)

1:  ∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 A d f-B (d e+c f)==0

Rule: If  2 A d f-B (d e+c f)==0, then

∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((b B (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/(d f h (Sqrt[a+b x])))-((B (b g-a h))/(2 f h)) ∫((Sqrt[e+f x])/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[g+h x])))dx+((B (b e-a f) (b g-a h))/(2 d f h)) ∫((Sqrt[c+d x])/((((a+b x))^(3/2)) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Program code:

Int[Sqrt[a_.+b_.*x_]*(A_.+B_.*x_)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  b*B*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(d*f*h*Sqrt[a+b*x]) - 
  B*(b*g-a*h)/(2*f*h)*Int[Sqrt[e+f*x]/(Sqrt[a+b*x]*Sqrt[c+d*x]*Sqrt[g+h*x]),x] + 
  B*(b*e-a*f)*(b*g-a*h)/(2*d*f*h)*Int[Sqrt[c+d*x]/((a+b*x)^(3/2)*Sqrt[e+f*x]*Sqrt[g+h*x]),x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x] && EqQ[2*A*d*f-B*(d*e+c*f),0]

x:  ∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 A d f-B (d e+c f)≠0

Derivation: Algebraic expansion

Basis: A+B x==((2 A d f-B (d e+c f))/(2 d f))+((B (d e+c f+2 d f x))/(2 d f))

Rule: If  2 A d f-B (d e+c f)≠0, then

∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((2 A d f-B (d e+c f))/(2 d f)) ∫((Sqrt[a+b x])/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx+(B/(2 d f)) ∫(((Sqrt[a+b x]) (d e+c f+2 d f x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Program code:

(* Int[Sqrt[a_.+b_.*x_]*(A_.+B_.*x_)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  (2*A*d*f-B*(d*e+c*f))/(2*d*f)*Int[Sqrt[a+b*x]/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]),x] + 
  B/(2*d*f)*Int[(Sqrt[a+b*x]*(d*e+c*f+2*d*f*x))/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]),x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x] && NeQ[2*A*d*f-B*(d*e+c*f),0] *)

2:  ∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 A d f-B (d e+c f)≠0

Rule: If  2 A d f-B (d e+c f)≠0, then

∫(((Sqrt[a+b x]) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((B (Sqrt[a+b x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/(f h (Sqrt[c+d x])))+((B (d e-c f) (d g-c h))/(2 d f h)) ∫((Sqrt[a+b x])/((((c+d x))^(3/2)) (Sqrt[e+f x]) (Sqrt[g+h x])))dx-
((B (b e-a f) (b g-a h))/(2 b f h)) ∫(1/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx+((2 A b d f h+B (a d f h-b (d f g+d e h+c f h)))/(2 b d f h)) ∫((Sqrt[a+b x])/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Program code:

Int[Sqrt[a_.+b_.*x_]*(A_.+B_.*x_)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  B*Sqrt[a+b*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(f*h*Sqrt[c+d*x]) + 
  B*(d*e-c*f)*(d*g-c*h)/(2*d*f*h)*Int[Sqrt[a+b*x]/((c+d*x)^(3/2)*Sqrt[e+f*x]*Sqrt[g+h*x]),x] - 
  B*(b*e-a*f)*(b*g-a*h)/(2*b*f*h)*Int[1/(Sqrt[a+b*x]*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]),x] + 
  (2*A*b*d*f*h+B*(a*d*f*h-b*(d*f*g+d*e*h+c*f*h)))/(2*b*d*f*h)*Int[Sqrt[a+b*x]/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]),x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x] && NeQ[2*A*d*f-B*(d*e+c*f),0]

2:  ∫(((((a+b x))^m) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m>0

Rule: If  2 m∈ℤ ∧ m>0, then

∫(((((a+b x))^m) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

(1/(d f h (2 m+3))) ∫((((a+b x))^(m-1))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))(a A d f h (2 m+3)+(A b+a B) d f h (2 m+3) x+b B d f h (2 m+3) (x^2))dx

Program code:

Int[(a_.+b_.*x_)^m_.*(A_.+B_.*x_)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  1/(d*f*h*(2*m+3))*Int[((a+b*x)^(m-1)/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]))*
    Simp[a*A*d*f*h*(2*m+3)+(A*b+a*B)*d*f*h*(2*m+3)*x+b*B*d*f*h*(2*m+3)*x^2,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x] && IntegerQ[2*m] && GtQ[m,0]

2.  ∫(((((a+b x))^m) (A+B x))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m<0

1:  ∫((A+B x)/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Derivation: Algebraic expansion

Basis: ((A+B x)/(Sqrt[a+b x]))==((A b-a B)/(b (Sqrt[a+b x])))+((B (Sqrt[a+b x]))/b)

Rule:

∫((A+B x)/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((A b-a B)/b) ∫(1/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx+(B/b) ∫((Sqrt[a+b x])/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Program code:

Int[(A_.+B_.*x_)/(Sqrt[a_.+b_.*x_]*Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  (A*b-a*B)/b*Int[1/(Sqrt[a+b*x]*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]),x] + 
  B/b*Int[Sqrt[a+b*x]/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]),x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x]

2:  ∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m<-1

Rule: If  2 m∈ℤ ∧ m<-1, then

∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

(((A (b^2)-a b B+(a^2) C) (((a+b x))^(m+1)) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/((m+1) (b c-a d) (b e-a f) (b g-a h)))-
(1/(2 (m+1) (b c-a d) (b e-a f) (b g-a h))) ∫((((a+b x))^(m+1))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))·
(A (2 (a^2) d f h (m+1)-2 a b (m+1) (d f g+d e h+c f h)+(b^2) (2 m+3) (d e g+c f g+c e h))-(b B-a C) (a (d e g+c f g+c e h)+2 b c e g (m+1))-
2 ((A b-a B) (a d f h (m+1)-b (m+2) (d f g+d e h+c f h))-C ((a^2) (d f g+d e h+c f h)-(b^2) c e g (m+1)+a b (m+1) (d e g+c f g+c e h))) x+
d f h (2 m+5) (A (b^2)-a b B+(a^2) C) (x^2))dx

Program code:

Int[(a_.+b_.*x_)^m_*(A_.+B_.*x_)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  (A*b^2-a*b*B)*(a+b*x)^(m+1)*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/((m+1)*(b*c-a*d)*(b*e-a*f)*(b*g-a*h)) - 
  1/(2*(m+1)*(b*c-a*d)*(b*e-a*f)*(b*g-a*h))*Int[((a+b*x)^(m+1)/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]))*
    Simp[A*(2*a^2*d*f*h*(m+1)-2*a*b*(m+1)*(d*f*g+d*e*h+c*f*h)+b^2*(2*m+3)*(d*e*g+c*f*g+c*e*h)) - 
      b*B*(a*(d*e*g+c*f*g+c*e*h)+2*b*c*e*g*(m+1)) - 
      2*((A*b-a*B)*(a*d*f*h*(m+1)-b*(m+2)*(d*f*g+d*e*h+c*f*h)))*x + 
      d*f*h*(2*m+5)*(A*b^2-a*b*B)*x^2,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B},x] && IntegerQ[2*m] && LtQ[m,-1]

2.  ∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ

1:  ∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m>0

Rule: If  2 m∈ℤ ∧ m>0, then

∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((2 C (((a+b x))^m) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/(d f h (2 m+3)))+
(1/(d f h (2 m+3))) ∫((((a+b x))^(m-1))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))·
(a A d f h (2 m+3)-C (a (d e g+c f g+c e h)+2 b c e g m)+
((A b+a B) d f h (2 m+3)-C (2 a (d f g+d e h+c f h)+b (2 m+1) (d e g+c f g+c e h))) x+
(b B d f h (2 m+3)+2 C (a d f h m-b (m+1) (d f g+d e h+c f h))) (x^2))dx

Program code:

Int[(a_.+b_.*x_)^m_.*(A_.+B_.*x_+C_.*x_^2)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  2*C*(a+b*x)^m*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(d*f*h*(2*m+3)) + 
  1/(d*f*h*(2*m+3))*Int[((a+b*x)^(m-1)/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]))*
    Simp[a*A*d*f*h*(2*m+3)-C*(a*(d*e*g+c*f*g+c*e*h)+2*b*c*e*g*m) + 
      ((A*b+a*B)*d*f*h*(2*m+3)-C*(2*a*(d*f*g+d*e*h+c*f*h)+b*(2*m+1)*(d*e*g+c*f*g+c*e*h)))*x + 
      (b*B*d*f*h*(2*m+3)+2*C*(a*d*f*h*m-b*(m+1)*(d*f*g+d*e*h+c*f*h)))*x^2,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B,C},x] && IntegerQ[2*m] && GtQ[m,0]

Int[(a_.+b_.*x_)^m_.*(A_.+C_.*x_^2)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  2*C*(a+b*x)^m*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(d*f*h*(2*m+3)) + 
  1/(d*f*h*(2*m+3))*Int[((a+b*x)^(m-1)/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]))*
    Simp[a*A*d*f*h*(2*m+3)-C*(a*(d*e*g+c*f*g+c*e*h)+2*b*c*e*g*m) + 
      (A*b*d*f*h*(2*m+3)-C*(2*a*(d*f*g+d*e*h+c*f*h)+b*(2*m+1)*(d*e*g+c*f*g+c*e*h)))*x + 
      2*C*(a*d*f*h*m-b*(m+1)*(d*f*g+d*e*h+c*f*h))*x^2,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,C},x] && IntegerQ[2*m] && GtQ[m,0]

2.  ∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m<0

1:  ∫((A+B x+C (x^2))/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Rule:

∫((A+B x+C (x^2))/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

((C (Sqrt[a+b x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/(b f h (Sqrt[c+d x])))+
((C (d e-c f) (d g-c h))/(2 b d f h)) ∫((Sqrt[a+b x])/((((c+d x))^(3/2)) (Sqrt[e+f x]) (Sqrt[g+h x])))dx+
(1/(2 b d f h )) ∫((2 A b d f h-C (b d e g+a c f h)+(2 b B d f h-C (a d f h+b (d f g+d e h+c f h))) x)/((Sqrt[a+b x]) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx

Program code:

Int[(A_.+B_.*x_+C_.*x_^2)/(Sqrt[a_.+b_.*x_]*Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  C*Sqrt[a+b*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(b*f*h*Sqrt[c+d*x]) + 
  C*(d*e-c*f)*(d*g-c*h)/(2*b*d*f*h)*Int[Sqrt[a+b*x]/((c+d*x)^(3/2)*Sqrt[e+f*x]*Sqrt[g+h*x]),x] + 
  1/(2*b*d*f*h)*Int[1/(Sqrt[a+b*x]*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x])*
    Simp[2*A*b*d*f*h-C*(b*d*e*g+a*c*f*h)+(2*b*B*d*f*h-C*(a*d*f*h+b*(d*f*g+d*e*h+c*f*h)))*x,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B,C},x]

Int[(A_.+C_.*x_^2)/(Sqrt[a_.+b_.*x_]*Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  C*Sqrt[a+b*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/(b*f*h*Sqrt[c+d*x]) + 
  C*(d*e-c*f)*(d*g-c*h)/(2*b*d*f*h)*Int[Sqrt[a+b*x]/((c+d*x)^(3/2)*Sqrt[e+f*x]*Sqrt[g+h*x]),x] + 
  1/(2*b*d*f*h)*Int[1/(Sqrt[a+b*x]*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x])*
    Simp[2*A*b*d*f*h-C*(b*d*e*g+a*c*f*h)-C*(a*d*f*h+b*(d*f*g+d*e*h+c*f*h))*x,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,C},x]

2:  ∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  when  2 m∈ℤ ∧ m<-1

Rule: If  2 m∈ℤ ∧ m<-1, then

∫(((((a+b x))^m) (A+B x+C (x^2)))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))dx  ⟶  

(((A (b^2)-a b B+(a^2) C) (((a+b x))^(m+1)) (Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x]))/((m+1) (b c-a d) (b e-a f) (b g-a h)))-
(1/(2 (m+1) (b c-a d) (b e-a f) (b g-a h))) ∫((((a+b x))^(m+1))/((Sqrt[c+d x]) (Sqrt[e+f x]) (Sqrt[g+h x])))·
(A (2 (a^2) d f h (m+1)-2 a b (m+1) (d f g+d e h+c f h)+(b^2) (2 m+3) (d e g+c f g+c e h))-(b B-a C) (a (d e g+c f g+c e h)+2 b c e g (m+1))-
2 ((A b-a B) (a d f h (m+1)-b (m+2) (d f g+d e h+c f h))-C ((a^2) (d f g+d e h+c f h)-(b^2) c e g (m+1)+a b (m+1) (d e g+c f g+c e h))) x+
d f h (2 m+5) (A (b^2)-a b B+(a^2) C) (x^2))dx

Program code:

Int[(a_.+b_.*x_)^m_*(A_.+B_.*x_+C_.*x_^2)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  (A*b^2-a*b*B+a^2*C)*(a+b*x)^(m+1)*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/((m+1)*(b*c-a*d)*(b*e-a*f)*(b*g-a*h)) - 
  1/(2*(m+1)*(b*c-a*d)*(b*e-a*f)*(b*g-a*h))*Int[((a+b*x)^(m+1)/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]))*
    Simp[A*(2*a^2*d*f*h*(m+1)-2*a*b*(m+1)*(d*f*g+d*e*h+c*f*h)+b^2*(2*m+3)*(d*e*g+c*f*g+c*e*h)) - 
      (b*B-a*C)*(a*(d*e*g+c*f*g+c*e*h)+2*b*c*e*g*(m+1)) - 
      2*((A*b-a*B)*(a*d*f*h*(m+1)-b*(m+2)*(d*f*g+d*e*h+c*f*h))-C*(a^2*(d*f*g+d*e*h+c*f*h)-b^2*c*e*g*(m+1)+a*b*(m+1)*(d*e*g+c*f*g+c*e*h)))*x + 
      d*f*h*(2*m+5)*(A*b^2-a*b*B+a^2*C)*x^2,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B,C},x] && IntegerQ[2*m] && LtQ[m,-1]

Int[(a_.+b_.*x_)^m_*(A_.+C_.*x_^2)/(Sqrt[c_.+d_.*x_]*Sqrt[e_.+f_.*x_]*Sqrt[g_.+h_.*x_]),x_Symbol] :=
  (A*b^2+a^2*C)*(a+b*x)^(m+1)*Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]/((m+1)*(b*c-a*d)*(b*e-a*f)*(b*g-a*h)) - 
  1/(2*(m+1)*(b*c-a*d)*(b*e-a*f)*(b*g-a*h))*Int[((a+b*x)^(m+1)/(Sqrt[c+d*x]*Sqrt[e+f*x]*Sqrt[g+h*x]))*
    Simp[A*(2*a^2*d*f*h*(m+1)-2*a*b*(m+1)*(d*f*g+d*e*h+c*f*h)+b^2*(2*m+3)*(d*e*g+c*f*g+c*e*h)) + 
      a*C*(a*(d*e*g+c*f*g+c*e*h)+2*b*c*e*g*(m+1)) - 
      2*(A*b*(a*d*f*h*(m+1)-b*(m+2)*(d*f*g+d*e*h+c*f*h))-C*(a^2*(d*f*g+d*e*h+c*f*h)-b^2*c*e*g*(m+1)+a*b*(m+1)*(d*e*g+c*f*g+c*e*h)))*x + 
      d*f*h*(2*m+5)*(A*b^2+a^2*C)*x^2,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,C},x] && IntegerQ[2*m] && LtQ[m,-1]

3:  ∫P[x] (((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)dx  when  (m|n)∈ℤ

Derivation: Algebraic expansion

Rule: If (m|n)∈ℤ, then

∫P[x] (((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)dx  ⟶  ∫ExpandIntegrand[P[x] (((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q),x]dx

Program code:

Int[Px_*(a_.+b_.*x_)^m_.*(c_.+d_.*x_)^n_.*(e_.+f_.*x_)^p_.*(g_.+h_.*x_)^q_.,x_Symbol] :=
  Int[ExpandIntegrand[Px*(a+b*x)^m*(c+d*x)^n*(e+f*x)^p*(g+h*x)^q,x],x] /;
FreeQ[{a,b,c,d,e,f,g,h,m,n,p,q},x] && PolyQ[Px,x] && IntegersQ[m,n]

4:  ∫P[x] (((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)dx

Derivation: Algebraic expansion

Basis: P[x]==PolynomialRemainder[P[x],a+b x,x]+(a+b x) PolynomialQuotient[P[x],a+b x,x]

Note: Reduces the degree of the polynomial, but results in exponential growth.

Rule:

∫P[x] (((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)dx  ⟶  

PolynomialRemainder[P[x],a+b x,x] ∫(((a+b x))^m) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)dx+
∫PolynomialQuotient[P[x],a+b x,x] (((a+b x))^(m+1)) (((c+d x))^n) (((e+f x))^p) (((g+h x))^q)dx

Program code:

Int[Px_*(a_.+b_.*x_)^m_.*(c_.+d_.*x_)^n_.*(e_.+f_.*x_)^p_.*(g_.+h_.*x_)^q_.,x_Symbol] :=
  PolynomialRemainder[Px,a+b*x,x]*Int[(a+b*x)^m*(c+d*x)^n*(e+f*x)^p*(g+h*x)^q,x] + 
  Int[PolynomialQuotient[Px,a+b*x,x]*(a+b*x)^(m+1)*(c+d*x)^n*(e+f*x)^p*(g+h*x)^q,x] /;
FreeQ[{a,b,c,d,e,f,g,h,m,n,p,q},x] && PolyQ[Px,x] && EqQ[m,-1]

Int[Px_*(a_.+b_.*x_)^m_.*(c_.+d_.*x_)^n_.*(e_.+f_.*x_)^p_.*(g_.+h_.*x_)^q_.,x_Symbol] :=
  PolynomialRemainder[Px,a+b*x,x]*Int[(a+b*x)^m*(c+d*x)^n*(e+f*x)^p*(g+h*x)^q,x] + 
  Int[PolynomialQuotient[Px,a+b*x,x]*(a+b*x)^(m+1)*(c+d*x)^n*(e+f*x)^p*(g+h*x)^q,x] /;
FreeQ[{a,b,c,d,e,f,g,h,m,n,p,q},x] && PolyQ[Px,x]