\(\int \cot (c+d x) (a+a \sec (c+d x))^n \, dx\) [223]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 19, antiderivative size = 74 \[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=-\frac {\operatorname {Hypergeometric2F1}\left (1,n,1+n,\frac {1}{2} (1+\sec (c+d x))\right ) (a+a \sec (c+d x))^n}{2 d n}+\frac {\operatorname {Hypergeometric2F1}(1,n,1+n,1+\sec (c+d x)) (a+a \sec (c+d x))^n}{d n} \] Output:

-1/2*hypergeom([1, n],[1+n],1/2+1/2*sec(d*x+c))*(a+a*sec(d*x+c))^n/d/n+hyp 
ergeom([1, n],[1+n],1+sec(d*x+c))*(a+a*sec(d*x+c))^n/d/n
 

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.77 \[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=-\frac {\left (\operatorname {Hypergeometric2F1}\left (1,n,1+n,\frac {1}{2} (1+\sec (c+d x))\right )-2 \operatorname {Hypergeometric2F1}(1,n,1+n,1+\sec (c+d x))\right ) (a (1+\sec (c+d x)))^n}{2 d n} \] Input:

Integrate[Cot[c + d*x]*(a + a*Sec[c + d*x])^n,x]
 

Output:

-1/2*((Hypergeometric2F1[1, n, 1 + n, (1 + Sec[c + d*x])/2] - 2*Hypergeome 
tric2F1[1, n, 1 + n, 1 + Sec[c + d*x]])*(a*(1 + Sec[c + d*x]))^n)/(d*n)
 

Rubi [A] (verified)

Time = 0.27 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.09, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.421, Rules used = {3042, 25, 4368, 25, 27, 97, 75, 78}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cot (c+d x) (a \sec (c+d x)+a)^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -\frac {\left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^n}{\cot \left (c+d x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {\left (\csc \left (\frac {1}{2} (2 c+\pi )+d x\right ) a+a\right )^n}{\cot \left (\frac {1}{2} (2 c+\pi )+d x\right )}dx\)

\(\Big \downarrow \) 4368

\(\displaystyle \frac {a^2 \int -\frac {\cos (c+d x) (\sec (c+d x) a+a)^{n-1}}{a (1-\sec (c+d x))}d\sec (c+d x)}{d}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {a^2 \int \frac {\cos (c+d x) (\sec (c+d x) a+a)^{n-1}}{a (1-\sec (c+d x))}d\sec (c+d x)}{d}\)

\(\Big \downarrow \) 27

\(\displaystyle -\frac {a \int \frac {\cos (c+d x) (\sec (c+d x) a+a)^{n-1}}{1-\sec (c+d x)}d\sec (c+d x)}{d}\)

\(\Big \downarrow \) 97

\(\displaystyle -\frac {a \left (\int \frac {(\sec (c+d x) a+a)^{n-1}}{1-\sec (c+d x)}d\sec (c+d x)+\int \cos (c+d x) (\sec (c+d x) a+a)^{n-1}d\sec (c+d x)\right )}{d}\)

\(\Big \downarrow \) 75

\(\displaystyle -\frac {a \left (\int \frac {(\sec (c+d x) a+a)^{n-1}}{1-\sec (c+d x)}d\sec (c+d x)-\frac {(a \sec (c+d x)+a)^n \operatorname {Hypergeometric2F1}(1,n,n+1,\sec (c+d x)+1)}{a n}\right )}{d}\)

\(\Big \downarrow \) 78

\(\displaystyle -\frac {a \left (\frac {(a \sec (c+d x)+a)^n \operatorname {Hypergeometric2F1}\left (1,n,n+1,\frac {1}{2} (\sec (c+d x)+1)\right )}{2 a n}-\frac {(a \sec (c+d x)+a)^n \operatorname {Hypergeometric2F1}(1,n,n+1,\sec (c+d x)+1)}{a n}\right )}{d}\)

Input:

Int[Cot[c + d*x]*(a + a*Sec[c + d*x])^n,x]
 

Output:

-((a*((Hypergeometric2F1[1, n, 1 + n, (1 + Sec[c + d*x])/2]*(a + a*Sec[c + 
 d*x])^n)/(2*a*n) - (Hypergeometric2F1[1, n, 1 + n, 1 + Sec[c + d*x]]*(a + 
 a*Sec[c + d*x])^n)/(a*n)))/d)
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 75
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x 
)^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))*Hypergeometric2F1[-m, n + 1, n + 2, 1 + 
 d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] &&  !IntegerQ[n] && (IntegerQ[m] 
 || GtQ[-d/(b*c), 0])
 

