\(\int \frac {\cot ^6(e+f x)}{(a+b \sec ^2(e+f x))^2} \, dx\) [362]

Optimal result
Mathematica [C] (warning: unable to verify)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-1)]
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 23, antiderivative size = 207 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=-\frac {x}{a^2}+\frac {b^{7/2} (9 a+2 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^2 (a+b)^{9/2} f}-\frac {\left (2 a^3+8 a^2 b+12 a b^2-b^3\right ) \cot (e+f x)}{2 a (a+b)^4 f}+\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{6 a (a+b)^3 f}-\frac {(2 a-5 b) \cot ^5(e+f x)}{10 a (a+b)^2 f}-\frac {b \cot ^5(e+f x)}{2 a (a+b) f \left (a+b+b \tan ^2(e+f x)\right )} \] Output:

-x/a^2+1/2*b^(7/2)*(9*a+2*b)*arctan(b^(1/2)*tan(f*x+e)/(a+b)^(1/2))/a^2/(a 
+b)^(9/2)/f-1/2*(2*a^3+8*a^2*b+12*a*b^2-b^3)*cot(f*x+e)/a/(a+b)^4/f+1/6*(2 
*a^2+6*a*b-3*b^2)*cot(f*x+e)^3/a/(a+b)^3/f-1/10*(2*a-5*b)*cot(f*x+e)^5/a/( 
a+b)^2/f-1/2*b*cot(f*x+e)^5/a/(a+b)/f/(a+b+b*tan(f*x+e)^2)
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 8.14 (sec) , antiderivative size = 3028, normalized size of antiderivative = 14.63 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\text {Result too large to show} \] Input:

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

Output:

