Rules for integrands of the form (((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)

1.  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0

1:  ∫(((f+g x))^m) (h+i x) (A+B Log[e (((((a+b x)/(c+d x))))^n)])dx  when  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0 ∧ m+2∈(SuperPlus[ℤ])

Rule: If  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0 ∧ m+2∈(SuperPlus[ℤ]), then

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

Program code:

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

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_]),x_Symbol] :=
  (f+g*x)^(m+1)*(h+i*x)*(A+B*Log[e*(a+b*x)^n/(c+d*x)^n])/(g*(m+2)) + 
  i*(b*c-a*d)/(b*d*(m+2))*Int[(f+g*x)^m*(A-B*n+B*Log[e*(a+b*x)^n/(c+d*x)^n]),x] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,m,n},x] && EqQ[n+mn,0] && IGtQ[n,0] && NeQ[b*c-a*d,0] && EqQ[b*f-a*g,0] && EqQ[d*h-c*i,0] && IGtQ[m,-2]

2:  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0 ∧ (m|q)∈ℤ

Derivation: Integration by substitution

Basis: F[x,((a+b x)/(c+d x))]==(b c-a d) Subst[((F[-((a-c x)/(b-d x)),x])/(((b-d x))^2)),x,((a+b x)/(c+d x))] (∂_x)((a+b x)/(c+d x))

Rule: If  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0 ∧ (m|q)∈ℤ, then

∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  ⟶  
(((b c-a d))^(m+q+1)) ((((g/b)))^m) ((((i/d)))^q) Subst[∫(((x^m) (((A+B Log[e (x^n)]))^p))/(((b-d x))^(m+q+2)))dx,x,((a+b x)/(c+d x))]

Program code:

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*((a_.+b_.*x_)/(c_.+d_.*x_))^n_.])^p_.,x_Symbol] :=
  (b*c-a*d)^(m+q+1)*(g/b)^m*(i/d)^q*Subst[Int[x^m*(A+B*Log[e*x^n])^p/(b-d*x)^(m+q+2),x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,n,p},x] && NeQ[b*c-a*d,0] && EqQ[b*f-a*g,0] && EqQ[d*h-c*i,0] && IntegersQ[m,q]

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  (b*c-a*d)^(m+q+1)*(g/b)^m*(i/d)^q*Subst[Int[x^m*(A+B*Log[e*x^n])^p/(b-d*x)^(m+q+2),x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,n,p},x] && EqQ[n+mn,0] && IGtQ[n,0] && NeQ[b*c-a*d,0] && EqQ[b*f-a*g,0] && EqQ[d*h-c*i,0] && IntegersQ[m,q]

3:  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0 ∧ m+q+2==0

Derivation: Integration by substitution and partial fraction expansion

Basis: F[x,((a+b x)/(c+d x))]==(b c-a d) Subst[((F[-((a-c x)/(b-d x)),x])/(((b-d x))^2)),x,((a+b x)/(c+d x))] (∂_x)((a+b x)/(c+d x))

Basis: If  m+q+2==0, then (∂_x)(((((((g (b c-a d) x)/(b (b-d x)))))^m) (((((i (b c-a d))/(d (b-d x)))))^q))/((x^m) (((b-d x))^2)))==0

Rule: If  b c-a d≠0 ∧ b f-a g==0 ∧ d h-c i==0 ∧ m+q+2==0, then

∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx

  ⟶  (b c-a d) Subst[∫(((((((g (b c-a d) x)/(b (b-d x)))))^m) (((((i (b c-a d))/(d (b-d x)))))^q) (((A+B Log[e (x^n)]))^p))/(((b-d x))^2))dx,x,((a+b x)/(c+d x))]

  ⟶  (b c-a d) Subst[(((((((g (b c-a d) x)/(b (b-d x)))))^m) (((((i (b c-a d))/(d (b-d x)))))^q))/((x^m) (((b-d x))^2))) ∫(x^m) (((A+B Log[e (x^n)]))^p)dx,x,((a+b x)/(c+d x))]

  ⟶  (((d^2)(((((g (a+b x))/b)))^m))/((i^2) (b c-a d) (((((i (c+d x))/d)))^m) (((((a+b x)/(c+d x))))^m))) Subst[∫(x^m) (((A+B Log[e (x^n)]))^p)dx,x,((a+b x)/(c+d x))]

