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

1.  ∫(((c+d x))^m) (((b Sec[e+f x]))^n)dx

1.  ∫(((c+d x))^m) ((Sec[e+f x])^n)dx  when  n>0

1:  ∫(((c+d x))^m)Sec[e+f x]dx  when  m∈(SuperPlus[ℤ])

Derivation: Integration by parts

Basis: Csc[e+f x]==-(∂_x)((2ArcTanh[(e^(i (e+f x)))])/f)==(∂_x)((Log[1-(e^(i (e+f x)))])/f)-(∂_x)((Log[1+(e^(i (e+f x)))])/f)

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

∫(((c+d x))^m)Sec[e+f x]dx  ⟶  
-((2i (((c+d x))^m) ArcTan[(e^(i (e+f x)))])/f)-((d m)/f)∫(((c+d x))^(m-1)) Log[1-i (e^(i (e+f x)))]dx+((d m)/f)∫(((c+d x))^(m-1)) Log[1+i (e^(i (e+f x)))]dx

∫(((c+d x))^m)Csc[e+f x]dx  ⟶  
-((2 (((c+d x))^m) ArcTanh[(e^(-i (e+f x)))])/f)-((d m)/f)∫(((c+d x))^(m-1)) Log[1-(e^(-i (e+f x)))]dx+((d m)/f)∫(((c+d x))^(m-1)) Log[1+(e^(-i (e+f x)))]dx

Program code:

Int[(c_.+d_.*x_)^m_.*csc[e_.+k_.*Pi+f_.*Complex[0,fz_]*x_],x_Symbol] :=
  -2*(c+d*x)^m*ArcTanh[E^(-I*k*Pi)*E^(-I*e+f*fz*x)]/(f*fz*I) - 
  d*m/(f*fz*I)*Int[(c+d*x)^(m-1)*Log[1-E^(-I*k*Pi)*E^(-I*e+f*fz*x)],x] + 
  d*m/(f*fz*I)*Int[(c+d*x)^(m-1)*Log[1+E^(-I*k*Pi)*E^(-I*e+f*fz*x)],x] /;
FreeQ[{c,d,e,f,fz},x] && IntegerQ[2*k] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_.*csc[e_.+k_.*Pi+f_.*x_],x_Symbol] :=
  -2*(c+d*x)^m*ArcTanh[E^(I*k*Pi)*E^(I*(e+f*x))]/f - 
  d*m/f*Int[(c+d*x)^(m-1)*Log[1-E^(I*k*Pi)*E^(I*(e+f*x))],x] + 
  d*m/f*Int[(c+d*x)^(m-1)*Log[1+E^(I*k*Pi)*E^(I*(e+f*x))],x] /;
FreeQ[{c,d,e,f},x] && IntegerQ[2*k] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_.*csc[e_.+f_.*Complex[0,fz_]*x_],x_Symbol] :=
  -2*(c+d*x)^m*ArcTanh[E^(-I*e+f*fz*x)]/(f*fz*I) - 
  d*m/(f*fz*I)*Int[(c+d*x)^(m-1)*Log[1-E^(-I*e+f*fz*x)],x] + 
  d*m/(f*fz*I)*Int[(c+d*x)^(m-1)*Log[1+E^(-I*e+f*fz*x)],x] /;
FreeQ[{c,d,e,f,fz},x] && IGtQ[m,0]

Int[(c_.+d_.*x_)^m_.*csc[e_.+f_.*x_],x_Symbol] :=
  -2*(c+d*x)^m*ArcTanh[E^(I*(e+f*x))]/f - 
  d*m/f*Int[(c+d*x)^(m-1)*Log[1-E^(I*(e+f*x))],x] + 
  d*m/f*Int[(c+d*x)^(m-1)*Log[1+E^(I*(e+f*x))],x] /;
FreeQ[{c,d,e,f},x] && IGtQ[m,0]

2.  ∫(((c+d x))^m) (((b Sec[e+f x]))^n)dx  when  n>1

1:  ∫(((c+d x))^m)((Sec[e+f x])^2)dx  when  m>0

Reference: CRC 430, A&S 4.3.125

Reference: CRC 428, A&S 4.3.121

Basis: ((Sec[e+f x])^2)==(∂_x)((Tan[e+f x])/f)

Rule: If  m>0, then

∫(((c+d x))^m)((Sec[e+f x])^2)dx  ⟶  (((((c+d x))^m) Tan[e+f x])/f)-((d m)/f)∫(((c+d x))^(m-1)) Tan[e+f x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*csc[e_.+f_.*x_]^2,x_Symbol] :=
  -(c+d*x)^m*Cot[e+f*x]/f + 
  d*m/f*Int[(c+d*x)^(m-1)*Cot[e+f*x],x] /;