((9*a + 2*b)*(a + 2*b + a*Cos[2*e + 2*f*x])^2*Sec[e + f*x]^4*(-1/8*(b^4*Ar 
cTan[Sec[f*x]*(Cos[2*e]/(2*Sqrt[a + b]*Sqrt[b*Cos[4*e] - I*b*Sin[4*e]]) - 
((I/2)*Sin[2*e])/(Sqrt[a + b]*Sqrt[b*Cos[4*e] - I*b*Sin[4*e]]))*(-(a*Sin[f 
*x]) - 2*b*Sin[f*x] + a*Sin[2*e + f*x])]*Cos[2*e])/(a^2*Sqrt[a + b]*f*Sqrt 
[b*Cos[4*e] - I*b*Sin[4*e]]) + ((I/8)*b^4*ArcTan[Sec[f*x]*(Cos[2*e]/(2*Sqr 
t[a + b]*Sqrt[b*Cos[4*e] - I*b*Sin[4*e]]) - ((I/2)*Sin[2*e])/(Sqrt[a + b]* 
Sqrt[b*Cos[4*e] - I*b*Sin[4*e]]))*(-(a*Sin[f*x]) - 2*b*Sin[f*x] + a*Sin[2* 
e + f*x])]*Sin[2*e])/(a^2*Sqrt[a + b]*f*Sqrt[b*Cos[4*e] - I*b*Sin[4*e]]))) 
/((a + b)^4*(a + b*Sec[e + f*x]^2)^2) + ((a + 2*b + a*Cos[2*e + 2*f*x])*Cs 
c[e]*Csc[e + f*x]^5*Sec[2*e]*Sec[e + f*x]^4*(75*a^5*f*x*Cos[f*x] + 900*a^4 
*b*f*x*Cos[f*x] + 2850*a^3*b^2*f*x*Cos[f*x] + 3900*a^2*b^3*f*x*Cos[f*x] + 
2475*a*b^4*f*x*Cos[f*x] + 600*b^5*f*x*Cos[f*x] - 15*a^5*f*x*Cos[3*f*x] + 2 
40*a^4*b*f*x*Cos[3*f*x] + 1110*a^3*b^2*f*x*Cos[3*f*x] + 1740*a^2*b^3*f*x*C 
os[3*f*x] + 1185*a*b^4*f*x*Cos[3*f*x] + 300*b^5*f*x*Cos[3*f*x] - 75*a^5*f* 
x*Cos[2*e - f*x] - 900*a^4*b*f*x*Cos[2*e - f*x] - 2850*a^3*b^2*f*x*Cos[2*e 
 - f*x] - 3900*a^2*b^3*f*x*Cos[2*e - f*x] - 2475*a*b^4*f*x*Cos[2*e - f*x] 
- 600*b^5*f*x*Cos[2*e - f*x] - 75*a^5*f*x*Cos[2*e + f*x] - 900*a^4*b*f*x*C 
os[2*e + f*x] - 2850*a^3*b^2*f*x*Cos[2*e + f*x] - 3900*a^2*b^3*f*x*Cos[2*e 
 + f*x] - 2475*a*b^4*f*x*Cos[2*e + f*x] - 600*b^5*f*x*Cos[2*e + f*x] + 75* 
a^5*f*x*Cos[4*e + f*x] + 900*a^4*b*f*x*Cos[4*e + f*x] + 2850*a^3*b^2*f*...
 

Rubi [A] (verified)

Time = 0.58 (sec) , antiderivative size = 231, normalized size of antiderivative = 1.12, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.522, Rules used = {3042, 4629, 2075, 374, 445, 27, 445, 27, 445, 397, 216, 218}

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 \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4629

\(\displaystyle \frac {\int \frac {\cot ^6(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (a+b \left (\tan ^2(e+f x)+1\right )\right )^2}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 2075

\(\displaystyle \frac {\int \frac {\cot ^6(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )^2}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 374

\(\displaystyle \frac {\frac {\int \frac {\cot ^6(e+f x) \left (-7 b \tan ^2(e+f x)+2 a-5 b\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 445

\(\displaystyle \frac {\frac {-\frac {\int \frac {5 \cot ^4(e+f x) \left (2 a^2+6 b a-3 b^2+(2 a-5 b) b \tan ^2(e+f x)\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{5 (a+b)}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {-\frac {\int \frac {\cot ^4(e+f x) \left (2 a^2+6 b a-3 b^2+(2 a-5 b) b \tan ^2(e+f x)\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 445

\(\displaystyle \frac {\frac {-\frac {-\frac {\int \frac {3 \cot ^2(e+f x) \left (2 a^3+8 b a^2+12 b^2 a-b^3+b \left (2 a^2+6 b a-3 b^2\right ) \tan ^2(e+f x)\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{3 (a+b)}-\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{3 (a+b)}}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {\frac {-\frac {-\frac {\int \frac {\cot ^2(e+f x) \left (2 a^3+8 b a^2+12 b^2 a-b^3+b \left (2 a^2+6 b a-3 b^2\right ) \tan ^2(e+f x)\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{a+b}-\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{3 (a+b)}}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 445

\(\displaystyle \frac {\frac {-\frac {-\frac {-\frac {\int \frac {2 a^4+10 b a^3+20 b^2 a^2+20 b^3 a+b^4+b \left (2 a^3+8 b a^2+12 b^2 a-b^3\right ) \tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a+b\right )}d\tan (e+f x)}{a+b}-\frac {\left (2 a^3+8 a^2 b+12 a b^2-b^3\right ) \cot (e+f x)}{a+b}}{a+b}-\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{3 (a+b)}}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 397

\(\displaystyle \frac {\frac {-\frac {-\frac {-\frac {\frac {2 (a+b)^4 \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a}-\frac {b^4 (9 a+2 b) \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a}}{a+b}-\frac {\left (2 a^3+8 a^2 b+12 a b^2-b^3\right ) \cot (e+f x)}{a+b}}{a+b}-\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{3 (a+b)}}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {\frac {-\frac {-\frac {-\frac {\frac {2 (a+b)^4 \arctan (\tan (e+f x))}{a}-\frac {b^4 (9 a+2 b) \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a}}{a+b}-\frac {\left (2 a^3+8 a^2 b+12 a b^2-b^3\right ) \cot (e+f x)}{a+b}}{a+b}-\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{3 (a+b)}}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {-\frac {-\frac {\left (2 a^2+6 a b-3 b^2\right ) \cot ^3(e+f x)}{3 (a+b)}-\frac {-\frac {\left (2 a^3+8 a^2 b+12 a b^2-b^3\right ) \cot (e+f x)}{a+b}-\frac {\frac {2 (a+b)^4 \arctan (\tan (e+f x))}{a}-\frac {b^{7/2} (9 a+2 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}}}{a+b}}{a+b}}{a+b}-\frac {(2 a-5 b) \cot ^5(e+f x)}{5 (a+b)}}{2 a (a+b)}-\frac {b \cot ^5(e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

Input:

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

Output:

((-1/5*((2*a - 5*b)*Cot[e + f*x]^5)/(a + b) - (-1/3*((2*a^2 + 6*a*b - 3*b^ 
2)*Cot[e + f*x]^3)/(a + b) - (-(((2*(a + b)^4*ArcTan[Tan[e + f*x]])/a - (b 
^(7/2)*(9*a + 2*b)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a + b]])/(a*Sqrt[a + 
 b]))/(a + b)) - ((2*a^3 + 8*a^2*b + 12*a*b^2 - b^3)*Cot[e + f*x])/(a + b) 
)/(a + b))/(a + b))/(2*a*(a + b)) - (b*Cot[e + f*x]^5)/(2*a*(a + b)*(a + b 
 + b*Tan[e + f*x]^2)))/f
 

Defintions of rubi rules used

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 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 374
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[(-b)*(e*x)^(m + 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q 
 + 1)/(a*e*2*(b*c - a*d)*(p + 1))), x] + Simp[1/(a*2*(b*c - a*d)*(p + 1)) 
 Int[(e*x)^m*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[b*c*(m + 1) + 2*(b*c - 
a*d)*(p + 1) + d*b*(m + 2*(p + q + 2) + 1)*x^2, x], x], x] /; FreeQ[{a, b, 
c, d, e, m, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && IntBinomialQ[a, b, 
 c, d, e, m, 2, p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 445
Int[((g_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_ 
.)*((e_) + (f_.)*(x_)^2), x_Symbol] :> Simp[e*(g*x)^(m + 1)*(a + b*x^2)^(p 
+ 1)*((c + d*x^2)^(q + 1)/(a*c*g*(m + 1))), x] + Simp[1/(a*c*g^2*(m + 1)) 
 Int[(g*x)^(m + 2)*(a + b*x^2)^p*(c + d*x^2)^q*Simp[a*f*c*(m + 1) - e*(b*c 
+ a*d)*(m + 2 + 1) - e*2*(b*c*p + a*d*q) - b*e*d*(m + 2*(p + q + 2) + 1)*x^ 
2, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, q}, x] && LtQ[m, -1]
 

rule 2075
Int[(u_)^(p_.)*(v_)^(q_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*Expa 
ndToSum[u, x]^p*ExpandToSum[v, x]^q, x] /; FreeQ[{e, m, p, q}, x] && Binomi 
alQ[{u, v}, x] && EqQ[BinomialDegree[u, x] - BinomialDegree[v, x], 0] &&  ! 
BinomialMatchQ[{u, v}, x]
 

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

rule 4629
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f 
_.)*(x_)])^(m_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim 
p[ff/f   Subst[Int[(d*ff*x)^m*((a + b*(1 + ff^2*x^2)^(n/2))^p/(1 + ff^2*x^2 
)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && Inte 
gerQ[n/2] && (IntegerQ[m/2] || EqQ[n, 2])
 
Maple [A] (verified)

Time = 10.39 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.73

method result size
derivativedivides \(\frac {\frac {b^{4} \left (\frac {a \tan \left (f x +e \right )}{2 a +2 b +2 b \tan \left (f x +e \right )^{2}}+\frac {\left (9 a +2 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \sqrt {\left (a +b \right ) b}}\right )}{\left (a +b \right )^{4} a^{2}}-\frac {1}{5 \left (a +b \right )^{2} \tan \left (f x +e \right )^{5}}-\frac {-a -3 b}{3 \left (a +b \right )^{3} \tan \left (f x +e \right )^{3}}-\frac {a^{2}+4 a b +6 b^{2}}{\left (a +b \right )^{4} \tan \left (f x +e \right )}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{2}}}{f}\) \(152\)
default \(\frac {\frac {b^{4} \left (\frac {a \tan \left (f x +e \right )}{2 a +2 b +2 b \tan \left (f x +e \right )^{2}}+\frac {\left (9 a +2 b \right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{2 \sqrt {\left (a +b \right ) b}}\right )}{\left (a +b \right )^{4} a^{2}}-\frac {1}{5 \left (a +b \right )^{2} \tan \left (f x +e \right )^{5}}-\frac {-a -3 b}{3 \left (a +b \right )^{3} \tan \left (f x +e \right )^{3}}-\frac {a^{2}+4 a b +6 b^{2}}{\left (a +b \right )^{4} \tan \left (f x +e \right )}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{2}}}{f}\) \(152\)
risch \(-\frac {x}{a^{2}}-\frac {i \left (46 a^{5}+15 a \,b^{4}+172 b \,a^{4}+216 a^{3} b^{2}+90 a^{5} {\mathrm e}^{12 i \left (f x +e \right )}+150 b^{5} {\mathrm e}^{10 i \left (f x +e \right )}+300 b^{5} {\mathrm e}^{6 i \left (f x +e \right )}+240 a^{5} {\mathrm e}^{6 i \left (f x +e \right )}-300 b^{5} {\mathrm e}^{8 i \left (f x +e \right )}-150 b^{5} {\mathrm e}^{4 i \left (f x +e \right )}+10 a^{5} {\mathrm e}^{8 i \left (f x +e \right )}+30 b^{5} {\mathrm e}^{2 i \left (f x +e \right )}-30 b^{5} {\mathrm e}^{12 i \left (f x +e \right )}+46 a^{5} {\mathrm e}^{4 i \left (f x +e \right )}-48 a^{5} {\mathrm e}^{2 i \left (f x +e \right )}+75 a \,b^{4} {\mathrm e}^{4 i \left (f x +e \right )}+864 a^{2} b^{3} {\mathrm e}^{2 i \left (f x +e \right )}-60 a \,b^{4} {\mathrm e}^{2 i \left (f x +e \right )}-32 a^{4} b \,{\mathrm e}^{2 i \left (f x +e \right )}-508 a^{4} b \,{\mathrm e}^{4 i \left (f x +e \right )}+300 a^{3} b^{2} {\mathrm e}^{12 i \left (f x +e \right )}-3120 a^{2} b^{3} {\mathrm e}^{4 i \left (f x +e \right )}+4840 a^{3} b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+60 a \,b^{4} {\mathrm e}^{10 i \left (f x +e \right )}+340 a^{3} b^{2} {\mathrm e}^{2 i \left (f x +e \right )}+300 a^{4} b \,{\mathrm e}^{12 i \left (f x +e \right )}-860 a^{4} b \,{\mathrm e}^{8 i \left (f x +e \right )}+240 a^{4} b \,{\mathrm e}^{10 i \left (f x +e \right )}-2324 a^{3} b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-3600 a^{2} b^{3} {\mathrm e}^{8 i \left (f x +e \right )}-75 a \,b^{4} {\mathrm e}^{8 i \left (f x +e \right )}+5040 a^{2} b^{3} {\mathrm e}^{6 i \left (f x +e \right )}-15 a \,b^{4} {\mathrm e}^{12 i \left (f x +e \right )}+900 a^{3} b^{2} {\mathrm e}^{10 i \left (f x +e \right )}+1840 a^{4} b \,{\mathrm e}^{6 i \left (f x +e \right )}-3120 a^{3} b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+1200 a^{2} b^{3} {\mathrm e}^{10 i \left (f x +e \right )}\right )}{15 f \left (a +b \right )^{4} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{5} a^{2} \left (a \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+4 b \,{\mathrm e}^{2 i \left (f x +e \right )}+a \right )}-\frac {9 \sqrt {-\left (a +b \right ) b}\, b^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}+a +2 b}{a}\right )}{4 \left (a +b \right )^{5} f a}-\frac {\sqrt {-\left (a +b \right ) b}\, b^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-\left (a +b \right ) b}+a +2 b}{a}\right )}{2 \left (a +b \right )^{5} f \,a^{2}}+\frac {9 \sqrt {-\left (a +b \right ) b}\, b^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}-a -2 b}{a}\right )}{4 \left (a +b \right )^{5} f a}+\frac {\sqrt {-\left (a +b \right ) b}\, b^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-\left (a +b \right ) b}-a -2 b}{a}\right )}{2 \left (a +b \right )^{5} f \,a^{2}}\) \(832\)

Input:

int(cot(f*x+e)^6/(a+b*sec(f*x+e)^2)^2,x,method=_RETURNVERBOSE)
 

Output:

1/f*(b^4/(a+b)^4/a^2*(1/2*a*tan(f*x+e)/(a+b+b*tan(f*x+e)^2)+1/2*(9*a+2*b)/ 
((a+b)*b)^(1/2)*arctan(b*tan(f*x+e)/((a+b)*b)^(1/2)))-1/5/(a+b)^2/tan(f*x+ 
e)^5-1/3*(-a-3*b)/(a+b)^3/tan(f*x+e)^3-(a^2+4*a*b+6*b^2)/(a+b)^4/tan(f*x+e 
)-1/a^2*arctan(tan(f*x+e)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 709 vs. \(2 (189) = 378\).

Time = 0.17 (sec) , antiderivative size = 1505, normalized size of antiderivative = 7.27 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

[-1/120*(4*(46*a^5 + 172*a^4*b + 216*a^3*b^2 + 15*a*b^4)*cos(f*x + e)^7 - 
4*(70*a^5 + 234*a^4*b + 218*a^3*b^2 - 216*a^2*b^3 + 45*a*b^4)*cos(f*x + e) 
^5 + 20*(6*a^5 + 10*a^4*b - 20*a^3*b^2 - 78*a^2*b^3 + 9*a*b^4)*cos(f*x + e 
)^3 - 15*((9*a^2*b^3 + 2*a*b^4)*cos(f*x + e)^6 + 9*a*b^4 + 2*b^5 - (18*a^2 
*b^3 - 5*a*b^4 - 2*b^5)*cos(f*x + e)^4 + (9*a^2*b^3 - 16*a*b^4 - 4*b^5)*co 
s(f*x + e)^2)*sqrt(-b/(a + b))*log(((a^2 + 8*a*b + 8*b^2)*cos(f*x + e)^4 - 
 2*(3*a*b + 4*b^2)*cos(f*x + e)^2 - 4*((a^2 + 3*a*b + 2*b^2)*cos(f*x + e)^ 
3 - (a*b + b^2)*cos(f*x + e))*sqrt(-b/(a + b))*sin(f*x + e) + b^2)/(a^2*co 
s(f*x + e)^4 + 2*a*b*cos(f*x + e)^2 + b^2))*sin(f*x + e) + 60*(2*a^4*b + 8 
*a^3*b^2 + 12*a^2*b^3 - a*b^4)*cos(f*x + e) + 120*((a^5 + 4*a^4*b + 6*a^3* 
b^2 + 4*a^2*b^3 + a*b^4)*f*x*cos(f*x + e)^6 - (2*a^5 + 7*a^4*b + 8*a^3*b^2 
 + 2*a^2*b^3 - 2*a*b^4 - b^5)*f*x*cos(f*x + e)^4 + (a^5 + 2*a^4*b - 2*a^3* 
b^2 - 8*a^2*b^3 - 7*a*b^4 - 2*b^5)*f*x*cos(f*x + e)^2 + (a^4*b + 4*a^3*b^2 
 + 6*a^2*b^3 + 4*a*b^4 + b^5)*f*x)*sin(f*x + e))/(((a^7 + 4*a^6*b + 6*a^5* 
b^2 + 4*a^4*b^3 + a^3*b^4)*f*cos(f*x + e)^6 - (2*a^7 + 7*a^6*b + 8*a^5*b^2 
 + 2*a^4*b^3 - 2*a^3*b^4 - a^2*b^5)*f*cos(f*x + e)^4 + (a^7 + 2*a^6*b - 2* 
a^5*b^2 - 8*a^4*b^3 - 7*a^3*b^4 - 2*a^2*b^5)*f*cos(f*x + e)^2 + (a^6*b + 4 
*a^5*b^2 + 6*a^4*b^3 + 4*a^3*b^4 + a^2*b^5)*f)*sin(f*x + e)), -1/60*(2*(46 
*a^5 + 172*a^4*b + 216*a^3*b^2 + 15*a*b^4)*cos(f*x + e)^7 - 2*(70*a^5 + 23 
4*a^4*b + 218*a^3*b^2 - 216*a^2*b^3 + 45*a*b^4)*cos(f*x + e)^5 + 10*(6*...
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 319, normalized size of antiderivative = 1.54 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\frac {15 \, {\left (9 \, a b^{4} + 2 \, b^{5}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{{\left (a^{6} + 4 \, a^{5} b + 6 \, a^{4} b^{2} + 4 \, a^{3} b^{3} + a^{2} b^{4}\right )} \sqrt {{\left (a + b\right )} b}} - \frac {15 \, {\left (2 \, a^{3} b + 8 \, a^{2} b^{2} + 12 \, a b^{3} - b^{4}\right )} \tan \left (f x + e\right )^{6} + 10 \, {\left (3 \, a^{4} + 14 \, a^{3} b + 26 \, a^{2} b^{2} + 15 \, a b^{3}\right )} \tan \left (f x + e\right )^{4} + 6 \, a^{4} + 18 \, a^{3} b + 18 \, a^{2} b^{2} + 6 \, a b^{3} - 2 \, {\left (5 \, a^{4} + 22 \, a^{3} b + 29 \, a^{2} b^{2} + 12 \, a b^{3}\right )} \tan \left (f x + e\right )^{2}}{{\left (a^{5} b + 4 \, a^{4} b^{2} + 6 \, a^{3} b^{3} + 4 \, a^{2} b^{4} + a b^{5}\right )} \tan \left (f x + e\right )^{7} + {\left (a^{6} + 5 \, a^{5} b + 10 \, a^{4} b^{2} + 10 \, a^{3} b^{3} + 5 \, a^{2} b^{4} + a b^{5}\right )} \tan \left (f x + e\right )^{5}} - \frac {30 \, {\left (f x + e\right )}}{a^{2}}}{30 \, f} \] Input:

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

Output:

1/30*(15*(9*a*b^4 + 2*b^5)*arctan(b*tan(f*x + e)/sqrt((a + b)*b))/((a^6 + 
4*a^5*b + 6*a^4*b^2 + 4*a^3*b^3 + a^2*b^4)*sqrt((a + b)*b)) - (15*(2*a^3*b 
 + 8*a^2*b^2 + 12*a*b^3 - b^4)*tan(f*x + e)^6 + 10*(3*a^4 + 14*a^3*b + 26* 
a^2*b^2 + 15*a*b^3)*tan(f*x + e)^4 + 6*a^4 + 18*a^3*b + 18*a^2*b^2 + 6*a*b 
^3 - 2*(5*a^4 + 22*a^3*b + 29*a^2*b^2 + 12*a*b^3)*tan(f*x + e)^2)/((a^5*b 
+ 4*a^4*b^2 + 6*a^3*b^3 + 4*a^2*b^4 + a*b^5)*tan(f*x + e)^7 + (a^6 + 5*a^5 
*b + 10*a^4*b^2 + 10*a^3*b^3 + 5*a^2*b^4 + a*b^5)*tan(f*x + e)^5) - 30*(f* 
x + e)/a^2)/f
 

Giac [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 298, normalized size of antiderivative = 1.44 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\frac {15 \, b^{4} \tan \left (f x + e\right )}{{\left (a^{5} + 4 \, a^{4} b + 6 \, a^{3} b^{2} + 4 \, a^{2} b^{3} + a b^{4}\right )} {\left (b \tan \left (f x + e\right )^{2} + a + b\right )}} + \frac {15 \, {\left (9 \, a b^{4} + 2 \, b^{5}\right )} {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b + b^{2}}}\right )\right )}}{{\left (a^{6} + 4 \, a^{5} b + 6 \, a^{4} b^{2} + 4 \, a^{3} b^{3} + a^{2} b^{4}\right )} \sqrt {a b + b^{2}}} - \frac {30 \, {\left (f x + e\right )}}{a^{2}} - \frac {2 \, {\left (15 \, a^{2} \tan \left (f x + e\right )^{4} + 60 \, a b \tan \left (f x + e\right )^{4} + 90 \, b^{2} \tan \left (f x + e\right )^{4} - 5 \, a^{2} \tan \left (f x + e\right )^{2} - 20 \, a b \tan \left (f x + e\right )^{2} - 15 \, b^{2} \tan \left (f x + e\right )^{2} + 3 \, a^{2} + 6 \, a b + 3 \, b^{2}\right )}}{{\left (a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}\right )} \tan \left (f x + e\right )^{5}}}{30 \, f} \] Input:

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

Output:

1/30*(15*b^4*tan(f*x + e)/((a^5 + 4*a^4*b + 6*a^3*b^2 + 4*a^2*b^3 + a*b^4) 
*(b*tan(f*x + e)^2 + a + b)) + 15*(9*a*b^4 + 2*b^5)*(pi*floor((f*x + e)/pi 
 + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt(a*b + b^2)))/((a^6 + 4*a^5*b + 
 6*a^4*b^2 + 4*a^3*b^3 + a^2*b^4)*sqrt(a*b + b^2)) - 30*(f*x + e)/a^2 - 2* 
(15*a^2*tan(f*x + e)^4 + 60*a*b*tan(f*x + e)^4 + 90*b^2*tan(f*x + e)^4 - 5 
*a^2*tan(f*x + e)^2 - 20*a*b*tan(f*x + e)^2 - 15*b^2*tan(f*x + e)^2 + 3*a^ 
2 + 6*a*b + 3*b^2)/((a^4 + 4*a^3*b + 6*a^2*b^2 + 4*a*b^3 + b^4)*tan(f*x + 
e)^5))/f
 

Mupad [B] (verification not implemented)

Time = 21.51 (sec) , antiderivative size = 6017, normalized size of antiderivative = 29.07 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

atan(((((64*a^6*b^22 + 2304*a^7*b^21 + 29440*a^8*b^20 + 210560*a^9*b^19 + 
997248*a^10*b^18 + 3404800*a^11*b^17 + 8806912*a^12*b^16 + 17809920*a^13*b 
^15 + 28745600*a^14*b^14 + 37533184*a^15*b^13 + 39975936*a^16*b^12 + 34874 
112*a^17*b^11 + 24926720*a^18*b^10 + 14545920*a^19*b^9 + 6874624*a^20*b^8 
+ 2595328*a^21*b^7 + 765504*a^22*b^6 + 170240*a^23*b^5 + 26880*a^24*b^4 + 
2688*a^25*b^3 + 128*a^26*b^2 + (tan(e + f*x)*(512*a^7*b^23 + 10496*a^8*b^2 
2 + 102400*a^9*b^21 + 632320*a^10*b^20 + 2772480*a^11*b^19 + 9178368*a^12* 
b^18 + 23814144*a^13*b^17 + 49612800*a^14*b^16 + 84341760*a^15*b^15 + 1182 
43840*a^16*b^14 + 137592832*a^17*b^13 + 133293056*a^18*b^12 + 107494400*a^ 
19*b^11 + 71938560*a^20*b^10 + 39690240*a^21*b^9 + 17860608*a^22*b^8 + 644 
9664*a^23*b^7 + 1824000*a^24*b^6 + 389120*a^25*b^5 + 58880*a^26*b^4 + 5632 
*a^27*b^3 + 256*a^28*b^2)*1i)/(2*a^2))*1i)/(2*a^2) + tan(e + f*x)*(128*a^3 
*b^23 + 2624*a^4*b^22 + 24592*a^5*b^21 + 140608*a^6*b^20 + 554016*a^7*b^19 
 + 1613184*a^8*b^18 + 3637488*a^9*b^17 + 6570624*a^10*b^16 + 9747456*a^11* 
b^15 + 12075072*a^12*b^14 + 12596848*a^13*b^13 + 11073344*a^14*b^12 + 8154 
592*a^15*b^11 + 4977408*a^16*b^10 + 2481936*a^17*b^9 + 992256*a^18*b^8 + 3 
10080*a^19*b^7 + 72960*a^20*b^6 + 12160*a^21*b^5 + 1280*a^22*b^4 + 64*a^23 
*b^3))/(2*a^2) - (((64*a^6*b^22 + 2304*a^7*b^21 + 29440*a^8*b^20 + 210560* 
a^9*b^19 + 997248*a^10*b^18 + 3404800*a^11*b^17 + 8806912*a^12*b^16 + 1780 
9920*a^13*b^15 + 28745600*a^14*b^14 + 37533184*a^15*b^13 + 39975936*a^1...
 

Reduce [B] (verification not implemented)

Time = 1.39 (sec) , antiderivative size = 1216, normalized size of antiderivative = 5.87 \[ \int \frac {\cot ^6(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx =\text {Too large to display} \] Input:

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

Output:

(135*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqr 
t(b))*sin(e + f*x)**7*a**2*b**3 + 30*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b) 
*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)**7*a*b**4 - 135*sqrt(b) 
*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e 
+ f*x)**5*a**2*b**3 - 165*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f 
*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)**5*a*b**4 - 30*sqrt(b)*sqrt(a + b) 
*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)**5*b* 
*5 + 135*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a)) 
/sqrt(b))*sin(e + f*x)**7*a**2*b**3 + 30*sqrt(b)*sqrt(a + b)*atan((sqrt(a 
+ b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + f*x)**7*a*b**4 - 135*sqr 
t(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*si 
n(e + f*x)**5*a**2*b**3 - 165*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e 
 + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + f*x)**5*a*b**4 - 30*sqrt(b)*sqrt(a 
+ b)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + f*x)** 
5*b**5 - 46*cos(e + f*x)*sin(e + f*x)**6*a**6 - 218*cos(e + f*x)*sin(e + f 
*x)**6*a**5*b - 388*cos(e + f*x)*sin(e + f*x)**6*a**4*b**2 - 216*cos(e + f 
*x)*sin(e + f*x)**6*a**3*b**3 - 15*cos(e + f*x)*sin(e + f*x)**6*a**2*b**4 
- 15*cos(e + f*x)*sin(e + f*x)**6*a*b**5 + 68*cos(e + f*x)*sin(e + f*x)**4 
*a**6 + 350*cos(e + f*x)*sin(e + f*x)**4*a**5*b + 712*cos(e + f*x)*sin(e + 
 f*x)**4*a**4*b**2 + 646*cos(e + f*x)*sin(e + f*x)**4*a**3*b**3 + 216*c...