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

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

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

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

1:  ∫((Sin[c+d x])^n)dx  when  ((n-1)/2)∈(SuperPlus[ℤ])

Derivation: Integration by substitution

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

Rule: If  ((n-1)/2)∈(SuperPlus[ℤ]), then

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

Program code:

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

2.  ∫(((b Sin[c+d x]))^n)dx  when  n>1

1:  ∫((Sin[c+d x])^2)dx

Derivation: Algebraic expansion

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

Rule:

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

Program code:

Int[sin[c_.+d_.*x_/2]^2,x_Symbol] :=
  x/2 - Sin[2*c+d*x]/(2*d) /;
FreeQ[{c,d},x]

2:  ∫(((b Sin[c+d x]))^n)dx  when  n>1

Reference: G&R 2.510.2 with q->0, CRC 299

Reference: G&R 2.510.5 with p->0, CRC 305

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

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

Rule: If n>1, then

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

Program code:

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

2:  ∫(((b Sin[c+d x]))^n)dx  when  n<-1

Reference: G&R 2.510.3 with q->0, CRC 309

Reference: G&R 2.510.6 with p->0, CRC 313

Reference: G&R 2.552.3

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

Derivation: Sine recurrence 2a with A->1,B->0,C->0,a->0,m->0

Rule: If  n<-1, then

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

Program code:

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

3.  ∫(((b Sin[c+d x]))^n)dx  when  -1≤n≤-1

1.  ∫((Sin[c+d x])^n)dx  when  -1≤n≤-1

1.  ∫((Sin[c+d x])^n)dx  when  (n^2)==1

1:  ∫Sin[c+d x]dx

Reference: G&R 2.01.5, CRC 290, A&S 4.3.113

Reference: G&R 2.01.6, CRC 291, A&S 4.3.114

Derivation: Primitive rule

Basis: (∂_x)Cos[c+d x]==-d Sin[c+d x]

Rule:

∫Sin[c+d x]dx  ⟶  -((Cos[c+d x])/d)

Program code:

Int[sin[c_.+Pi/2+d_.*x_],x_Symbol] :=
  Sin[c+d*x]/d /;
FreeQ[{c,d},x]

Int[sin[c_.+d_.*x_],x_Symbol] :=
  -Cos[c+d*x]/d /;
FreeQ[{c,d},x]

x:  ∫(1/(Sin[c+d x]))dx

Note: This rule not necessary since Mathematica automatically simplifies (1/(Sin[z])) to Csc[z].

Rule:

∫(1/(Sin[c+d x]))dx  ⟶  ∫Csc[c+d x]dx

Program code:

(* Int[1/sin[c_.+d_.*x_],x_Symbol] :=
  Int[Csc[c+d*x],x] /;
FreeQ[{c,d},x] *)

2.  ∫((Sin[c+d x])^n)dx  when  (n^2)==(1/4)

1:  ∫(Sqrt[Sin[c+d x]])dx

Derivation: Primitive rule

Basis: (∂_x)EllipticE[(1/2) (x-(π/2)),2]==((Sqrt[Sin[x]])/2)

Rule:

∫(Sqrt[Sin[c+d x]])dx  ⟶  (2/d)EllipticE[(1/2) (c-(π/2)+d x),2]

Program code:

Int[Sqrt[sin[c_.+d_.*x_]],x_Symbol] :=
  2/d*EllipticE[1/2*(c-Pi/2+d*x),2] /;
FreeQ[{c,d},x]

2:  ∫(1/(Sqrt[Sin[c+d x]]))dx

Derivation: Primitive rule

Basis: (∂_x)EllipticF[(1/2) (x-(π/2)),2]==(1/(2 (Sqrt[Sin[x]])))

Rule:

∫(1/(Sqrt[Sin[c+d x]]))dx  ⟶  (2/d) EllipticF[(1/2) (c-(π/2)+d x),2]

Program code:

