Rules for integrands of the form (((a Trg[e+f x]))^m) (((b Tan[e+f x]))^n)

1.  ∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx

1:  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  m+n-1==0

Rule: If  m+n-1==0, then

∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  ⟶  -((b (((a Sin[e+f x]))^m)(((b Tan[e+f x]))^(n-1)))/(f m))

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  -b*(a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n-1)/(f*m) /;
FreeQ[{a,b,e,f,m,n},x] && EqQ[m+n-1,0]

2:  ∫((Sin[e+f x])^m) ((Tan[e+f x])^n)dx  when  (m|n|((m+n-1)/2))∈ℤ

Derivation: Integration by substitution

Basis: If  (m|n|((m+n-1)/2))∈ℤ, then ((Sin[e+f x])^m) ((Tan[e+f x])^n)==-(1/f)Subst[((((1-(x^2)))^((m+n-1)/2))/(x^n)),x,Cos[e+f x]](∂_x)Cos[e+f x]

Rule: If  (m|n|((m+n-1)/2))∈ℤ, then

∫((Sin[e+f x])^m) ((Tan[e+f x])^n)dx  ⟶  -(1/f)Subst[∫((((1-(x^2)))^((m+n-1)/2))/(x^n))dx,x,Cos[e+f x]]

Program code:

Int[sin[e_.+f_.*x_]^m_.*tan[e_.+f_.*x_]^n_.,x_Symbol] :=
  -1/f*Subst[Int[(1-x^2)^((m+n-1)/2)/x^n,x],x,Cos[e+f*x]] /;
FreeQ[{e,f},x] && IntegersQ[m,n,(m+n-1)/2]

3:  ∫((Sin[e+f x])^m) (((b Tan[e+f x]))^n)dx  when  (m/2)∈ℤ

Derivation: Integration by substitution

Basis: ((Sin[z])^2)==(((Tan[z])^2)/(1+((Tan[z])^2)))

Basis: If (m/2)∈ℤ, then ((Sin[e+f x])^m) F[b Tan[e+f x]]==(b/f)Subst[(((x^m) F[x])/((((b^2)+(x^2)))^((m/2)+1))),x,b Tan[e+f x]](∂_x)(b Tan[e+f x])

Rule: If (m/2)∈ℤ, then

∫((Sin[e+f x])^m) (((b Tan[e+f x]))^n)dx  ⟶  (b/f)Subst[∫((x^(m+n))/((((b^2)+(x^2)))^((m/2)+1)))dx,x,b Tan[e+f x]]

Program code:

Int[sin[e_.+f_.*x_]^m_*(b_.*tan[e_.+f_.*x_])^n_.,x_Symbol] :=
  With[{ff=FreeFactors[Tan[e+f*x],x]},
  b*ff/f*Subst[Int[(ff*x)^(m+n)/(b^2+ff^2*x^2)^(m/2+1),x],x,b*Tan[e+f*x]/ff]] /;
FreeQ[{b,e,f,n},x] && IntegerQ[m/2]

4:  ∫(((a Sin[e+f x]))^m) ((Tan[e+f x])^n)dx  when  ((n+1)/2)∈ℤ

Derivation: Integration by substitution

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

Rule: If ((n+1)/2)∈ℤ, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_.*tan[e_.+f_.*x_]^n_.,x_Symbol] :=
  With[{ff=FreeFactors[Sin[e+f*x],x]},
  ff/f*Subst[Int[(ff*x)^(m+n)/(a^2-ff^2*x^2)^((n+1)/2),x],x,a*Sin[e+f*x]/ff]] /;
FreeQ[{a,e,f,m},x] && IntegerQ[(n+1)/2]

5.  ∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n>1

1:  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n>1 ∧ m<-1

Reference: G&R 2.510.6, CRC 334b

Reference: G&R 2.510.3, CRC 334a

Rule: If  n>1 ∧ m<-1, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(a*Sin[e+f*x])^(m+2)*(b*Tan[e+f*x])^(n-1)/(a^2*f*(n-1)) - 
  b^2*(m+2)/(a^2*(n-1))*Int[(a*Sin[e+f*x])^(m+2)*(b*Tan[e+f*x])^(n-2),x] /;
