\(\int \cot (e+f x) (a+b \sec ^2(e+f x))^p \, dx\) [445]

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

Optimal result

Integrand size = 21, antiderivative size = 115 \[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {\operatorname {Hypergeometric2F1}\left (1,1+p,2+p,\frac {a+b \sec ^2(e+f x)}{a}\right ) \left (a+b \sec ^2(e+f x)\right )^{1+p}}{2 a f (1+p)}-\frac {\operatorname {Hypergeometric2F1}\left (1,1+p,2+p,\frac {a+b \sec ^2(e+f x)}{a+b}\right ) \left (a+b \sec ^2(e+f x)\right )^{1+p}}{2 (a+b) f (1+p)} \] Output:

1/2*hypergeom([1, p+1],[2+p],(a+b*sec(f*x+e)^2)/a)*(a+b*sec(f*x+e)^2)^(p+1 
)/a/f/(p+1)-1/2*hypergeom([1, p+1],[2+p],(a+b*sec(f*x+e)^2)/(a+b))*(a+b*se 
c(f*x+e)^2)^(p+1)/(a+b)/f/(p+1)
 

Mathematica [A] (verified)

Time = 1.23 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00 \[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\frac {(a+2 b+a \cos (2 (e+f x))) \left ((a+b) \operatorname {Hypergeometric2F1}\left (1,1+p,2+p,\frac {a+b+b \tan ^2(e+f x)}{a}\right )-a \operatorname {Hypergeometric2F1}\left (1,1+p,2+p,1+\frac {b \tan ^2(e+f x)}{a+b}\right )\right ) \sec ^2(e+f x) \left (a+b \sec ^2(e+f x)\right )^p}{4 a (a+b) f (1+p)} \] Input:

Integrate[Cot[e + f*x]*(a + b*Sec[e + f*x]^2)^p,x]
 

Output:

((a + 2*b + a*Cos[2*(e + f*x)])*((a + b)*Hypergeometric2F1[1, 1 + p, 2 + p 
, (a + b + b*Tan[e + f*x]^2)/a] - a*Hypergeometric2F1[1, 1 + p, 2 + p, 1 + 
 (b*Tan[e + f*x]^2)/(a + b)])*Sec[e + f*x]^2*(a + b*Sec[e + f*x]^2)^p)/(4* 
a*(a + b)*f*(1 + p))
 

Rubi [A] (verified)

Time = 0.29 (sec) , antiderivative size = 110, normalized size of antiderivative = 0.96, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4627, 25, 354, 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 (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \sec (e+f x)^2\right )^p}{\tan (e+f x)}dx\)

\(\Big \downarrow \) 4627

\(\displaystyle \frac {\int -\frac {\cos (e+f x) \left (b \sec ^2(e+f x)+a\right )^p}{1-\sec ^2(e+f x)}d\sec (e+f x)}{f}\)

\(\Big \downarrow \) 25

\(\displaystyle -\frac {\int \frac {\cos (e+f x) \left (b \sec ^2(e+f x)+a\right )^p}{1-\sec ^2(e+f x)}d\sec (e+f x)}{f}\)

\(\Big \downarrow \) 354

\(\displaystyle -\frac {\int \frac {\cos (e+f x) \left (b \sec ^2(e+f x)+a\right )^p}{1-\sec ^2(e+f x)}d\sec ^2(e+f x)}{2 f}\)

\(\Big \downarrow \) 97

\(\displaystyle -\frac {\int \frac {\left (b \sec ^2(e+f x)+a\right )^p}{1-\sec ^2(e+f x)}d\sec ^2(e+f x)+\int \cos (e+f x) \left (b \sec ^2(e+f x)+a\right )^pd\sec ^2(e+f x)}{2 f}\)

\(\Big \downarrow \) 75

\(\displaystyle -\frac {\int \frac {\left (b \sec ^2(e+f x)+a\right )^p}{1-\sec ^2(e+f x)}d\sec ^2(e+f x)-\frac {\left (a+b \sec ^2(e+f x)\right )^{p+1} \operatorname {Hypergeometric2F1}\left (1,p+1,p+2,\frac {b \sec ^2(e+f x)}{a}+1\right )}{a (p+1)}}{2 f}\)

\(\Big \downarrow \) 78