Int[1/Sqrt[sin[c_.+d_.*x_]],x_Symbol] :=
  2/d*EllipticF[1/2*(c-Pi/2+d*x),2] /;
FreeQ[{c,d},x]

2:  ∫(((b Sin[c+d x]))^n)dx  when  -1<n<-1

Derivation: Piecewise constant extraction

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

Rule: If  -1<n<-1, then

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

Program code:

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

2:  ∫(((b Sin[c+d x]))^n)dx  when  2n∉ℤ

Derivation: Piecewise constant extraction and integration by substitution

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

Basis: ((Cos[c+d x])/(Sqrt[((Cos[c+d x])^2)]))((Cos[c+d x])/(Sqrt[1-((Sin[c+d x])^2)]))==1

Basis: Cos[c+d x]F[b Sin[c+d x]]==(1/(b d)) Subst[F[x],x,b Sin[c+d x]](∂_x)(b Sin[c+d x])

Rule: If  2n∉ℤ, then

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

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

  ⟶  ((Cos[c+d x] (((b Sin[c+d x]))^(n+1)))/(b d (n+1) (Sqrt[((Cos[c+d x])^2)]))) Hypergeometric2F1[(1/2),((n+1)/2),((n+3)/2),((Sin[c+d x])^2)]

Alternate rule: If  2n∉ℤ, then

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

Program code:

(* Int[(b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  Cos[c+d*x]/(b*d*Sqrt[Cos[c+d*x]^2])*Subst[Int[x^n/Sqrt[1-x^2/b^2],x],x,b*Sin[c+d*x]] /;
FreeQ[{b,c,d,n},x] && Not[IntegerQ[2*n] || IntegerQ[3*n]] *)

Int[(b_.*sin[c_.+d_.*x_])^n_,x_Symbol] :=
  Cos[c+d*x]*(b*Sin[c+d*x])^(n+1)/(b*d*(n+1)*Sqrt[Cos[c+d*x]^2])*Hypergeometric2F1[1/2,(n+1)/2,(n+3)/2,Sin[c+d*x]^2] /;
FreeQ[{b,c,d,n},x] && Not[IntegerQ[2*n]]

2:  ∫(((a+b Sin[c+d x]))^2)dx

Derivation: Algebraic expansion

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

Rule:

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

Program code:

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

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

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

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

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

Derivation: Algebraic expansion

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

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

Program code:

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

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

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

Derivation: Singly degenerate sine recurrence 1b with A->c,B->d,m->(1/2),n->-1,p->0

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

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

Program code:

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

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

Reference: G&R 2.555.? inverted

Derivation: Singly degenerate sine recurrence 1b with A->c,B->d,n->-1,p->0

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

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

Program code:

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

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

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

Reference: G&R 2.555.3', CRC 337', A&S 4.3.134'/5'

Derivation: Singly degenerate sine recurrence 2a with A->1,B->0,m->-1,n->0,p->0

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

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

Program code:

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

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

Derivation: Integration by substitution

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

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

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

Program code:

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

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

Reference: G&R 2.555.?

Derivation: Singly degenerate sine recurrence 2a with A->1,B->0,n->0,p->0

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

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

Program code:

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

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

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

Derivation: Piecewise constant extraction and integration by substitution

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

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

Basis: Cos[c+d x] F[Sin[c+d x]]==(1/d) Subst[F[x],x,Sin[c+d x]](∂_x)Sin[c+d x]

Note: If  3n∈ℤ, this results in a complicated expression involving elliptic integrals instead of a single hypergeometric function.

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

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

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

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

Program code:

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

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

Derivation: Piecewise constant extraction and integration by substitution

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

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

Program code:

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

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

Derivation: Piecewise constant extraction

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

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

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

Program code:

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

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

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

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

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

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

Derivation: Primitive rule

Basis: If  a+b>0, then (∂_x)EllipticE[(1/2) (x-(π/2)),((2 b)/(a+b))]==(1/(2 (Sqrt[a+b]))) (Sqrt[a+b Sin[x]])

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

∫(Sqrt[a+b Sin[c+d x]])dx  ⟶  ((2 (Sqrt[a+b]))/d)EllipticE[(1/2) (c-(π/2)+d x),((2 b)/(a+b))]

Program code:

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

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

Derivation: Primitive rule

Basis: If  a-b>0, then (∂_x)EllipticE[(1/2) (x+(π/2)),-((2 b)/(a-b))]==(1/(2 (Sqrt[a-b]))) (Sqrt[a+b Sin[x]])

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

∫(Sqrt[a+b Sin[c+d x]])dx  ⟶  ((2 (Sqrt[a-b]))/d)EllipticE[(1/2) (c+(π/2)+d x),-((2 b)/(a-b))]

Program code:

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

3:  ∫(Sqrt[a+b Sin[c+d x]])dx  when  (a^2)-(b^2)≠0 ∧ a+b≯0

Derivation: Piecewise constant extraction

Basis: (∂_x)((Sqrt[a+b f[x]])/(Sqrt[((a+b f[x])/(a+b))]))==0

Note: Since (a/(a+b))+(b/(a+b))==1>0, the above rule applies to the resulting integrand.

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

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

Program code:

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

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

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

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

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

Program code:

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

2.  ∫(((a+b Sin[c+d x]))^n)dx  when  (a^2)-(b^2)≠0 ∧ 2n∈(SuperMinus[ℤ])

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

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

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

Note: Resulting antiderivative is continuous on the real line.

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

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

Program code:

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

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

Note: Resulting antiderivative is continuous on the real line.

Rule: If  (a^2)-(b^2)>0 ∧ a≯0, let q=(Sqrt[(a^2)-(b^2)]), then

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

Program code:

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

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

Reference: G&R 2.551.3, CRC 340, A&S 4.3.131

Reference: G&R 2.553.3, CRC 341, A&S 4.3.133

Derivation: Integration by substitution

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

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

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

Note: Tan[(z/2)]==((Sin[z])/(1+Cos[z]))

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

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

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

Program code:

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

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

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

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

Derivation: Primitive rule

Basis: If  a+b>0, then (∂_x)EllipticF[(1/2) (x-(π/2)),((2 b)/(a+b))]==((Sqrt[a+b])/(2 (Sqrt[a+b Sin[x]])))

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

∫(1/(Sqrt[a+b Sin[c+d x]]))dx  ⟶  (2/(d (Sqrt[a+b])))EllipticF[(1/2) (c-(π/2)+d x),((2 b)/(a+b))]

Program code:

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

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

Derivation: Primitive rule

Basis: If  a-b>0, then (∂_x)EllipticF[(1/2) (x+(π/2)),-((2 b)/(a-b))]==((Sqrt[a-b])/(2 (Sqrt[a+b Sin[x]])))

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

∫(1/(Sqrt[a+b Sin[c+d x]]))dx  ⟶  (2/(d (Sqrt[a-b])))EllipticF[(1/2) (c+(π/2)+d x),-((2 b)/(a-b))]

Program code:

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

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

Derivation: Piecewise constant extraction

Basis: (∂_x)((Sqrt[((a+b f[x])/(a+b))])/(Sqrt[a+b f[x]]))==0

Note: Since (a/(a+b))+(b/(a+b))==1>0, rule f1 applies to the resulting integrand.

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

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

Program code:

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

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

Reference: G&R 2.552.3

Derivation: Nondegenerate sine recurrence 1a with A->1,B->0,C->0,m->0,p->0

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

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

Program code:

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

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

Derivation: Piecewise constant extraction and integration by substitution

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

Basis: Cos[c+d x]==(1/d)(∂_x)Sin[c+d x]

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

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

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

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

Program code:

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

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

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

Derivation: Algebraic simplification

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

Rule:

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

Program code:

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