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

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

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

Derivation: Algebraic simplification

Basis: If  b c+a d==0 ∧ (a^2)+(b^2)==0, then (a+b Tan[z]) (c+d Tan[z])==a c ((Sec[z])^2)

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

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

Program code:

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

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

Derivation: Integration by substitution

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

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

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

Program code:

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

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

1.  ∫(a+b Tan[e+f x])(c+d Tan[e+f x])dx  when  b c-a d≠0

1:  ∫(a+b Tan[e+f x])(c+d Tan[e+f x])dx  when  b c-a d≠0 ∧ b c+a d==0

Derivation: Tangent recurrence 2b with A->(a^2),B->2a b,C->(b^2),m->-1,n->1

Rule: If  b c-a d≠0 ∧ b c+a d==0, then

∫(a+b Tan[e+f x])(c+d Tan[e+f x])dx  ⟶  (a c-b d)x+((b d Tan[e+f x])/f)

Program code:

Int[(a_+b_.*tan[e_.+f_.*x_])*(c_+d_.*tan[e_.+f_.*x_]),x_Symbol] :=
  (a*c-b*d)*x + b*d*Tan[e+f*x]/f /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[b*c-a*d,0] && EqQ[b*c+a*d,0]

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

Derivation: Tangent recurrence 2b with A->(a^2),B->2a b,C->(b^2),m->-1,n->1

Rule: If  b c-a d≠0 ∧ b c+a d≠0, then

∫(a+b Tan[e+f x])(c+d Tan[e+f x])dx  ⟶  (a c-b d)x+((b d Tan[e+f x])/f)+(b c+a d)∫Tan[e+f x]dx

Program code:

Int[(a_+b_.*tan[e_.+f_.*x_])*(c_.+d_.*tan[e_.+f_.*x_]),x_Symbol] :=
  (a*c-b*d)*x + b*d*Tan[e+f*x]/f + (b*c+a*d)*Int[Tan[e+f*x],x] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[b*c-a*d,0] && NeQ[b*c+a*d,0]

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

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

Derivation: Symmetric tangent recurrence 2a with A->c,B->d,n->0

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ m<0, then

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 3a with A->c,B->d,n->0

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ m≮0, then

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

Program code:

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

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

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

Derivation: Tangent recurrence 2a with A->0,B->A,C->B,n->-1

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

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

Program code:

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

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

Derivation: Tangent recurrence 1b with A->c,B->d,C->0,n->0

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

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

Program code:

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