\(\displaystyle -\frac {\frac {\left (a+b \sec ^2(e+f x)\right )^{p+1} \operatorname {Hypergeometric2F1}\left (1,p+1,p+2,\frac {b \sec ^2(e+f x)+a}{a+b}\right )}{(p+1) (a+b)}-\frac {\left (a+b \sec ^2(e+f x)\right )^{p+1} \operatorname {Hypergeometric2F1}\left (1,p+1,p+2,\frac {b \sec ^2(e+f x)}{a}+1\right )}{a (p+1)}}{2 f}\)

Input:

Int[Cot[e + f*x]*(a + b*Sec[e + f*x]^2)^p,x]
 

Output:

-1/2*((Hypergeometric2F1[1, 1 + p, 2 + p, (a + b*Sec[e + f*x]^2)/(a + b)]* 
(a + b*Sec[e + f*x]^2)^(1 + p))/((a + b)*(1 + p)) - (Hypergeometric2F1[1, 
1 + p, 2 + p, 1 + (b*Sec[e + f*x]^2)/a]*(a + b*Sec[e + f*x]^2)^(1 + p))/(a 
*(1 + p)))/f
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], 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 354
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S 
ymbol] :> Simp[1/2   Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x 
, x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ 
[(m - 1)/2]
 

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

rule 4627
Int[((a_) + (b_.)*((c_.)*sec[(e_.) + (f_.)*(x_)])^(n_))^(p_.)*tan[(e_.) + ( 
f_.)*(x_)]^(m_.), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Si 
mp[1/f   Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a + b*(c*ff*x)^n)^p/x), x] 
, x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[( 
m - 1)/2] && (GtQ[m, 0] || EqQ[n, 2] || EqQ[n, 4] || IGtQ[p, 0] || Integers 
Q[2*n, p])
 
Maple [F]

\[\int \cot \left (f x +e \right ) \left (a +b \sec \left (f x +e \right )^{2}\right )^{p}d x\]

Input:

int(cot(f*x+e)*(a+b*sec(f*x+e)^2)^p,x)
 

Output:

int(cot(f*x+e)*(a+b*sec(f*x+e)^2)^p,x)
 

Fricas [F]

\[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cot \left (f x + e\right ) \,d x } \] Input:

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^2)^p,x, algorithm="fricas")
 

Output:

integral((b*sec(f*x + e)^2 + a)^p*cot(f*x + e), x)
 

Sympy [F]

\[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{p} \cot {\left (e + f x \right )}\, dx \] Input:

integrate(cot(f*x+e)*(a+b*sec(f*x+e)**2)**p,x)
 

Output:

Integral((a + b*sec(e + f*x)**2)**p*cot(e + f*x), x)
 

Maxima [F]

\[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int { {\left (b \sec \left (f x + e\right )^{2} + a\right )}^{p} \cot \left (f x + e\right ) \,d x } \] Input:

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^2)^p,x, algorithm="maxima")
 

Output:

integrate((b*sec(f*x + e)^2 + a)^p*cot(f*x + e), x)
 

Giac [F(-2)]

Exception generated. \[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\text {Exception raised: RuntimeError} \] Input:

integrate(cot(f*x+e)*(a+b*sec(f*x+e)^2)^p,x, algorithm="giac")
 

Output:

Exception raised: RuntimeError >> an error occurred running a Giac command 
:INPUT:sage2OUTPUT:Unable to divide, perhaps due to rounding error%%%{1,[0 
,1,2,0]%%%}+%%%{1,[0,1,0,0]%%%} / %%%{2,[0,0,0,2]%%%} Error: Bad Argument 
Value
 

Mupad [F(-1)]

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

int(cot(e + f*x)*(a + b/cos(e + f*x)^2)^p,x)
 

Output:

int(cot(e + f*x)*(a + b/cos(e + f*x)^2)^p, x)
 

Reduce [F]

\[ \int \cot (e+f x) \left (a+b \sec ^2(e+f x)\right )^p \, dx=\int \left (\sec \left (f x +e \right )^{2} b +a \right )^{p} \cot \left (f x +e \right )d x \] Input:

int(cot(f*x+e)*(a+b*sec(f*x+e)^2)^p,x)
 

Output:

int((sec(e + f*x)**2*b + a)**p*cot(e + f*x),x)