FreeQ[{a,b,e,f},x] && GtQ[n,1] && (LtQ[m,-1] || EqQ[m,-1] && EqQ[n,3/2]) && IntegersQ[2*m,2*n]

2:  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n>1

Reference: G&R 2.510.1

Reference: G&R 2.510.4

Rule: If  n>1, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n-1)/(f*(n-1)) - 
  b^2*(m+n-1)/(n-1)*Int[(a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n-2),x] /;
FreeQ[{a,b,e,f,m},x] && GtQ[n,1] && IntegersQ[2*m,2*n] && Not[GtQ[m,1] && Not[IntegerQ[(m-1)/2]]]

6.  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n<-1

1:  ∫((Sqrt[a Sin[e+f x]])/(((b Tan[e+f x]))^(3/2)))dx

Rule:

∫((Sqrt[a Sin[e+f x]])/(((b Tan[e+f x]))^(3/2)))dx  ⟶  ((2 (Sqrt[a Sin[e+f x]]))/(b f (Sqrt[b Tan[e+f x]])))+((a^2)/(b^2)) ∫((Sqrt[b Tan[e+f x]])/(((a Sin[e+f x]))^(3/2)))dx

Program code:

Int[Sqrt[a_.*sin[e_.+f_.*x_]]/(b_.*tan[e_.+f_.*x_])^(3/2),x_Symbol]:=
  2*Sqrt[a*Sin[e+f*x]]/(b*f*Sqrt[b*Tan[e+f*x]]) + a^2/b^2*Int[Sqrt[b*Tan[e+f*x]]/(a*Sin[e+f*x])^(3/2),x] /;
FreeQ[{a,b,e,f},x]

2:  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n<-1 ∧ m>1

Reference: G&R 2.510.5, CRC 323a

Reference: G&R 2.510.2, CRC 323b

Rule: If  n<-1 ∧ m>1, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  (a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n+1)/(b*f*m) - 
  a^2*(n+1)/(b^2*m)*Int[(a*Sin[e+f*x])^(m-2)*(b*Tan[e+f*x])^(n+2),x] /;
FreeQ[{a,b,e,f},x] && LtQ[n,-1] && GtQ[m,1] && IntegersQ[2*m,2*n]

3:  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n<-1 ∧ m+n+1≠0

Reference: G&R 2.510.4

Reference: G&R 2.510.1

Rule: If  n<-1 ∧ m+n+1≠0, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  (a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n+1)/(b*f*(m+n+1)) - 
  (n+1)/(b^2*(m+n+1))*Int[(a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n+2),x] /;
FreeQ[{a,b,e,f,m},x] && LtQ[n,-1] && NeQ[m+n+1,0] && IntegersQ[2*m,2*n] && Not[EqQ[n,-3/2] && EqQ[m,1]]

7:  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  m>1

Reference: G&R 2.510.2, CRC 323b

Reference: G&R 2.510.5, CRC 323a

Rule: If  m>1, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_.,x_Symbol]:=
  -b*(a*Sin[e+f*x])^m*(b*Tan[e+f*x])^(n-1)/(f*m) + 
  a^2*(m+n-1)/m*Int[(a*Sin[e+f*x])^(m-2)*(b*Tan[e+f*x])^n,x] /;
FreeQ[{a,b,e,f,n},x] && (GtQ[m,1] || EqQ[m,1] && EqQ[n,1/2]) && IntegersQ[2*m,2*n]

8:  ∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  m<-1 ∧ m+n+1≠0

Reference: G&R 2.510.3, CRC 334a

Reference: G&R 2.510.6, CRC 334b

Rule: If  m<-1 ∧ m+n+1≠0, then

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

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_.,x_Symbol]:=
  b*(a*Sin[e+f*x])^(m+2)*(b*Tan[e+f*x])^(n-1)/(a^2*f*(m+n+1)) + 
  (m+2)/(a^2*(m+n+1))*Int[(a*Sin[e+f*x])^(m+2)*(b*Tan[e+f*x])^n,x] /;