3.  ∫((c+d Tan[e+f x])/(a+b Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0

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

Derivation: Algebraic expansion and reciprocal for integration

Basis: If  a c+b d==0, then ((c+d Tan[z])/(a+b Tan[z]))==((c(b Cos[z]-a Sin[z]))/(b(a Cos[z]+b Sin[z])))

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ a c+b d==0, then

∫((c+d Tan[e+f x])/(a+b Tan[e+f x]))dx  ⟶  (c/b)∫((b Cos[e+f x]-a Sin[e+f x])/(a Cos[e+f x]+b Sin[e+f x]))dx  ⟶  (c/(b f))Log[a Cos[e+f x]+b Sin[e+f x]]

Program code:

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

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

Derivation: Algebraic expansion

Basis: ((c+d z)/(a+b z))==((a c+b d)/((a^2)+(b^2)))+(((b c-a d) (b-a z))/(((a^2)+(b^2)) (a+b z)))

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

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

Program code:

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

4.  ∫((c+d Tan[e+f x])/(Sqrt[a+b Tan[e+f x]]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0

1.  ∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx

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

Derivation: Integration by substitution

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

Rule: If  (c^2)-(d^2)==0, then

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

Program code:

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

2.  ∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx  when  (c^2)-(d^2)≠0

x:  ∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx  when  (c^2)-(d^2)≠0

Derivation: Algebraic expansion

Basis: c+d z==(((c+d)(1+z))/2)+(((c-d)(1-z))/2)

Rule: If  (c^2)-(d^2)≠0, then

∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx  ⟶  ((c+d)/2) ∫((1+Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx+((c-d)/2) ∫((1-Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx

Program code:

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

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

Derivation: Integration by substitution

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

Note: This is just a special case of the following rule, but it saves two steps by canceling out the gcd.

Rule: If  (c^2)+(d^2)==0, then

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

Program code:

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

x:  ∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx  when  (c^2)-(d^2)≠0 ∧ (c^2)+(d^2)≠0

Derivation: Algebraic expansion

Basis: c+d z==(((c+i d))/2)(1-i z)+(((c-i d))/2)(1+i z)

Note: Introduces the imaginary unit.

Rule: If  (c^2)-(d^2)≠0 ∧ (c^2)+(d^2)≠0, then

∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx  ⟶  (((c+i d))/2)∫((1-i Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx+(((c-i d))/2)∫((1+i Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx

Program code:

(* Int[(c_+d_.*tan[e_.+f_.*x_])/Sqrt[b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  (c+I*d)/2*Int[(1-I*Tan[e+f*x])/Sqrt[b*Tan[e+f*x]],x] + (c-I*d)/2*Int[(1+I*Tan[e+f*x])/Sqrt[b*Tan[e+f*x]],x] /;
FreeQ[{b,c,d,e,f},x] && NeQ[c^2-d^2,0] && NeQ[c^2+d^2,0] *)

2:  ∫((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))dx  when  (c^2)-(d^2)≠0 ∧ (c^2)+(d^2)≠0

Derivation: Integration by substitution

Basis: ((c+d Tan[e+f x])/(Sqrt[b Tan[e+f x]]))==(2/f) Subst[((b c+d (x^2))/((b^2)+(x^4))),x,(Sqrt[b Tan[e+f x]])](∂_x)(Sqrt[b Tan[e+f x]])

Rule: If  (c^2)-(d^2)≠0 ∧ (c^2)+(d^2)≠0, then

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

Program code:

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

2.  ∫((c+d Tan[e+f x])/(Sqrt[a+b Tan[e+f x]]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0

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

Derivation: Integration by substitution

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

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ 2 a c d-b ((c^2)-(d^2))==0, then

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

Program code:

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

2:  ∫((c+d Tan[e+f x])/(Sqrt[a+b Tan[e+f x]]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ 2 a c d-b ((c^2)-(d^2))≠0

Derivation: Algebraic expansion

Note: The resulting integrands are of the form required by the above rule.

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ 2 a c d-b ((c^2)-(d^2))≠0, let q=(Sqrt[(a^2)+(b^2)]), then

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

Program code:

Int[(c_.+d_.*tan[e_.+f_.*x_])/Sqrt[a_+b_.*tan[e_.+f_.*x_]],x_Symbol] :=
  With[{q=Rt[a^2+b^2,2]},
  1/(2*q)*Int[(a*c+b*d+c*q+(b*c-a*d+d*q)*Tan[e+f*x])/Sqrt[a+b*Tan[e+f*x]],x] - 
  1/(2*q)*Int[(a*c+b*d-c*q+(b*c-a*d-d*q)*Tan[e+f*x])/Sqrt[a+b*Tan[e+f*x]],x]] /;
FreeQ[{a,b,c,d,e,f},x] && NeQ[b*c-a*d,0] && NeQ[a^2+b^2,0] && NeQ[c^2+d^2,0] && NeQ[2*a*c*d-b*(c^2-d^2),0] && 
  (PerfectSquareQ[a^2+b^2] || RationalQ[a,b,c,d])

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

Derivation: Integration by substitution

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

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)==0, then

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

Program code:

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

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

1:  ∫(((b Tan[e+f x]))^m)(c+d Tan[e+f x])dx  when  (c^2)+(d^2)≠0 ∧ 2m∉ℤ

Derivation: Algebraic expansion

Basis: (((b z))^m)(c+d z)==c (((b z))^m)+(d/b) (((b z))^(m+1))

Rule: If  (c^2)+(d^2)≠0 ∧ 2m∉ℤ, then

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

Program code:

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

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

Derivation: Algebraic expansion

Basis: c+d z==(((c+i d))/2)(1-i z)+(((c-i d))/2)(1+i z)

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

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

Program code:

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

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

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

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

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

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

Program code:

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

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

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

Derivation: Algebraic expansion

Basis: ((((c+d z))^2)/(a+b z))==((d (2 b c-a d))/(b^2))+(((d^2) z)/b)+((((b c-a d))^2)/((b^2) (a+b z)))

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

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

Program code:

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

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

Derivation: Tangent recurrence 1b with A->(c^2),B->2c d,C->(d^2),n->0

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

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

Program code:

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

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

Derivation: Tangent recurrence 2b with A->(c^2),B->2c d,C->(d^2),n->0

Rule: If  b c-a d≠0 ∧ m≰-1, then

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

Program code:

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

4.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0

1.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m+n==0

1.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m+n==0 ∧ m≥(1/2)

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

Derivation: Integration by substitution

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

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 , then

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 1a with A->1,B->0,n->-m

Note: If  (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then a c-b d≠0.

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

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 2b with A->c,B->d,n->-m-1

Note: If  (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then a c-b d≠0.

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

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

Program code:

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

2.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m+n+1==0

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

Derivation: Symmetric tangent recurrence 2b with A->1,B->0,n->-m-1

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

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 3b with A->1,B->0,n->-m-1

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m+n+1==0 ∧ m≮-1, then

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

Program code:

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

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

1.  ∫((((c+d Tan[e+f x]))^n)/(a+b Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ n>0

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

Derivation: Symmetric tangent recurrence 2a with A->1,B->0,m->-1

Derivation: Symmetric tangent recurrence 2b with A->c,B->d,m->-1,n->n-1

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ 0<n<1, then

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 2a with A->c,B->d,m->-1,n->n-1

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ n>1, then

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

Program code:

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

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

Derivation: Algebraic expansion

Basis: (1/((a+b z) (c+d z)))==(b/((b c-a d) (a+b z)))-(d/((b c-a d) (c+d z)))

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then

∫(1/((a+b Tan[e+f x])(c+d Tan[e+f x])))dx  ⟶  (b/(b c-a d))∫(1/(a+b Tan[e+f x]))dx-(d/(b c-a d))∫(1/(c+d Tan[e+f x]))dx

Program code:

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

3:  ∫((((c+d Tan[e+f x]))^n)/(a+b Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ n≯0

Derivation: Symmetric tangent recurrence 2b with A->1,B->0,m->-1

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ n≯0, then

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

Program code:

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

4.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m>1

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

Derivation: Symmetric tangent recurrence 1a with A->a,B->b,m->m-1

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

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

Program code:

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

2.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m>1 ∧ n≮-1

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

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then ((((a+b z))^(3/2))/(c+d z))==((2 (a^2) (Sqrt[a+b z]))/(a c-b d))-(((2 b c d+a ((c^2)-(d^2))) (a-b z) (Sqrt[a+b z]))/(a ((c^2)+(d^2)) (c+d z)))

Note: If  (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then a c-b d≠0.

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then

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

Program code:

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

2:  ∫((((a+b Tan[e+f x]))^(3/2))/(Sqrt[c+d Tan[e+f x]]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0

Derivation: Algebraic expansion

Basis: If  (a^2)+(b^2)==0, then (((a+b z))^(3/2))==2 a (Sqrt[a+b z])+(b/a) (b+a z)(Sqrt[a+b z])

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 1b with A->a,B->b,m->m-1

Note: This rule is applied when m∈ℤ even if n is symbolic since the antiderivative can be expressed in terms of hypergeometric functions instead of requiring Appell functions.

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

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

Program code:

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

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

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

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

Derivation: Symmetric tangent recurrence 2a with A->1,B->0,n->(1/2)

Derivation: Symmetric tangent recurrence 2b with A->0,B->1,n->-(1/2)

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m<0, then

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 2a with A->c,B->d,n->n-1

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

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 2b with A->1,B->0

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ m<0 ∧ n≯0, then

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 3a with A->c,B->d,n->n-1

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

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

Program code:

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

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

Derivation: Symmetric tangent recurrence 3b with A->1,B->0

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0 ∧ n<-1, then

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

Program code:

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

8:  ∫((((a+b Tan[e+f x]))^m)/(c+d Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0

Derivation: Algebraic expansion

Basis: ((((a+b z))^m)/(c+d z))==((a(((a+b z))^m))/(a c-b d)) -((d(((a+b z))^m)(b+a z))/((a c-b d)(c+d z)))

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then

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

Program code:

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

9:  ∫(Sqrt[a+b Tan[e+f x]]) (Sqrt[c+d Tan[e+f x]])dx  when  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0

Derivation: Algebraic expansion

Basis: (Sqrt[c+d z])==((a c-b d)/(a (Sqrt[c+d z])))+((d (b+a z))/(a (Sqrt[c+d z])))

Note: If  (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then a c-b d≠0.

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then

∫(Sqrt[a+b Tan[e+f x]]) (Sqrt[c+d Tan[e+f x]])dx  ⟶  ((a c-b d)/a)∫((Sqrt[a+b Tan[e+f x]])/(Sqrt[c+d Tan[e+f x]]))dx+(d/a)∫(((Sqrt[a+b Tan[e+f x]])(b+a Tan[e+f x]))/(Sqrt[c+d Tan[e+f x]]))dx

Program code:

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

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

Derivation: Integration by substitution

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

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)==0 ∧ (c^2)+(d^2)≠0, then

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

Program code:

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

5.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0

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

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

Derivation: Tangent recurrence 1a with A->(a^2),B->2a b,C->(b^2),m->m-2

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

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

Program code:

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

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

Derivation: Tangent recurrence 2a with A->(a^2),B->2a b,C->(b^2),m->m-2

Note: This rule is applied when m∈ℤ even if n is symbolic since the antiderivative can be expressed in terms of hypergeometric functions instead of requiring Appell functions.

Rule: If  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ m>2 ∧ n≮-1 ∧ (n≥-1 ∨ m∈ℤ), then

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

Program code:

Int[(a_.+b_.*tan[e_.+f_.*x_])^m_*(c_.+d_.*tan[e_.+f_.*x_])^n_,x_Symbol] :=
  b^2*(a+b*Tan[e+f*x])^(m-2)*(c+d*Tan[e+f*x])^(n+1)/(d*f*(m+n-1)) + 
  1/(d*(m+n-1))*Int[(a+b*Tan[e+f*x])^(m-3)*(c+d*Tan[e+f*x])^n*
    Simp[a^3*d*(m+n-1)-b^2*(b*c*(m-2)+a*d*(1+n))+b*d*(m+n-1)*(3*a^2-b^2)*Tan[e+f*x]-
      b^2*(b*c*(m-2)-a*d*(3*m+2*n-4))*Tan[e+f*x]^2,x],x] /;
FreeQ[{a,b,c,d,e,f,n},x] && NeQ[b*c-a*d,0] && NeQ[a^2+b^2,0] && NeQ[c^2+d^2,0] && IntegerQ[2*m] && GtQ[m,2] && (GeQ[n,-1] || IntegerQ[m]) && 
  Not[IGtQ[n,2] && (Not[IntegerQ[m]] || EqQ[c,0] && NeQ[a,0])]

2.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ m<-1

1.  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ m<-1 ∧ 0<n<2

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

Derivation: Tangent recurrence 1a with A->a,B->b,C->0,m->m-1

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

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

Program code:

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

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

Derivation: Tangent recurrence 1a with A->1,B->0,C->0

Derivation: Tangent recurrence 3b with A->a,B->b,C->0,m->m-1

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

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

Program code:

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

2:  ∫(((a+b Tan[e+f x]))^m) (((c+d Tan[e+f x]))^n)dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0 ∧ m<-1 ∧ (n<0 ∨ m∈ℤ)

Derivation: Tangent recurrence 3a with A->1,B->0,C->0

Note: This rule is applied when m∈ℤ even if n is symbolic since the antiderivative can be expressed in terms of hypergeometric functions instead of requiring Appell functions.

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

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

Program code:

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

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

Derivation: Tangent recurrence 2a with A->a c,B->b c+a d,C->b d,m->m-1,n->n-1

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

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

Program code:

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

4.  ∫((((a+b Tan[e+f x]))^m)/(c+d Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0

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

Derivation: Algebraic expansion

Basis: (1/((a+b z) (c+d z)))==((a c-b d)/(((a^2)+(b^2)) ((c^2)+(d^2))))+(((b^2) (b-a z))/((b c-a d)((a^2)+(b^2)) (a+b z)))-(((d^2) (d-c z))/((b c-a d) ((c^2)+(d^2)) (c+d z)))

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

∫((A+B Tan[e+f x])/((a+b Tan[e+f x])(c+d Tan[e+f x])))dx  ⟶  
(((a c-b d)x)/(((a^2)+(b^2)) ((c^2)+(d^2))))+((b^2)/((b c-a d)((a^2)+(b^2))))∫((b-a Tan[e+f x])/(a+b Tan[e+f x]))dx-((d^2)/((b c-a d) ((c^2)+(d^2))))∫((d-c Tan[e+f x])/(c+d Tan[e+f x]))dx

Program code:

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

2:  ∫((Sqrt[a+b Tan[e+f x]])/(c+d Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0

Derivation: Algebraic expansion

Basis: ((Sqrt[a+b z])/(c+d z))==((a c+b d+(b c-a d) z)/(((c^2)+(d^2)) (Sqrt[a+b z])))-((d (b c-a d) (1+(z^2)))/(((c^2)+(d^2)) (Sqrt[a+b z]) (c+d z)))

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

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

Program code:

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

3:  ∫((((a+b Tan[e+f x]))^(3/2))/(c+d Tan[e+f x]))dx  when  b c-a d≠0 ∧ (a^2)+(b^2)≠0 ∧ (c^2)+(d^2)≠0

Derivation: Algebraic expansion

Basis: ((((a+b z))^(3/2))/(c+d z))==(((a^2) c-(b^2) c+2 a b d+(2 a b c-(a^2) d+(b^2) d) z)/(((c^2)+(d^2)) (Sqrt[a+b z])))+(((((b c-a d))^2) (1+(z^2)))/(((c^2)+(d^2)) (Sqrt[a+b z]) (c+d z)))

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

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

Program code:

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

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

Derivation: Algebraic expansion

Basis: (1/(c+d z))==((c-d z)/((c^2)+(d^2)))+(((d^2) (1+(z^2)))/(((c^2)+(d^2)) (c+d z)))

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

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

Program code:

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

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

Derivation: Integration by substitution

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

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

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

Program code:

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

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

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

Derivation: Algebraic normalization

Basis: If  m∈ℤ, then (((a+b Tan[z]))^m)==(((d^m)(((b+a Cot[z]))^m))/(((d Cot[z]))^m))

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

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

Program code:

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

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

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

Derivation: Piecewise constant extraction

Basis: (∂_x)((((c (((d Tan[e+f x]))^p)))^n)/(((d Tan[e+f x]))^(n p)))==0

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

∫(((a+b Tan[e+f x]))^m) (((c (((d Tan[e+f x]))^p)))^n)dx  ⟶  (((c^(IntPart[n])) (((c (((d Tan[e+f x]))^p)))^(FracPart[n])))/(((d Tan[e+f x]))^(p FracPart[n])))∫(((a+b Tan[e+f x]))^m) (((d Tan[e+f x]))^(n p))dx

Program code:

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

Int[(a_.+b_.*cot[e_.+f_.*x_])^m_.*(c_.*(d_.*cot[e_.+f_.*x_])^p_)^n_,x_Symbol] :=
  c^IntPart[n]*(c*(d*Cot[e + f*x])^p)^FracPart[n]/(d*Cot[e + f*x])^(p*FracPart[n])*
    Int[(a+b*Cot[e+f*x])^m*(d*Cot[e+f*x])^(n*p),x] /;
FreeQ[{a,b,c,d,e,f,m,n,p},x] && Not[IntegerQ[n]] && Not[IntegerQ[m]]