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

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

1:  ∫Cos[e+f x] (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx

Derivation: Integration by substitution

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])

Rule:

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

Program code:

Int[cos[e_.+f_.*x_]*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_])^n_.,x_Symbol] :=
  1/(b*f)*Subst[Int[(a+x)^m*(c+d/b*x)^n,x],x,b*Sin[e+f*x]] /;
FreeQ[{a,b,c,d,e,f,m,n},x]

2:  ∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (a+b Sin[e+f x])dx  when ((p-1)/2)∈ℤ ∧ n∈ℤ ∧ (p<0 ∧ (a^2)-(b^2)≠0 ∨ 0<n<p-1 ∨ p+1<-n<2 p+1)

Derivation: Algebraic expansion

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

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

Program code:

Int[cos[e_.+f_.*x_]^p_*(d_.*sin[e_.+f_.*x_])^n_.*(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  a*Int[Cos[e+f*x]^p*(d*Sin[e+f*x])^n,x] + b/d*Int[Cos[e+f*x]^p*(d*Sin[e+f*x])^(n+1),x] /;
FreeQ[{a,b,d,e,f,n,p},x] && IntegerQ[(p-1)/2] && IntegerQ[n] && (LtQ[p,0] && NeQ[a^2-b^2,0] || LtQ[0,n,p-1] || LtQ[p+1,-n,2*p+1])

3.  ∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0

1:  ∫((((Cos[e+f x])^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0 ∧ n∈ℤ ∧ (0<n<((p+1)/2) ∨ p≤-n<2 p-3 ∨ 0<n≤-p)

Derivation: Algebraic expansion

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

Rule: If  ((p-1)/2)∈ℤ ∧ (a^2)-(b^2)==0 ∧ n∈ℤ ∧ (0<n<((p+1)/2) ∨ p≤-n<2 p-3 ∨ 0<n≤-p), then

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

Program code:

Int[cos[e_.+f_.*x_]^p_*(d_.*sin[e_.+f_.*x_])^n_./(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  1/a*Int[Cos[e+f*x]^(p-2)*(d*Sin[e+f*x])^n,x] - 
  1/(b*d)*Int[Cos[e+f*x]^(p-2)*(d*Sin[e+f*x])^(n+1),x] /;
FreeQ[{a,b,d,e,f,n,p},x] && IntegerQ[(p-1)/2] && EqQ[a^2-b^2,0] && IntegerQ[n] && (LtQ[0,n,(p+1)/2] || LeQ[p,-n] && LtQ[-n,2*p-3] || GtQ[n,0] && LeQ[n,-p])

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

Derivation: Integration by substitution

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

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

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

Program code:

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

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

Derivation: Integration by substitution

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

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

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

Program code:

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

2:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (a+b Sin[e+f x])dx

Derivation: Algebraic expansion

Rule:

∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (a+b Sin[e+f x])dx  ⟶  a∫(((g Cos[e+f x]))^p)(((d Sin[e+f x]))^n) dx+(b/d)∫(((g Cos[e+f x]))^p)(((d Sin[e+f x]))^(n+1)) dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_.*(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  a*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^n,x] + b/d*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n+1),x] /;
FreeQ[{a,b,d,e,f,g,n,p},x]

3:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)==0

Derivation: Algebraic expansion

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

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

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  ((g^2)/a)∫(((g Cos[e+f x]))^(p-2))(((d Sin[e+f x]))^n)dx-((g^2)/(b d))∫(((g Cos[e+f x]))^(p-2))(((d Sin[e+f x]))^(n+1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_./(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g^2/a*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n,x] - 
  g^2/(b*d)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+1),x] /;
FreeQ[{a,b,d,e,f,g,n,p},x] && EqQ[a^2-b^2,0]

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

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[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 Sin[z]) (c+d Sin[z])==a c ((Cos[z])^2)

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  (((a^m) (c^m))/(g^(2 m)))∫(((g Cos[e+f x]))^(2 m+p)) (((c+d Sin[e+f x]))^(n-m))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_+d_.*sin[e_.+f_.*x_])^n_.,x_Symbol] :=
  a^m*c^m/g^(2*m)*Int[(g*Cos[e+f*x])^(2*m+p)*(c+d*Sin[e+f*x])^(n-m),x] /;
FreeQ[{a,b,c,d,e,f,g,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && IntegerQ[m] && Not[IntegerQ[n] && LtQ[n^2,m^2]]

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

Derivation: Algebraic simplification

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

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

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

Program code:

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

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

Derivation: Piecewise constant extraction

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

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

∫((((g Cos[e+f x]))^p)/((Sqrt[a+b Sin[e+f x]]) (Sqrt[c+d Sin[e+f x]])))dx  ⟶  ((g Cos[e+f x])/((Sqrt[a+b Sin[e+f x]]) (Sqrt[c+d Sin[e+f x]])))∫(((g Cos[e+f x]))^(p-1))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_/(Sqrt[a_+b_.*sin[e_.+f_.*x_]]*Sqrt[c_+d_.*sin[e_.+f_.*x_]]),x_Symbol] :=
  g*Cos[e+f*x]/(Sqrt[a+b*Sin[e+f*x]]*Sqrt[c+d*Sin[e+f*x]])*Int[(g*Cos[e+f*x])^(p-1),x] /;
FreeQ[{a,b,c,d,e,f,g,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0]

4.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+(p/2)+(1/2)∈(SuperPlus[ℤ])

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+(p/2)-(1/2)==0

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ 2 m+p-1==0 ∧ m-n-1==0

Derivation: Piecewise constant extraction

Basis: If  b c+a d==0 ∧ (a^2)-(b^2)==0, then (∂_x)(((((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^m))/(((g Cos[e+f x]))^(2m)))==0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  a^IntPart[m]*c^IntPart[m]*(a+b*Sin[e+f*x])^FracPart[m]*(c+d*Sin[e+f*x])^FracPart[m]/
    (g^(2*IntPart[m])*(g*Cos[e+f*x])^(2*FracPart[m]))*Int[(g*Cos[e+f*x])^(2*m+p)/(c+d*Sin[e+f*x]),x] /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && EqQ[2*m+p-1,0] && EqQ[m-n-1,0]

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

Derivation: Doubly degenerate sine recurrence 1a

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  ((b(((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^(m-1)) (((c+d Sin[e+f x]))^n))/(f g(m-n-1)))

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n/(f*g*(m-n-1)) /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && EqQ[2*m+p-1,0] && NeQ[m-n-1,0]

2.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+(p/2)-(1/2)∈(SuperPlus[ℤ])

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+(p/2)-(1/2)∈(SuperPlus[ℤ]) ∧ n<-1

Derivation: Doubly degenerate sine recurrence 1a

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  -2*b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n/(f*g*(2*n+p+1)) - 
  b*(2*m+p-1)/(d*(2*n+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^(n+1),x] /;
FreeQ[{a,b,c,d,e,f,g,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && IGtQ[Simplify[m+p/2-1/2],0] && LtQ[n,-1] && 
  NeQ[2*n+p+1,0] && Not[ILtQ[Simplify[m+n+p],0] && GtQ[Simplify[2*m+n+3*p/2+1],0]]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+(p/2)-(1/2)∈(SuperPlus[ℤ])∧ n≮-1

Derivation: Doubly degenerate sine recurrence 1b

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n/(f*g*(m+n+p)) + 
  a*(2*m+p-1)/(m+n+p)*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n,x] /;
FreeQ[{a,b,c,d,e,f,g,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && IGtQ[Simplify[m+p/2-1/2],0] && Not[LtQ[n,-1]] && 
  Not[IGtQ[Simplify[n+p/2-1/2],0] && GtQ[m-n,0]] && Not[ILtQ[Simplify[m+n+p],0] && GtQ[Simplify[2*m+n+3*p/2+1],0]]

5.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+n+p∈(SuperMinus[ℤ])

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

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+n+p+1==0 ∧ m-n==0

Derivation: Piecewise constant extraction

Basis: If  b c+a d==0 ∧ (a^2)-(b^2)==0, then (∂_x)(((((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^m))/(((g Cos[e+f x]))^(2m)))==0

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^m)dx  ⟶  
(((a^(IntPart[m])) (c^(IntPart[m])) (((a+b Sin[e+f x]))^(FracPart[m])) (((c+d Sin[e+f x]))^(FracPart[m])))/((g^(2 IntPart[m])) (((g Cos[e+f x]))^(2FracPart[m]))))∫(((g Cos[e+f x]))^(2 m+p))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  a^IntPart[m]*c^IntPart[m]*(a+b*Sin[e+f*x])^FracPart[m]*(c+d*Sin[e+f*x])^FracPart[m]/
    (g^(2*IntPart[m])*(g*Cos[e+f*x])^(2*FracPart[m]))*Int[(g*Cos[e+f*x])^(2*m+p),x] /;
FreeQ[{a,b,c,d,e,f,g,m,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && EqQ[2*m+p+1,0]

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

Derivation: Doubly degenerate sine recurrence 1c with n->-m-p-1

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  ((b(((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n))/(a f g(m-n)))

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m*(c+d*Sin[e+f*x])^n/(a*f*g*(m-n)) /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && EqQ[m+n+p+1,0] && NeQ[m,n]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+n+p+1∈(SuperMinus[ℤ])∧ 2 m+p+1≠0

Derivation: Doubly degenerate sine recurrence 1c

Rule: If  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m+n+p+1∈(SuperMinus[ℤ])∧ 2 m+p+1≠0, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  
((b(((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n))/(a f g(2 m+p+1)))+((m+n+p+1)/(a(2 m+p+1)))∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^(m+1)) (((c+d Sin[e+f x]))^n)dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m*(c+d*Sin[e+f*x])^n/(a*f*g*(2*m+p+1)) + 
  (m+n+p+1)/(a*(2*m+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m+1)*(c+d*Sin[e+f*x])^n,x] /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && ILtQ[Simplify[m+n+p+1],0] && NeQ[2*m+p+1,0] && 
  (SumSimplerQ[m,1] || Not[SumSimplerQ[n,1]])

6.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ (2 m|2 n|2 p)∈ℤ

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m>0

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

Derivation: Doubly degenerate sine recurrence 1a

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  -2*b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n/(f*g*(2*n+p+1)) - 
  b*(2*m+p-1)/(d*(2*n+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^(n+1),x] /;
FreeQ[{a,b,c,d,e,f,g,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && GtQ[m,0] && LtQ[n,-1] && NeQ[2*n+p+1,0] && IntegersQ[2*m,2*n,2*p]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m>0 ∧ m+n+p≠0

Derivation: Doubly degenerate sine recurrence 1b

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  -b*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n/(f*g*(m+n+p)) + 
  a*(2*m+p-1)/(m+n+p)*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1)*(c+d*Sin[e+f*x])^n,x] /;
FreeQ[{a,b,c,d,e,f,g,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && GtQ[m,0] && NeQ[m+n+p,0] && Not[LtQ[0,n,m]] && IntegersQ[2*m,2*n,2*p]

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

Derivation: Doubly degenerate sine recurrence 1c

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  
((b(((g Cos[e+f x]))^(p+1))(((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n))/(a f g(2 m+p+1)))+((m+n+p+1)/(a(2 m+p+1)))∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^(m+1)) (((c+d Sin[e+f x]))^n)dx

Program code:

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

7:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  b c+a d==0 ∧ (a^2)-(b^2)==0 ∧ m∉ℤ ∧ n∉ℤ

Derivation: Piecewise constant extraction

Basis: If  b c+a d==0 ∧ (a^2)-(b^2)==0, then (∂_x)(((((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^m))/(((g Cos[e+f x]))^(2m)))==0

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  
(((a^(IntPart[m])) (c^(IntPart[m])) (((a+b Sin[e+f x]))^(FracPart[m])) (((c+d Sin[e+f x]))^(FracPart[m])))/((g^(2 IntPart[m])) (((g Cos[e+f x]))^(2FracPart[m]))))∫(((g Cos[e+f x]))^(2 m+p)) (((c+d Sin[e+f x]))^(n-m))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  a^IntPart[m]*c^IntPart[m]*(a+b*Sin[e+f*x])^FracPart[m]*(c+d*Sin[e+f*x])^FracPart[m]/
    (g^(2*IntPart[m])*(g*Cos[e+f*x])^(2*FracPart[m]))*
    Int[(g*Cos[e+f*x])^(2*m+p)*(c+d*Sin[e+f*x])^(n-m),x] /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && EqQ[b*c+a*d,0] && EqQ[a^2-b^2,0] && (FractionQ[m] || Not[FractionQ[n]])

5.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0

1:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0 ∧ a d m+b c (m+p+1)==0

Derivation: Singly degenerate sine recurrence 2c with c->1,d->0,n->0

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

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -d*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(f*g*(m+p+1)) /;
FreeQ[{a,b,c,d,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && EqQ[a*d*m+b*c*(m+p+1),0]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0 ∧ m>-1 ∧ p<-1

Derivation: Singly degenerate sine recurrence 4a with c->1,d->0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -(b*c+a*d)*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(a*f*g*(p+1)) + 
  b*(a*d*m+b*c*(m+p+1))/(a*g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-1),x] /;
FreeQ[{a,b,c,d,e,f,g},x] && EqQ[a^2-b^2,0] && GtQ[m,-1] && LtQ[p,-1]

3:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0 ∧ ((2 m+p+1)/2)∈(SuperPlus[ℤ])∧ m+p+1≠0

Derivation: Singly degenerate sine recurrence 2c with c->1,d->0,n->0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -d*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(f*g*(m+p+1)) + 
  (a*d*m+b*c*(m+p+1))/(b*(m+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,c,d,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && IGtQ[Simplify[(2*m+p+1)/2],0] && NeQ[m+p+1,0]

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

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

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

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

Program code:

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

2:  ∫((Cos[e+f x])^2) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0 ∧ -(3/2)≤m<0

Rule: If  (a^2)-(b^2)==0 ∧ -(3/2)≤m<0, then

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

Program code:

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

5:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0 ∧ (m<-1 ∨ m+p∈(SuperMinus[ℤ])) ∧ 2 m+p+1≠0

Derivation: Singly degenerate sine recurrence 2a with c->1,d->0

Derivation: Singly degenerate sine recurrence 2b with c->1,d->0

Rule: If  (a^2)-(b^2)==0 ∧ (m<-1 ∨ m+p∈(SuperMinus[ℤ])) ∧ 2 m+p+1≠0, then

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  (b*c-a*d)*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(a*f*g*(2*m+p+1)) + 
  (a*d*m+b*c*(m+p+1))/(a*b*(2*m+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m+1),x] /;
FreeQ[{a,b,c,d,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && (LtQ[m,-1] || ILtQ[Simplify[m+p],0]) && NeQ[2*m+p+1,0]

6:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when (a^2)-(b^2)==0 ∧ m+p+1≠0

Derivation: Singly degenerate sine recurrence 2c with c->1,d->0,n->0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -d*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(f*g*(m+p+1)) + 
  (a*d*m+b*c*(m+p+1))/(b*(m+p+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,c,d,e,f,g,m,p},x] && EqQ[a^2-b^2,0] && NeQ[m+p+1,0]

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

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

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

Derivation: Nondegenerate sine recurrence 3a with c->1,d->0,C->0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m*(d+c*Sin[e+f*x])/(f*g*(p+1)) + 
  1/(g^2*(p+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-1)*Simp[a*c*(p+2)+b*d*m+b*c*(m+p+2)*Sin[e+f*x],x],x] /;
FreeQ[{a,b,c,d,e,f,g},x] && NeQ[a^2-b^2,0] && GtQ[m,0] && LtQ[p,-1] && IntegerQ[2*m] && 
  Not[EqQ[m,1] && NeQ[c^2-d^2,0] && SimplerQ[c+d*x,a+b*x]]

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

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

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -d*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^m/(f*g*(m+p+1)) + 
  1/(m+p+1)*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m-1)*Simp[a*c*(m+p+1)+b*d*m+(a*d*m+b*c*(m+p+1))*Sin[e+f*x],x],x] /;
FreeQ[{a,b,c,d,e,f,g,p},x] && NeQ[a^2-b^2,0] && GtQ[m,0] && Not[LtQ[p,-1]] && IntegerQ[2*m] && 
  Not[EqQ[m,1] && NeQ[c^2-d^2,0] && SimplerQ[c+d*x,a+b*x]]

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

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

Derivation: Nondegenerate sine recurrence 2a with c->0,d->1,A->0,B->A,C->B,n->-1

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)*(b*c*(m+p+1)-a*d*p+b*d*(m+1)*Sin[e+f*x])/(b^2*f*(m+1)*(m+p+1)) + 
  g^2*(p-1)/(b^2*(m+1)*(m+p+1))*
    Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^(m+1)*Simp[b*d*(m+1)+(b*c*(m+p+1)-a*d*p)*Sin[e+f*x],x],x] /;
FreeQ[{a,b,c,d,e,f,g},x] && NeQ[a^2-b^2,0] && LtQ[m,-1] && GtQ[p,1] && NeQ[m+p+1,0] && IntegerQ[2*m]

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

Derivation: Nondegenerate sine recurrence 1a with c->1,d->0,C->0

Derivation: Nondegenerate sine recurrence 1c with c->1,d->0,C->0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -(b*c-a*d)*(g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m+1)/(f*g*(a^2-b^2)*(m+1)) + 
  1/((a^2-b^2)*(m+1))*Int[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^(m+1)*Simp[(a*c-b*d)*(m+1)-(b*c-a*d)*(m+p+2)*Sin[e+f*x],x],x] /;
FreeQ[{a,b,c,d,e,f,g,p},x] && NeQ[a^2-b^2,0] && LtQ[m,-1] && IntegerQ[2*m]

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

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

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)*(a+b*Sin[e+f*x])^(m+1)*(b*c*(m+p+1)-a*d*p+b*d*(m+p)*Sin[e+f*x])/(b^2*f*(m+p)*(m+p+1)) + 
  g^2*(p-1)/(b^2*(m+p)*(m+p+1))*
    Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^m*Simp[b*(a*d*m+b*c*(m+p+1))+(a*b*c*(m+p+1)-d*(a^2*p-b^2*(m+p)))*Sin[e+f*x],x],x] /;
FreeQ[{a,b,c,d,e,f,g,m},x] && NeQ[a^2-b^2,0] && GtQ[p,1] && NeQ[m+p,0] && NeQ[m+p+1,0] && IntegerQ[2*m]

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

Derivation: Nondegenerate sine recurrence 3b with c->1,d->0,C->0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  (g*Cos[e+f*x])^(p+1)*(a+b*Sin[e+f*x])^(m+1)*(b*c-a*d-(a*c-b*d)*Sin[e+f*x])/(f*g*(a^2-b^2)*(p+1)) + 
  1/(g^2*(a^2-b^2)*(p+1))*
    Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^m*Simp[c*(a^2*(p+2)-b^2*(m+p+2))+a*b*d*m+b*(a*c-b*d)*(m+p+3)*Sin[e+f*x],x],x] /;
FreeQ[{a,b,c,d,e,f,g,m},x] && NeQ[a^2-b^2,0] && LtQ[p,-1] && IntegerQ[2*m]

5:  ∫(((((g Cos[e+f x]))^p) (c+d Sin[e+f x]))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0

Derivation: Algebraic expansion

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

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

∫(((((g Cos[e+f x]))^p) (c+d Sin[e+f x]))/(a+b Sin[e+f x]))dx  ⟶  (d/b)∫(((g Cos[e+f x]))^p)dx+((b c-a d)/b)∫((((g Cos[e+f x]))^p)/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(c_.+d_.*sin[e_.+f_.*x_])/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  d/b*Int[(g*Cos[e+f*x])^p,x] + (b*c-a*d)/b*Int[(g*Cos[e+f*x])^p/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,c,d,e,f,g},x] && NeQ[a^2-b^2,0]

6:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (c+d Sin[e+f x])dx  when  (a^2)-(b^2)≠0 ∧ (c^2)-(d^2)==0

Derivation: Piecewise constant extraction and integration by substitution

Basis: (∂_x)((((g Cos[e+f x]))^(p-1))/((((1+Sin[e+f x]))^((p-1)/2)) (((1-Sin[e+f x]))^((p-1)/2))))==0

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

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

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

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

((c g (((g Cos[e+f x]))^(p-1)))/(f (((1+Sin[e+f x]))^((p-1)/2)) (((1-Sin[e+f x]))^((p-1)/2))))Subst[∫(((1+(d/c) x))^((p+1)/2)) (((1-(d/c) x))^((p-1)/2)) (((a+b x))^m)dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_]),x_Symbol] :=
  c*g*(g*Cos[e+f*x])^(p-1)/(f*(1+Sin[e+f*x])^((p-1)/2)*(1-Sin[e+f*x])^((p-1)/2))*
    Subst[Int[(1+d/c*x)^((p+1)/2)*(1-d/c*x)^((p-1)/2)*(a+b*x)^m,x],x,Sin[e+f*x]] /;
FreeQ[{a,b,c,d,e,f,m,p},x] && NeQ[a^2-b^2,0] && EqQ[c^2-d^2,0]

6.  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m) dx  when (a^2)-(b^2)==0

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

Derivation: Algebraic simplification

Basis: If  (a^2)-(b^2)==0 ∧ m∈ℤ ∧ 2 m+p==0, then ((Cos[z])^p) (((a+b Sin[z]))^m)==((a^(2 m))/(((a-b Sin[z]))^m))

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

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

Program code:

Int[cos[e_.+f_.*x_]^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  a^(2*m)*Int[(d*Sin[e+f*x])^n/(a-b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,d,e,f,n},x] && EqQ[a^2-b^2,0] && IntegersQ[m,p] && EqQ[2*m+p,0]

2:  ∫(((g Cos[e+f x]))^p) ((Sin[e+f x])^2) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ m==p

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

Rule: If  (a^2)-(b^2)==0 ∧ m==p, then

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

Program code:

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

3:  ∫(((g Cos[e+f x]))^p) ((Sin[e+f x])^2) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ m+p+1==0

Derivation: ???

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

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

Program code:

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

4.  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m∈ℤ

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

Derivation: Algebraic expansion

Basis: If  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ, then ((Cos[z])^p)==(1/(a^p)) (((a-b Sin[z]))^(p/2)) (((a+b Sin[z]))^(p/2))

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

∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  ⟶  
(1/(a^p))∫ExpandTrig[(((d Sin[e+f x]))^n) (((a-b Sin[e+f x]))^(p/2)) (((a+b Sin[e+f x]))^(m+p/2)),x] dx

Program code:

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

2:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

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

∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  ⟶  ∫(((g Cos[e+f x]))^p)ExpandTrig[(((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m),x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  Int[ExpandTrig[(g*cos[e+f*x])^p,(d*sin[e+f*x])^n*(a+b*sin[e+f*x])^m,x],x] /;
FreeQ[{a,b,d,e,f,g,n,p},x] && EqQ[a^2-b^2,0] && IGtQ[m,0]

3.  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m) dx  when (a^2)-(b^2)==0 ∧ m∈(SuperMinus[ℤ])

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

Derivation: Algebraic simplification

Basis: If  (a^2)-(b^2)==0, then ((Cos[z])^2)==(1/(b^2))(a+b Sin[z]) (a-b Sin[z])

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

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

Program code:

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

2:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m∈(SuperMinus[ℤ])

Derivation: Algebraic expansion

Basis: If  (a^2)-(b^2)==0, then a+b Sin[z]==(((a^2) (((g Cos[z]))^2))/((g^2) (a-b Sin[z])))

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  (a/g)^(2*m)*Int[(g*Cos[e+f*x])^(2*m+p)*(d*Sin[e+f*x])^n/(a-b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,d,e,f,g,n,p},x] && EqQ[a^2-b^2,0] && ILtQ[m,0]

5:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m∈ℤ ∧ (2 m+p==0 ∨ 2 m+p>0 ∧ p<-1)

Derivation: Algebraic expansion

Basis: If  (a^2)-(b^2)==0, then a+b Sin[z]==(((a^2) (((g Cos[z]))^2))/((g^2) (a-b Sin[z])))

Note: By making the degree of the cosine factor in the integrand nonnegative, this rule removes the removable singularities from the integrand and hence from the resulting antiderivatives.

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  (a/g)^(2*m)*Int[(g*Cos[e+f*x])^(2*m+p)*(d*Sin[e+f*x])^n/(a-b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,d,e,f,g,n},x] && EqQ[a^2-b^2,0] && IntegerQ[m] && RationalQ[p] && (EqQ[2*m+p,0] || GtQ[2*m+p,0] && LtQ[p,-1])

6.  ∫(((g Cos[e+f x]))^p) ((Sin[e+f x])^2) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0

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

Derivation: ???

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

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

Program code:

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

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

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

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

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

Program code:

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

7.  ∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ

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

Derivation: Algebraic simplification

Basis: If  (a^2)-(b^2)==0, then ((Cos[z])^2)==(1/(b^2))(a+b Sin[z]) (a-b Sin[z])

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

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

Program code:

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

2.  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0

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

Derivation: Algebraic expansion

Basis: If (a^2)-(b^2)==0, then ((Cos[z])^4)==-(2/(a b))Sin[z](((a+b Sin[z]))^2)+(1/(a^2))(1+((Sin[z])^2))(((a+b Sin[z]))^2)

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

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

Program code:

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

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

Derivation: Algebraic expansion

Basis: ((Cos[z])^4)==((Sin[z])^4)+1-2((Sin[z])^2)

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

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

Program code:

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

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

Derivation: Algebraic expansion, piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ, then ((Cos[z])^p)==(a^(-p)) (((a+b Sin[z]))^(p/2)) (((a-b Sin[z]))^(p/2))

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

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

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

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

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

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

(((a^m) Cos[e+f x])/(f (Sqrt[1+Sin[e+f x]]) (Sqrt[1-Sin[e+f x]])))Subst[∫(((d x))^n) (((1+(b/a) x))^(m+((p-1)/2))) (((1-(b/a) x))^((p-1)/2))dx,x,Sin[e+f x]]

Program code:

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

4:  ∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ ∧ m∉ℤ

Derivation: Algebraic expansion, piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ, then ((Cos[z])^p)==(a^(-p)) (((a+b Sin[z]))^(p/2)) (((a-b Sin[z]))^(p/2))

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

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

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

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

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

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

((Cos[e+f x])/((a^(p-2))f (Sqrt[a+b Sin[e+f x]]) (Sqrt[a-b Sin[e+f x]])))Subst[∫(((d x))^n) (((a+b x))^(m+(p/2)-(1/2))) (((a-b x))^((p/2)-(1/2)))dx,x,Sin[e+f x]]

Program code:

Int[cos[e_.+f_.*x_]^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  Cos[e+f*x]/(a^(p-2)*f*Sqrt[a+b*Sin[e+f*x]]*Sqrt[a-b*Sin[e+f*x]])*
    Subst[Int[(d*x)^n(a+b*x)^(m+p/2-1/2)*(a-b*x)^(p/2-1/2),x],x,Sin[e+f*x]] /;
FreeQ[{a,b,d,e,f,m,n},x] && EqQ[a^2-b^2,0] && IntegerQ[p/2] && Not[IntegerQ[m]]

8:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)==0 ∧ m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

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

∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  ⟶  ∫(((g Cos[e+f x]))^p)ExpandTrig[(((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m),x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  Int[ExpandTrig[(g*cos[e+f*x])^p,(d*sin[e+f*x])^n*(a+b*sin[e+f*x])^m,x],x] /;
FreeQ[{a,b,d,e,f,g,n,p},x] && EqQ[a^2-b^2,0] && IGtQ[m,0] && (IntegerQ[p] || IGtQ[n,0])

9.  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0

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

Derivation: Piecewise constant extraction and integration by substitution

Basis: (∂_x)((((g Cos[e+f x]))^(p-1))/((((1+Sin[e+f x]))^((p-1)/2)) (((1-Sin[e+f x]))^((p-1)/2))))==0

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

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

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

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

(((a^m) g (((g Cos[e+f x]))^(p-1)))/(f (((1+Sin[e+f x]))^((p-1)/2)) (((1-Sin[e+f x]))^((p-1)/2))))Subst[∫(((d x))^n) (((1+(b/a) x))^(m+((p-1)/2))) (((1-(b/a) x))^((p-1)/2))dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  a^m*g*(g*Cos[e+f*x])^(p-1)/(f*(1+Sin[e+f*x])^((p-1)/2)*(1-Sin[e+f*x])^((p-1)/2))*
    Subst[Int[(d*x)^n*(1+b/a*x)^(m+(p-1)/2)*(1-b/a*x)^((p-1)/2),x],x,Sin[e+f*x]] /;
FreeQ[{a,b,d,e,f,n,p},x] && EqQ[a^2-b^2,0] && IntegerQ[m]

2:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when  (a^2)-(b^2)==0 ∧ m∉ℤ

Derivation: Piecewise constant extraction and integration by substitution

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

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

Rule: If  (a^2)-(b^2)==0 ∧ m∉ℤ, then

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

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

((g (((g Cos[e+f x]))^(p-1)))/(f (((a+b Sin[e+f x]))^((p-1)/2)) (((a-b Sin[e+f x]))^((p-1)/2))))Subst[∫(((d x))^n) (((a+b x))^(m+((p-1)/2))) (((a-b x))^((p-1)/2))dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)/(f*(a+b*Sin[e+f*x])^((p-1)/2)*(a-b*Sin[e+f*x])^((p-1)/2))*
    Subst[Int[(d*x)^n*(a+b*x)^(m+(p-1)/2)*(a-b*x)^((p-1)/2),x],x,Sin[e+f*x]] /;
FreeQ[{a,b,d,e,f,m,n,p},x] && EqQ[a^2-b^2,0] && Not[IntegerQ[m]]

7.  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0

1.  ∫(((((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m))/(Sqrt[d Sin[e+f x]]))dx  when (a^2)-(b^2)≠0

1:  ∫(((((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m))/(Sqrt[d Sin[e+f x]]))dx  when (a^2)-(b^2)≠0 ∧ m<-1 ∧ m+p+(1/2)==0

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

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

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_/Sqrt[d_.*sin[e_.+f_.*x_]],x_Symbol] :=
  -g*(g*Cos[e+f*x])^(p-1)*Sqrt[d*Sin[e+f*x]]*(a+b*Sin[e+f*x])^(m+1)/(a*d*f*(m+1)) + 
  g^2*(2*m+3)/(2*a*(m+1))*Int[(g*Cos[e+f*x])^(p-2)*(a+b*Sin[e+f*x])^(m+1)/Sqrt[d*Sin[e+f*x]],x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && LtQ[m,-1] && EqQ[m+p+1/2,0]

2:  ∫(((((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m))/(Sqrt[d Sin[e+f x]]))dx  when (a^2)-(b^2)≠0 ∧ m>0 ∧ m+p+(3/2)==0

Rule: If  (a^2)-(b^2)≠0 ∧ m>0 ∧ m+p+(3/2)==0, then

∫(((((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m))/(Sqrt[d Sin[e+f x]]))dx  ⟶  
((2 (((g Cos[e+f x]))^(p+1)) (Sqrt[d Sin[e+f x]]) (((a+b Sin[e+f x]))^m))/(d f g (2 m+1)))+((2 a m)/((g^2) (2 m+1))) ∫(((((g Cos[e+f x]))^(p+2)) (((a+b Sin[e+f x]))^(m-1)))/(Sqrt[d Sin[e+f x]]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_/Sqrt[d_.*sin[e_.+f_.*x_]],x_Symbol] :=
  2*(g*Cos[e+f*x])^(p+1)*Sqrt[d*Sin[e+f*x]]*(a+b*Sin[e+f*x])^m/(d*f*g*(2*m+1)) + 
  2*a*m/(g^2*(2*m+1))*Int[(g*Cos[e+f*x])^(p+2)*(a+b*Sin[e+f*x])^(m-1)/Sqrt[d*Sin[e+f*x]],x] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0] && GtQ[m,0] && EqQ[m+p+3/2,0]

2.  ∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ (p/2)∈(SuperPlus[ℤ])

1:  ∫((Cos[e+f x])^2) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ)

Derivation: Algebraic expansion

Basis: ((Cos[z])^2)==1-((Sin[z])^2)

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

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

Program code:

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

2.  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ)

1.  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m<-1

x:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n<-1

Derivation: Algebraic expansion

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

Note: This  produces a slightly simpler antiderivative when m=-2.

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

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

Program code:

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

1:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n<-1

Derivation: Algebraic expansion and sine recurrence 3b with A->1,B->0,C->-2,m->n,n->p,  2b with A->-b (m+n+2),B->-a n,C->b (n+p+3),m->n+1,n->p and
			2a with A->0,B->0,C->1,m->n+4-2,n->p

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

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

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

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

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

Program code:

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

2.  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n≮-1

1:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n≮-1 ∧ (m<-2 ∨ m+n+4==0)

Derivation: Algebraic expansion

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

Rule: If  (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n≮-1 ∧ (m<-2 ∨ m+n+4==0), then

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

Program code:

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

2:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n≮-1 ∧ m+n+4≠0

Derivation: Algebraic expansion

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

Rule: If  (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ m<-1 ∧ n≮-1 ∧ m+n+4≠0, then

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

Program code:

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

2.  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1

1.  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1 ∧ n<-1

1:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1 ∧ n<-1 ∧ (n<-2 ∨ m+n+4==0)

Derivation: Algebraic expansion and sine recurrence 3b with A->1,B->0,C->0,m->n,n->p and 3b with A->-b (n+p+2),B->a (n+2),C->b (n+p+3),m->n+1,n->p

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

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

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

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

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

Program code:

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

2:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1 ∧ n<-1 ∧ m+n+4≠0

Derivation: Algebraic expansion and sine recurrence 3b with A->1,B->0,C->-2,m->n,n->p and 3a with A->0,B->0,C->1,m->n+4-2,n->p

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

Rule: If  (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1 ∧ n<-1 ∧ m+n+4≠0, then

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

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

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

Program code:

Int[cos[e_.+f_.*x_]^4*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  Cos[e+f*x]*(a+b*Sin[e+f*x])^(m+1)*(d*Sin[e+f*x])^(n+1)/(a*d*f*(n+1)) - 
  Cos[e+f*x]*(a+b*Sin[e+f*x])^(m+1)*(d*Sin[e+f*x])^(n+2)/(b*d^2*f*(m+n+4)) + 
  1/(a*b*d*(n+1)*(m+n+4))*Int[(a+b*Sin[e+f*x])^m*(d*Sin[e+f*x])^(n+1)*
    Simp[a^2*(n+1)*(n+2)-b^2*(m+n+2)*(m+n+4)+a*b*(m+3)*Sin[e+f*x]-(a^2*(n+1)*(n+3)-b^2*(m+n+3)*(m+n+4))*Sin[e+f*x]^2,x],x] /;
FreeQ[{a,b,d,e,f,m},x] && NeQ[a^2-b^2,0] && (IGtQ[m,0] || IntegersQ[2*m,2*n]) && Not[m<-1] && LtQ[n,-1] && NeQ[m+n+4,0]

2:  ∫((Cos[e+f x])^4) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1 ∧ n≮-1 ∧ m+n+3≠0 ∧ m+n+4≠0

Derivation: Algebraic expansion and sine recurrence 3a with A->0,B->0,C->1,m->n+4-2,n->p and 3a with A->a (n+2),B->b (n+p+3),C->-a (n+3),m->n+1,n->p

Basis: ((Cos[z])^4)==1-2((Sin[z])^2)+((Sin[z])^4)

Rule: If  (a^2)-(b^2)≠0 ∧ (m∈(SuperPlus[ℤ])∨ (2m|2n)∈ℤ) ∧ m≮-1 ∧ n≮-1 ∧ m+n+3≠0 ∧ m+n+4≠0, then

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

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

((a (n+3) Cos[e+f x] (((d Sin[e+f x]))^(n+1)) (((a+b Sin[e+f x]))^(m+1)))/((b^2) d f (m+n+3) (m+n+4)))-((Cos[e+f x] (((d Sin[e+f x]))^(n+2)) (((a+b Sin[e+f x]))^(m+1)))/(b (d^2)f (m+n+4)))-
(1/((b^2) (m+n+3) (m+n+4)))∫(((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)·
((a^2) (n+1) (n+3)-(b^2) (m+n+3) (m+n+4)+a b m Sin[e+f x]-((a^2) (n+2) (n+3)-(b^2) (m+n+3) (m+n+5)) ((Sin[e+f x])^2)) dx

Program code:

Int[cos[e_.+f_.*x_]^4*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  a*(n+3)*Cos[e+f*x]*(d*Sin[e+f*x])^(n+1)*(a+b*Sin[e+f*x])^(m+1)/(b^2*d*f*(m+n+3)*(m+n+4)) - 
  Cos[e+f*x]*(d*Sin[e+f*x])^(n+2)*(a+b*Sin[e+f*x])^(m+1)/(b*d^2*f*(m+n+4)) - 
  1/(b^2*(m+n+3)*(m+n+4))*Int[(d*Sin[e+f*x])^n*(a+b*Sin[e+f*x])^m*
    Simp[a^2*(n+1)*(n+3)-b^2*(m+n+3)*(m+n+4)+a*b*m*Sin[e+f*x]-(a^2*(n+2)*(n+3)-b^2*(m+n+3)*(m+n+5))*Sin[e+f*x]^2,x],x] /;
FreeQ[{a,b,d,e,f,m,n},x] && NeQ[a^2-b^2,0] && (IGtQ[m,0] || IntegersQ[2*m,2*n]) && Not[m<-1] && Not[LtQ[n,-1]] && NeQ[m+n+3,0] && NeQ[m+n+4,0]

3:  ∫((Cos[e+f x])^6) (((d Sin[e+f x]))^n)(((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ n≠-1 ∧ n≠-2 ∧ m+n+5≠0 ∧ m+n+6≠0

Derivation: Algebraic expansion and sine recurrence 3b with A->1,B->0,C->-3,m->n,n->p,  3b with A->-b (2+n+p),B->a (2+n-3 (1+n)),C->b (3+n+p),m->n+1,n->p, 
			3a with A->3,B->0,C->-1,m->n+4,n->p and 3a with A->-a (4+n),B->b (-5-n-p+3 (6+n+p)),C->a (5+n),m->n+3,n->p

Basis: ((Cos[z])^6)==1-3 ((Sin[z])^2)+((Sin[z])^4)(3-((Sin[z])^2))

Rule: If  (a^2)-(b^2)≠0 ∧ (2m|2n)∈ℤ ∧ n≠-1 ∧ n≠-2 ∧ m+n+5≠0 ∧ m+n+6≠0, then

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

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

((Cos[e+f x] (((d Sin[e+f x]))^(n+1)) (((a+b Sin[e+f x]))^(m+1)))/(a d f (n+1)))-((b (m+n+2) Cos[e+f x] (((d Sin[e+f x]))^(n+2)) (((a+b Sin[e+f x]))^(m+1)))/((a^2) (d^2) f (n+1) (n+2)))-
((a (n+5) Cos[e+f x] (((d Sin[e+f x]))^(n+3)) (((a+b Sin[e+f x]))^(m+1)))/((b^2) (d^3)f (m+n+5) (m+n+6)))+((Cos[e+f x] (((d Sin[e+f x]))^(n+4)) (((a+b Sin[e+f x]))^(m+1)))/(b (d^4)f (m+n+6)))+
(1/((a^2) (b^2)(d^2)(n+1) (n+2) (m+n+5) (m+n+6)))∫(((d Sin[e+f x]))^(n+2)) (((a+b Sin[e+f x]))^m)·
((a^4) (n+1) (n+2) (n+3) (n+5)-(a^2) (b^2) (n+2) (2 n+1) (m+n+5) (m+n+6)+(b^4) (m+n+2) (m+n+3) (m+n+5) (m+n+6)+
a b m ((a^2) (n+1) (n+2)-(b^2) (m+n+5) (m+n+6)) Sin[e+f x]-
((a^4) (n+1) (n+2) (4+n) (n+5)+(b^4) (m+n+2) (m+n+4) (m+n+5) (m+n+6)-(a^2) (b^2) (n+1) (n+2) (m+n+5) (2 n+2 m+13)) ((Sin[e+f x])^2))dx

Program code:

Int[cos[e_.+f_.*x_]^6*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  Cos[e+f*x]*(d*Sin[e+f*x])^(n+1)*(a+b*Sin[e+f*x])^(m+1)/(a*d*f*(n+1)) - 
  b*(m+n+2)*Cos[e+f*x]*(d*Sin[e+f*x])^(n+2)*(a+b*Sin[e+f*x])^(m+1)/(a^2*d^2*f*(n+1)*(n+2)) - 
  a*(n+5)*Cos[e+f*x]*(d*Sin[e+f*x])^(n+3)*(a+b*Sin[e+f*x])^(m+1)/(b^2*d^3*f*(m+n+5)*(m+n+6)) + 
  Cos[e+f*x]*(d*Sin[e+f*x])^(n+4)*(a+b*Sin[e+f*x])^(m+1)/(b*d^4*f*(m+n+6)) + 
  1/(a^2*b^2*d^2*(n+1)*(n+2)*(m+n+5)*(m+n+6))*
    Int[(d*Sin[e+f*x])^(n+2)*(a+b*Sin[e+f*x])^m*
      Simp[a^4*(n+1)*(n+2)*(n+3)*(n+5)-a^2*b^2*(n+2)*(2*n+1)*(m+n+5)*(m+n+6)+b^4*(m+n+2)*(m+n+3)*(m+n+5)*(m+n+6) + 
        a*b*m*(a^2*(n+1)*(n+2)-b^2*(m+n+5)*(m+n+6))*Sin[e+f*x] - 
        (a^4*(n+1)*(n+2)*(4+n)*(n+5)+b^4*(m+n+2)*(m+n+4)*(m+n+5)*(m+n+6)-a^2*b^2*(n+1)*(n+2)*(m+n+5)*(2*n+2*m+13))*Sin[e+f*x]^2,x],x] /;
FreeQ[{a,b,d,e,f,m,n},x] && NeQ[a^2-b^2,0] && IntegersQ[2*m,2*n] && NeQ[n,-1] && NeQ[n,-2] && NeQ[m+n+5,0] && NeQ[m+n+6,0] && Not[IGtQ[m,0]]

3:  ∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m|2n|(p/2))∈ℤ ∧ (m<-1 ∨ m==1 ∧ p>0)

Derivation: Algebraic expansion

Basis: ((Cos[z])^2)==1-((Sin[z])^2)

Rule: If  (a^2)-(b^2)≠0 ∧ (m|2n|(p/2))∈ℤ ∧ (m<-1 ∨ m==1 ∧ p>0), then

∫((Cos[e+f x])^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  ⟶  ∫ExpandTrig[(((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m) (((1-((Sin[e+f x])^2)))^(p/2)),x] dx

Program code:

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

4.  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0

1:  ∫(((((g Cos[e+f x]))^p) ((Sin[e+f x])^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ n∈ℤ ∧ (n<0 ∨  p+(1/2)∈(SuperPlus[ℤ]))

Derivation: Algebraic expansion

Rule: If  (a^2)-(b^2)≠0 ∧ n∈ℤ ∧ (n<0 ∨  p+(1/2)∈(SuperPlus[ℤ])), then

∫(((((g Cos[e+f x]))^p) ((Sin[e+f x])^n))/(a+b Sin[e+f x]))dx  ⟶  ∫(((g Cos[e+f x]))^p) ExpandTrig[(((Sin[e+f x])^n)/(a+b Sin[e+f x])),x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*sin[e_.+f_.*x_]^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  Int[ExpandTrig[(g*cos[e+f*x])^p,sin[e+f*x]^n/(a+b*sin[e+f*x]),x],x] /;
FreeQ[{a,b,e,f,g,p},x] && NeQ[a^2-b^2,0] && IntegerQ[n] && (LtQ[n,0] || IGtQ[p+1/2,0])

2.  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1

1.  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1 ∧ n<-1

1:  ∫(((((g Cos[e+f x]))^p)(((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1 ∧ n≤-2

Derivation: Algebraic expansion

Basis: (((Cos[z])^2)/(a+b Sin[z]))==(1/a)-((b Sin[z])/(a^2))-((((a^2)-(b^2)) ((Sin[z])^2))/((a^2) (a+b Sin[z])))

Rule: If  (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1 ∧ n≤-2, then

∫(((((g Cos[e+f x]))^p)(((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  
((g^2)/a)∫(((g Cos[e+f x]))^(p-2))(((d Sin[e+f x]))^n)dx-((b (g^2))/((a^2)d))∫(((g Cos[e+f x]))^(p-2))(((d Sin[e+f x]))^(n+1))dx-(((g^2)((a^2)-(b^2)))/((a^2)(d^2)))∫(((((g Cos[e+f x]))^(p-2))(((d Sin[e+f x]))^(n+2)))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g^2/a*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n,x] - 
  b*g^2/(a^2*d)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+1),x] - 
  g^2*(a^2-b^2)/(a^2*d^2)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+2)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && GtQ[p,1] && (LeQ[n,-2] || EqQ[n,-3/2] && EqQ[p,3/2])

2:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1 ∧ n<-1

Derivation: Algebraic expansion

Basis: (((((g Cos[z]))^p) (((d Sin[z]))^n))/(a+b Sin[z]))==(((g^2) (((g Cos[z]))^(p-2)) (((d Sin[z]))^n) (b-a Sin[z]))/(a b))+(((g^2) ((a^2)-(b^2)) (((g Cos[z]))^(p-2)) (((d Sin[z]))^(n+1)))/(a b d (a+b Sin[z])))

Rule: If  (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1 ∧ n<-1, then

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  
((g^2)/(a b)) ∫(((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^n) (b-a Sin[e+f x])dx+(((g^2) ((a^2)-(b^2)))/(a b d))∫(((((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^(n+1)))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g^2/(a*b)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n*(b-a*Sin[e+f*x]),x] + 
  g^2*(a^2-b^2)/(a*b*d)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+1)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && GtQ[p,1] && (LtQ[n,-1] || EqQ[p,3/2] && EqQ[n,-1/2])

2:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1

Derivation: Algebraic expansion

Basis: ((((g Cos[z]))^p)/(a+b Sin[z]))==(((g^2) (((g Cos[z]))^(p-2)) (a-b Sin[z]))/(b^2))-(((g^2) ((a^2)-(b^2)) (((g Cos[z]))^(p-2)))/((b^2) (a+b Sin[z])))

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

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  
((g^2)/(b^2)) ∫(((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^n) (a-b Sin[e+f x])dx-(((g^2) ((a^2)-(b^2)))/(b^2))∫(((((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g^2/b^2*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n*(a-b*Sin[e+f*x]),x] - 
  g^2*(a^2-b^2)/b^2*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && GtQ[p,1]

x:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p>1

Derivation: Algebraic expansion

Basis: (((g Cos[z]))^p) (((d Sin[z]))^n)==(g^2) (((g Cos[z]))^(p-2)) (((d Sin[z]))^n)-(((g^2) (((g Cos[z]))^(p-2)) (((d Sin[z]))^(n+2)))/(d^2))

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

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  (g^2) ∫(((((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx-((g^2)/(d^2))∫(((((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^(n+2)))/(a+b Sin[e+f x]))dx

Program code:

(* Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  g^2*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n/(a+b*Sin[e+f*x]),x] - 
  g^2/d^2*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+2)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && GtQ[p,1] *)

3.  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p<-1

1:  ∫(((((g Cos[e+f x]))^p)(((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p<-1 ∧ n>1

Derivation: Algebraic expansion

Basis: (((Sin[z])^2)/(a+b Sin[z]))==(a/((a^2)-(b^2)))-((b Sin[z])/((a^2)-(b^2)))-(((a^2)((Cos[z])^2))/(((a^2)-(b^2)) (a+b Sin[z])))

Rule: If  (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p<-1 ∧ n>1, then

∫(((((g Cos[e+f x]))^p)(((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  
((a (d^2))/((a^2)-(b^2)))∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n-2))dx-((b d)/((a^2)-(b^2)))∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n-1))dx-(((a^2)(d^2))/((g^2)((a^2)-(b^2))))∫(((((g Cos[e+f x]))^(p+2))(((d Sin[e+f x]))^(n-2)))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  a*d^2/(a^2-b^2)*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n-2),x] - 
  b*d/(a^2-b^2)*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n-1),x] - 
  a^2*d^2/(g^2*(a^2-b^2))*Int[(g*Cos[e+f*x])^(p+2)*(d*Sin[e+f*x])^(n-2)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && LtQ[p,-1] && GtQ[n,1]

2:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p<-1∧ n>0

Derivation: Algebraic expansion

Basis: (((((g Cos[z]))^p) (((d Sin[z]))^n))/(a+b Sin[z]))==-((d (((g Cos[z]))^p) (((d Sin[z]))^(n-1)) (b-a Sin[z]))/((a^2)-(b^2)))+((a b d (((g Cos[z]))^(p+2)) (((d Sin[z]))^(n-1)))/((g^2) ((a^2)-(b^2)) (a+b Sin[z])))

Rule: If  (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p<-1∧ n>0, then

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  
-(d/((a^2)-(b^2))) ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n-1)) (b-a Sin[e+f x])dx+((a b d)/((g^2) ((a^2)-(b^2))))∫(((((g Cos[e+f x]))^(p+2)) (((d Sin[e+f x]))^(n-1)))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  -d/(a^2-b^2)*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n-1)*(b-a*Sin[e+f*x]),x] + 
  a*b*d/(g^2*(a^2-b^2))*Int[(g*Cos[e+f*x])^(p+2)*(d*Sin[e+f*x])^(n-1)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && LtQ[p,-1] && GtQ[n,0]

3:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ p<-1

Derivation: Algebraic expansion

Basis: ((((g Cos[z]))^p)/(a+b Sin[z]))==(((g^2) (((g Cos[z]))^p) (a-b Sin[z]))/((g^2) ((a^2)-(b^2))))-(((b^2) (((g Cos[z]))^(p+2)))/((g^2) ((a^2)-(b^2)) (a+b Sin[z])))

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

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  
(1/((a^2)-(b^2))) ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (a-b Sin[e+f x])dx-((b^2)/((g^2) ((a^2)-(b^2))))∫(((((g Cos[e+f x]))^(p+2)) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  1/(a^2-b^2)*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^n*(a-b*Sin[e+f*x]),x] - 
  b^2/(g^2*(a^2-b^2))*Int[(g*Cos[e+f*x])^(p+2)*(d*Sin[e+f*x])^n/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && LtQ[p,-1]

4.  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ -1<p<1

1.  ∫((Sqrt[g Cos[e+f x]])/((Sqrt[d Sin[e+f x]]) (a+b Sin[e+f x])))dx  when (a^2)-(b^2)≠0

1:  ∫((Sqrt[g Cos[e+f x]])/((Sqrt[Sin[e+f x]]) (a+b Sin[e+f x])))dx  when (a^2)-(b^2)≠0

Derivation: Integration by substitution

Basis: ((Sqrt[g Cos[e+f x]])/((Sqrt[Sin[e+f x]]) (a+b Sin[e+f x])))==-((4 (Sqrt[2]) g)/f) Subst[((x^2)/(((a+b) (g^2)+(a-b) (x^4)) (Sqrt[1-((x^4)/(g^2))]))),x,((Sqrt[g Cos[e+f x]])/(Sqrt[1+Sin[e+f x]]))] (∂_x)((Sqrt[g Cos[e+f x]])/(Sqrt[1+Sin[e+f x]]))

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

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

Program code:

Int[Sqrt[g_.*cos[e_.+f_.*x_]]/(Sqrt[sin[e_.+f_.*x_]]*(a_+b_.*sin[e_.+f_.*x_])),x_Symbol] :=
  -4*Sqrt[2]*g/f*Subst[Int[x^2/(((a+b)*g^2+(a-b)*x^4)*Sqrt[1-x^4/g^2]),x],x,Sqrt[g*Cos[e+f*x]]/Sqrt[1+Sin[e+f*x]]] /;
FreeQ[{a,b,e,f,g},x] && NeQ[a^2-b^2,0]

2:  ∫((Sqrt[g Cos[e+f x]])/((Sqrt[d Sin[e+f x]]) (a+b Sin[e+f x])))dx  when (a^2)-(b^2)≠0

Derivation: Piecewise constant extraction

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

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

∫((Sqrt[g Cos[e+f x]])/((Sqrt[d Sin[e+f x]]) (a+b Sin[e+f x])))dx  ⟶  ((Sqrt[Sin[e+f x]])/(Sqrt[d Sin[e+f x]]))∫((Sqrt[g Cos[e+f x]])/((Sqrt[Sin[e+f x]]) (a+b Sin[e+f x])))dx

Program code:

Int[Sqrt[g_.*cos[e_.+f_.*x_]]/(Sqrt[d_*sin[e_.+f_.*x_]]*(a_+b_.*sin[e_.+f_.*x_])),x_Symbol] :=
  Sqrt[Sin[e+f*x]]/Sqrt[d*Sin[e+f*x]]*Int[Sqrt[g*Cos[e+f*x]]/(Sqrt[Sin[e+f*x]]*(a+b*Sin[e+f*x])),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0]

2.  ∫((Sqrt[d Sin[e+f x]])/((Sqrt[g Cos[e+f x]]) (a+b Sin[e+f x])))dx  when (a^2)-(b^2)≠0

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

Derivation: Integration by substitution and algebraic expansion

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

Basis: Let q->(Sqrt[-(a^2)+(b^2)]), then ((x^2)/(a (d^2)+2 b d (x^2)+a (x^4)))==((b+q)/(2 q (d (b+q)+a (x^2))))-((b-q)/(2 q (d (b-q)+a (x^2))))

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

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

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

Program code:

Int[Sqrt[d_.*sin[e_.+f_.*x_]]/(Sqrt[cos[e_.+f_.*x_]]*(a_+b_.*sin[e_.+f_.*x_])),x_Symbol] :=
  With[{q=Rt[-a^2+b^2,2]},
  2*Sqrt[2]*d*(b+q)/(f*q)*Subst[Int[1/((d*(b+q)+a*x^2)*Sqrt[1-x^4/d^2]),x],x,Sqrt[d*Sin[e+f*x]]/Sqrt[1+Cos[e+f*x]]] - 
  2*Sqrt[2]*d*(b-q)/(f*q)*Subst[Int[1/((d*(b-q)+a*x^2)*Sqrt[1-x^4/d^2]),x],x,Sqrt[d*Sin[e+f*x]]/Sqrt[1+Cos[e+f*x]]]] /;
FreeQ[{a,b,d,e,f},x] && NeQ[a^2-b^2,0]

2:  ∫((Sqrt[d Sin[e+f x]])/((Sqrt[g Cos[e+f x]]) (a+b Sin[e+f x])))dx  when (a^2)-(b^2)≠0

Derivation: Piecewise constant extraction

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

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

∫((Sqrt[d Sin[e+f x]])/((Sqrt[g Cos[e+f x]]) (a+b Sin[e+f x])))dx  ⟶  ((Sqrt[Cos[e+f x]])/(Sqrt[g Cos[e+f x]]))∫((Sqrt[d Sin[e+f x]])/((Sqrt[Cos[e+f x]]) (a+b Sin[e+f x])))dx

Program code:

Int[Sqrt[d_.*sin[e_.+f_.*x_]]/(Sqrt[g_.*cos[e_.+f_.*x_]]*(a_+b_.*sin[e_.+f_.*x_])),x_Symbol] :=
  Sqrt[Cos[e+f*x]]/Sqrt[g*Cos[e+f*x]]*Int[Sqrt[d*Sin[e+f*x]]/(Sqrt[Cos[e+f*x]]*(a+b*Sin[e+f*x])),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0]

3:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ -1<p<1 ∧ n>0

Derivation: Algebraic expansion

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

Rule: If  (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ -1<p<1 ∧ n>0, then

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  (d/b)∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n-1))dx-((a d)/b)∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n-1)))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  d/b*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n-1),x] - 
  a*d/b*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n-1)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && LtQ[-1,p,1] && GtQ[n,0]

4:  ∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  when (a^2)-(b^2)≠0 ∧ (2 n|2 p)∈ℤ ∧ -1<p<1 ∧ n<0

Derivation: Algebraic expansion

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

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

∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n))/(a+b Sin[e+f x]))dx  ⟶  (1/a)∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n)dx-(b/(a d))∫(((((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n+1)))/(a+b Sin[e+f x]))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_/(a_+b_.*sin[e_.+f_.*x_]),x_Symbol] :=
  1/a*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^n,x] - 
  b/(a*d)*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n+1)/(a+b*Sin[e+f*x]),x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[2*n,2*p] && LtQ[-1,p,1] && LtQ[n,0]

5.  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m∈ℤ ∧ (m>0  ∨ n∈ℤ)

1:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^2)dx  when (a^2)-(b^2)≠0

Derivation: Algebraic expansion

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

∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^2)dx  ⟶  
((2 a b)/d) ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^(n+1))dx+∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) ((a^2)+(b^2) ((Sin[e+f x])^2))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^2,x_Symbol] :=
  2*a*b/d*Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^(n+1),x] + 
  Int[(g*Cos[e+f*x])^p*(d*Sin[e+f*x])^n*(a^2+b^2*Sin[e+f*x]^2),x] /;
FreeQ[{a,b,d,e,f,g,n,p},x] && NeQ[a^2-b^2,0]

2:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ m∈ℤ ∧ (m>0  ∨ n∈ℤ)

Derivation: Algebraic expansion

Rule: If  (a^2)-(b^2)≠0 ∧ m∈ℤ ∧ (m>0  ∨ n∈ℤ), then

∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  ⟶  ∫(((g Cos[e+f x]))^p) ExpandTrig[(((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m),x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  Int[ExpandTrig[(g*cos[e+f*x])^p,(d*sin[e+f*x])^n*(a+b*sin[e+f*x])^m,x],x] /;
FreeQ[{a,b,d,e,f,g,n,p},x] && NeQ[a^2-b^2,0] && IntegerQ[m] && (GtQ[m,0] || IntegerQ[n])

6:  ∫(((g Cos[e+f x]))^p) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^m)dx  when (a^2)-(b^2)≠0 ∧ (m|2 n|2 p)∈ℤ ∧ m<0 ∧ p>1 ∧ n≤-2

Derivation: Algebraic expansion

Basis: ((Cos[z])^2)==((a+b Sin[z])/a)-((b Sin[z] (a+b Sin[z]))/(a^2))-((((a^2)-(b^2)) ((Sin[z])^2))/(a^2))

Rule: If  (a^2)-(b^2)≠0 ∧ (m|2 n|2 p)∈ℤ ∧ m<0 ∧ p>1 ∧ n≤-2, then

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

((g^2)/a)∫(((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^n) (((a+b Sin[e+f x]))^(m+1))dx-
((b (g^2))/((a^2)d))∫(((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^(n+1)) (((a+b Sin[e+f x]))^(m+1))dx-
(((g^2)((a^2)-(b^2)))/((a^2)(d^2)))∫(((g Cos[e+f x]))^(p-2)) (((d Sin[e+f x]))^(n+2)) (((a+b Sin[e+f x]))^m)dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(d_.*sin[e_.+f_.*x_])^n_*(a_+b_.*sin[e_.+f_.*x_])^m_,x_Symbol] :=
  g^2/a*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^n*(a+b*Sin[e+f*x])^(m+1),x] - 
  b*g^2/(a^2*d)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+1)*(a+b*Sin[e+f*x])^(m+1),x] - 
  g^2*(a^2-b^2)/(a^2*d^2)*Int[(g*Cos[e+f*x])^(p-2)*(d*Sin[e+f*x])^(n+2)*(a+b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,d,e,f,g},x] && NeQ[a^2-b^2,0] && IntegersQ[m,2*n,2*p] && LtQ[m,0] && GtQ[p,1] && (LeQ[n,-2] || EqQ[m,-1] && EqQ[n,-3/2] && EqQ[p,3/2])

8.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)==0

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

Derivation: Algebraic simplification

Basis: If  (a^2)-(b^2)==0 ∧ m∈ℤ ∧ 2 m+p==0, then ((Cos[z])^p) (((a+b Sin[z]))^m)==((a^(2 m))/(((a-b Sin[z]))^m))

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

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

Program code:

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

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)==0 ∧ m∈ℤ ∧ (2 m+p==0 ∨ 2 m+p>0 ∧ p<-1)

Derivation: Algebraic expansion

Basis: If  (a^2)-(b^2)==0, then a+b Sin[z]==(((a^2) (((g Cos[z]))^2))/((g^2) (a-b Sin[z])))

Note: By making the degree of the cosine factor in the integrand nonnegative, this rule removes the removable singularities from the integrand and hence from the resulting antiderivatives.

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  ((a^(2 m))/(g^(2 m))) ∫(((((g Cos[e+f x]))^(2 m+p)) (((c+d Sin[e+f x]))^n))/(((a-b Sin[e+f x]))^m))dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  (a/g)^(2*m)*Int[(g*Cos[e+f*x])^(2*m+p)*(c+d*Sin[e+f*x])^n/(a-b*Sin[e+f*x])^m,x] /;
FreeQ[{a,b,c,d,e,f,g,n},x] && EqQ[a^2-b^2,0] && IntegerQ[m] && (EqQ[2*m+p,0] || GtQ[2*m+p,0] && LtQ[p,-1])

3.  ∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ

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

Derivation: Algebraic simplification

Basis: If  (a^2)-(b^2)==0, then ((Cos[z])^2)==(1/(b^2))(a+b Sin[z]) (a-b Sin[z])

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

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

Program code:

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

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

Derivation: Algebraic expansion, piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ, then ((Cos[z])^p)==(a^(-p)) (((a+b Sin[z]))^(p/2)) (((a-b Sin[z]))^(p/2))

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

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

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

∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  

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

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

(((a^m) Cos[e+f x])/(f (Sqrt[1+Sin[e+f x]]) (Sqrt[1-Sin[e+f x]])))Subst[∫(((1+(b/a) x))^(m+((p-1)/2))) (((1-(b/a) x))^((p-1)/2)) (((c+d x))^n)dx,x,Sin[e+f x]]

Program code:

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

3:  ∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ ∧ m∉ℤ

Derivation: Algebraic expansion, piecewise constant extraction and integration by substitution

Basis: If  (a^2)-(b^2)==0 ∧ (p/2)∈ℤ, then ((Cos[z])^p)==(a^(-p)) (((a+b Sin[z]))^(p/2)) (((a-b Sin[z]))^(p/2))

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

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

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

∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  

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

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

((Cos[e+f x])/((a^(p-2))f (Sqrt[a+b Sin[e+f x]]) (Sqrt[a-b Sin[e+f x]])))Subst[∫(((a+b x))^(m+(p/2)-(1/2))) (((a-b x))^((p/2)-(1/2))) (((c+d x))^n)dx,x,Sin[e+f x]]

Program code:

Int[cos[e_.+f_.*x_]^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  Cos[e+f*x]/(a^(p-2)*f*Sqrt[a+b*Sin[e+f*x]]*Sqrt[a-b*Sin[e+f*x]])*
    Subst[Int[(a+b*x)^(m+p/2-1/2)*(a-b*x)^(p/2-1/2)*(c+d*x)^n,x],x,Sin[e+f*x]] /;
FreeQ[{a,b,c,d,e,f,m,n},x] && EqQ[a^2-b^2,0] && IntegerQ[p/2] && Not[IntegerQ[m]]

4:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)==0 ∧ m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

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

∫(((g Cos[e+f x]))^p)(((a+b Sin[e+f x]))^m)(((c+d Sin[e+f x]))^n)dx  ⟶  ∫(((g Cos[e+f x]))^p)ExpandTrig[(((a+b Sin[e+f x]))^m)(((c+d Sin[e+f x]))^n),x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  Int[ExpandTrig[(g*cos[e+f*x])^p,(a+b*sin[e+f*x])^m*(c+d*sin[e+f*x])^n,x],x] /;
FreeQ[{a,b,c,d,e,f,g,n,p},x] && EqQ[a^2-b^2,0] && IGtQ[m,0] && (IntegerQ[p] || IGtQ[n,0])

5.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  (a^2)-(b^2)==0

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

Derivation: Piecewise constant extraction and integration by substitution

Basis: (∂_x)((((g Cos[e+f x]))^(p-1))/((((1+Sin[e+f x]))^((p-1)/2)) (((1-Sin[e+f x]))^((p-1)/2))))==0

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

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  

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

(((a^m) g (((g Cos[e+f x]))^(p-1)))/(f (((1+Sin[e+f x]))^((p-1)/2)) (((1-Sin[e+f x]))^((p-1)/2))))Subst[∫(((1+(b/a) x))^(m+((p-1)/2))) (((1-(b/a) x))^((p-1)/2)) (((c+d x))^n)dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  a^m*g*(g*Cos[e+f*x])^(p-1)/(f*(1+Sin[e+f*x])^((p-1)/2)*(1-Sin[e+f*x])^((p-1)/2))*
    Subst[Int[(1+b/a*x)^(m+(p-1)/2)*(1-b/a*x)^((p-1)/2)*(c+d*x)^n,x],x,Sin[e+f*x]] /;
FreeQ[{a,b,c,d,e,f,n,p},x] && EqQ[a^2-b^2,0] && IntegerQ[m]

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when  (a^2)-(b^2)==0 ∧ m∉ℤ

Derivation: Piecewise constant extraction and integration by substitution

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

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

Rule: If  (a^2)-(b^2)==0 ∧ m∉ℤ, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  

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

((g (((g Cos[e+f x]))^(p-1)))/(f (((a+b Sin[e+f x]))^((p-1)/2)) (((a-b Sin[e+f x]))^((p-1)/2))))Subst[∫(((a+b x))^(m+((p-1)/2))) (((a-b x))^((p-1)/2)) (((c+d x))^n)dx,x,Sin[e+f x]]

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  g*(g*Cos[e+f*x])^(p-1)/(f*(a+b*Sin[e+f*x])^((p-1)/2)*(a-b*Sin[e+f*x])^((p-1)/2))*
    Subst[Int[(a+b*x)^(m+(p-1)/2)*(a-b*x)^((p-1)/2)*(c+d*x)^n,x],x,Sin[e+f*x]] /;
FreeQ[{a,b,c,d,e,f,m,n,p},x] && EqQ[a^2-b^2,0] && Not[IntegerQ[m]]

9.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)≠0

1.  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)≠0 ∧ (p/2)∈(SuperPlus[ℤ])

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

Derivation: Algebraic expansion

Basis: ((Cos[z])^2)==1-((Sin[z])^2)

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

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

Program code:

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

2:  ∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)≠0 ∧ (p/2)∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: ((Cos[z])^2)==1-((Sin[z])^2)

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

∫((Cos[e+f x])^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  
∫ExpandTrig[(((a+b Sin[e+f x]))^m)(((c+d Sin[e+f x]))^n)(((1-((Sin[e+f x])^2)))^(p/2)),x] dx

Program code:

Int[cos[e_.+f_.*x_]^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  Int[ExpandTrig[(a+b*sin[e+f*x])^m*(c+d*sin[e+f*x])^n*(1-sin[e+f*x]^2)^(p/2),x],x] /;
FreeQ[{a,b,c,d,e,f,m,n},x] && NeQ[a^2-b^2,0] && IGtQ[p/2,0] && (IGtQ[m,0] || IntegersQ[2*m,2*n])

2:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)≠0 ∧ (m|n)∈ℤ

Derivation: Algebraic expansion

Rule: If  (a^2)-(b^2)≠0 ∧ (m|n)∈ℤ, then

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  ∫ExpandTrig[(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n),x]dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_*(c_+d_.*sin[e_.+f_.*x_])^n_,x_Symbol] :=
  Int[ExpandTrig[(g*cos[e+f*x])^p*(a+b*sin[e+f*x])^m*(c+d*sin[e+f*x])^n,x],x] /;
FreeQ[{a,b,c,d,e,f,g,p},x] && NeQ[a^2-b^2,0] && IntegersQ[2*m,2*n]

X:  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  when (a^2)-(b^2)≠0

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

∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  ∫(((g Cos[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx

Program code:

Int[(g_.*cos[e_.+f_.*x_])^p_*(a_+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_])^n_.,x_Symbol] :=
  Unintegrable[(g*Cos[e+f*x])^p*(a+b*Sin[e+f*x])^m*(c+d*Sin[e+f*x])^n,x] /;
FreeQ[{a,b,c,d,e,f,g,m,n,p},x] && NeQ[a^2-b^2,0]

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

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

Derivation: Piecewise constant extraction

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

Rule: If  p∉ℤ, then

∫(((g Sec[e+f x]))^p) (((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n)dx  ⟶  
(g^(2 IntPart[p])) (((g Cos[e+f x]))^(FracPart[p])) (((g Sec[e+f x]))^(FracPart[p])) ∫(((((a+b Sin[e+f x]))^m) (((c+d Sin[e+f x]))^n))/(((g Cos[e+f x]))^p))dx

Program code:

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

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