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

1.  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx

1:  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)==0

Reference: Integration by substitution

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

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

∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  ⟶  ((a (((a Cos[c+d x]+b Sin[c+d x]))^n))/(b d n))

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  a*(a*Cos[c+d*x]+b*Sin[c+d*x])^n/(b*d*n) /;
FreeQ[{a,b,c,d,n},x] && EqQ[a^2+b^2,0]

2.  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0

1.  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n>1

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

Reference: G&R 2.557'

Derivation: Integration by substitution

Basis: If  ((n-1)/2)∈ℤ, then (((a Cos[z]+b Sin[z]))^n)==-((((a^2)+(b^2)-(((b Cos[z]-a Sin[z]))^2)))^((n-1)/2)) (∂_z)(b Cos[z]-a Sin[z])

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

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

Program code:

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

2:  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ ((n-1)/2)∉ℤ ∧ n>1

Derivation: Integration by parts with a double-back flip

Rule: If  (a^2)+(b^2)≠0 ∧ ((n-1)/2)∉ℤ ∧ n>1, then

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

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  -(b*Cos[c+d*x]-a*Sin[c+d*x])*(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-1)/(d*n) +
  (n-1)*(a^2+b^2)/n*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-2),x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0] && Not[IntegerQ[(n-1)/2]] && GtQ[n,1]

2.  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n≤-1

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

Reference: G&R 2.557'

Derivation: Integration by substitution

Basis: If  ((n-1)/2)∈ℤ, then (((a Cos[z]+b Sin[z]))^n)==-((((a^2)+(b^2)-(((b Cos[z]-a Sin[z]))^2)))^((n-1)/2)) (∂_z)(b Cos[z]-a Sin[z])

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

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

Program code:

Int[1/(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_]),x_Symbol] :=
  -1/d*Subst[Int[1/(a^2+b^2-x^2),x],x,b*Cos[c+d*x]-a*Sin[c+d*x]] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0]

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

Reference: G&R 2.557.5b'

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

∫(1/(((a Cos[c+d x]+b Sin[c+d x]))^2))dx  ⟶  ((Sin[c+d x])/(a d (a Cos[c+d x]+b Sin[c+d x])))

Program code:

Int[1/(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^2,x_Symbol] :=
  Sin[c+d*x]/(a*d*(a*Cos[c+d*x]+b*Sin[c+d*x])) /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0]

3:  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n<-1 ∧ n≠-2

Derivation: Integration by parts with a double-back flip

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

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

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  (b*Cos[c+d*x]-a*Sin[c+d*x])*(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+1)/(d*(n+1)*(a^2+b^2)) +
  (n+2)/((n+1)*(a^2+b^2))*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+2),x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0] && LtQ[n,-1] && NeQ[n,-2]

3.  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ ¬(n≥1 ∨ n≤-1)

1:  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  ¬(n≥1 ∨ n≤-1) ∧ (a^2)+(b^2)>0

Derivation: Algebraic simplification

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

Rule: If  ¬(n≥1 ∨ n≤-1) ∧ (a^2)+(b^2)>0, then

∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  ⟶  ((((a^2)+(b^2)))^(n/2))∫(((Cos[c+d x-ArcTan[a,b]]))^n)dx

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  (a^2+b^2)^(n/2)*Int[(Cos[c+d*x-ArcTan[a,b]])^n,x] /;
FreeQ[{a,b,c,d,n},x] && Not[GeQ[n,1] || LeQ[n,-1]] && GtQ[a^2+b^2,0]

2:  ∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  ¬(n≥1 ∨ n≤-1) ∧ ¬((a^2)+(b^2)≥0)

Derivation: Piecewise constant extraction and algebraic simplification

Basis: (∂_x)((((a Cos[c+d x]+b Sin[c+d x]))^n)/(((((a Cos[c+d x]+b Sin[c+d x])/(Sqrt[(a^2)+(b^2)]))))^n))==0

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