Program code:

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*((a_.+b_.*x_)/(c_.+d_.*x_))^n_.])^p_.,x_Symbol] :=
  d^2*(g*(a+b*x)/b)^m/(i^2*(b*c-a*d)*(i*(c+d*x)/d)^m*((a+b*x)/(c+d*x))^m)*
    Subst[Int[x^m*(A+B*Log[e*x^n])^p,x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,m,n,p,q},x] && NeQ[b*c-a*d,0] && EqQ[b*f-a*g,0] && EqQ[d*h-c*i,0] && EqQ[m+q+2,0]

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  d^2*(g*(a+b*x)/b)^m/(i^2*(b*c-a*d)*(i*(c+d*x)/d)^m*((a+b*x)/(c+d*x))^m)*
    Subst[Int[x^m*(A+B*Log[e*x^n])^p,x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,m,n,p,q},x] && EqQ[n+mn,0] && IGtQ[n,0] && NeQ[b*c-a*d,0] && EqQ[b*f-a*g,0] && EqQ[d*h-c*i,0] && EqQ[m+q+2,0]

(* Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  b*d*(f+g*x)^(m+1)/(g*i*(b*c-a*d)*(h+i*x)^(m+1)*((a+b*x)/(c+d*x))^(m+1))*
    Subst[Int[x^m*(A+B*Log[e*x^n])^p,x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,m,n,p,q},x] && EqQ[n+mn,0] && NeQ[b*c-a*d,0] && EqQ[b*f-a*g,0] && EqQ[d*h-c*i,0] && EqQ[m+q+2,0] *)

2:  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b c-a d≠0 ∧ (m|q)∈ℤ ∧ p∈(SuperPlus[ℤ])∧ d h-c i==0

Derivation: Integration by substitution

Basis: F[x,((a+b x)/(c+d x))]==(b c-a d) Subst[((F[-((a-c x)/(b-d x)),x])/(((b-d x))^2)),x,((a+b x)/(c+d x))] (∂_x)((a+b x)/(c+d x))

Rule: If  b c-a d≠0 ∧ (m|q)∈ℤ ∧ p∈(SuperPlus[ℤ])∧ d h-c i==0, then

∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  ⟶  
(((b c-a d))^(q+1)) ((((i/d)))^q) Subst[∫(((((b f-a g-(d f-c g) x))^m) (((A+B Log[e (x^n)]))^p))/(((b-d x))^(m+q+2)))dx,x,((a+b x)/(c+d x))]

Program code:

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*((a_.+b_.*x_)/(c_.+d_.*x_))^n_.])^p_.,x_Symbol] :=
  (b*c-a*d)^(q+1)*(i/d)^q*Subst[Int[(b*f-a*g-(d*f-c*g)*x)^m*(A+B*Log[e*x^n])^p/(b-d*x)^(m+q+2),x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,n},x] && NeQ[b*c-a*d,0] && IntegersQ[m,q] && IGtQ[p,0] && EqQ[d*h-c*i,0]

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  (b*c-a*d)^(q+1)*(i/d)^q*Subst[Int[(b*f-a*g-(d*f-c*g)*x)^m*(A+B*Log[e*x^n])^p/(b-d*x)^(m+q+2),x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,n},x] && EqQ[n+mn,0] && IGtQ[n,0] && NeQ[b*c-a*d,0] && IntegersQ[m,q] && IGtQ[p,0] && EqQ[d*h-c*i,0]

3:  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b c-a d≠0 ∧ (m|q)∈ℤ ∧ p∈(SuperPlus[ℤ])

Derivation: Integration by substitution

Basis: F[x,((a+b x)/(c+d x))]==(b c-a d) Subst[((F[-((a-c x)/(b-d x)),x])/(((b-d x))^2)),x,((a+b x)/(c+d x))] (∂_x)((a+b x)/(c+d x))

Rule: If  b c-a d≠0 ∧ (m|q)∈ℤ ∧ p∈(SuperPlus[ℤ]), then

∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  ⟶  
(b c-a d) Subst[∫(((((b f-a g-(d f-c g) x))^m) (((b h-a i-(d h-c i) x))^q) (((A+B Log[e (x^n)]))^p))/(((b-d x))^(m+q+2)))dx,x,((a+b x)/(c+d x))]