rule 78
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b 
*c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m 
 + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] 
 &&  !IntegerQ[m] && IntegerQ[n]
 

rule 97
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), 
x_] :> Simp[b/(b*c - a*d)   Int[(e + f*x)^p/(a + b*x), x], x] - Simp[d/(b*c 
 - a*d)   Int[(e + f*x)^p/(c + d*x), x], x] /; FreeQ[{a, b, c, d, e, f, p}, 
 x] &&  !IntegerQ[p]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4368
Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n 
_), x_Symbol] :> Simp[-(d*b^(m - 1))^(-1)   Subst[Int[(-a + b*x)^((m - 1)/2 
)*((a + b*x)^((m - 1)/2 + n)/x), x], x, Csc[c + d*x]], x] /; FreeQ[{a, b, c 
, d, n}, x] && IntegerQ[(m - 1)/2] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[n]
 
Maple [F]

\[\int \cot \left (d x +c \right ) \left (a +a \sec \left (d x +c \right )\right )^{n}d x\]

Input:

int(cot(d*x+c)*(a+a*sec(d*x+c))^n,x)
 

Output:

int(cot(d*x+c)*(a+a*sec(d*x+c))^n,x)
 

Fricas [F]

\[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=\int { {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right ) \,d x } \] Input:

integrate(cot(d*x+c)*(a+a*sec(d*x+c))^n,x, algorithm="fricas")
 

Output:

integral((a*sec(d*x + c) + a)^n*cot(d*x + c), x)
 

Sympy [F]

\[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=\int \left (a \left (\sec {\left (c + d x \right )} + 1\right )\right )^{n} \cot {\left (c + d x \right )}\, dx \] Input:

integrate(cot(d*x+c)*(a+a*sec(d*x+c))**n,x)
 

Output:

Integral((a*(sec(c + d*x) + 1))**n*cot(c + d*x), x)
 

Maxima [F]

\[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=\int { {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right ) \,d x } \] Input:

integrate(cot(d*x+c)*(a+a*sec(d*x+c))^n,x, algorithm="maxima")
 

Output:

integrate((a*sec(d*x + c) + a)^n*cot(d*x + c), x)
 

Giac [F]

\[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=\int { {\left (a \sec \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right ) \,d x } \] Input:

integrate(cot(d*x+c)*(a+a*sec(d*x+c))^n,x, algorithm="giac")
 

Output:

integrate((a*sec(d*x + c) + a)^n*cot(d*x + c), x)
 

Mupad [F(-1)]

Timed out. \[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=\int \mathrm {cot}\left (c+d\,x\right )\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n \,d x \] Input:

int(cot(c + d*x)*(a + a/cos(c + d*x))^n,x)
 

Output:

int(cot(c + d*x)*(a + a/cos(c + d*x))^n, x)
 

Reduce [F]

\[ \int \cot (c+d x) (a+a \sec (c+d x))^n \, dx=\int \left (\sec \left (d x +c \right ) a +a \right )^{n} \cot \left (d x +c \right )d x \] Input:

int(cot(d*x+c)*(a+a*sec(d*x+c))^n,x)
 

Output:

int((sec(c + d*x)*a + a)**n*cot(c + d*x),x)