Rules for integrands of the form (((a+b Sec[e+f x]))^m) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))

1:  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  A (b^2)-a b B+(a^2) C==0

Derivation: Algebraic simplification

Basis:  If  A (b^2)-a b B+(a^2) C==0, then A+B z+C (z^2)==(1/(b^2))(a+b z)(b B-a C+b C z)

Rule: If  (a^2)-(b^2)≠0 ∧ A (b^2)-a b B+(a^2) C==0, then

∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  (1/(b^2)) ∫(((a+b Sec[e+f x]))^(m+1))(b B-a C+b C Sec[e+f x])dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])^m_.*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  1/b^2*Int[(a+b*Csc[e+f*x])^(m+1)*Simp[b*B-a*C+b*C*Csc[e+f*x],x],x] /;
FreeQ[{a,b,e,f,A,B,C,m},x] && EqQ[A*b^2-a*b*B+a^2*C,0]

Int[(a_+b_.*csc[e_.+f_.*x_])^m_.*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  C/b^2*Int[(a+b*Csc[e+f*x])^(m+1)*Simp[-a+b*Csc[e+f*x],x],x] /;
FreeQ[{a,b,e,f,A,C,m},x] && EqQ[A*b^2+a^2*C,0]

2.  ∫(((b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx

1.  ∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx

1:  ∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  when  C m+A (m+1)==0

Derivation: Cosecant recurrence 1b with a->0,B->0,C->-((A (n+1))/n),m->0

Derivation: Cosecant recurrence 3a with a->0,B->0,C->-((A (n+1))/n),m->0

Rule: If  C m+A (m+1)==0, then

∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  ⟶  -((A Tan[e+f x](((b Sec[e+f x]))^m))/(f m))

Program code:

Int[(b_.*csc[e_.+f_.*x_])^m_.*(A_+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  A*Cot[e+f*x]*(b*Csc[e+f*x])^m/(f*m) /;
FreeQ[{b,e,f,A,C,m},x] && EqQ[C*m+A*(m+1),0]

2.  ∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  when  C m+A (m+1)≠0

1.  ∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  when  C m+A (m+1)≠0 ∧ m≤-1

1:  ∫((Sec[e+f x])^m) (A+C ((Sec[e+f x])^2))dx  when  C m+A (m+1)≠0 ∧ ((m+1)/2)∈(SuperMinus[ℤ])

Derivation: Algebraic simplification

Basis: If  m∈ℤ, then ((Sec[z])^m) (A+C ((Sec[z])^2))==((C+A ((Cos[z])^2))/((Cos[z])^(m+2)))

Rule: If  C m+A (m+1)≠0 ∧ ((m+1)/2)∈(SuperMinus[ℤ]), then

∫((Sec[e+f x])^m) (A+C ((Sec[e+f x])^2))dx  ⟶  ∫((C+A ((Cos[e+f x])^2))/((Cos[e+f x])^(m+2)))dx

Program code:

Int[csc[e_.+f_.*x_]^m_.*(A_+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  Int[(C+A*Sin[e+f*x]^2)/Sin[e+f*x]^(m+2),x] /;
FreeQ[{e,f,A,C},x] && NeQ[C*m+A*(m+1),0] && ILtQ[(m+1)/2,0]

2:  ∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  when  C m+A (m+1)≠0 ∧ m≤-1

Derivation: ???

Rule: If  C m+A (m+1)≠0 ∧ m≤-1, then

∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  ⟶  -((A Tan[e+f x](((b Sec[e+f x]))^m))/(f m))+((C m+A (m+1))/((b^2)m))∫(((b Sec[e+f x]))^(m+2))dx

Program code:

Int[(b_.*csc[e_.+f_.*x_])^m_.*(A_+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  A*Cot[e+f*x]*(b*Csc[e+f*x])^m/(f*m) + 
  (C*m+A*(m+1))/(b^2*m)*Int[(b*Csc[e+f*x])^(m+2),x] /;
FreeQ[{b,e,f,A,C},x] && NeQ[C*m+A*(m+1),0] && LeQ[m,-1]

2:  ∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  when  C m+A (m+1)≠0 ∧ m≰-1

Derivation: Cosecant recurrence 1b with a->0,B->0,m->0

Derivation: Cosecant recurrence 3a with a->0,B->0,m->0

Rule: If  C m+A (m+1)≠0 ∧ m≰-1, then

∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx  ⟶  ((C Tan[e+f x](((b Sec[e+f x]))^m))/(f (m+1)))+((C m+A (m+1))/(m+1))∫(((b Sec[e+f x]))^m)dx

Program code:

Int[(b_.*csc[e_.+f_.*x_])^m_.*(A_+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -C*Cot[e+f*x]*(b*Csc[e+f*x])^m/(f*(m+1)) + 
  (C*m+A*(m+1))/(m+1)*Int[(b*Csc[e+f*x])^m,x] /;
FreeQ[{b,e,f,A,C,m},x] && NeQ[C*m+A*(m+1),0] && Not[LeQ[m,-1]]

2:  ∫(((b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx

Derivation: Algebraic expansion

Rule:

∫(((b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  (B/b)∫(((b Sec[e+f x]))^(m+1))dx+∫(((b Sec[e+f x]))^m)(A+C ((Sec[e+f x])^2))dx

Program code:

Int[(b_.*csc[e_.+f_.*x_])^m_.*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  B/b*Int[(b*Csc[e+f*x])^(m+1),x] + Int[(b*Csc[e+f*x])^m*(A+C*Csc[e+f*x]^2),x] /;
FreeQ[{b,e,f,A,B,C,m},x]

3:  ∫(a+b Sec[e+f x])(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx

Derivation: Algebraic expansion, nondegenerate secant recurrence 1b with c->0,d->1,A->a c,B->b c+a d,C->b d,m->m+1,n->0,p->0 and algebraic simplification

Basis: A+B z+C (z^2)==((C (((d z))^2))/(d^2))+A+B z

Rule:

∫(a+b Sec[e+f x])(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  

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

((b C Sec[e+f x] Tan[e+f x])/(2 f))+(1/2)∫(2A a+(2B a+b (2 A+C)) Sec[e+f x]+2(a C+B b) ((Sec[e+f x])^2))dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -b*C*Csc[e+f*x]*Cot[e+f*x]/(2*f) + 
  1/2*Int[Simp[2*A*a+(2*B*a+b*(2*A+C))*Csc[e+f*x]+2*(a*C+B*b)*Csc[e+f*x]^2,x],x] /;
FreeQ[{a,b,e,f,A,B,C},x]

Int[(a_+b_.*csc[e_.+f_.*x_])*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -b*C*Csc[e+f*x]*Cot[e+f*x]/(2*f) + 
  1/2*Int[Simp[2*A*a+b*(2*A+C)*Csc[e+f*x]+2*a*C*Csc[e+f*x]^2,x],x] /;
FreeQ[{a,b,e,f,A,C},x]

4:  ∫((A+B Sec[e+f x]+C ((Sec[e+f x])^2))/(a+b Sec[e+f x]))dx

Derivation: Algebraic expansion

Basis: ((A+B z+C (z^2))/(a+b z))==((C z)/b)+((A b+(b B-a C) z)/(b (a+b z)))

Rule:

∫((A+B Sec[e+f x]+C ((Sec[e+f x])^2))/(a+b Sec[e+f x]))dx  ⟶  (C/b)∫Sec[e+f x]dx+(1/b)∫((A b+(b B-a C) Sec[e+f x])/(a+b Sec[e+f x]))dx

Program code:

Int[(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2)/(a_+b_.*csc[e_.+f_.*x_]),x_Symbol] :=
  C/b*Int[Csc[e+f*x],x] + 1/b*Int[(A*b+(b*B-a*C)*Csc[e+f*x])/(a+b*Csc[e+f*x]),x] /;
FreeQ[{a,b,e,f,A,B,C},x]

Int[(A_.+C_.*csc[e_.+f_.*x_]^2)/(a_+b_.*csc[e_.+f_.*x_]),x_Symbol] :=
  C/b*Int[Csc[e+f*x],x] + 1/b*Int[(A*b-a*C*Csc[e+f*x])/(a+b*Csc[e+f*x]),x] /;
FreeQ[{a,b,e,f,A,C},x]

5.  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)==0

1:  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)==0 ∧ m<-(1/2)

Derivation: Algebraic expansion, singly degenerate secant recurrence 2b with A->1,B->0,p->0 and algebraic simplification

Basis: If  (a^2)-(b^2)==0, then A+B z+C (z^2)==((a A-b B+a C)/a)+(((a+b z)(b B-a C+b C z))/(b^2))

Rule: If  (a^2)-(b^2)==0 ∧ m<-(1/2), then

∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  

((a A-b B+a C)/a)∫(((a+b Sec[e+f x]))^m) dx+(1/(b^2))∫(((a+b Sec[e+f x]))^(m+1))(b B-a C+b C Sec[e+f x])dx   ⟶  

(((a A-b B+a C) Tan[e+f x] (((a+b Sec[e+f x]))^m))/(a f (2 m+1)))+
(1/(a b (2 m+1)))∫(((a+b Sec[e+f x]))^(m+1))(A b (2 m+1)+(b B (m+1)-a (A (m+1)-C m)) Sec[e+f x])dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])^m_*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -(a*A-b*B+a*C)*Cot[e+f*x]*(a+b*Csc[e+f*x])^m/(a*f*(2*m+1)) + 
  1/(a*b*(2*m+1))*Int[(a+b*Csc[e+f*x])^(m+1)*Simp[A*b*(2*m+1)+(b*B*(m+1)-a*(A*(m+1)-C*m))*Csc[e+f*x],x],x] /;
FreeQ[{a,b,e,f,A,B,C},x] && EqQ[a^2-b^2,0] && LtQ[m,-1/2]

Int[(a_+b_.*csc[e_.+f_.*x_])^m_*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -a*(A+C)*Cot[e+f*x]*(a+b*Csc[e+f*x])^m/(a*f*(2*m+1)) + 
  1/(a*b*(2*m+1))*Int[(a+b*Csc[e+f*x])^(m+1)*Simp[A*b*(2*m+1)-a*(A*(m+1)-C*m)*Csc[e+f*x],x],x] /;
FreeQ[{a,b,e,f,A,C},x] && EqQ[a^2-b^2,0] && LtQ[m,-1/2]

2:  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)==0 ∧ m≮-(1/2)

Derivation: Nondegenerate secant recurrence 1b with p->0 and (a^2)-(b^2)==0

Derivation: Algebraic expansion and singly degenerate secant recurrence 2c with A->c,B->d,n->n+1,p->0

Basis: A+B z+C (z^2)==C (z^2)+A+B z

Rule: If  (a^2)-(b^2)==0 ∧ m≮-(1/2), then

∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  

C∫(((a+b Sec[e+f x]))^m)((Sec[e+f x])^2)dx+∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x])dx   ⟶  

((C Tan[e+f x](((a+b Sec[e+f x]))^m))/(f (m+1)))+(1/(b (m+1)))∫(((a+b Sec[e+f x]))^m)(A b (m+1)+(a C m+b B (m+1)) Sec[e+f x])dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])^m_.*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -C*Cot[e+f*x]*(a+b*Csc[e+f*x])^m/(f*(m+1)) + 
  1/(b*(m+1))*Int[(a+b*Csc[e+f*x])^m*Simp[A*b*(m+1)+(a*C*m+b*B*(m+1))*Csc[e+f*x],x],x] /;
FreeQ[{a,b,e,f,A,B,C,m},x] && EqQ[a^2-b^2,0] && Not[LtQ[m,-1/2]]

Int[(a_+b_.*csc[e_.+f_.*x_])^m_.*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -C*Cot[e+f*x]*(a+b*Csc[e+f*x])^m/(f*(m+1)) + 
  1/(b*(m+1))*Int[(a+b*Csc[e+f*x])^m*Simp[A*b*(m+1)+a*C*m*Csc[e+f*x],x],x] /;
FreeQ[{a,b,e,f,A,C,m},x] && EqQ[a^2-b^2,0] && Not[LtQ[m,-1/2]]

6.  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)≠0

1.  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)≠0 ∧ 2m∈ℤ

1:  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)≠0 ∧ 2m∈(SuperPlus[ℤ])

Derivation: Nondegenerate secant recurrence 1b with p->0

Rule: If  (a^2)-(b^2)≠0 ∧ m>0, then

∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  
((C Tan[e+f x] (((a+b Sec[e+f x]))^m))/(f (m+1)))+
(1/(m+1))∫(((a+b Sec[e+f x]))^(m-1))(a A (m+1)+((A b+a B) (m+1)+b C m) Sec[e+f x]+(b B (m+1)+a C m) ((Sec[e+f x])^2))dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])^m_.*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -C*Cot[e+f*x]*(a+b*Csc[e+f*x])^m/(f*(m+1)) + 
  1/(m+1)*Int[(a+b*Csc[e+f*x])^(m-1)*
    Simp[a*A*(m+1)+((A*b+a*B)*(m+1)+b*C*m)*Csc[e+f*x]+(b*B*(m+1)+a*C*m)*Csc[e+f*x]^2,x],x] /;
FreeQ[{a,b,e,f,A,B,C},x] && NeQ[a^2-b^2,0] && IGtQ[2*m,0]

Int[(a_+b_.*csc[e_.+f_.*x_])^m_.*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  -C*Cot[e+f*x]*(a+b*Csc[e+f*x])^m/(f*(m+1)) + 
  1/(m+1)*Int[(a+b*Csc[e+f*x])^(m-1)*Simp[a*A*(m+1)+(A*b*(m+1)+b*C*m)*Csc[e+f*x]+a*C*m*Csc[e+f*x]^2,x],x] /;
FreeQ[{a,b,e,f,A,C},x] && NeQ[a^2-b^2,0] && IGtQ[2*m,0]

2.  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)≠0 ∧ 2m∈(SuperMinus[ℤ])

1:  ∫((A+B Sec[e+f x]+C ((Sec[e+f x])^2))/(Sqrt[a+b Sec[e+f x]]))dx  when  (a^2)-(b^2)≠0

Derivation: Algebraic expansion

Basis: A+B z+C (z^2)==A+(B-C)z+C z(1+z)

Rule: If  (a^2)-(b^2)≠0, then

∫((A+B Sec[e+f x]+C ((Sec[e+f x])^2))/(Sqrt[a+b Sec[e+f x]]))dx  ⟶  ∫((A+(B-C) Sec[e+f x])/(Sqrt[a+b Sec[e+f x]]))dx+C ∫((Sec[e+f x] (1+Sec[e+f x]))/(Sqrt[a+b Sec[e+f x]]))dx

Program code:

Int[(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2)/Sqrt[a_+b_.*csc[e_.+f_.*x_]],x_Symbol] :=
  Int[(A+(B-C)*Csc[e+f*x])/Sqrt[a+b*Csc[e+f*x]],x] + C*Int[Csc[e+f*x]*(1+Csc[e+f*x])/Sqrt[a+b*Csc[e+f*x]],x] /;
FreeQ[{a,b,e,f,A,B,C},x] && NeQ[a^2-b^2,0]

Int[(A_.+C_.*csc[e_.+f_.*x_]^2)/Sqrt[a_+b_.*csc[e_.+f_.*x_]],x_Symbol] :=
  Int[(A-C*Csc[e+f*x])/Sqrt[a+b*Csc[e+f*x]],x] + C*Int[Csc[e+f*x]*(1+Csc[e+f*x])/Sqrt[a+b*Csc[e+f*x]],x] /;
FreeQ[{a,b,e,f,A,C},x] && NeQ[a^2-b^2,0]

2:  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)≠0 ∧ 2m∈ℤ ∧ m<-1

Derivation: Nondegenerate secant recurrence 1c with p->0

Rule: If  (a^2)-(b^2)≠0 ∧ 2m∈ℤ ∧ m<-1, then

∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  
-(((A (b^2)-a b B+(a^2) C) Tan[e+f x] (((a+b Sec[e+f x]))^(m+1)))/(a f (m+1) ((a^2)-(b^2))))+
(1/(a (m+1) ((a^2)-(b^2))))∫(((a+b Sec[e+f x]))^(m+1))·
(A ((a^2)-(b^2)) (m+1)-a (A b-a B+b C) (m+1) Sec[e+f x]+(A (b^2)-a b B+(a^2) C) (m+2) ((Sec[e+f x])^2))dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])^m_*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  (A*b^2-a*b*B+a^2*C)*Cot[e+f*x]*(a+b*Csc[e+f*x])^(m+1)/(a*f*(m+1)*(a^2-b^2)) + 
  1/(a*(m+1)*(a^2-b^2))*Int[(a+b*Csc[e+f*x])^(m+1)*
    Simp[A*(a^2-b^2)*(m+1)-a*(A*b-a*B+b*C)*(m+1)*Csc[e+f*x]+(A*b^2-a*b*B+a^2*C)*(m+2)*Csc[e+f*x]^2,x],x] /;
FreeQ[{a,b,e,f,A,B,C},x] && NeQ[a^2-b^2,0] && LtQ[m,-1]

Int[(a_+b_.*csc[e_.+f_.*x_])^m_*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  (A*b^2+a^2*C)*Cot[e+f*x]*(a+b*Csc[e+f*x])^(m+1)/(a*f*(m+1)*(a^2-b^2)) + 
  1/(a*(m+1)*(a^2-b^2))*Int[(a+b*Csc[e+f*x])^(m+1)*
    Simp[A*(a^2-b^2)*(m+1)-a*b*(A+C)*(m+1)*Csc[e+f*x]+(A*b^2+a^2*C)*(m+2)*Csc[e+f*x]^2,x],x] /;
FreeQ[{a,b,e,f,A,C},x] && NeQ[a^2-b^2,0] && IntegerQ[2*m] && LtQ[m,-1]

2:  ∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  (a^2)-(b^2)≠0 ∧ 2m∉ℤ

Derivation: Algebraic expansion

Basis: A+B z+C (z^2)==((A b+(b B-a C) z)/b)+((C z (a+b z))/b)

Rule: If  (a^2)-(b^2)≠0 ∧ 2m∉ℤ, then

∫(((a+b Sec[e+f x]))^m)(A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  
(1/b)∫(((a+b Sec[e+f x]))^m)(A b+(b B-a C) Sec[e+f x])dx+(C/b)∫Sec[e+f x] (((a+b Sec[e+f x]))^(m+1))dx

Program code:

Int[(a_+b_.*csc[e_.+f_.*x_])^m_*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  1/b*Int[(a+b*Csc[e+f*x])^m*(A*b+(b*B-a*C)*Csc[e+f*x]),x] + C/b*Int[Csc[e+f*x]*(a+b*Csc[e+f*x])^(m+1),x] /;
FreeQ[{a,b,e,f,A,B,C,m},x] && NeQ[a^2-b^2,0] && Not[IntegerQ[2*m]]

Int[(a_+b_.*csc[e_.+f_.*x_])^m_*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  1/b*Int[(a+b*Csc[e+f*x])^m*(A*b-a*C*Csc[e+f*x]),x] + C/b*Int[Csc[e+f*x]*(a+b*Csc[e+f*x])^(m+1),x] /;
FreeQ[{a,b,e,f,A,C,m},x] && NeQ[a^2-b^2,0] && Not[IntegerQ[2*m]]

Rules for integrands of the form (((a (((b Sec[e+f x]))^p)))^m) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))

1:  ∫(((b Cos[e+f x]))^m) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  m∉ℤ

Derivation: Algebraic normalization

Basis: A+B Sec[z]+C ((Sec[z])^2)==(((b^2) (C+B Cos[z]+A ((Cos[z])^2)))/(((b Cos[z]))^2))

Rule: If  m∉ℤ, then

∫(((b Cos[e+f x]))^m) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  (b^2)∫(((b Cos[e+f x]))^(m-2)) (C+B Cos[e+f x]+A ((Cos[e+f x])^2))dx

Program code:

Int[(b_.*cos[e_.+f_.*x_])^m_*(A_.+B_.*sec[e_.+f_.*x_]+C_.*sec[e_.+f_.*x_]^2),x_Symbol] :=
  b^2*Int[(b*Cos[e+f*x])^(m-2)*(C+B*Cos[e+f*x]+A*Cos[e+f*x]^2),x] /;
FreeQ[{b,e,f,A,B,C,m},x] && Not[IntegerQ[m]]

Int[(b_.*sin[e_.+f_.*x_])^m_*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  b^2*Int[(b*Sin[e+f*x])^(m-2)*(C+B*Sin[e+f*x]+A*Sin[e+f*x]^2),x] /;
FreeQ[{b,e,f,A,B,C,m},x] && Not[IntegerQ[m]]

Int[(b_.*cos[e_.+f_.*x_])^m_*(A_.+C_.*sec[e_.+f_.*x_]^2),x_Symbol] :=
  b^2*Int[(b*Cos[e+f*x])^(m-2)*(C+A*Cos[e+f*x]^2),x] /;
FreeQ[{b,e,f,A,C,m},x] && Not[IntegerQ[m]]

Int[(b_.*sin[e_.+f_.*x_])^m_*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  b^2*Int[(b*Sin[e+f*x])^(m-2)*(C+A*Sin[e+f*x]^2),x] /;
FreeQ[{b,e,f,A,C,m},x] && Not[IntegerQ[m]]

2:  ∫(((a (((b Sec[e+f x]))^p)))^m) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  when  m∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((a (((b Sec[e+f x]))^p)))^m)/(((b Sec[e+f x]))^(m p)))==0

Rule: If  m∉ℤ, then

∫(((a (((b Sec[e+f x]))^p)))^m) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx  ⟶  
(((a^(IntPart[m])) (((a (((b Sec[e+f x]))^p)))^(FracPart[m])))/(((b Sec[e+f x]))^(p FracPart[m])))∫(((b Sec[e+f x]))^(m p)) (A+B Sec[e+f x]+C ((Sec[e+f x])^2))dx

Program code:

Int[(a_.*(b_.*sec[e_.+f_.*x_])^p_)^m_*(A_.+B_.*sec[e_.+f_.*x_]+C_.*sec[e_.+f_.*x_]^2),x_Symbol] :=
  a^IntPart[m]*(a*(b*Sec[e+f*x])^p)^FracPart[m]/(b*Sec[e+f*x])^(p*FracPart[m])*
    Int[(b*Sec[e+f*x])^(m*p)*(A+B*Sec[e+f*x]+C*Sec[e+f*x]^2),x] /;
FreeQ[{a,b,e,f,A,B,C,m,p},x] && Not[IntegerQ[m]]

Int[(a_.*(b_.*csc[e_.+f_.*x_])^p_)^m_*(A_.+B_.*csc[e_.+f_.*x_]+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  a^IntPart[m]*(a*(b*Csc[e+f*x])^p)^FracPart[m]/(b*Csc[e+f*x])^(p*FracPart[m])*
    Int[(b*Csc[e+f*x])^(m*p)*(A+B*Csc[e+f*x]+C*Csc[e+f*x]^2),x] /;
FreeQ[{a,b,e,f,A,B,C,m,p},x] && Not[IntegerQ[m]]

Int[(a_.*(b_.*sec[e_.+f_.*x_])^p_)^m_*(A_.+C_.*sec[e_.+f_.*x_]^2),x_Symbol] :=
  a^IntPart[m]*(a*(b*Sec[e+f*x])^p)^FracPart[m]/(b*Sec[e+f*x])^(p*FracPart[m])*
    Int[(b*Sec[e+f*x])^(m*p)*(A+C*Sec[e+f*x]^2),x] /;
FreeQ[{a,b,e,f,A,C,m,p},x] && Not[IntegerQ[m]]

Int[(a_.*(b_.*csc[e_.+f_.*x_])^p_)^m_*(A_.+C_.*csc[e_.+f_.*x_]^2),x_Symbol] :=
  a^IntPart[m]*(a*(b*Csc[e+f*x])^p)^FracPart[m]/(b*Csc[e+f*x])^(p*FracPart[m])*
    Int[(b*Csc[e+f*x])^(m*p)*(A+C*Csc[e+f*x]^2),x] /;
FreeQ[{a,b,e,f,A,C,m,p},x] && Not[IntegerQ[m]]