Program code:

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*((a_.+b_.*x_)/(c_.+d_.*x_))^n_.])^p_.,x_Symbol] :=
  (b*c-a*d)*Subst[Int[(b*f-a*g-(d*f-c*g)*x)^m*(b*h-a*i-(d*h-c*i)*x)^q*(A+B*Log[e*x^n])^p/(b-d*x)^(m+q+2),x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,n},x] && NeQ[b*c-a*d,0] && IntegersQ[m,q] && IGtQ[p,0]

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  (b*c-a*d)*Subst[Int[(b*f-a*g-(d*f-c*g)*x)^m*(b*h-a*i-(d*h-c*i)*x)^q*(A+B*Log[e*x^n])^p/(b-d*x)^(m+q+2),x],x,(a+b*x)/(c+d*x)] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,n},x] && EqQ[n+mn,0] && IGtQ[n,0] && NeQ[b*c-a*d,0] && IntegersQ[m,q] && IGtQ[p,0]

U:  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx

Rule:

∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  ⟶  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx

Program code:

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*((a_.+b_.*x_)/(c_.+d_.*x_))^n_.])^p_.,x_Symbol] :=
  Unintegrable[(f+g*x)^m*(h+i*x)^q*(A+B*Log[e*((a+b*x)/(c+d*x))^n])^p,x] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,m,n,p,q},x]

Int[(f_.+g_.*x_)^m_.*(h_.+i_.*x_)^q_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  Unintegrable[(f+g*x)^m*(h+i*x)^q*(A+B*Log[e*(a+b*x)^n/(c+d*x)^n])^p,x] /;
FreeQ[{a,b,c,d,e,f,g,h,i,A,B,m,n,p,q},x] && EqQ[n+mn,0] && IntegerQ[n]

N:  ∫(w^m) (y^q) (((A+B Log[e ((((u/v)))^n)]))^p)dx  when  u==a+b x ∧ v==c+d x ∧ w==f+g x ∧ y==h+i x

Derivation: Algebraic normalization

Rule: If  u==a+b x ∧ v==c+d x ∧ w==f+g x ∧ y==h+i x, then

∫(w^m) (y^q) (((A+B Log[e ((((u/v)))^n)]))^p)dx  ⟶  ∫(((f+g x))^m) (((h+i x))^q) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx

Program code:

Int[w_^m_.*y_^q_.*(A_.+B_.*Log[e_.*(u_/v_)^n_.])^p_.,x_Symbol] :=
  Int[ExpandToSum[w,x]^m*ExpandToSum[y,x]^q*(A+B*Log[e*(ExpandToSum[u,x]/ExpandToSum[v,x])^n])^p,x] /;
FreeQ[{e,A,B,m,n,p,q},x] && LinearQ[{u,v,w,y},x] && Not[LinearMatchQ[{u,v,w,y},x]]

Int[w_^m_.*y_^q_.*(A_.+B_.*Log[e_.*u_^n_.*v_^mn_])^p_.,x_Symbol] :=
  Int[ExpandToSum[w,x]^m*ExpandToSum[y,x]^q*(A+B*Log[e*ExpandToSum[u,x]^n/ExpandToSum[v,x]^n])^p,x] /;
FreeQ[{e,A,B,m,n,p,q},x] && EqQ[n+mn,0] && IGtQ[n,0] && LinearQ[{u,v,w,y},x] && Not[LinearMatchQ[{u,v,w,y},x]]

S:  ∫w (((A+B Log[e ((u^n)/(v^n))]))^p)dx  when  u==a+b x ∧ v==c+d x ∧ n∉ℤ

Derivation: Integration by substitution

Basis: (∂_x)Log[e (((u[x])^n)/((v[x])^n))]==(∂_x)Log[e (((((u[x])/(v[x]))))^n)]

Rule: If  u==a+b x ∧ v==c+d x ∧ n∉ℤ, then

∫w (((A+B Log[e ((u^n)/(v^n))]))^p)dx  ⟶  Subst[∫w (((A+B Log[e ((((u/v)))^n)]))^p)dx,e ((((u/v)))^n),e ((u^n)/(v^n))]

Program code:

Int[w_.*(A_.+B_.*Log[e_.*u_^n_.*v_^mn_])^p_.,x_Symbol] :=
  Subst[Int[w*(A+B*Log[e*(u/v)^n])^p,x],e*(u/v)^n,e*u^n/v^n] /;
FreeQ[{e,A,B,n,p},x] && EqQ[n+mn,0] && LinearQ[{u,v},x] && Not[IntegerQ[n]]

(* Int[w_.*(A_.+B_.*Log[e_.*(f_.*u_^q_.*v_^mq_)^n_.])^p_.,x_Symbol] :=
  Subst[Int[w*(A+B*Log[e*f^n*(u/v)^(n*q)])^p,x],e*f^n*(u/v)^(n*q),e*(f*(u^q/v^q))^n] /;
FreeQ[{e,f,A,B,n,p,q},x] && EqQ[q+mq,0] && LinearQ[{u,v},x] && Not[IntegerQ[n]] *)

Rules for integrands of the form (((f+g x+h (x^2)))^m) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)

