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

1:  ∫(((d Sec[e+f x]))^m) (a+b Tan[e+f x])dx

Derivation: Algebraic expansion and integration by substitution

Basis: Tan[e+f x] F[Sec[e+f x]]==(1/f) Subst[((F[x])/x),x,Sec[e+f x]] (∂_x)Sec[e+f x]

Rule:

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

Program code:

Int[(d_.*sec[e_.+f_.*x_])^m_.*(a_+b_.*tan[e_.+f_.*x_]),x_Symbol] :=
  b*(d*Sec[e+f*x])^m/(f*m) + a*Int[(d*Sec[e+f*x])^m,x] /;
FreeQ[{a,b,d,e,f,m},x] && (IntegerQ[2*m] || NeQ[a^2+b^2,0])

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

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

Derivation: Integration by substitution

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

Rule: If  (a^2)+(b^2)==0 ∧ (m/2)∈ℤ, then

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

Program code:

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

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

Rule: If  (a^2)+(b^2)==0 ∧ m+n==0, then

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

Program code:

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

3.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ (m/2)+n==0

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

Derivation: Integration by substitution

Basis: If (a^2)+(b^2)==0, then ((Sec[e+f x])/(Sqrt[a+b Tan[e+f x]]))==-((2 a)/(b f)) Subst[(1/(2-a (x^2))),x,((Sec[e+f x])/(Sqrt[a+b Tan[e+f x]]))] (∂_x)((Sec[e+f x])/(Sqrt[a+b Tan[e+f x]]))

Rule: If  (a^2)+(b^2)==0, then

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

Program code:

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

2:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ (m/2)+n==0 ∧ n>0

Rule: If  (a^2)+(b^2)==0 ∧ (m/2)+n==0 ∧ n>0, then

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

Program code:

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

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

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

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

Program code:

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

4:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ (m/2)+n==0

Derivation: Piecewise constant extraction

Basis: If  (a^2)+(b^2)==0, then (∂_x)(((((a+b Tan[e+f x]))^n) (((a-b Tan[e+f x]))^n))/(((d Sec[e+f x]))^(2 n)))==0

Note: Degree of secant factor in resulting integrand is even, making it easy to integrate by substitution.

Rule: If  (a^2)+(b^2)==0 ∧ (m/2)+n==0, then

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

Program code:

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

4.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ (m/2)+n∈(SuperPlus[ℤ])

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

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

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

Program code:

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

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

Rule: If (a^2)+(b^2)==0 ∧ (m/2)+n-1∈(SuperPlus[ℤ])∧ n∉ℤ, then

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

Program code:

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

5.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ n>0

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

Derivation: Integration by substitution

Basis: If (a^2)+(b^2)==0, then (Sqrt[d Sec[e+f x]]) (Sqrt[a+b Tan[e+f x]])==-((4 b (d^2))/f) Subst[((x^2)/((a^2)+(d^2) (x^4))),x,((Sqrt[a+b Tan[e+f x]])/(Sqrt[d Sec[e+f x]]))] (∂_x)((Sqrt[a+b Tan[e+f x]])/(Sqrt[d Sec[e+f x]]))

Rule: If  (a^2)+(b^2)==0, then

∫(Sqrt[d Sec[e+f x]]) (Sqrt[a+b Tan[e+f x]])dx  ⟶  -((4 b (d^2))/f)Subst[∫((x^2)/((a^2)+(d^2) (x^4)))dx,x,((Sqrt[a+b Tan[e+f x]])/(Sqrt[d Sec[e+f x]]))]

Program code:

Int[Sqrt[d_.*sec[e_.+f_.*x_]]*Sqrt[a_+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  -4*b*d^2/f*Subst[Int[x^2/(a^2+d^2*x^4),x],x,Sqrt[a+b*Tan[e+f*x]]/Sqrt[d*Sec[e+f*x]]] /;
FreeQ[{a,b,d,e,f},x] && EqQ[a^2+b^2,0]

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

Rule: If  (a^2)+(b^2)==0 ∧ n>1 ∧ m<0, then

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

Program code:

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

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

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

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

Program code:

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

4:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ n>0

Rule: If (a^2)+(b^2)==0 ∧ n>0, then

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

Program code:

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

6.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ n<0

1:  ∫((((d Sec[e+f x]))^(3/2))/(Sqrt[a+b Tan[e+f x]]))dx  when (a^2)+(b^2)==0

Derivation: Piecewise constant extraction

Basis: If  (a^2)+(b^2)==0, then (∂_x)((Sec[e+f x])/((Sqrt[a-b Tan[e+f x]]) (Sqrt[a+b Tan[e+f x]])))==0

Rule: If  (a^2)+(b^2)==0, then

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

Program code:

Int[(d_.*sec[e_.+f_.*x_])^(3/2)/Sqrt[a_+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  d*Sec[e+f*x]/(Sqrt[a-b*Tan[e+f*x]]*Sqrt[a+b*Tan[e+f*x]])*Int[Sqrt[d*Sec[e+f*x]]*Sqrt[a-b*Tan[e+f*x]],x] /;
FreeQ[{a,b,d,e,f},x] && EqQ[a^2+b^2,0]

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

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

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

Program code:

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

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

Rule: If  (a^2)+(b^2)==0 ∧ n<0 ∧ m>1, then

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

Program code:

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

4:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ n<0

Rule: If  (a^2)+(b^2)==0 ∧ n<0, then

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

Program code:

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

7.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ m+n∈ℤ

1:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ m+n-1∈(SuperPlus[ℤ])

Rule: If (a^2)+(b^2)==0 ∧ m+n-1∈(SuperPlus[ℤ]), then

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

Program code:

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

2:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ m+n∈(SuperMinus[ℤ])

Rule: If  (a^2)+(b^2)==0 ∧ m+n∈(SuperMinus[ℤ]), then

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

Program code:

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

x:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)==0 ∧ n∈ℤ

Derivation: Piecewise constant extraction, algebraic expansion and integration by substitution

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

Basis: ((Sec[e+f x])^2)==1+((Tan[e+f x])^2)

Basis: F[b Tan[e+f x]]==(1/(b f)) Subst[((F[x])/(1+((x^2)/(b^2)))),x,b Tan[e+f x]] (∂_x)(b Tan[e+f x])

Rule: If  (a^2)+(b^2)==0 ∧ n∈ℤ, then

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

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

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

Program code:

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

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

Derivation: Piecewise constant extraction, algebraic expansion and integration by substitution

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

Basis: ((Sec[e+f x])^2)==1+((Tan[e+f x])^2)

Basis: F[b Tan[e+f x]]==(1/(b f)) Subst[((F[x])/(1+((x^2)/(b^2)))),x,b Tan[e+f x]] (∂_x)(b Tan[e+f x])

Rule: If  (a^2)+(b^2)==0, then

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

Program code:

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

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

Derivation: Piecewise constant extraction

Basis: If  (a^2)+(b^2)==0, then (∂_x)((((d Sec[e+f x]))^m)/((((a+b Tan[e+f x]))^(m/2)) (((a-b Tan[e+f x]))^(m/2))))==0

Rule: If  (a^2)+(b^2)==0, then

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

Program code:

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

3.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)≠0

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

Derivation: Algebraic expansion and integration by substitution

Basis: ((Sec[e+f x])^2)==1+((Tan[e+f x])^2)

Basis: F[b Tan[e+f x]]==(1/(b f)) Subst[((F[x])/(1+((x^2)/(b^2)))),x,b Tan[e+f x]] (∂_x)(b Tan[e+f x])

Rule: If  (a^2)+(b^2)≠0 ∧ (m/2)∈ℤ, then

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

Program code:

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

2.  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^2)dx  when (a^2)+(b^2)≠0

1:  ∫((((a+b Tan[e+f x]))^2)/(Sec[e+f x]))dx  when (a^2)+(b^2)≠0

Derivation: Algebraic expansion

Basis: ((((a+b Tan[e+f x]))^2)/(Sec[e+f x]))==(b^2) Sec[e+f x]+2 a b Sin[e+f x]+((a^2)-(b^2)) Cos[e+f x]

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

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

Program code:

Int[(a_+b_.*tan[e_.+f_.*x_])^2/sec[e_.+f_.*x_],x_Symbol] :=
  b^2*ArcTanh[Sin[e+f*x]]/f - 2*a*b*Cos[e+f*x]/f + (a^2-b^2)*Sin[e+f*x]/f /;
FreeQ[{a,b,e,f},x] && NeQ[a^2+b^2,0]

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

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

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

Program code:

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

3.  ∫((((d Sec[e+f x]))^m)/(a+b Tan[e+f x]))dx  when (a^2)+(b^2)≠0 ∧ m∈ℤ

1.  ∫((((d Sec[e+f x]))^m)/(a+b Tan[e+f x]))dx  when (a^2)+(b^2)≠0 ∧ m∈(SuperPlus[ℤ])

1:  ∫((Sec[e+f x])/(a+b Tan[e+f x]))dx  when (a^2)+(b^2)≠0

Derivation: Integration by substitution

Basis: ((Sec[e+f x])/(a+b Tan[e+f x]))==-(1/f) Subst[(1/((a^2)+(b^2)-(x^2))),x,((b-a Tan[e+f x])/(Sec[e+f x]))] (∂_x)((b-a Tan[e+f x])/(Sec[e+f x]))

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

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

Program code:

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

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

Derivation: Algebraic expansion

Basis: (((Sec[c+x])^2)/(a+b Tan[c+x]))==-((a-b Tan[c+x])/(b^2))+(((a^2)+(b^2))/((b^2) (a+b Tan[c+x])))

Rule: If  (a^2)+(b^2)≠0 ∧ m-1∈(SuperPlus[ℤ]), then

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

Program code:

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

2:  ∫((((d Sec[e+f x]))^m)/(a+b Tan[e+f x]))dx  when (a^2)+(b^2)≠0 ∧ m∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Basis: (1/(a+b Tan[e+f x]))==((a-b Tan[e+f x])/((a^2)+(b^2)))+(((b^2) ((Sec[e+f x])^2))/(((a^2)+(b^2)) (a+b Tan[e+f x])))

Rule: If  (a^2)+(b^2)≠0 ∧ m∈(SuperMinus[ℤ]), then

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

Program code:

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

4:  ∫(((d Sec[e+f x]))^m) (((a+b Tan[e+f x]))^n)dx  when (a^2)+(b^2)≠0 ∧ (m/2)∉ℤ

Derivation: Piecewise constant extraction, algebraic expansion and integration by substitution

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

Basis: ((Sec[e+f x])^2)==1+((Tan[e+f x])^2)

Basis: F[b Tan[e+f x]]==(1/(b f)) Subst[((F[x])/(1+((x^2)/(b^2)))),x,b Tan[e+f x]] (∂_x)(b Tan[e+f x])

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

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

Program code:

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

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

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

1:  ∫((Sqrt[a+b Tan[e+f x]])/(Sqrt[d Cos[e+f x]]))dx  when (a^2)+(b^2)==0

Derivation: Integration by substitution

Basis: If (a^2)+(b^2)==0, then ((Sqrt[a+b Tan[e+f x]])/(Sqrt[d Cos[e+f x]]))==-((4 b)/f) Subst[((x^2)/((a^2) (d^2)+(x^4))),x,(Sqrt[d Cos[e+f x]]) (Sqrt[a+b Tan[e+f x]])] (∂_x)((Sqrt[d Cos[e+f x]]) (Sqrt[a+b Tan[e+f x]]))

Rule: If  (a^2)+(b^2)==0, then

∫((Sqrt[a+b Tan[e+f x]])/(Sqrt[d Cos[e+f x]]))dx  ⟶  -((4 b)/f)Subst[∫((x^2)/((a^2) (d^2)+(x^4)))dx,x,(Sqrt[d Cos[e+f x]]) (Sqrt[a+b Tan[e+f x]])]

Program code:

Int[Sqrt[a_+b_.*tan[e_.+f_.*x_]]/Sqrt[d_.cos[e_.+f_.*x_]],x_Symbol] :=
  -4*b/f*Subst[Int[x^2/(a^2*d^2+x^4),x],x,Sqrt[d*Cos[e+f*x]]*Sqrt[a+b*Tan[e+f*x]]] /;
FreeQ[{a,b,d,e,f},x] && EqQ[a^2+b^2,0]

2:  ∫(1/((((d Cos[e+f x]))^(3/2)) (Sqrt[a+b Tan[e+f x]])))dx  when (a^2)+(b^2)==0

Derivation: Piecewise constant extraction

Basis: If  (a^2)+(b^2)==0, then (∂_x)(1/(Cos[e+f x] (Sqrt[a-b Tan[e+f x]]) (Sqrt[a+b Tan[e+f x]])))==0

Rule: If  (a^2)+(b^2)==0, then

∫(1/((((d Cos[e+f x]))^(3/2)) (Sqrt[a+b Tan[e+f x]])))dx  ⟶  (1/(d Cos[e+f x] (Sqrt[a-b Tan[e+f x]]) (Sqrt[a+b Tan[e+f x]]))) ∫((Sqrt[a-b Tan[e+f x]])/(Sqrt[d Cos[e+f x]]))dx

Program code:

Int[1/((d_.cos[e_.+f_.*x_])^(3/2)*Sqrt[a_+b_.*tan[e_.+f_.*x_]]),x_Symbol] :=
  1/(d*Cos[e+f*x]*Sqrt[a-b*Tan[e+f*x]]*Sqrt[a+b*Tan[e+f*x]])*Int[Sqrt[a-b*Tan[e+f*x]]/Sqrt[d*Cos[e+f*x]],x] /;
FreeQ[{a,b,d,e,f},x] && EqQ[a^2+b^2,0]

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

Derivation: Piecewise constant extraction

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

Rule: If  m∉ℤ, then

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

Program code:

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