Rules for integrands of the form (((a+b Sin[e+f x]))^m)(((c+d Sin[e+f x]))^n)(A+B Sin[e+f x]+C ((Sin[e+f x])^2))

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

Derivation: Algebraic simplification

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

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

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

Program code:

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

Int[(a_.+b_.*sin[e_.+f_.*x_])^m_.*(c_.+d_.*sin[e_.+f_.*x_])^n_.*(A_.+C_.*sin[e_.+f_.*x_]^2),x_Symbol] :=
  -C/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,A,C,m,n},x] && NeQ[b*c-a*d,0] && EqQ[A*b^2+a^2*C,0]

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

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

Derivation: Algebraic expansion, nondegenerate sine recurrence 1c with c->1,d->0,A->c,B->d,C->0,n->0,p->0 and algebraic simplification

Basis: A+B z+C (z^2)==((A (b^2)-a b B+(a^2) C)/(b^2))+(((a+b z) (b B-a C+b C z))/(b^2))

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

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

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

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

Program code:

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

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

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

Derivation: Algebraic expansion, nondegenerate sine recurrence 1b with c->0,d->1,A->a c,B->b c+a d,C->b d,m->m+1,n->0,p->0 and algebraic simplification

Basis: A+B z+C (z^2)==((C (((a+b z))^2))/(b^2))+((A (b^2)-(a^2) C+b (b B-2 a C) z)/(b^2))

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

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

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

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

Program code:

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

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

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

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

Derivation: Algebraic expansion, singly degenerate sine recurrence 2b with A->1,B->0,p->0 and algebraic simplification

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

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

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