FreeQ[{a,b,e,f,n},x] && LtQ[m,-1] && NeQ[m+n+1,0] && IntegersQ[2*m,2*n]

9:  ∫(((a Sin[e+f x]))^m) ((Tan[e+f x])^n)dx  when  n∈ℤ ∧ m∉ℤ

Derivation: Algebraic normalization

Basis: Tan[z]==((Sin[z])/(Cos[z]))

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

∫(((a Sin[e+f x]))^m) ((Tan[e+f x])^n)dx  ⟶  (1/(a^n))∫((((a Sin[e+f x]))^(m+n))/((Cos[e+f x])^n)) dx

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_*tan[e_.+f_.*x_]^n_,x_Symbol]:=
  1/a^n*Int[(a*Sin[e+f*x])^(m+n)/Cos[e+f*x]^n,x] /;
FreeQ[{a,e,f,m},x] && IntegerQ[n] && Not[IntegerQ[m]]

10.  ∫(((a Sin[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n∉ℤ

1:  ∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n∉ℤ ∧ m<0

Derivation: Piecewise constant extraction

Basis: (∂_x)(((((Cos[e+f x]))^n) (((b Tan[e+f x]))^n))/(((a Sin[e+f x]))^n))==0

Rule: If  n∉ℤ ∧ m<0, then

∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx  ⟶  (((((Cos[e+f x]))^n) (((b Tan[e+f x]))^n))/(((a Sin[e+f x]))^n)) ∫((((a Sin[e+f x]))^(m+n))/((Cos[e+f x])^n))dx

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  Cos[e+f*x]^n*(b*Tan[e+f*x])^n/(a*Sin[e+f*x])^n*Int[(a*Sin[e+f*x])^(m+n)/Cos[e+f*x]^n,x] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[n]] && (ILtQ[m,0] || EqQ[m,1] && EqQ[n,-1/2] || IntegersQ[m-1/2,n-1/2])

2:  ∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)(((((Cos[e+f x]))^n) (((b Tan[e+f x]))^n))/(((a Sin[e+f x]))^n))==0

Rule: If  n∉ℤ, then

∫(((a Sin[e+f x]))^m) (((b Tan[e+f x]))^n)dx  ⟶  ((a (((Cos[e+f x]))^(n+1)) (((b Tan[e+f x]))^(n+1)))/(b (((a Sin[e+f x]))^(n+1)))) ∫((((a Sin[e+f x]))^(m+n))/((Cos[e+f x])^n))dx

Program code:

Int[(a_.*sin[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  a*Cos[e+f*x]^(n+1)*(b*Tan[e+f*x])^(n+1)/(b*(a*Sin[e+f*x])^(n+1))*Int[(a*Sin[e+f*x])^(m+n)/Cos[e+f*x]^n,x] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[n]]

2:  ∫(((a Cos[e+f x]))^m) (((b Tan[e+f x]))^n) dx  when  m∉ℤ ∧ n∉ℤ

Derivation: Piecewise constant extraction

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

Rule: If  m∉ℤ ∧ n∉ℤ, then

∫(((a Cos[e+f x]))^m) (((b Tan[e+f x]))^n)dx  ⟶  (((a Cos[e+f x]))^(FracPart[m])) (((((Sec[e+f x])/a)))^(FracPart[m]))∫((((b Tan[e+f x]))^n)/(((((Sec[e+f x])/a)))^m))dx

Program code:

Int[(a_.*cos[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  (a*Cos[e+f*x])^FracPart[m]*(Sec[e+f*x]/a)^FracPart[m]*Int[(b*Tan[e+f*x])^n/(Sec[e+f*x]/a)^m,x] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[m]] && Not[IntegerQ[n]]

3:  ∫(((a Cot[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  m∉ℤ ∧ n∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((a Cot[e+f x]))^m) (((b Tan[e+f x]))^m))==0

Rule: If  m∉ℤ ∧ n∉ℤ, then

∫(((a Cot[e+f x]))^m) (((b Tan[e+f x]))^n)dx  ⟶  (((a Cot[e+f x]))^m) (((b Tan[e+f x]))^m)∫(((b Tan[e+f x]))^(n-m))dx

Program code:

Int[(a_.*cot[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  (a*Cot[e+f*x])^m*(b*Tan[e+f*x])^m*Int[(b*Tan[e+f*x])^(n-m),x] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[m]] && Not[IntegerQ[n]]

4.  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx

1:  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  m+n+1==0

Rule: If  m+n+1==0, then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_.,x_Symbol] :=
  -(a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n+1)/(b*f*m) /;
FreeQ[{a,b,e,f,m,n},x] && EqQ[m+n+1,0]

2:  ∫(((a Sec[e+f x]))^m) ((Tan[e+f x])^n)dx  when  ((n-1)/2)∈ℤ ∧ ¬((m/2)∈ℤ ∧ 0<m<n+1)

Derivation: Integration by substitution

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

Rule: If  ((n-1)/2)∈ℤ ∧ ¬((m/2)∈ℤ ∧ 0<m<n+1), then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_.,x_Symbol] :=
  a/f*Subst[Int[(a*x)^(m-1)*(-1+x^2)^((n-1)/2),x],x,Sec[e+f*x]] /;
FreeQ[{a,e,f,m},x] && IntegerQ[(n-1)/2] && Not[IntegerQ[m/2] && LtQ[0,m,n+1]]

3:  ∫((Sec[e+f x])^m) (((b Tan[e+f x]))^n)dx  when  (m/2)∈ℤ ∧ ¬(((n-1)/2)∈ℤ ∧ 0<n<m-1)

Derivation: Integration by substitution

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

Rule: If  (m/2)∈ℤ ∧ ¬(((n-1)/2)∈ℤ ∧ 0<n<m-1), then

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

Program code:

Int[sec[e_.+f_.*x_]^m_*(b_.*tan[e_.+f_.*x_])^n_.,x_Symbol] :=
  1/f*Subst[Int[(b*x)^n*(1+x^2)^(m/2-1),x],x,Tan[e+f*x]] /;
FreeQ[{b,e,f,n},x] && IntegerQ[m/2] && Not[IntegerQ[(n-1)/2] && LtQ[0,n,m-1]]

4.  ∫(((a Sec[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n<-1

1:  ∫(((a Sec[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n<-1 ∧ (m>1 ∨ m==1 ∧ n==-(3/2))

Reference: G&R 2.510.5, CRC 323a

Reference: G&R 2.510.2, CRC 323b

Rule: If  n<-1 ∧ (m>1 ∨ m==1 ∧ n==-(3/2)), then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  a^2*(a*Sec[e+f*x])^(m-2)*(b*Tan[e+f*x])^(n+1)/(b*f*(n+1)) - 
  a^2*(m-2)/(b^2*(n+1))*Int[(a*Sec[e+f*x])^(m-2)*(b*Tan[e+f*x])^(n+2),x] /;
FreeQ[{a,b,e,f},x] && LtQ[n,-1] && (GtQ[m,1] || EqQ[m,1] && EqQ[n,-3/2]) && IntegersQ[2*m,2*n]

2:  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n<-1

Reference: G&R 2.510.4

Reference: G&R 2.510.1

Rule: If  n<-1, then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  (a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n+1)/(b*f*(n+1)) - 
  (m+n+1)/(b^2*(n+1))*Int[(a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n+2),x] /;
FreeQ[{a,b,e,f,m},x] && LtQ[n,-1] && IntegersQ[2*m,2*n]

5.  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n>1

1:  ∫(((a Sec[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  n>1 ∧ (m<-1 ∨ m==-1 ∧ n==(3/2))

Reference: G&R 2.510.6, CRC 334b

Reference: G&R 2.510.3, CRC 334a

Rule: If  n>1 ∧ (m<-1 ∨ m==-1 ∧ n==(3/2)), then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n-1)/(f*m) - 
  b^2*(n-1)/(a^2*m)*Int[(a*Sec[e+f*x])^(m+2)*(b*Tan[e+f*x])^(n-2),x] /;
FreeQ[{a,b,e,f},x] && GtQ[n,1] && (LtQ[m,-1] || EqQ[m,-1] && EqQ[n,3/2]) && IntegersQ[2*m,2*n]

2:  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n>1 ∧ m+n-1≠0

Reference: G&R 2.510.1

Reference: G&R 2.510.4

Rule: If  n>1 ∧ m+n-1≠0, then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n-1)/(f*(m+n-1)) - 
  b^2*(n-1)/(m+n-1)*Int[(a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n-2),x] /;
FreeQ[{a,b,e,f,m},x] && GtQ[n,1] && NeQ[m+n-1,0] && IntegersQ[2*m,2*n]

6:  ∫(((a Sec[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  m<-1

Reference: G&R 2.510.3, CRC 334a

Reference: G&R 2.510.6, CRC 334b

Rule: If  m<-1, then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  -(a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n+1)/(b*f*m) + 
  (m+n+1)/(a^2*m)*Int[(a*Sec[e+f*x])^(m+2)*(b*Tan[e+f*x])^n,x] /;
FreeQ[{a,b,e,f,n},x] && (LtQ[m,-1] || EqQ[m,-1] && EqQ[n,-1/2]) && IntegersQ[2*m,2*n]

7:  ∫(((a Sec[e+f x]))^m)(((b Tan[e+f x]))^n)dx  when  m>1 ∧ m+n-1≠0

Reference: G&R 2.510.2, CRC 323b

Reference: G&R 2.510.5, CRC 323a

Rule: If  m>1 ∧ m+n-1≠0, then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  a^2*(a*Sec[e+f*x])^(m-2)*(b*Tan[e+f*x])^(n+1)/(b*f*(m+n-1)) + 
  a^2*(m-2)/(m+n-1)*Int[(a*Sec[e+f*x])^(m-2)*(b*Tan[e+f*x])^n,x] /;
FreeQ[{a,b,e,f,n},x] && (GtQ[m,1] || EqQ[m,1] && EqQ[n,1/2]) && NeQ[m+n-1,0] && IntegersQ[2*m,2*n]

8:  ∫((Sec[e+f x])/(Sqrt[b Tan[e+f x]]))dx

Derivation: Piecewise constant extraction

Basis: (∂_x)((Sqrt[Sin[e+f x]])/((Sqrt[Cos[e+f x]]) (Sqrt[b Tan[e+f x]])))==0

Rule:

∫((Sec[e+f x])/(Sqrt[b Tan[e+f x]]))dx  ⟶  ((Sqrt[Sin[e+f x]])/((Sqrt[Cos[e+f x]]) (Sqrt[b Tan[e+f x]]))) ∫(1/((Sqrt[Cos[e+f x]]) (Sqrt[Sin[e+f x]])))dx

Program code:

Int[sec[e_.+f_.*x_]/Sqrt[b_.*tan[e_.+f_.*x_]],x_Symbol]:=
  Sqrt[Sin[e+f*x]]/(Sqrt[Cos[e+f*x]]*Sqrt[b*Tan[e+f*x]])*Int[1/(Sqrt[Cos[e+f*x]]*Sqrt[Sin[e+f*x]]),x] /;
FreeQ[{b,e,f},x]

9:  ∫((Sqrt[b Tan[e+f x]])/(Sec[e+f x]))dx

Derivation: Piecewise constant extraction

Basis: (∂_x)(((Sqrt[Cos[e+f x]]) (Sqrt[b Tan[e+f x]]))/(Sqrt[Sin[e+f x]]))==0

Rule:

∫((Sqrt[b Tan[e+f x]])/(Sec[e+f x]))dx  ⟶  (((Sqrt[Cos[e+f x]]) (Sqrt[b Tan[e+f x]]))/(Sqrt[Sin[e+f x]])) ∫(Sqrt[Cos[e+f x]]) (Sqrt[Sin[e+f x]])dx

Program code:

Int[Sqrt[b_.*tan[e_.+f_.*x_]]/sec[e_.+f_.*x_],x_Symbol]:=
  Sqrt[Cos[e+f*x]]*Sqrt[b*Tan[e+f*x]]/Sqrt[Sin[e+f*x]]*Int[Sqrt[Cos[e+f*x]]*Sqrt[Sin[e+f*x]],x] /;
FreeQ[{b,e,f},x]

10:  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  n+(1/2)∈ℤ ∧ m+(1/2)∈ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((b Tan[e+f x]))^n)/((((a Sec[e+f x]))^n) (((b Sin[e+f x]))^n)))==0

Rule: If  n+(1/2)∈ℤ ∧ m+(1/2)∈ℤ, then

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

Program code:

Int[(a_.*sec[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  a^(m+n)*(b*Tan[e+f*x])^n/((a*Sec[e+f*x])^n*(b*Sin[e+f*x])^n)*Int[(b*Sin[e+f*x])^n/Cos[e+f*x]^(m+n),x] /;
FreeQ[{a,b,e,f,m,n},x] && IntegerQ[n+1/2] && IntegerQ[m+1/2]

11:  ∫(((a Sec[e+f x]))^m) (((b Tan[e+f x]))^n)dx  when  ((n-1)/2)∉ℤ ∧ (m/2)∉ℤ

Derivation: Piecewise constant extraction and integration by substitution

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

Basis: Cos[e+f x] F[Sin[e+f x]]==(1/(b f)) Subst[F[(x/b)],x,b Sin[e+f x]] (∂_x)(b Sin[e+f x])

Note: If (n/2)∈ℤ, then (((((a Sec[e+f x]))^m) (((b Tan[e+f x]))^(n+1)) (((((Cos[e+f x])^2)))^((m+n+1)/2)))/(((b Sin[e+f x]))^(n+1)))==(((a Sec[e+f x]))^(m+1)) (((((Cos[e+f x])^2)))^((m+1)/2))

Note: If (n/2)∈ℤ and m is a third-integer integration of ((x^n)/(((1-((x^2)/(b^2))))^((m+n+1)/2))) results in a complicated antiderivative involving elliptic integrals and the imaginary unit.

Rule: If ((n-1)/2)∉ℤ ∧ (m/2)∉ℤ, then

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

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

  ⟶  (((((a Sec[e+f x]))^m) (((b Tan[e+f x]))^(n+1)) (((((Cos[e+f x])^2)))^((m+n+1)/2)))/(b f (n+1))) Hypergeometric2F1[((n+1)/2),((m+n+1)/2),((n+3)/2),((Sin[e+f x])^2)]

Program code:

(* Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  (a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n+1)*(Cos[e+f*x]^2)^((m+n+1)/2)/(b*f*(b*Sin[e+f*x])^(n+1))*
    Subst[Int[x^n/(1-x^2/b^2)^((m+n+1)/2),x],x,b*Sin[e+f*x]] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[(n-1)/2]] && Not[IntegerQ[m/2]] *)

Int[(a_.*sec[e_.+f_.*x_])^m_.*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol]:=
  (a*Sec[e+f*x])^m*(b*Tan[e+f*x])^(n+1)*(Cos[e+f*x]^2)^((m+n+1)/2)/(b*f*(n+1))*
    Hypergeometric2F1[(n+1)/2,(m+n+1)/2,(n+3)/2,Sin[e+f*x]^2] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[(n-1)/2]] && Not[IntegerQ[m/2]]

5:  ∫(((a Csc[e+f x]))^m) (((b Tan[e+f x]))^n) dx  when  m∉ℤ ∧ n∉ℤ

Derivation: Piecewise constant extraction

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

Rule: If  m∉ℤ ∧ n∉ℤ, then

∫(((a Csc[e+f x]))^m) (((b Tan[e+f x]))^n)dx  ⟶  (((a Csc[e+f x]))^(FracPart[m])) (((((Sin[e+f x])/a)))^(FracPart[m]))∫((((b Tan[e+f x]))^n)/(((((Sin[e+f x])/a)))^m))dx

Program code:

Int[(a_.*csc[e_.+f_.*x_])^m_*(b_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  (a*Csc[e+f*x])^FracPart[m]*(Sin[e+f*x]/a)^FracPart[m]*Int[(b*Tan[e+f*x])^n/(Sin[e+f*x]/a)^m,x] /;
FreeQ[{a,b,e,f,m,n},x] && Not[IntegerQ[m]] && Not[IntegerQ[n]]