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

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 = 181 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=-\frac {x}{a^3}+\frac {b^{3/2} \left (35 a^2+28 a b+8 b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{8 a^3 (a+b)^{7/2} f}-\frac {\left (8 a^2-11 a b-4 b^2\right ) \cot (e+f x)}{8 a^2 (a+b)^3 f}-\frac {b \cot (e+f x)}{4 a (a+b) f \left (a+b+b \tan ^2(e+f x)\right )^2}-\frac {b (9 a+4 b) \cot (e+f x)}{8 a^2 (a+b)^2 f \left (a+b+b \tan ^2(e+f x)\right )} \] Output:

-x/a^3+1/8*b^(3/2)*(35*a^2+28*a*b+8*b^2)*arctan(b^(1/2)*tan(f*x+e)/(a+b)^( 
1/2))/a^3/(a+b)^(7/2)/f-1/8*(8*a^2-11*a*b-4*b^2)*cot(f*x+e)/a^2/(a+b)^3/f- 
1/4*b*cot(f*x+e)/a/(a+b)/f/(a+b+b*tan(f*x+e)^2)^2-1/8*b*(9*a+4*b)*cot(f*x+ 
e)/a^2/(a+b)^2/f/(a+b+b*tan(f*x+e)^2)
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

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

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

Output:

((35*a^2 + 28*a*b + 8*b^2)*(a + 2*b + a*Cos[2*e + 2*f*x])^3*Sec[e + f*x]^6 
*(-1/64*(b^2*ArcTan[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^3*Sqr 
t[a + b]*f*Sqrt[b*Cos[4*e] - I*b*Sin[4*e]]) + ((I/64)*b^2*ArcTan[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])]*Sin[2*e])/(a^3*Sqrt[a + b]*f*Sqrt[b*Cos[4*e] - 
I*b*Sin[4*e]])))/((a + b)^3*(a + b*Sec[e + f*x]^2)^3) + ((a + 2*b + a*Cos[ 
2*e + 2*f*x])*Csc[e]*Csc[e + f*x]*Sec[2*e]*Sec[e + f*x]^6*(8*a^5*f*x*Cos[f 
*x] + 56*a^4*b*f*x*Cos[f*x] + 184*a^3*b^2*f*x*Cos[f*x] + 296*a^2*b^3*f*x*C 
os[f*x] + 224*a*b^4*f*x*Cos[f*x] + 64*b^5*f*x*Cos[f*x] - 12*a^5*f*x*Cos[3* 
f*x] - 68*a^4*b*f*x*Cos[3*f*x] - 132*a^3*b^2*f*x*Cos[3*f*x] - 108*a^2*b^3* 
f*x*Cos[3*f*x] - 32*a*b^4*f*x*Cos[3*f*x] - 8*a^5*f*x*Cos[2*e - f*x] - 56*a 
^4*b*f*x*Cos[2*e - f*x] - 184*a^3*b^2*f*x*Cos[2*e - f*x] - 296*a^2*b^3*f*x 
*Cos[2*e - f*x] - 224*a*b^4*f*x*Cos[2*e - f*x] - 64*b^5*f*x*Cos[2*e - f*x] 
 - 8*a^5*f*x*Cos[2*e + f*x] - 56*a^4*b*f*x*Cos[2*e + f*x] - 184*a^3*b^2*f* 
x*Cos[2*e + f*x] - 296*a^2*b^3*f*x*Cos[2*e + f*x] - 224*a*b^4*f*x*Cos[2*e 
+ f*x] - 64*b^5*f*x*Cos[2*e + f*x] + 8*a^5*f*x*Cos[4*e + f*x] + 56*a^4*b*f 
*x*Cos[4*e + f*x] + 184*a^3*b^2*f*x*Cos[4*e + f*x] + 296*a^2*b^3*f*x*Co...
 

Rubi [A] (verified)

Time = 0.51 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.17, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.391, Rules used = {3042, 4629, 2075, 374, 441, 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 ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4629

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

\(\Big \downarrow \) 2075

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

\(\Big \downarrow \) 374

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

\(\Big \downarrow \) 441

\(\displaystyle \frac {\frac {\frac {\int \frac {\cot ^2(e+f x) \left (8 a^2-11 b a-4 b^2-3 b (9 a+4 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)}{2 a (a+b)}-\frac {b (9 a+4 b) \cot (e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{4 a (a+b)}-\frac {b \cot (e+f x)}{4 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\)

\(\Big \downarrow \) 445

\(\displaystyle \frac {\frac {\frac {-\frac {\int \frac {8 a^3+32 b a^2+13 b^2 a+4 b^3+b \left (8 a^2-11 b a-4 b^2\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 (8 a^2-11 a b-4 b^2\right ) \cot (e+f x)}{a+b}}{2 a (a+b)}-\frac {b (9 a+4 b) \cot (e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{4 a (a+b)}-\frac {b \cot (e+f x)}{4 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\)

\(\Big \downarrow \) 397

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 218

\(\displaystyle \frac {\frac {\frac {-\frac {\frac {8 (a+b)^3 \arctan (\tan (e+f x))}{a}-\frac {b^{3/2} \left (35 a^2+28 a b+8 b^2\right ) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}}}{a+b}-\frac {\left (8 a^2-11 a b-4 b^2\right ) \cot (e+f x)}{a+b}}{2 a (a+b)}-\frac {b (9 a+4 b) \cot (e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{4 a (a+b)}-\frac {b \cot (e+f x)}{4 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )^2}}{f}\)

Input:

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

Output:

(-1/4*(b*Cot[e + f*x])/(a*(a + b)*(a + b + b*Tan[e + f*x]^2)^2) + ((-(((8* 
(a + b)^3*ArcTan[Tan[e + f*x]])/a - (b^(3/2)*(35*a^2 + 28*a*b + 8*b^2)*Arc 
Tan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a + b]])/(a*Sqrt[a + b]))/(a + b)) - ((8*a 
^2 - 11*a*b - 4*b^2)*Cot[e + f*x])/(a + b))/(2*a*(a + b)) - (b*(9*a + 4*b) 
*Cot[e + f*x])/(2*a*(a + b)*(a + b + b*Tan[e + f*x]^2)))/(4*a*(a + b)))/f
 

Defintions of rubi rules used

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

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 = 13.26 (sec) , antiderivative size = 149, normalized size of antiderivative = 0.82

method result size
derivativedivides \(\frac {\frac {b^{2} \left (\frac {\left (\frac {11}{8} a^{2} b +\frac {1}{2} a \,b^{2}\right ) \tan \left (f x +e \right )^{3}+\frac {a \left (13 a^{2}+17 a b +4 b^{2}\right ) \tan \left (f x +e \right )}{8}}{\left (a +b +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\left (35 a^{2}+28 a b +8 b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{8 \sqrt {\left (a +b \right ) b}}\right )}{a^{3} \left (a +b \right )^{3}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{3}}-\frac {1}{\left (a +b \right )^{3} \tan \left (f x +e \right )}}{f}\) \(149\)
default \(\frac {\frac {b^{2} \left (\frac {\left (\frac {11}{8} a^{2} b +\frac {1}{2} a \,b^{2}\right ) \tan \left (f x +e \right )^{3}+\frac {a \left (13 a^{2}+17 a b +4 b^{2}\right ) \tan \left (f x +e \right )}{8}}{\left (a +b +b \tan \left (f x +e \right )^{2}\right )^{2}}+\frac {\left (35 a^{2}+28 a b +8 b^{2}\right ) \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {\left (a +b \right ) b}}\right )}{8 \sqrt {\left (a +b \right ) b}}\right )}{a^{3} \left (a +b \right )^{3}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{3}}-\frac {1}{\left (a +b \right )^{3} \tan \left (f x +e \right )}}{f}\) \(149\)
risch \(-\frac {x}{a^{3}}+\frac {i \left (-8 a^{5} {\mathrm e}^{8 i \left (f x +e \right )}+13 a^{3} b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+36 a^{2} b^{3} {\mathrm e}^{8 i \left (f x +e \right )}+16 a \,b^{4} {\mathrm e}^{8 i \left (f x +e \right )}-32 a^{5} {\mathrm e}^{6 i \left (f x +e \right )}-64 a^{4} b \,{\mathrm e}^{6 i \left (f x +e \right )}+26 a^{3} b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+86 a^{2} b^{3} {\mathrm e}^{6 i \left (f x +e \right )}+136 a \,b^{4} {\mathrm e}^{6 i \left (f x +e \right )}+48 b^{5} {\mathrm e}^{6 i \left (f x +e \right )}-48 a^{5} {\mathrm e}^{4 i \left (f x +e \right )}-128 a^{4} b \,{\mathrm e}^{4 i \left (f x +e \right )}-128 a^{3} b^{2} {\mathrm e}^{4 i \left (f x +e \right )}-30 a^{2} b^{3} {\mathrm e}^{4 i \left (f x +e \right )}-120 a \,b^{4} {\mathrm e}^{4 i \left (f x +e \right )}-48 b^{5} {\mathrm e}^{4 i \left (f x +e \right )}-32 a^{5} {\mathrm e}^{2 i \left (f x +e \right )}-64 a^{4} b \,{\mathrm e}^{2 i \left (f x +e \right )}-26 a^{3} b^{2} {\mathrm e}^{2 i \left (f x +e \right )}-86 a^{2} b^{3} {\mathrm e}^{2 i \left (f x +e \right )}-32 a \,b^{4} {\mathrm e}^{2 i \left (f x +e \right )}-8 a^{5}-13 a^{3} b^{2}-6 a^{2} b^{3}\right )}{4 a^{3} \left (a +b \right )^{3} f \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 )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {35 \sqrt {-\left (a +b \right ) b}\, b \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 )}{16 \left (a +b \right )^{4} f a}-\frac {7 \sqrt {-\left (a +b \right ) b}\, b^{2} \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 )^{4} f \,a^{2}}-\frac {\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 )}{2 \left (a +b \right )^{4} f \,a^{3}}+\frac {35 \sqrt {-\left (a +b \right ) b}\, b \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 )}{16 \left (a +b \right )^{4} f a}+\frac {7 \sqrt {-\left (a +b \right ) b}\, b^{2} \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 )^{4} f \,a^{2}}+\frac {\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 )}{2 \left (a +b \right )^{4} f \,a^{3}}\) \(756\)

Input:

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

Output:

1/f*(b^2/a^3/(a+b)^3*(((11/8*a^2*b+1/2*a*b^2)*tan(f*x+e)^3+1/8*a*(13*a^2+1 
7*a*b+4*b^2)*tan(f*x+e))/(a+b+b*tan(f*x+e)^2)^2+1/8*(35*a^2+28*a*b+8*b^2)/ 
((a+b)*b)^(1/2)*arctan(b*tan(f*x+e)/((a+b)*b)^(1/2)))-1/a^3*arctan(tan(f*x 
+e))-1/(a+b)^3/tan(f*x+e))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 486 vs. \(2 (165) = 330\).

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

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

Output:

[-1/32*(4*(8*a^5 + 13*a^3*b^2 + 6*a^2*b^3)*cos(f*x + e)^5 + 4*(16*a^4*b - 
13*a^3*b^2 + 5*a^2*b^3 + 4*a*b^4)*cos(f*x + e)^3 - (35*a^2*b^3 + 28*a*b^4 
+ 8*b^5 + (35*a^4*b + 28*a^3*b^2 + 8*a^2*b^3)*cos(f*x + e)^4 + 2*(35*a^3*b 
^2 + 28*a^2*b^3 + 8*a*b^4)*cos(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*cos(f*x + e)^4 + 2*a*b*cos(f*x + e)^2 + b^2))*s 
in(f*x + e) + 4*(8*a^3*b^2 - 11*a^2*b^3 - 4*a*b^4)*cos(f*x + e) + 32*((a^5 
 + 3*a^4*b + 3*a^3*b^2 + a^2*b^3)*f*x*cos(f*x + e)^4 + 2*(a^4*b + 3*a^3*b^ 
2 + 3*a^2*b^3 + a*b^4)*f*x*cos(f*x + e)^2 + (a^3*b^2 + 3*a^2*b^3 + 3*a*b^4 
 + b^5)*f*x)*sin(f*x + e))/(((a^8 + 3*a^7*b + 3*a^6*b^2 + a^5*b^3)*f*cos(f 
*x + e)^4 + 2*(a^7*b + 3*a^6*b^2 + 3*a^5*b^3 + a^4*b^4)*f*cos(f*x + e)^2 + 
 (a^6*b^2 + 3*a^5*b^3 + 3*a^4*b^4 + a^3*b^5)*f)*sin(f*x + e)), -1/16*(2*(8 
*a^5 + 13*a^3*b^2 + 6*a^2*b^3)*cos(f*x + e)^5 + 2*(16*a^4*b - 13*a^3*b^2 + 
 5*a^2*b^3 + 4*a*b^4)*cos(f*x + e)^3 + (35*a^2*b^3 + 28*a*b^4 + 8*b^5 + (3 
5*a^4*b + 28*a^3*b^2 + 8*a^2*b^3)*cos(f*x + e)^4 + 2*(35*a^3*b^2 + 28*a^2* 
b^3 + 8*a*b^4)*cos(f*x + e)^2)*sqrt(b/(a + b))*arctan(1/2*((a + 2*b)*cos(f 
*x + e)^2 - b)*sqrt(b/(a + b))/(b*cos(f*x + e)*sin(f*x + e)))*sin(f*x + e) 
 + 2*(8*a^3*b^2 - 11*a^2*b^3 - 4*a*b^4)*cos(f*x + e) + 16*((a^5 + 3*a^4*b 
+ 3*a^3*b^2 + a^2*b^3)*f*x*cos(f*x + e)^4 + 2*(a^4*b + 3*a^3*b^2 + 3*a^...
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 311, normalized size of antiderivative = 1.72 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\frac {\frac {{\left (35 \, a^{2} b^{2} + 28 \, a b^{3} + 8 \, b^{4}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{{\left (a^{6} + 3 \, a^{5} b + 3 \, a^{4} b^{2} + a^{3} b^{3}\right )} \sqrt {{\left (a + b\right )} b}} - \frac {{\left (8 \, a^{2} b^{2} - 11 \, a b^{3} - 4 \, b^{4}\right )} \tan \left (f x + e\right )^{4} + 8 \, a^{4} + 16 \, a^{3} b + 8 \, a^{2} b^{2} + {\left (16 \, a^{3} b + 3 \, a^{2} b^{2} - 17 \, a b^{3} - 4 \, b^{4}\right )} \tan \left (f x + e\right )^{2}}{{\left (a^{5} b^{2} + 3 \, a^{4} b^{3} + 3 \, a^{3} b^{4} + a^{2} b^{5}\right )} \tan \left (f x + e\right )^{5} + 2 \, {\left (a^{6} b + 4 \, a^{5} b^{2} + 6 \, a^{4} b^{3} + 4 \, a^{3} b^{4} + a^{2} b^{5}\right )} \tan \left (f x + e\right )^{3} + {\left (a^{7} + 5 \, a^{6} b + 10 \, a^{5} b^{2} + 10 \, a^{4} b^{3} + 5 \, a^{3} b^{4} + a^{2} b^{5}\right )} \tan \left (f x + e\right )} - \frac {8 \, {\left (f x + e\right )}}{a^{3}}}{8 \, f} \] Input:

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

Output:

1/8*((35*a^2*b^2 + 28*a*b^3 + 8*b^4)*arctan(b*tan(f*x + e)/sqrt((a + b)*b) 
)/((a^6 + 3*a^5*b + 3*a^4*b^2 + a^3*b^3)*sqrt((a + b)*b)) - ((8*a^2*b^2 - 
11*a*b^3 - 4*b^4)*tan(f*x + e)^4 + 8*a^4 + 16*a^3*b + 8*a^2*b^2 + (16*a^3* 
b + 3*a^2*b^2 - 17*a*b^3 - 4*b^4)*tan(f*x + e)^2)/((a^5*b^2 + 3*a^4*b^3 + 
3*a^3*b^4 + a^2*b^5)*tan(f*x + e)^5 + 2*(a^6*b + 4*a^5*b^2 + 6*a^4*b^3 + 4 
*a^3*b^4 + a^2*b^5)*tan(f*x + e)^3 + (a^7 + 5*a^6*b + 10*a^5*b^2 + 10*a^4* 
b^3 + 5*a^3*b^4 + a^2*b^5)*tan(f*x + e)) - 8*(f*x + e)/a^3)/f
 

Giac [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 247, normalized size of antiderivative = 1.36 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx=\frac {\frac {{\left (35 \, a^{2} b^{2} + 28 \, a b^{3} + 8 \, b^{4}\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} + 3 \, a^{5} b + 3 \, a^{4} b^{2} + a^{3} b^{3}\right )} \sqrt {a b + b^{2}}} + \frac {11 \, a b^{3} \tan \left (f x + e\right )^{3} + 4 \, b^{4} \tan \left (f x + e\right )^{3} + 13 \, a^{2} b^{2} \tan \left (f x + e\right ) + 17 \, a b^{3} \tan \left (f x + e\right ) + 4 \, b^{4} \tan \left (f x + e\right )}{{\left (a^{5} + 3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3}\right )} {\left (b \tan \left (f x + e\right )^{2} + a + b\right )}^{2}} - \frac {8 \, {\left (f x + e\right )}}{a^{3}} - \frac {8}{{\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \tan \left (f x + e\right )}}{8 \, f} \] Input:

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

Output:

1/8*((35*a^2*b^2 + 28*a*b^3 + 8*b^4)*(pi*floor((f*x + e)/pi + 1/2)*sgn(b) 
+ arctan(b*tan(f*x + e)/sqrt(a*b + b^2)))/((a^6 + 3*a^5*b + 3*a^4*b^2 + a^ 
3*b^3)*sqrt(a*b + b^2)) + (11*a*b^3*tan(f*x + e)^3 + 4*b^4*tan(f*x + e)^3 
+ 13*a^2*b^2*tan(f*x + e) + 17*a*b^3*tan(f*x + e) + 4*b^4*tan(f*x + e))/(( 
a^5 + 3*a^4*b + 3*a^3*b^2 + a^2*b^3)*(b*tan(f*x + e)^2 + a + b)^2) - 8*(f* 
x + e)/a^3 - 8/((a^3 + 3*a^2*b + 3*a*b^2 + b^3)*tan(f*x + e)))/f
 

Mupad [B] (verification not implemented)

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

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

Output:

((tan(e + f*x)^4*(11*a*b^3 + 4*b^4 - 8*a^2*b^2))/(8*a^2*(a + b)^3) - 1/(a 
+ b) + (tan(e + f*x)^2*(13*a*b^2 - 16*a^2*b + 4*b^3))/(8*a^2*(a + b)^2))/( 
f*(tan(e + f*x)^3*(2*a*b + 2*b^2) + tan(e + f*x)*(2*a*b + a^2 + b^2) + b^2 
*tan(e + f*x)^5)) - atan((286720*a^6*b^15*tan(e + f*x))/(286720*a^6*b^15 + 
 3619840*a^7*b^14 + 21052416*a^8*b^13 + 74346496*a^9*b^12 + 177172480*a^10 
*b^11 + 299796480*a^11*b^10 + 369346560*a^12*b^9 + 334344192*a^13*b^8 + 22 
1663232*a^14*b^7 + 105978880*a^15*b^6 + 35445760*a^16*b^5 + 7864320*a^17*b 
^4 + 1048576*a^18*b^3 + 65536*a^19*b^2) + (3619840*a^7*b^14*tan(e + f*x))/ 
(286720*a^6*b^15 + 3619840*a^7*b^14 + 21052416*a^8*b^13 + 74346496*a^9*b^1 
2 + 177172480*a^10*b^11 + 299796480*a^11*b^10 + 369346560*a^12*b^9 + 33434 
4192*a^13*b^8 + 221663232*a^14*b^7 + 105978880*a^15*b^6 + 35445760*a^16*b^ 
5 + 7864320*a^17*b^4 + 1048576*a^18*b^3 + 65536*a^19*b^2) + (21052416*a^8* 
b^13*tan(e + f*x))/(286720*a^6*b^15 + 3619840*a^7*b^14 + 21052416*a^8*b^13 
 + 74346496*a^9*b^12 + 177172480*a^10*b^11 + 299796480*a^11*b^10 + 3693465 
60*a^12*b^9 + 334344192*a^13*b^8 + 221663232*a^14*b^7 + 105978880*a^15*b^6 
 + 35445760*a^16*b^5 + 7864320*a^17*b^4 + 1048576*a^18*b^3 + 65536*a^19*b^ 
2) + (74346496*a^9*b^12*tan(e + f*x))/(286720*a^6*b^15 + 3619840*a^7*b^14 
+ 21052416*a^8*b^13 + 74346496*a^9*b^12 + 177172480*a^10*b^11 + 299796480* 
a^11*b^10 + 369346560*a^12*b^9 + 334344192*a^13*b^8 + 221663232*a^14*b^7 + 
 105978880*a^15*b^6 + 35445760*a^16*b^5 + 7864320*a^17*b^4 + 1048576*a^...
 

Reduce [B] (verification not implemented)

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

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

Output:

(35*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt 
(b))*sin(e + f*x)**5*a**4*b + 28*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan 
((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)**5*a**3*b**2 + 8*sqrt(b)*sq 
rt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f 
*x)**5*a**2*b**3 - 70*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/ 
2) - sqrt(a))/sqrt(b))*sin(e + f*x)**3*a**4*b - 126*sqrt(b)*sqrt(a + b)*at 
an((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)**3*a**3* 
b**2 - 72*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a) 
)/sqrt(b))*sin(e + f*x)**3*a**2*b**3 - 16*sqrt(b)*sqrt(a + b)*atan((sqrt(a 
 + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)**3*a*b**4 + 35*sqr 
t(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*si 
n(e + f*x)*a**4*b + 98*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x) 
/2) - sqrt(a))/sqrt(b))*sin(e + f*x)*a**3*b**2 + 99*sqrt(b)*sqrt(a + b)*at 
an((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)*a**2*b** 
3 + 44*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/s 
qrt(b))*sin(e + f*x)*a*b**4 + 8*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan( 
(e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)*b**5 + 35*sqrt(b)*sqrt(a + b 
)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + f*x)**5*a 
**4*b + 28*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a 
))/sqrt(b))*sin(e + f*x)**5*a**3*b**2 + 8*sqrt(b)*sqrt(a + b)*atan((sqr...