Rule: If  ¬(n≥1 ∨ n≤-1) ∧ ¬((a^2)+(b^2)≥0), then

∫(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  ⟶  ((((a Cos[c+d x]+b Sin[c+d x]))^n)/(((((a Cos[c+d x]+b Sin[c+d x])/(Sqrt[(a^2)+(b^2)]))))^n))∫(((((a Cos[c+d x]+b Sin[c+d x])/(Sqrt[(a^2)+(b^2)]))))^n)dx
                                                                              ⟶  ((((a Cos[c+d x]+b Sin[c+d x]))^n)/(((((a Cos[c+d x]+b Sin[c+d x])/(Sqrt[(a^2)+(b^2)]))))^n))∫(((Cos[c+d x-ArcTan[a,b]]))^n)dx

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  (a*Cos[c+d*x]+b*Sin[c+d*x])^n/((a*Cos[c+d*x]+b*Sin[c+d*x])/Sqrt[a^2+b^2])^n*Int[Cos[c+d*x-ArcTan[a,b]]^n,x] /;
FreeQ[{a,b,c,d,n},x] && Not[GeQ[n,1] || LeQ[n,-1]] && Not[GtQ[a^2+b^2,0] || EqQ[a^2+b^2,0]]

2.  ∫((Sin[c+d x])^m)(((a Cos[c+d x]+b Sin[c+d x]))^n)dx

1.  ∫((((a Cos[c+d x]+b Sin[c+d x]))^n)/((Sin[c+d x])^n))dx  when n∈ℤ

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

1:  ∫((((a Cos[c+d x]+b Sin[c+d x]))^n)/((Sin[c+d x])^n))dx  when (a^2)+(b^2)==0 ∧ n>1

Note: Compare this with the rule for integrands of the form (((a+b Cot[c+d x]))^n) when (a^2)+(b^2)==0 ∧ n>1.

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

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

Program code:

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

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

2:  ∫((((a Cos[c+d x]+b Sin[c+d x]))^n)/((Sin[c+d x])^n))dx  when (a^2)+(b^2)==0 ∧ n<0

Note: Compare this with the rule for integrands of the form (((a+b Cot[c+d x]))^n) when (a^2)+(b^2)==0 ∧ n<0.

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

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

Program code:

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

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

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

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

∫((((a Cos[c+d x]+b Sin[c+d x]))^n)/((Sin[c+d x])^n))dx  ⟶  ((a(((a Cos[c+d x]+b Sin[c+d x]))^n))/(2 b d n ((Sin[c+d x])^n)))Hypergeometric2F1[1,n,n+1,((b+a Cot[c+d x])/(2 b))]

Program code:

Int[sin[c_.+d_.*x_]^m_.*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  a*(a*Cos[c+d*x]+b*Sin[c+d*x])^n/(2*b*d*n*Sin[c+d*x]^n)*Hypergeometric2F1[1,n,n+1,(b+a*Cot[c+d*x])/(2*b)] /;
FreeQ[{a,b,c,d,n},x] && EqQ[m+n,0] && EqQ[a^2+b^2,0] && Not[IntegerQ[n]]

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

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

Derivation: Algebraic simplification

Basis: ((a Cos[z]+b Sin[z])/(Sin[z]))==b+a Cot[z]

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

∫((((a Cos[c+d x]+b Sin[c+d x]))^n)/((Sin[c+d x])^n))dx  ⟶  ∫(((b+a Cot[c+d x]))^n)dx

Program code:

Int[sin[c_.+d_.*x_]^m_*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_.,x_Symbol] :=
  Int[(b+a*Cot[c+d*x])^n,x] /;
FreeQ[{a,b,c,d},x] && EqQ[m+n,0] && IntegerQ[n] && NeQ[a^2+b^2,0]

Int[cos[c_.+d_.*x_]^m_*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_.,x_Symbol] :=
  Int[(a+b*Tan[c+d*x])^n,x] /;
FreeQ[{a,b,c,d},x] && EqQ[m+n,0] && IntegerQ[n] && NeQ[a^2+b^2,0]

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

Derivation: Integration by substitution

Basis: If  n∈ℤ, then ((Sin[c+d x])^m)(((a Cos[c+d x]+b Sin[c+d x]))^n)==((Sin[c+d x])^(m+n))((((a+b Tan[c+d x]))^n)/((Tan[c+d x])^n))

Basis: If ((m+n)/2)∈ℤ, then ((Sin[c+d x])^(m+n))((((a+b Tan[c+d x]))^n)/((Tan[c+d x])^n))==(1/d)((((Tan[c+d x])^m)(((a+b Tan[c+d x]))^n))/(((1+((Tan[c+d x])^2)))^((m+n+2)/2)))(∂_x)Tan[c+d x]

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

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

Program code:

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

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

3:  ∫((Sin[c+d x])^m)(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when m∈ℤ ∧ n∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule: If  m∈ℤ ∧ n∈(SuperPlus[ℤ]), then

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

Program code:

Int[sin[c_.+d_.*x_]^m_.*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_.,x_Symbol] :=
  Int[ExpandTrig[sin[c+d*x]^m*(a*cos[c+d*x]+b*sin[c+d*x])^n,x],x] /;
FreeQ[{a,b,c,d},x] && IntegerQ[m] && IGtQ[n,0]

Int[cos[c_.+d_.*x_]^m_.*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_.,x_Symbol] :=
  Int[ExpandTrig[cos[c+d*x]^m*(a*cos[c+d*x]+b*sin[c+d*x])^n,x],x] /;
FreeQ[{a,b,c,d},x] && IntegerQ[m] && IGtQ[n,0]

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

Derivation: Algebraic simplification

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

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

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

Program code:

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

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

5.  ∫((Sin[c+d x])^m)(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0

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

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

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

2.  ∫((Sin[c+d x])^m)(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n>1 ∧ m<0

1:  ∫((((a Cos[c+d x]+b Sin[c+d x]))^n)/(Sin[c+d x]))dx  when  (a^2)+(b^2)≠0 ∧ n>1

Derivation: Algebraic expansion and power rule for integration

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

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

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

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_/sin[c_.+d_.*x_],x_Symbol] :=
  a*(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-1)/(d*(n-1)) + 
  b*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-1),x] + 
  a^2*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-2)/Sin[c+d*x],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0] && LtQ[n,-1]

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_/cos[c_.+d_.*x_],x_Symbol] :=
  -b*(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-1)/(d*(n-1)) + 
  a*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-1),x] + 
  b^2*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n-2)/Cos[c+d*x],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0] && LtQ[n,-1]

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