((a A-b B+a C)/a)∫(((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)(b B-a C+b C Sin[e+f x])dx   ⟶  

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

Program code:

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

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

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

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

Derivation: Algebraic expansion and doubly degenerate sine recurrence 2b with n->-(1/2),p->0

Basis: A+B z+C (z^2)==((C (e+f z+g (z^2)))/g)-((C e-A g+(C f-B g) z)/g)

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

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

Program code:

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

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

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

Derivation: Nondegenerate sine recurrence 1b with p->0 and (a^2)-(b^2)==0

Derivation: Algebraic expansion and singly degenerate sine recurrence 2c with A->c,B->d,n->n+1,p->0

Basis: A+B z+C (z^2)==((C (((c+d z))^2))/(d^2))+((A (d^2)-(c^2) C-d (2 c C-B d) z)/(d^2))

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

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

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

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

Program code:

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

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

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

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

Derivation: Algebraic expansion, singly degenerate sine recurrence 2b with A->1,B->0,p->0 and algebraic simplification

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

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

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

((a A-b B+a C)/a)∫(((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)(b B-a C+b C Sin[e+f x])dx   ⟶  

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

Program code:

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

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

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

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

Derivation: Algebraic expansion and singly degenerate sine recurrence 1c with A->1,B->0,p->0

Basis: A+B z+C (z^2)==(((c^2) C-B c d+A (d^2))/(d^2))-(((c+d z) (c C-B d-C d z))/(d^2))

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

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

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

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

Program code:

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

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

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

Derivation: Nondegenerate sine recurrence 1b with p->0 and (a^2)-(b^2)==0

Derivation: Algebraic expansion and singly degenerate sine recurrence 2c with A->c,B->d,n->n+1,p->0

Basis: A+B z+C (z^2)==((C (((c+d z))^2))/(d^2))+((A (d^2)-(c^2) C-d (2 c C-B d) z)/(d^2))

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

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

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

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

Program code:

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

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

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

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

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

Derivation: Nondegenerate sine recurrence 1a with p->0

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

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

Program code:

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

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

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

Derivation: Nondegenerate sine recurrence 1b with p->0

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

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

Program code:

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

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

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

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

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

Derivation: Algebraic expansion

Basis: ((A+B z+C (z^2))/((((a+b z))^(3/2))(Sqrt[d z])))==((C (Sqrt[d z]))/(b d (Sqrt[a+b z])))+((A b+(b B-a C) z)/(b(((a+b z))^(3/2))(Sqrt[d z])))

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

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

Program code:

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

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

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

Derivation: Algebraic expansion

Basis: ((A+B z+C (z^2))/(((a+b z))^(3/2)))==((C (Sqrt[a+b z]))/(b^2))+((A (b^2)-(a^2) C+b (b B-2 a C) z)/((b^2) (((a+b z))^(3/2))))

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

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

Program code:

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

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

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

Derivation: Nondegenerate sine recurrence 1c with p->0

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

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

Program code:

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

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

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

Derivation: Algebraic expansion

Basis: ((A+B z+C (z^2))/((a+b z) (c+d z)))==(C/(b d))+((A (b^2)-a b B+(a^2) C)/(b (b c-a d) (a+b z)))-(((c^2) C-B c d+A (d^2))/(d (b c-a d) (c+d z)))

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

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

Program code:

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

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

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

Derivation: Algebraic expansion

Basis: ((A+B z+C (z^2))/((Sqrt[a+b z]) (c+d z)))==((C (Sqrt[a+b z]))/(b d))-((a c C-A b d+(b c C-b B d+a C d) z)/(b d (Sqrt[a+b z]) (c+d z)))

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

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

Program code:

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

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

5:  ∫((A+B Sin[e+f x]+C ((Sin[e+f x])^2))/((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 ∧ (c^2)-(d^2)≠0

Derivation: Nondegenerate sine recurrence 1b with m->-(1/2),n->-(1/2),p->0

Note: If one of the square root factors does not have a constant term, it is better to raise that factor to the 3/2 power.

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

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

Program code:

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

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

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

Derivation: Algebraic expansion

Basis: ((A+B z+C (z^2))/(a+b z))==((b B-a C)/(b^2))+((C z)/b)+((A (b^2)-a b B+(a^2) C)/((b^2) (a+b z)))

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

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

Program code:

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

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

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

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

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

Program code:

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

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

Rules for integrands of the form (((b ((Sin[e+f x])^p)))^m) (((c+d Sin[e+f x]))^n) (A+B Sin[e+f x]+C ((Sin[e+f x])^2))

1:  ∫(((b ((Sin[e+f x])^p)))^m) (((c+d Sin[e+f x]))^n) (A+B Sin[e+f x]+C ((Sin[e+f x])^2))dx  when  m∉ℤ

Derivation: Piecewise constant extraction

Basis: (∂_x)((((b ((Sin[e+f x])^p)))^m)/(((b Sin[e+f x]))^(m p)))==0

Rule: If  m∉ℤ, then

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

Program code:

Int[(b_.*sin[e_.+f_.*x_]^p_)^m_*(c_.+d_.*sin[e_.+f_.*x_])^n_.*(A_.+B_.*sin[e_.+f_.*x_]+C_.*sin[e_.+f_.*x_]^2),x_Symbol] :=
  (b*Sin[e+f*x]^p)^m/(b*Sin[e+f*x])^(m*p)*Int[(b*Sin[e+f*x])^(m*p)*(c+d*Sin[e+f*x])^n*(A+B*Sin[e+f*x]+C*Sin[e+f*x]^2),x] /;
FreeQ[{b,c,d,e,f,A,B,C,m,n,p},x] && Not[IntegerQ[m]]

Int[(b_.*cos[e_.+f_.*x_]^p_)^m_*(c_.+d_.*cos[e_.+f_.*x_])^n_.*(A_.+B_.*cos[e_.+f_.*x_]+C_.*cos[e_.+f_.*x_]^2),x_Symbol] :=
  (b*Cos[e+f*x]^p)^m/(b*Cos[e+f*x])^(m*p)*Int[(b*Cos[e+f*x])^(m*p)*(c+d*Cos[e+f*x])^n*(A+B*Cos[e+f*x]+C*Cos[e+f*x]^2),x] /;
FreeQ[{b,c,d,e,f,A,B,C,m,n,p},x] && Not[IntegerQ[m]]

Int[(b_.*sin[e_.+f_.*x_]^p_)^m_*(c_.+d_.*sin[e_.+f_.*x_])^n_.*(A_.+C_.*sin[e_.+f_.*x_]^2),x_Symbol] :=
  (b*Sin[e+f*x]^p)^m/(b*Sin[e+f*x])^(m*p)*Int[(b*Sin[e+f*x])^(m*p)*(c+d*Sin[e+f*x])^n*(A+C*Sin[e+f*x]^2),x] /;
FreeQ[{b,c,d,e,f,A,C,m,n,p},x] && Not[IntegerQ[m]]

Int[(b_.*cos[e_.+f_.*x_]^p_)^m_*(c_.+d_.*cos[e_.+f_.*x_])^n_.*(A_.+C_.*cos[e_.+f_.*x_]^2),x_Symbol] :=
  (b*Cos[e+f*x]^p)^m/(b*Cos[e+f*x])^(m*p)*Int[(b*Cos[e+f*x])^(m*p)*(c+d*Cos[e+f*x])^n*(A+C*Cos[e+f*x]^2),x] /;
FreeQ[{b,c,d,e,f,A,C,m,n,p},x] && Not[IntegerQ[m]]