FreeQ[{c,d,e,f},x] && GtQ[m,0]

2:  ∫(c+d x) (((b Sec[e+f x]))^n)dx  when  n>1 ∧ n≠2

Reference: G&R 2.643.2 with m->1, CRC 431, A&S 4.3.126

Reference: G&R 2.643.1 with m->1, CRC 429', A&S 4.3.122

Rule: If  n>1 ∧ n≠2, then

∫(c+d x) (((b Sec[e+f x]))^n)dx  ⟶  
(((b^2) (c+d x) Tan[e+f x] (((b Sec[e+f x]))^(n-2)))/(f (n-1)))-(((b^2) d (((b Sec[e+f x]))^(n-2)))/((f^2) (n-1) (n-2)))+(((b^2) (n-2))/(n-1))∫(c+d x) (((b Sec[e+f x]))^(n-2))dx

Program code:

Int[(c_.+d_.*x_)*(b_.*csc[e_.+f_.*x_])^n_,x_Symbol] :=
  -b^2*(c+d*x)*Cot[e+f*x]*(b*Csc[e+f*x])^(n-2)/(f*(n-1)) - 
  b^2*d*(b*Csc[e+f*x])^(n-2)/(f^2*(n-1)*(n-2)) + 
  b^2*(n-2)/(n-1)*Int[(c+d*x)*(b*Csc[e+f*x])^(n-2),x] /;
FreeQ[{b,c,d,e,f},x] && GtQ[n,1] && NeQ[n,2]

3:  ∫(((c+d x))^m)(((b Sec[e+f x]))^n)dx  when  n>1 ∧ n≠2 ∧ m>1

Reference: G&R 2.643.2

Reference: G&R 2.643.1

Rule: If  n>1 ∧ n≠2 ∧ m>1, then

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

Program code:

Int[(c_.+d_.*x_)^m_*(b_.*csc[e_.+f_.*x_])^n_,x_Symbol] :=
  -b^2*(c+d*x)^m*Cot[e+f*x]*(b*Csc[e+f*x])^(n-2)/(f*(n-1)) - 
  b^2*d*m*(c+d*x)^(m-1)*(b*Csc[e+f*x])^(n-2)/(f^2*(n-1)*(n-2)) + 
  b^2*(n-2)/(n-1)*Int[(c+d*x)^m*(b*Csc[e+f*x])^(n-2),x] + 
  b^2*d^2*m*(m-1)/(f^2*(n-1)*(n-2))*Int[(c+d*x)^(m-2)*(b*Csc[e+f*x])^(n-2),x] /;
FreeQ[{b,c,d,e,f},x] && GtQ[n,1] && NeQ[n,2] && GtQ[m,1]

2.  ∫(((c+d x))^m) (((b Sec[e+f x]))^n)dx  when  n<-1

1:  ∫(c+d x) (((b Sec[e+f x]))^n)dx  when  n<-1

Reference: G&R 2.631.3 with m->1

Reference: G&R 2.631.2 with m->1

Rule: If  n<-1, then

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

Program code:

Int[(c_.+d_.*x_)*(b_.*csc[e_.+f_.*x_])^n_,x_Symbol] :=
  d*(b*Csc[e+f*x])^n/(f^2*n^2) + 
  (c+d*x)*Cos[e+f*x]*(b*Csc[e+f*x])^(n+1)/(b*f*n) + 
  (n+1)/(b^2*n)*Int[(c+d*x)*(b*Csc[e+f*x])^(n+2),x] /;
FreeQ[{b,c,d,e,f},x] && LtQ[n,-1]

2:  ∫(((c+d x))^m)(((b Sec[e+f x]))^n)dx  when  n<-1 ∧ m>1

Reference: G&R 2.631.3

Reference: G&R 2.631.2

Rule: If  n<-1 ∧ m>1, then

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

Program code:

Int[(c_.+d_.*x_)^m_*(b_.*csc[e_.+f_.*x_])^n_,x_Symbol] :=
  d*m*(c+d*x)^(m-1)*(b*Csc[e+f*x])^n/(f^2*n^2) + 
  (c+d*x)^m*Cos[e+f*x]*(b*Csc[e+f*x])^(n+1)/(b*f*n) + 
  (n+1)/(b^2*n)*Int[(c+d*x)^m*(b*Csc[e+f*x])^(n+2),x] - 
  d^2*m*(m-1)/(f^2*n^2)*Int[(c+d*x)^(m-2)*(b*Csc[e+f*x])^n,x] /;
