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

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

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

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

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

Reference: G&R 2.558.1 inverted with  n==(1/2) and  (a^2)-(b^2)-(c^2)==0

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

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

Program code:

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

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

Reference: G&R 2.558.1 inverted with (a^2)-(b^2)-(c^2)==0

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

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

Program code:

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

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

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

Reference: G&R 2.558.4d

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

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

Program code:

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

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

Derivation: Algebraic simplification

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

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

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

Program code:

Int[1/Sqrt[a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]],x_Symbol] :=
  Int[1/Sqrt[a+Sqrt[b^2+c^2]*Cos[d+e*x-ArcTan[b,c]]],x] /;
FreeQ[{a,b,c,d,e},x] && EqQ[a^2-b^2-c^2,0]

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

Reference: G&R 2.558.1 inverted with (a^2)-(b^2)-(c^2)==0 inverted

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

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

Program code:

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

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

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

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

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

Reference: Integration by substitution

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

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

∫(Sqrt[a+b Cos[d+e x]+c Sin[d+e x]])dx  ⟶  (b/(c e))Subst[∫((Sqrt[a+x])/x)dx,x,b Cos[d+e x]+c Sin[d+e x]]

Program code:

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

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

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

Derivation: Algebraic simplification

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

Rule: If  (b^2)+(c^2)≠0 ∧ a+(Sqrt[(b^2)+(c^2)])>0, then

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

Program code:

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

2:  ∫(Sqrt[a+b Cos[d+e x]+c Sin[d+e x]])dx  when  (a^2)-(b^2)-(c^2)≠0 ∧ (b^2)+(c^2)≠0 ∧ ¬(a+(Sqrt[(b^2)+(c^2)])>0)

Derivation: Piecewise constant extraction and algebraic simplification

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

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

Rule: If  (a^2)-(b^2)-(c^2)≠0 ∧ (b^2)+(c^2)≠0 ∧ ¬(a+(Sqrt[(b^2)+(c^2)])>0), then

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

Program code:

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

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

Reference: G&R 2.558.1 inverted

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

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

Program code:

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

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

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

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

Note: Although this rule produces a more complicated antiderivative than the following rule, it is continuous provided  (a^2)-(b^2)-(c^2)>0.

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

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

Program code:

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

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

Note: Although this rule produces a more complicated antiderivative than the following rule, it is continuous provided  (a^2)-(b^2)-(c^2)<0.

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

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

Program code:

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

1:  ∫(1/(a+b Cos[d+e x]+c Sin[d+e x]))dx  when  a+b==0

Derivation: Integration by substitution

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

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

Rule: If  a+b==0, then

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

Program code:

Int[1/(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  Module[{f=FreeFactors[Cot[(d+e*x)/2],x]},
  -f/e*Subst[Int[1/(a+c*f*x),x],x,Cot[(d+e*x)/2]/f]] /;
FreeQ[{a,b,c,d,e},x] && EqQ[a+b,0]

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

Derivation: Integration by substitution

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

Basis: If  a+c==0, then (1/(a+b Cos[d+e x]+c Sin[d+e x]))==(1/e) Subst[(1/(a+b x)),x,Tan[(1/2) (d+e x)+(π/4)]] (∂_x)Tan[(1/2) (d+e x)+(π/4)]

Rule: If  a+c==0, then

∫(1/(a+b Cos[d+e x]+c Sin[d+e x]))dx  ⟶  (1/e)Subst[∫(1/(a+b x))dx,x,Tan[(1/2) (d+e x)+(π/4)]]

Program code:

Int[1/(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  Module[{f=FreeFactors[Tan[(d+e*x)/2+Pi/4],x]},
  f/e*Subst[Int[1/(a+b*f*x),x],x,Tan[(d+e*x)/2+Pi/4]/f]] /;
FreeQ[{a,b,c,d,e},x] && EqQ[a+c,0]

3:  ∫(1/(a+b Cos[d+e x]+c Sin[d+e x]))dx  when  a-c==0

Derivation: Integration by substitution

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

Basis: If  a-c==0, then (1/(a+b Cos[d+e x]+c Sin[d+e x]))==-(1/e) Subst[(1/(a+b x)),x,Cot[(1/2) (d+e x)+(π/4)]] (∂_x)Cot[(1/2) (d+e x)+(π/4)]

Rule: If  a-c==0, then

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

Program code:

Int[1/(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  Module[{f=FreeFactors[Cot[(d+e*x)/2+Pi/4],x]},
  -f/e*Subst[Int[1/(a+b*f*x),x],x,Cot[(d+e*x)/2+Pi/4]/f]] /;
FreeQ[{a,b,c,d,e},x] && EqQ[a-c,0] && NeQ[a-b,0]

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

Reference: G&R 2.558.4

Derivation: Integration by substitution

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

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

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

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

Program code:

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

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

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

Reference: Integration by substitution

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

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

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

Program code:

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

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

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

Derivation: Algebraic simplification

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

Rule: If  (b^2)+(c^2)≠0 ∧ a+(Sqrt[(b^2)+(c^2)])>0, then

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

Program code:

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

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

Derivation: Piecewise constant extraction and algebraic simplification

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

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

Rule: If  (a^2)-(b^2)-(c^2)≠0 ∧ (b^2)+(c^2)≠0 ∧ ¬(a+(Sqrt[(b^2)+(c^2)])>0), then

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

Program code:

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

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

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

Reference: G&R 2.558.1 with n=-(3/2)

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

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

Program code:

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

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

Reference: G&R 2.558.1

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

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

Program code:

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

2.  ∫(A+B Cos[d+e x]+C Sin[d+e x])(((a+b Cos[d+e x]+c Sin[d+e x]))^n)dx

1.  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx

1:  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  when  (b^2)+(c^2)==0

Note: Although exactly analogous to G&R 2.451.3 for hyperbolic functions, there is no corresponding G&R 2.558.n formula for trig functions.  Apparently the authors did not anticipate  (b^2)+(c^2) could be 0 in the complex plane.

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

∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  ⟶  
(((2 a A-b B-c C) x)/(2 (a^2)))-(((b B+c C) (b Cos[d+e x]-c Sin[d+e x]))/(2 a b c e))+
((((a^2) (b B-c C)-2 a A (b^2)+(b^2) (b B+c C)) Log[a+b Cos[d+e x]+c Sin[d+e x]])/(2 (a^2) b c e))

Program code:

Int[(A_.+B_.*cos[d_.+e_.*x_]+C_.*sin[d_.+e_.*x_])/(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  (2*a*A-b*B-c*C)*x/(2*a^2) - (b*B+c*C)*(b*Cos[d+e*x]-c*Sin[d+e*x])/(2*a*b*c*e) + 
  (a^2*(b*B-c*C)-2*a*A*b^2+b^2*(b*B+c*C))*Log[RemoveContent[a+b*Cos[d+e*x]+c*Sin[d+e*x],x]]/(2*a^2*b*c*e) /;
FreeQ[{a,b,c,d,e,A,B,C},x] && EqQ[b^2+c^2,0]

Int[(A_.+C_.*sin[d_.+e_.*x_])/(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  (2*a*A-c*C)*x/(2*a^2) - C*Cos[d+e*x]/(2*a*e) + c*C*Sin[d+e*x]/(2*a*b*e) + 
  (-a^2*C+2*a*c*A+b^2*C)*Log[RemoveContent[a+b*Cos[d+e*x]+c*Sin[d+e*x],x]]/(2*a^2*b*e) /;
FreeQ[{a,b,c,d,e,A,C},x] && EqQ[b^2+c^2,0]

Int[(A_.+B_.*cos[d_.+e_.*x_])/(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  (2*a*A-b*B)*x/(2*a^2) - b*B*Cos[d+e*x]/(2*a*c*e) + B*Sin[d+e*x]/(2*a*e) + 
  (a^2*B-2*a*b*A+b^2*B)*Log[RemoveContent[a+b*Cos[d+e*x]+c*Sin[d+e*x],x]]/(2*a^2*c*e) /;
FreeQ[{a,b,c,d,e,A,B},x] && EqQ[b^2+c^2,0]

2.  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  when  (b^2)+(c^2)≠0

1:  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  when  (b^2)+(c^2)≠0 ∧ A((b^2)+(c^2))-a(b B+c C)==0

Reference: G&R 2.558.2 with  A((b^2)+(c^2))-a(b B+c C)==0

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

∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  ⟶  (((b B+c C) x)/((b^2)+(c^2)))+(((c B-b C) Log[a+b Cos[d+e x]+c Sin[d+e x]])/(e ((b^2)+(c^2))))

Program code:

Int[(A_.+B_.*cos[d_.+e_.*x_]+C_.*sin[d_.+e_.*x_])/(a_.+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  (b*B+c*C)*x/(b^2+c^2) + (c*B-b*C)*Log[a+b*Cos[d+e*x]+c*Sin[d+e*x]]/(e*(b^2+c^2)) /;
FreeQ[{a,b,c,d,e,A,B,C},x] && NeQ[b^2+c^2,0] && EqQ[A*(b^2+c^2)-a*(b*B+c*C),0]

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

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

2:  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  when  (b^2)+(c^2)≠0 ∧ A ((b^2)+(c^2))-a (b B+c C)≠0

Reference: G&R 2.558.2

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

∫((A+B Cos[d+e x]+C Sin[d+e x])/(a+b Cos[d+e x]+c Sin[d+e x]))dx  ⟶  
(((b B+c C) x)/((b^2)+(c^2)))+(((c B-b C) Log[a+b Cos[d+e x]+c Sin[d+e x]])/(e ((b^2)+(c^2))))+
((A ((b^2)+(c^2))-a (b B+c C))/((b^2)+(c^2)))∫(1/(a+b Cos[d+e x]+c Sin[d+e x]))dx

Program code:

Int[(A_.+B_.*cos[d_.+e_.*x_]+C_.*sin[d_.+e_.*x_])/(a_.+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]),x_Symbol] :=
  (b*B+c*C)*x/(b^2+c^2) + (c*B-b*C)*Log[a+b*Cos[d+e*x]+c*Sin[d+e*x]]/(e*(b^2+c^2)) +
  (A*(b^2+c^2)-a*(b*B+c*C))/(b^2+c^2)*Int[1/(a+b*Cos[d+e*x]+c*Sin[d+e*x]),x] /;
FreeQ[{a,b,c,d,e,A,B,C},x] && NeQ[b^2+c^2,0] && NeQ[A*(b^2+c^2)-a*(b*B+c*C),0]

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

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

2.  ∫(A+B Cos[d+e x]+C Sin[d+e x])(((a+b Cos[d+e x]+c Sin[d+e x]))^n)dx  when  n≠-1

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

1:  ∫(A+B Cos[d+e x]+C Sin[d+e x])(((a+b Cos[d+e x]+c Sin[d+e x]))^n)dx  when  n≠-1 ∧ (a^2)-(b^2)-(c^2)==0 ∧ (b B+c C) n+a A (n+1)==0

Reference: G&R 2.558.1b

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

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

Program code:

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

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

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

2:  ∫(A+B Cos[d+e x]+C Sin[d+e x])(((a+b Cos[d+e x]+c Sin[d+e x]))^n)dx  when  n≠-1 ∧ (a^2)-(b^2)-(c^2)==0 ∧ (b B+c C) n+a A (n+1)≠0

Reference: G&R 2.558.1b

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

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

Program code:

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

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

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

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

1:  ∫(B Cos[d+e x]+C Sin[d+e x])(((b Cos[d+e x]+c Sin[d+e x]))^n)dx  when  n≠-1 ∧ (b^2)+(c^2)≠0 ∧ b B+c C==0

Reference: G&R 2.558.1a with a=0, A=0 and b B+c C==0

Rule: If  n≠-1 ∧ (b^2)+(c^2)≠0 ∧ b B+c C==0, then

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

Program code:

Int[(B_.*cos[d_.+e_.*x_]+C_.*sin[d_.+e_.*x_])*(b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_])^n_.,x_Symbol] :=
  (c*B-b*C)*(b*Cos[d+e*x]+c*Sin[d+e*x])^(n+1)/(e*(n+1)*(b^2+c^2)) /;
FreeQ[{b,c,d,e,B,C},x] && NeQ[n,-1] && NeQ[b^2+c^2,0] && EqQ[b*B+c*C,0]

2:  ∫(A+B Cos[d+e x]+C Sin[d+e x])(((a+b Cos[d+e x]+c Sin[d+e x]))^n)dx  when  n>0 ∧ (a^2)-(b^2)-(c^2)≠0

Reference: G&R 2.558.1a inverted

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

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

Program code:

Int[(A_.+B_.*cos[d_.+e_.*x_]+C_.*sin[d_.+e_.*x_])*(a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_])^n_.,x_Symbol] :=
  (B*c-b*C-a*C*Cos[d+e*x]+a*B*Sin[d+e*x])*(a+b*Cos[d+e*x]+c*Sin[d+e*x])^n/(a*e*(n+1)) + 
  1/(a*(n+1))*Int[(a+b*Cos[d+e*x]+c*Sin[d+e*x])^(n-1)*
	Simp[a*(b*B+c*C)*n+a^2*A*(n+1)+
      (n*(a^2*B-B*c^2+b*c*C)+a*b*A*(n+1))*Cos[d+e*x]+
      (n*(b*B*c+a^2*C-b^2*C)+a*c*A*(n+1))*Sin[d+e*x],x],x] /;
FreeQ[{a,b,c,d,e,A,B,C},x] && GtQ[n,0] && NeQ[a^2-b^2-c^2,0]

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

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

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

1:  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(Sqrt[a+b Cos[d+e x]+c Sin[d+e x]]))dx  when  B c-b C==0 ∧ A b-a B≠0

Derivation: Algebraic simplification

Basis: If  B c-b C==0, then A+B z+C w==(B/b)(a+b z+c w)+((A b-a B)/b)

Rule: If  B c-b C==0 ∧ A b-a B≠0, then

∫((A+B Cos[d+e x]+C Sin[d+e x])/(Sqrt[a+b Cos[d+e x]+c Sin[d+e x]]))dx  ⟶  (B/b)∫(Sqrt[a+b Cos[d+e x]+c Sin[d+e x]])dx+((A b-a B)/b)∫(1/(Sqrt[a+b Cos[d+e x]+c Sin[d+e x]]))dx

Program code:

Int[(A_.+B_.*cos[d_.+e_.*x_]+C_.*sin[d_.+e_.*x_])/Sqrt[a_+b_.*cos[d_.+e_.*x_]+c_.*sin[d_.+e_.*x_]],x_Symbol] :=
  B/b*Int[Sqrt[a+b*Cos[d+e*x]+c*Sin[d+e*x]],x] +
  (A*b-a*B)/b*Int[1/Sqrt[a+b*Cos[d+e*x]+c*Sin[d+e*x]],x] /;
FreeQ[{a,b,c,d,e,A,B,C},x] && EqQ[B*c-b*C,0] && NeQ[A*b-a*B,0]

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

1.  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(((a+b Cos[d+e x]+c Sin[d+e x]))^2))dx  when  (a^2)-(b^2)-(c^2)≠0

1:  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(((a+b Cos[d+e x]+c Sin[d+e x]))^2))dx  when  (a^2)-(b^2)-(c^2)≠0 ∧ a A-b B-c C==0

Reference: G&R 2.558.1a with  n=-2  and  a A-b B-c C=0

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

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

Program code:

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

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

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

2:  ∫((A+B Cos[d+e x]+C Sin[d+e x])/(((a+b Cos[d+e x]+c Sin[d+e x]))^2))dx  when  (a^2)-(b^2)-(c^2)≠0 ∧ a A-b B-c C≠0

Reference: G&R 2.558.1a with  n=-2

Rule: If  (a^2)-(b^2)-(c^2)≠0 ∧ a A-b B-c C≠0, then

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

Program code:

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

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

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

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

Reference: G&R 2.558.1a

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

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

Program code:

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

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

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

3.  ∫u(((a+b Sec[d+e x]+c Tan[d+e x]))^n)dx

1:  ∫(1/(a+b Sec[d+e x]+c Tan[d+e x]))dx

Derivation: Algebraic simplification

Rule:

∫(1/(a+b Sec[d+e x]+c Tan[d+e x]))dx  ⟶  ∫((Cos[d+e x])/(b+a Cos[d+e x]+c Sin[d+e x]))dx

Program code:

Int[1/(a_.+b_.*sec[d_.+e_.*x_]+c_.*tan[d_.+e_.*x_]),x_Symbol] :=
  Int[Cos[d+e*x]/(b+a*Cos[d+e*x]+c*Sin[d+e*x]),x] /;
FreeQ[{a,b,c,d,e},x]

Int[1/(a_.+b_.*csc[d_.+e_.*x_]+c_.*cot[d_.+e_.*x_]),x_Symbol] :=
  Int[Sin[d+e*x]/(b+a*Sin[d+e*x]+c*Cos[d+e*x]),x] /;
FreeQ[{a,b,c,d,e},x]

2.  ∫((Cos[d+e x])^n)(((a+b Sec[d+e x]+c Tan[d+e x]))^n)dx

1:  ∫((Cos[d+e x])^n)(((a+b Sec[d+e x]+c Tan[d+e x]))^n)dx  when n∈ℤ

Derivation: Algebraic simplification

Rule: If  n∈ℤ, then

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

Program code:

Int[cos[d_.+e_.*x_]^n_.*(a_.+b_.*sec[d_.+e_.*x_]+c_.*tan[d_.+e_.*x_])^n_.,x_Symbol] :=
  Int[(b+a*Cos[d+e*x]+c*Sin[d+e*x])^n,x] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[n]

Int[sin[d_.+e_.*x_]^n_.*(a_.+b_.*csc[d_.+e_.*x_]+c_.*cot[d_.+e_.*x_])^n_.,x_Symbol] :=
  Int[(b+a*Sin[d+e*x]+c*Cos[d+e*x])^n,x] /;
FreeQ[{a,b,c,d,e},x] && IntegerQ[n]

2:  ∫((Cos[d+e x])^n)(((a+b Sec[d+e x]+c Tan[d+e x]))^n)dx  when n∉ℤ

Derivation: Piecewise constant extraction

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

Rule: If  n∈ℤ, then

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

Program code:

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

Int[sin[d_.+e_.*x_]^n_*(a_.+b_.*csc[d_.+e_.*x_]+c_.*cot[d_.+e_.*x_])^n_,x_Symbol] :=
  Sin[d+e*x]^n*(a+b*Csc[d+e*x]+c*Cot[d+e*x])^n/(b+a*Sin[d+e*x]+c*Cos[d+e*x])^n*Int[(b+a*Sin[d+e*x]+c*Cos[d+e*x])^n,x] /;
FreeQ[{a,b,c,d,e},x] && Not[IntegerQ[n]]

3.  ∫(((Sec[d+e x])^n)/(((a+b Sec[d+e x]+c Tan[d+e x]))^n))dx

1:  ∫(((Sec[d+e x])^n)/(((a+b Sec[d+e x]+c Tan[d+e x]))^n))dx  when n∈ℤ

Derivation: Algebraic simplification

Rule: If  n∈ℤ, then

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

Program code:

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

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

2:  ∫((Cos[d+e x])^n)(((a+b Sec[d+e x]+c Tan[d+e x]))^n)dx  when n∉ℤ

Derivation: Piecewise constant extraction

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

Rule: If  n∈ℤ, then

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

Program code:

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

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