Derivation: Algebraic expansion

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

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

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

Program code:

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

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

2.  ∫((Sin[c+d x])^m)(((a Cos[c+d x]+b Sin[c+d x]))^n)dx  when  (a^2)+(b^2)≠0 ∧ n<0

1.  ∫(((Sin[c+d x])^m)/(a Cos[c+d x]+b Sin[c+d x]))dx  when  (a^2)+(b^2)≠0

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

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

Derivation: Algebraic expansion

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

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

∫((Sin[c+d x])/(a Cos[c+d x]+b Sin[c+d x]))dx  ⟶  ((b x)/((a^2)+(b^2)))-(a/((a^2)+(b^2)))∫((b Cos[c+d x]-a Sin[c+d x])/(a Cos[c+d x]+b Sin[c+d x]))dx

Program code:

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

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

2:  ∫(((Sin[c+d x])^m)/(a Cos[c+d x]+b Sin[c+d x]))dx  when  (a^2)+(b^2)≠0 ∧ m>1

Derivation: Algebraic expansion and power rule for integration

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

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

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

Program code:

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

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

2.  ∫(((Sin[c+d x])^m)/(a Cos[c+d x]+b Sin[c+d x]))dx  when  (a^2)+(b^2)≠0 ∧ m<0

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

Derivation: Algebraic expansion

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

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