FreeQ[{b,c,d,e,f},x] && LtQ[n,-1] && GtQ[m,1]

3:  ∫(((c+d x))^m)(((b Sec[e+f x]))^n)dx  when  n∉ℤ

Derivation: Piecewise constant extraction

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

Rule: If  n∉ℤ, then

∫(((c+d x))^m)(((b Sec[e+f x]))^n)dx  ⟶  (((b Cos[e+f x]))^n) (((b Sec[e+f x]))^n)∫((((c+d x))^m)/(((b Cos[e+f x]))^n))dx

Program code:

Int[(c_.+d_.*x_)^m_.*(b_.*csc[e_.+f_.*x_])^n_,x_Symbol] :=
  (b*Sin[e+f*x])^n*(b*Csc[e+f*x])^n*Int[(c+d*x)^m/(b*Sin[e+f*x])^n,x] /;
FreeQ[{b,c,d,e,f,m,n},x] && Not[IntegerQ[n]]

2:  ∫(((c+d x))^m) (((a+b Sec[e+f x]))^n)dx  when  (m|n)∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

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

∫(((c+d x))^m) (((a+b Sec[e+f x]))^n)dx  ⟶  ∫(((c+d x))^m) ExpandIntegrand[(((a+b Sec[e+f x]))^n),x]dx

Program code:

Int[(c_.+d_.*x_)^m_.*(a_+b_.*csc[e_.+f_.*x_])^n_.,x_Symbol] :=
  Int[ExpandIntegrand[(c+d*x)^m,(a+b*Csc[e+f*x])^n,x],x] /;
FreeQ[{a,b,c,d,e,f,m},x] && IGtQ[m,0] && IGtQ[n,0]

3:  ∫(((c+d x))^m) (((a+b Sec[e+f x]))^n)dx  when  n∈(SuperMinus[ℤ])∧ m∈(SuperPlus[ℤ])

Derivation: Algebraic expansion

Basis: If  n∈ℤ, then (((a+b Sec[z]))^n)==(((Cos[z])^(-n))/(((b+a Cos[z]))^(-n)))

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

∫(((c+d x))^m) (((a+b Sec[e+f x]))^n)dx  ⟶  ∫(((c+d x))^m) ExpandIntegrand[(((Cos[e+f x])^(-n))/(((b+a Cos[e+f x]))^(-n))),x]dx

Program code:

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

X:  ∫(((c+d x))^m) (((a+b Sec[e+f x]))^n)dx

Basis: Csc[e+f x]==Sec[e-(π/2)+f x]

Basis: Csc[e+f x]==i Csch[i e+i f x]

Basis: Csc[e+f x]==Sech[i (e-(π/2))+i f x]

Rule:

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

Program code:

Int[(c_.+d_.*x_)^m_.*csc[e_.+f_.*x_]^n_.,x_Symbol] :=
  If[MatchQ[f,f1_.*Complex[0,j_]],
    If[MatchQ[e,e1_.+Pi/2],
      Unintegrable[(c+d*x)^m*Sech[I*(e-Pi/2)+I*f*x]^n,x],
    (-I)^n*Unintegrable[(c+d*x)^m*Csch[-I*e-I*f*x]^n,x]],
  If[MatchQ[e,e1_.+Pi/2],
    Unintegrable[(c+d*x)^m*Sec[e-Pi/2+f*x]^n,x],
  Unintegrable[(c+d*x)^m*Csc[e+f*x]^n,x]]] /;
FreeQ[{c,d,e,f,m,n},x] && IntegerQ[n]

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

N:  ∫(u^m)(((a+b Sec[v]))^n)dx  when  u==c+d x ∧ v==e+f x

Derivation: Algebraic normalization

Rule: If  u==c+d x ∧ v==e+f x, then

∫(u^m)(((a+b Sec[v]))^n)dx  ⟶  ∫(((c+d x))^m) (((a+b Sec[e+f x]))^n)dx

Program code:

Int[u_^m_.*(a_.+b_.*Sec[v_])^n_.,x_Symbol] :=
  Int[ExpandToSum[u,x]^m*(a+b*Sec[ExpandToSum[v,x]])^n,x] /;
FreeQ[{a,b,m,n},x] && LinearQ[{u,v},x] && Not[LinearMatchQ[{u,v},x]]

Int[u_^m_.*(a_.+b_.*Csc[v_])^n_.,x_Symbol] :=
  Int[ExpandToSum[u,x]^m*(a+b*Csc[ExpandToSum[v,x]])^n,x] /;
FreeQ[{a,b,m,n},x] && LinearQ[{u,v},x] && Not[LinearMatchQ[{u,v},x]]