Rules for integrands of the form (((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)

1:  ∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  when  m∈ℤ

Derivation: Algebraic normalization

Basis: If  m∈ℤ, then (((a+b Sec[z]))^m)==((((b+a Cos[z]))^m)/((Cos[z])^m))

Rule: If  m∈ℤ, then

∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  ⟶  ∫(((((g Sin[e+f x]))^p) (((b+a Cos[e+f x]))^m))/((Cos[e+f x])^m))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_.*(a_+b_.*csc[e_.+f_.*x_])^m_.,x_Symbol] :=
  Int[(g*Cos[e+f*x])^p*(b+a*Sin[e+f*x])^m/Sin[e+f*x]^m,x] /;
FreeQ[{a,b,e,f,g,p},x] && IntegerQ[m]

2.  ∫((Sin[e+f x])^p)(((a+b Sec[e+f x]))^m)dx  when ((p-1)/2)∈ℤ

1:  ∫((Sin[e+f x])^p)(((a+b Sec[e+f x]))^m)dx  when ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0

Derivation: Integration by substitution

Basis: If ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0, then ((Sin[e+f x])^p)==(1/(f (b^(p-1))))Subst[(((((-a+b x))^((p-1)/2)) (((a+b x))^((p-1)/2)))/(x^(p+1))),x,Sec[e+f x]] (∂_x)Sec[e+f x]

Rule: If ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0, then

∫((Sin[e+f x])^p)(((a+b Sec[e+f x]))^m)dx  ⟶ (1/(f (b^(p-1)))) Subst[∫(((((-a+b x))^((p-1)/2)) (((a+b x))^(m+((p-1)/2))))/(x^(p+1)))dx,x,Sec[e+f x]]

Program code:

Int[cos[e_.+f_.*x_]^p_.*(a_+b_.*csc[e_.+f_.*x_])^m_,x_Symbol] :=
  -1/(f*b^(p-1))*Subst[Int[(-a+b*x)^((p-1)/2)*(a+b*x)^(m+(p-1)/2)/x^(p+1),x],x,Csc[e+f*x]] /;
FreeQ[{a,b,e,f,m},x] && IntegerQ[(p-1)/2] && EqQ[a^2-b^2,0]

2:  ∫((Sin[e+f x])^p)(((a+b Sec[e+f x]))^m)dx  when ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)≠0

Derivation: Integration by substitution

Basis: If ((p-1)/2)∈ℤ, then ((Sin[e+f x])^p)==(1/f)Subst[(((((-1+x))^((p-1)/2)) (((1+x))^((p-1)/2)))/(x^(p+1))),x,Sec[e+f x]] (∂_x)Sec[e+f x]

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

∫((Sin[e+f x])^p)(((a+b Sec[e+f x]))^m)dx  ⟶ (1/f) Subst[∫(((((-1+ x))^((p-1)/2))(((1+ x))^((p-1)/2))(((a+b x))^m))/(x^(p+1)))dx,x,Sec[e+f x]]

Program code:

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

3:  ∫((((a+b sec[e+f x]))^m)/((Sin[e+f x])^2))dx

Derivation: Integration by parts

Basis: ∫(1/((Sin[e+f x])^2)) dx==-((Cot[e+f x])/f)

Basis: -((Cot[e+f x])/f) (∂_x)(((a+b Sec[e+f x]))^m)==-b m Sec[e+f x] (((a+b Sec[e+f x]))^(m-1))

Rule:

∫((((a+b sec[e+f x]))^m)/((Sin[e+f x])^2))dx  ⟶  -((Cot[e+f x] (((a+b Sec[e+f x]))^m))/f)+b m ∫Sec[e+f x] (((a+b Sec[e+f x]))^(m-1))dx

Program code:

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

4:  ∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∨ (2 m|p)∈ℤ

Derivation: Piecewise constant extraction

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

Rule: If  (a^2)-(b^2)==0 ∨ (2 m|p)∈ℤ, then

∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  ⟶  ((((Cos[e+f x])^m)(((a+b Sec[e+f x]))^m))/(((b+a Cos[e+f x]))^m))∫(((((g Sin[e+f x]))^p) (((b+a Cos[e+f x]))^m))/((Cos[e+f x])^m))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_.*(a_+b_.*csc[e_.+f_.*x_])^m_,x_Symbol] :=
  Sin[e+f*x]^FracPart[m]*(a+b*Csc[e+f*x])^FracPart[m]/(b+a*Sin[e+f*x])^FracPart[m]*
    Int[(g*Cos[e+f*x])^p*(b+a*Sin[e+f*x])^m/Sin[e+f*x]^m,x] /;
FreeQ[{a,b,e,f,g,m,p},x] && (EqQ[a^2-b^2,0] || IntegersQ[2*m,p])

X:  ∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx

Rule:

∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  ⟶  ∫(((g Sin[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_.*(a_+b_.*csc[e_.+f_.*x_])^m_.,x_Symbol] :=
  Unintegrable[(g*Cos[e+f*x])^p*(a+b*Csc[e+f*x])^m,x] /;
FreeQ[{a,b,e,f,g,m,p},x]

Rules for integrands of the form (((g Csc[e+f x]))^p) (((a+b Sec[e+f x]))^m)

x:  ∫(((g Csc[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  when  p∉ℤ ∧ m∈ℤ

Derivation: Algebraic normalization

Basis: If  m∈ℤ, then (((a+b Sec[z]))^m)==((((b+a Cos[z]))^m)/((Cos[z])^m))

Rule: If  p∉ℤ ∧ m∈ℤ, then

∫(((g Csc[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  ⟶  ∫(((((g Csc[e+f x]))^p) (((b+a Cos[e+f x]))^m))/((Cos[e+f x])^m))dx

Program code:

(* Int[(g_.*sec[e_.+f_.*x_])^p_*(a_+b_.*csc[e_.+f_.*x_])^m_.,x_Symbol] :=
  Int[(g*Sec[e+f*x])^p*(b+a*Sin[e+f*x])^m/Sin[e+f*x]^m,x] /;
FreeQ[{a,b,e,f,g,p},x] && Not[IntegerQ[p]] && IntegerQ[m] *)

1:  ∫(((g Csc[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  when  p∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((g Csc[e+f x]))^p) ((Sin[e+f x])^p))==0

Rule: If  p∉ℤ, then

∫(((g Csc[e+f x]))^p) (((a+b Sec[e+f x]))^m)dx  ⟶  (g^(IntPart[p])) (((g Csc[e+f x]))^(FracPart[p])) ((Sin[e+f x])^(FracPart[p]))∫((((a+b Sec[e+f x]))^m)/((Sin[e+f x])^p))dx

Program code:

Int[(g_.*sec[e_.+f_.*x_])^p_*(a_+b_.*csc[e_.+f_.*x_])^m_.,x_Symbol] :=
  g^IntPart[p]*(g*Sec[e+f*x])^FracPart[p]*Cos[e+f*x]^FracPart[p]*Int[(a+b*Csc[e+f*x])^m/Cos[e+f*x]^p,x] /;
FreeQ[{a,b,e,f,g,m,p},x] && Not[IntegerQ[p]]