Rules for normalizing integrands to known tangent forms

1.  ∫u(((c Trig[a+b x]))^m)(((d Trig[a+b x]))^n)dx  when  KnownTangentIntegrandQ[u,x]

1:  ∫u(((c Cot[a+b x]))^m)(((d Tan[a+b x]))^n)dx  when  KnownTangentIntegrandQ[u,x]

Derivation: Piecewise constant extraction

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

Rule: If  KnownTangentIntegrandQ[u,x], then

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

Program code:

Int[u_*(c_.*cot[a_.+b_.*x_])^m_.*(d_.*tan[a_.+b_.*x_])^n_.,x_Symbol] :=
  (c*Cot[a+b*x])^m*(d*Tan[a+b*x])^m*Int[ActivateTrig[u]*(d*Tan[a+b*x])^(n-m),x] /;
FreeQ[{a,b,c,d,m,n},x] && KnownTangentIntegrandQ[u,x]

2:  ∫u(((c Tan[a+b x]))^m)(((d Cot[a+b x]))^n)dx  when  KnownCotangentIntegrandQ[u,x]

Derivation: Piecewise constant extraction

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

Rule: If  KnownCotangentIntegrandQ[u,x], then

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

Program code:

Int[u_*(c_.*tan[a_.+b_.*x_])^m_.*(d_.*cos[a_.+b_.*x_])^n_.,x_Symbol] :=
  (c*Tan[a+b*x])^m*(d*Cos[a+b*x])^m/(d*Sin[a+b*x])^m*Int[ActivateTrig[u]*(d*Sin[a+b*x])^m/(d*Cos[a+b*x])^(m-n),x] /;
FreeQ[{a,b,c,d,m,n},x] && KnownCotangentIntegrandQ[u,x]

2.  ∫u(((c Trig[a+b x]))^m)dx  when  m∉ℤ ∧KnownTangentIntegrandQ[u,x]

1:  ∫u(((c Cot[a+b x]))^m)dx  when  m∉ℤ ∧KnownTangentIntegrandQ[u,x]

Derivation: Piecewise constant extraction

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

Rule: If  m∉ℤ ∧KnownTangentIntegrandQ[u,x], then

∫u(((c Cot[a+b x]))^m)dx  ⟶  (((c Cot[a+b x]))^m)(((c Tan[a+b x]))^m)∫(u/(((c Tan[a+b x]))^m))dx

Program code:

Int[u_*(c_.*cot[a_.+b_.*x_])^m_.,x_Symbol] :=
  (c*Cot[a+b*x])^m*(c*Tan[a+b*x])^m*Int[ActivateTrig[u]/(c*Tan[a+b*x])^m,x] /;
FreeQ[{a,b,c,m},x] && Not[IntegerQ[m]] && KnownTangentIntegrandQ[u,x]

2:  ∫u(((c Tan[a+b x]))^m)dx  when  m∉ℤ ∧KnownCotangentIntegrandQ[u,x]

Derivation: Piecewise constant extraction

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

Rule: If  m∉ℤ ∧KnownCotangentIntegrandQ[u,x], then

∫u(((c Tan[a+b x]))^m)dx  ⟶  (((c Cot[a+b x]))^m)(((c Tan[a+b x]))^m)∫(u/(((c Cot[a+b x]))^m))dx

Program code:

Int[u_*(c_.*tan[a_.+b_.*x_])^m_.,x_Symbol] :=
  (c*Cot[a+b*x])^m*(c*Tan[a+b*x])^m*Int[ActivateTrig[u]/(c*Cot[a+b*x])^m,x] /;
FreeQ[{a,b,c,m},x] && Not[IntegerQ[m]] && KnownCotangentIntegrandQ[u,x]

3.  ∫u(A+B Cot[a+b x])dx  when  KnownTangentIntegrandQ[u,x]

1:  ∫u(((c Tan[a+b x]))^n)(A+B Cot[a+b x])dx  when  KnownTangentIntegrandQ[u,x]

Derivation: Algebraic normalization

Rule: If  KnownTangentIntegrandQ[u,x], then

∫u(((c Tan[a+b x]))^n)(A+B Cot[a+b x])dx  ⟶  c∫u(((c Tan[a+b x]))^(n-1))(B+A Tan[a+b x])dx

Program code:

Int[u_*(c_.*tan[a_.+b_.*x_])^n_.*(A_+B_.*cot[a_.+b_.*x_]),x_Symbol] :=
  c*Int[ActivateTrig[u]*(c*Tan[a+b*x])^(n-1)*(B+A*Tan[a+b*x]),x] /;
FreeQ[{a,b,c,A,B,n},x] && KnownTangentIntegrandQ[u,x]

Int[u_*(c_.*cot[a_.+b_.*x_])^n_.*(A_+B_.*tan[a_.+b_.*x_]),x_Symbol] :=
  c*Int[ActivateTrig[u]*(c*Cot[a+b*x])^(n-1)*(B+A*Cot[a+b*x]),x] /;
FreeQ[{a,b,c,A,B,n},x] && KnownCotangentIntegrandQ[u,x]

2:  ∫u(A+B Cot[a+b x])dx  when  KnownTangentIntegrandQ[u,x]

Derivation: Algebraic normalization

Rule: If  KnownTangentIntegrandQ[u,x], then

∫u(A+B Cot[a+b x])dx  ⟶  ∫((u (B+A Tan[a+b x]))/(Tan[a+b x]))dx

Program code:

Int[u_*(A_+B_.*cot[a_.+b_.*x_]),x_Symbol] :=
  Int[ActivateTrig[u]*(B+A*Tan[a+b*x])/Tan[a+b*x],x] /;
FreeQ[{a,b,A,B},x] && KnownTangentIntegrandQ[u,x]

Int[u_*(A_+B_.*tan[a_.+b_.*x_]),x_Symbol] :=
  Int[ActivateTrig[u]*(B+A*Cot[a+b*x])/Cot[a+b*x],x] /;
FreeQ[{a,b,A,B},x] && KnownCotangentIntegrandQ[u,x]

4.  ∫u(A+B Cot[a+b x]+C ((Cot[a+b x])^2))dx  when  KnownTangentIntegrandQ[u,x]

1:  ∫u(((c Tan[a+b x]))^n)(A+B Cot[a+b x]+C ((Cot[a+b x])^2))dx  when  KnownTangentIntegrandQ[u,x]

Derivation: Algebraic normalization

Rule: If  KnownTangentIntegrandQ[u,x], then

∫u(((c Tan[a+b x]))^n)(A+B Cot[a+b x]+C ((Cot[a+b x])^2))dx  ⟶  (c^2)∫u(((c Tan[a+b x]))^(n-2))(C+B Tan[a+b x]+A ((Tan[a+b x])^2))dx

Program code:

Int[u_.*(c_.*tan[a_.+b_.*x_])^n_.*(A_.+B_.*cot[a_.+b_.*x_]+C_.*cot[a_.+b_.*x_]^2),x_Symbol] :=
  c^2*Int[ActivateTrig[u]*(c*Tan[a+b*x])^(n-2)*(C+B*Tan[a+b*x]+A*Tan[a+b*x]^2),x] /;
FreeQ[{a,b,c,A,B,C,n},x] && KnownTangentIntegrandQ[u,x]

Int[u_.*(c_.*cot[a_.+b_.*x_])^n_.*(A_.+B_.*tan[a_.+b_.*x_]+C_.*tan[a_.+b_.*x_]^2),x_Symbol] :=
  c^2*Int[ActivateTrig[u]*(c*Cot[a+b*x])^(n-2)*(C+B*Cot[a+b*x]+A*Cot[a+b*x]^2),x] /;
FreeQ[{a,b,c,A,B,C,n},x] && KnownCotangentIntegrandQ[u,x]

Int[u_.*(c_.*tan[a_.+b_.*x_])^n_.*(A_+C_.*cot[a_.+b_.*x_]^2),x_Symbol] :=
  c^2*Int[ActivateTrig[u]*(c*Tan[a+b*x])^(n-2)*(C+A*Tan[a+b*x]^2),x] /;
FreeQ[{a,b,c,A,C,n},x] && KnownTangentIntegrandQ[u,x]

Int[u_.*(c_.*cot[a_.+b_.*x_])^n_.*(A_+C_.*tan[a_.+b_.*x_]^2),x_Symbol] :=
  c^2*Int[ActivateTrig[u]*(c*Cot[a+b*x])^(n-2)*(C+A*Cot[a+b*x]^2),x] /;