∫(1/(Sin[c+d x](a Cos[c+d x]+b Sin[c+d x])))dx  ⟶  (1/a)∫Cot[c+d x]dx-(1/a)∫((b Cos[c+d x]-a Sin[c+d x])/(a Cos[c+d x]+b Sin[c+d x]))dx

Program code:

Int[1/(sin[c_.+d_.*x_]*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])),x_Symbol] :=
  1/a*Int[Cot[c+d*x],x] - 
  1/a*Int[(b*Cos[c+d*x]-a*Sin[c+d*x])/(a*Cos[c+d*x]+b*Sin[c+d*x]),x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0]

Int[1/(cos[c_.+d_.*x_]*(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])),x_Symbol] :=
  1/b*Int[Tan[c+d*x],x] + 
  1/b*Int[(b*Cos[c+d*x]-a*Sin[c+d*x])/(a*Cos[c+d*x]+b*Sin[c+d*x]),x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0]

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

Derivation: Algebraic expansion and power rule for integration

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

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

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

Program code:

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

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

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

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

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

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

Derivation: Algebraic expansion and power rule for integration

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

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

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

Program code:

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_/sin[c_.+d_.*x_],x_Symbol] :=
  -(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+1)/(a*d*(n+1)) - 
  b/a^2*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+1),x] + 
  1/a^2*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+2)/Sin[c+d*x],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0] && LtQ[n,-1]

Int[(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_])^n_/cos[c_.+d_.*x_],x_Symbol] :=
  (a*Cos[c+d*x]+b*Sin[c+d*x])^(n+1)/(b*d*(n+1)) - 
  a/b^2*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+1),x] + 
  1/b^2*Int[(a*Cos[c+d*x]+b*Sin[c+d*x])^(n+2)/Cos[c+d*x],x] /;
FreeQ[{a,b,c,d},x] && NeQ[a^2+b^2,0] && LtQ[n,-1]

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

Derivation: Algebraic expansion

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

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

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

Program code:

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

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

3.  ∫((Cos[c+d x])^m) ((Sin[c+d x])^n)(((a Cos[c+d x]+b Sin[c+d x]))^p)dx

1.  ∫((Cos[c+d x])^m) ((Sin[c+d x])^n)(((a Cos[c+d x]+b Sin[c+d x]))^p)dx  when p>0

1:  ∫((Cos[c+d x])^m) ((Sin[c+d x])^n)(((a Cos[c+d x]+b Sin[c+d x]))^p)dx  when p∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Rule: If  p∈(SuperPlus[ℤ]), then

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

Program code:

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

2.  ∫((Cos[c+d x])^m) ((Sin[c+d x])^n)(((a Cos[c+d x]+b Sin[c+d x]))^p)dx  when p<0

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

Derivation: Algebraic simplification

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

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

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

Program code:

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

2.  ∫((((Cos[c+d x])^m) ((Sin[c+d x])^n))/(a Cos[c+d x]+b Sin[c+d x]))dx

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

Derivation: Algebraic expansion

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

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

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

Program code:

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

2:  ∫((((Cos[c+d x])^m) ((Sin[c+d x])^n))/(a Cos[c+d x]+b Sin[c+d x]))dx  when  (m|n)∈ℤ

Derivation: Algebraic expansion

Rule: If  (m|n)∈ℤ, then

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

Program code:

Int[cos[c_.+d_.*x_]^m_.*sin[c_.+d_.*x_]^n_./(a_.*cos[c_.+d_.*x_]+b_.*sin[c_.+d_.*x_]),x_Symbol] :=
  Int[ExpandTrig[cos[c+d*x]^m*sin[c+d*x]^n/(a*cos[c+d*x]+b*sin[c+d*x]),x],x] /;
FreeQ[{a,b,c,d,m,n},x] && IntegersQ[m,n]

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

Derivation: Algebraic expansion

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

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

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

Program code:

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