1:  ∫(((f+g x+h (x^2)))^m) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b d f-a c h==0 ∧ b d g-h (b c+a d)==0 ∧ m∈ℤ

Derivation: Algebraic simplification

Basis: If  b d f-a c h==0 ∧ b d g-h (b c+a d)==0, then f+g x+h (x^2)==(h/(b d)) (a+b x) (c+d x)

Rule: If  b d f-a c h==0 ∧ b d g-h (b c+a d)==0 ∧ m∈ℤ, then

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

Program code:

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

Int[(f_.+g_.*x_+h_.*x_^2)^m_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  h^m/(b^m*d^m)*Int[(a+b*x)^m*(c+d*x)^m*(A+B*Log[e*(a+b*x)^n/(c+d*x)^n])^p,x] /;
FreeQ[{a,b,c,d,e,f,g,h,A,B,n,p},x] && EqQ[n+mn,0] && IGtQ[n,0] && EqQ[b*d*f-a*c*h,0] && EqQ[b*d*g-h*(b*c+a*d),0] && IntegerQ[m]

2:  ∫(((f+g x+h (x^2)))^m) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  when  b c-a d≠0 ∧ m∈ℤ ∧ p∈(SuperPlus[ℤ])

Derivation: Integration by substitution

Basis: F[x,((a+b x)/(c+d x))]==(b c-a d) Subst[((F[-((a-c x)/(b-d x)),x])/(((b-d x))^2)),x,((a+b x)/(c+d x))] (∂_x)((a+b x)/(c+d x))

Rule: If  b c-a d≠0 ∧ m∈ℤ ∧ p∈(SuperPlus[ℤ]), then

∫(((f+g x+h (x^2)))^m) (((A+B Log[e (((((a+b x)/(c+d x))))^n)]))^p)dx  ⟶  
(b c-a d) Subst[∫((((((b^2) f-a b g+(a^2) h-(2 b d f-b c g-a d g+2 a c h) x+((d^2) f-c d g+(c^2) h) (x^2)))^m) (((A+B Log[e (x^n)]))^p))/(((b-d x))^(2 (m+1))))dx,x,((a+b x)/(c+d x))]

Program code:

Int[P2x_^m_.*(A_.+B_.*Log[e_.*((a_.+b_.*x_)/(c_.+d_.*x_))^n_.])^p_.,x_Symbol] :=
  With[{f=Coeff[P2x,x,0],g=Coeff[P2x,x,1],h=Coeff[P2x,x,2]},
  (b*c-a*d)*
    Subst[Int[(b^2*f-a*b*g+a^2*h-(2*b*d*f-b*c*g-a*d*g+2*a*c*h)*x+(d^2*f-c*d*g+c^2*h)*x^2)^m*(A+B*Log[e*x^n])^p/
      (b-d*x)^(2*(m+1)),x],x,(a+b*x)/(c+d*x)]] /;
FreeQ[{a,b,c,d,e,A,B,n},x] && PolyQ[P2x,x,2] && NeQ[b*c-a*d,0] && IntegerQ[m] && IGtQ[p,0]

Int[P2x_^m_.*(A_.+B_.*Log[e_.*(a_.+b_.*x_)^n_.*(c_.+d_.*x_)^mn_])^p_.,x_Symbol] :=
  With[{f=Coeff[P2x,x,0],g=Coeff[P2x,x,1],h=Coeff[P2x,x,2]},
  (b*c-a*d)*
    Subst[Int[(b^2*f-a*b*g+a^2*h-(2*b*d*f-b*c*g-a*d*g+2*a*c*h)*x+(d^2*f-c*d*g+c^2*h)*x^2)^m*(A+B*Log[e*x^n])^p/
      (b-d*x)^(2*(m+1)),x],x,(a+b*x)/(c+d*x)]] /;
FreeQ[{a,b,c,d,e,A,B,n},x] && PolyQ[P2x,x,2] && EqQ[n+mn,0] && IGtQ[n,0] && NeQ[b*c-a*d,0] && IntegerQ[m] && IGtQ[p,0]