FreeQ[{a,b,c,A,C,n},x] && KnownCotangentIntegrandQ[u,x]

2:  ∫u(A+B Cot[a+b x]+C ((Cot[a+b x])^2))dx  when  KnownTangentIntegrandQ[u,x]

Derivation: Algebraic normalization

Rule: If  KnownTangentIntegrandQ[u,x], then

∫u(A+B Cot[a+b x]+C ((Cot[a+b x])^2))dx  ⟶  ∫((u (C+B Tan[a+b x]+A ((Tan[a+b x])^2)))/((Tan[a+b x])^2))dx

Program code:

Int[u_*(A_.+B_.*cot[a_.+b_.*x_]+C_.*cot[a_.+b_.*x_]^2),x_Symbol] :=
  Int[ActivateTrig[u]*(C+B*Tan[a+b*x]+A*Tan[a+b*x]^2)/Tan[a+b*x]^2,x] /;
FreeQ[{a,b,A,B,C},x] && KnownTangentIntegrandQ[u,x]

Int[u_*(A_.+B_.*tan[a_.+b_.*x_]+C_.*tan[a_.+b_.*x_]^2),x_Symbol] :=
  Int[ActivateTrig[u]*(C+B*Cot[a+b*x]+A*Cot[a+b*x]^2)/Cot[a+b*x]^2,x] /;
FreeQ[{a,b,A,B,C},x] && KnownCotangentIntegrandQ[u,x]

Int[u_*(A_+C_.*cot[a_.+b_.*x_]^2),x_Symbol] :=
  Int[ActivateTrig[u]*(C+A*Tan[a+b*x]^2)/Tan[a+b*x]^2,x] /;
FreeQ[{a,b,A,C},x] && KnownTangentIntegrandQ[u,x]

Int[u_*(A_+C_.*tan[a_.+b_.*x_]^2),x_Symbol] :=
  Int[ActivateTrig[u]*(C+A*Cot[a+b*x]^2)/Cot[a+b*x]^2,x] /;
FreeQ[{a,b,A,C},x] && KnownCotangentIntegrandQ[u,x]

5:  ∫u(A+B Tan[a+b x]+C Cot[a+b x])dx

Derivation: Algebraic normalization

Rule:

∫u(A+B Tan[a+b x]+C Cot[a+b x])dx  ⟶  ∫((u (C+A Tan[a+b x]+B ((Tan[a+b x])^2)))/(Tan[a+b x]))dx

Program code:

Int[u_*(A_.+B_.*tan[a_.+b_.*x_]+C_.*cot[a_.+b_.*x_]),x_Symbol] :=
  Int[ActivateTrig[u]*(C+A*Tan[a+b*x]+B*Tan[a+b*x]^2)/Tan[a+b*x],x] /;
FreeQ[{a,b,A,B,C},x]

6:  ∫u(A ((Tan[a+b x])^n)+B ((Tan[a+b x])^(n+1))+C ((Tan[a+b x])^(n+2)))dx

Derivation: Algebraic normalization

Rule:

∫u(A ((Tan[a+b x])^n)+B ((Tan[a+b x])^(n+1))+C ((Tan[a+b x])^(n+2)))dx  ⟶  ∫u ((Tan[a+b x])^n)(A+B Tan[a+b x]+C ((Tan[a+b x])^2))dx

Program code:

Int[u_*(A_.*tan[a_.+b_.*x_]^n_.+B_.*tan[a_.+b_.*x_]^n1_+C_.*tan[a_.+b_.*x_]^n2_),x_Symbol] :=
  Int[ActivateTrig[u]*Tan[a+b*x]^n*(A+B*Tan[a+b*x]+C*Tan[a+b*x]^2),x] /;
FreeQ[{a,b,A,B,C,n},x] && EqQ[n1,n+1] && EqQ[n2,n+2]

Int[u_*(A_.*cot[a_.+b_.*x_]^n_.+B_.*cot[a_.+b_.*x_]^n1_+C_.*cot[a_.+b_.*x_]^n2_),x_Symbol] :=
  Int[ActivateTrig[u]*Cot[a+b*x]^n*(A+B*Cot[a+b*x]+C*Cot[a+b*x]^2),x] /;
FreeQ[{a,b,A,B,C,n},x] && EqQ[n1,n+1] && EqQ[n2,n+2]