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

Optimal result
Mathematica [C] (warning: unable to verify)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F]
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 = 121 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=-\frac {x}{a^2}+\frac {b^{3/2} (5 a+2 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{2 a^2 (a+b)^{5/2} f}-\frac {(2 a-b) \cot (e+f x)}{2 a (a+b)^2 f}-\frac {b \cot (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^(3/2)*(5*a+2*b)*arctan(b^(1/2)*tan(f*x+e)/(a+b)^(1/2))/a^2/(a 
+b)^(5/2)/f-1/2*(2*a-b)*cot(f*x+e)/a/(a+b)^2/f-1/2*b*cot(f*x+e)/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 = 3.29 (sec) , antiderivative size = 288, normalized size of antiderivative = 2.38 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {(a+2 b+a \cos (2 (e+f x))) \sec ^4(e+f x) \left (-\frac {2 x (a+2 b+a \cos (2 (e+f x)))}{a^2}-\frac {b^2 (5 a+2 b) \arctan \left (\frac {\sec (f x) (\cos (2 e)-i \sin (2 e)) (-((a+2 b) \sin (f x))+a \sin (2 e+f x))}{2 \sqrt {a+b} \sqrt {b (\cos (e)-i \sin (e))^4}}\right ) (a+2 b+a \cos (2 (e+f x))) (\cos (2 e)-i \sin (2 e))}{a^2 (a+b)^{5/2} f \sqrt {b (\cos (e)-i \sin (e))^4}}+\frac {2 (a+2 b+a \cos (2 (e+f x))) \csc (e) \csc (e+f x) \sin (f x)}{(a+b)^2 f}+\frac {b^2 (-((a+2 b) \sin (2 e))+a \sin (2 f x))}{a^2 (a+b)^2 f (\cos (e)-\sin (e)) (\cos (e)+\sin (e))}\right )}{8 \left (a+b \sec ^2(e+f x)\right )^2} \] Input:

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

Output:

((a + 2*b + a*Cos[2*(e + f*x)])*Sec[e + f*x]^4*((-2*x*(a + 2*b + a*Cos[2*( 
e + f*x)]))/a^2 - (b^2*(5*a + 2*b)*ArcTan[(Sec[f*x]*(Cos[2*e] - I*Sin[2*e] 
)*(-((a + 2*b)*Sin[f*x]) + a*Sin[2*e + f*x]))/(2*Sqrt[a + b]*Sqrt[b*(Cos[e 
] - I*Sin[e])^4])]*(a + 2*b + a*Cos[2*(e + f*x)])*(Cos[2*e] - I*Sin[2*e])) 
/(a^2*(a + b)^(5/2)*f*Sqrt[b*(Cos[e] - I*Sin[e])^4]) + (2*(a + 2*b + a*Cos 
[2*(e + f*x)])*Csc[e]*Csc[e + f*x]*Sin[f*x])/((a + b)^2*f) + (b^2*(-((a + 
2*b)*Sin[2*e]) + a*Sin[2*f*x]))/(a^2*(a + b)^2*f*(Cos[e] - Sin[e])*(Cos[e] 
 + Sin[e]))))/(8*(a + b*Sec[e + f*x]^2)^2)
 

Rubi [A] (verified)

Time = 0.41 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.17, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 4629, 2075, 374, 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 )^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\tan (e+f x)^2 \left (a+b \sec (e+f x)^2\right )^2}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 )^2}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 )^2}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 374

\(\displaystyle \frac {\frac {\int \frac {\cot ^2(e+f x) \left (-3 b \tan ^2(e+f x)+2 a-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 (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 {2 a^2+6 b a+b^2+(2 a-b) b \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 {(2 a-b) \cot (e+f x)}{a+b}}{2 a (a+b)}-\frac {b \cot (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 {2 (a+b)^2 \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a}-\frac {b^2 (5 a+2 b) \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a}}{a+b}-\frac {(2 a-b) \cot (e+f x)}{a+b}}{2 a (a+b)}-\frac {b \cot (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 {2 (a+b)^2 \arctan (\tan (e+f x))}{a}-\frac {b^2 (5 a+2 b) \int \frac {1}{b \tan ^2(e+f x)+a+b}d\tan (e+f x)}{a}}{a+b}-\frac {(2 a-b) \cot (e+f x)}{a+b}}{2 a (a+b)}-\frac {b \cot (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 {2 (a+b)^2 \arctan (\tan (e+f x))}{a}-\frac {b^{3/2} (5 a+2 b) \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}}}{a+b}-\frac {(2 a-b) \cot (e+f x)}{a+b}}{2 a (a+b)}-\frac {b \cot (e+f x)}{2 a (a+b) \left (a+b \tan ^2(e+f x)+b\right )}}{f}\)

Input:

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

Output:

((-(((2*(a + b)^2*ArcTan[Tan[e + f*x]])/a - (b^(3/2)*(5*a + 2*b)*ArcTan[(S 
qrt[b]*Tan[e + f*x])/Sqrt[a + b]])/(a*Sqrt[a + b]))/(a + b)) - ((2*a - b)* 
Cot[e + f*x])/(a + b))/(2*a*(a + b)) - (b*Cot[e + f*x])/(2*a*(a + b)*(a + 
b + b*Tan[e + f*x]^2)))/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 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 = 3.18 (sec) , antiderivative size = 102, normalized size of antiderivative = 0.84

method result size
derivativedivides \(\frac {-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{2}}+\frac {b^{2} \left (\frac {a \tan \left (f x +e \right )}{2 a +2 b +2 b \tan \left (f x +e \right )^{2}}+\frac {\left (5 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 )}{a^{2} \left (a +b \right )^{2}}-\frac {1}{\left (a +b \right )^{2} \tan \left (f x +e \right )}}{f}\) \(102\)
default \(\frac {-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a^{2}}+\frac {b^{2} \left (\frac {a \tan \left (f x +e \right )}{2 a +2 b +2 b \tan \left (f x +e \right )^{2}}+\frac {\left (5 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 )}{a^{2} \left (a +b \right )^{2}}-\frac {1}{\left (a +b \right )^{2} \tan \left (f x +e \right )}}{f}\) \(102\)
risch \(-\frac {x}{a^{2}}+\frac {i \left (-2 a^{3} {\mathrm e}^{4 i \left (f x +e \right )}+a \,b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+2 b^{3} {\mathrm e}^{4 i \left (f x +e \right )}-4 a^{3} {\mathrm e}^{2 i \left (f x +e \right )}-8 \,{\mathrm e}^{2 i \left (f x +e \right )} a^{2} b -2 b^{3} {\mathrm e}^{2 i \left (f x +e \right )}-2 a^{3}-a \,b^{2}\right )}{a^{2} \left (a +b \right )^{2} 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 ) \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}-\frac {5 \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 )}{4 \left (a +b \right )^{3} f a}-\frac {\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 )}{2 \left (a +b \right )^{3} f \,a^{2}}+\frac {5 \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 )}{4 \left (a +b \right )^{3} f a}+\frac {\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 )}{2 \left (a +b \right )^{3} f \,a^{2}}\) \(393\)

Input:

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

Output:

1/f*(-1/a^2*arctan(tan(f*x+e))+b^2/a^2/(a+b)^2*(1/2*a*tan(f*x+e)/(a+b+b*ta 
n(f*x+e)^2)+1/2*(5*a+2*b)/((a+b)*b)^(1/2)*arctan(b*tan(f*x+e)/((a+b)*b)^(1 
/2)))-1/(a+b)^2/tan(f*x+e))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 258 vs. \(2 (107) = 214\).

Time = 0.13 (sec) , antiderivative size = 604, normalized size of antiderivative = 4.99 \[ \int \frac {\cot ^2(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)^2/(a+b*sec(f*x+e)^2)^2,x, algorithm="fricas")
 

Output:

[-1/8*(4*(2*a^3 + a*b^2)*cos(f*x + e)^3 - (5*a*b^2 + 2*b^3 + (5*a^2*b + 2* 
a*b^2)*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))*sin(f*x + e) + 4*(2*a 
^2*b - a*b^2)*cos(f*x + e) + 8*((a^3 + 2*a^2*b + a*b^2)*f*x*cos(f*x + e)^2 
 + (a^2*b + 2*a*b^2 + b^3)*f*x)*sin(f*x + e))/(((a^5 + 2*a^4*b + a^3*b^2)* 
f*cos(f*x + e)^2 + (a^4*b + 2*a^3*b^2 + a^2*b^3)*f)*sin(f*x + e)), -1/4*(2 
*(2*a^3 + a*b^2)*cos(f*x + e)^3 + (5*a*b^2 + 2*b^3 + (5*a^2*b + 2*a*b^2)*c 
os(f*x + e)^2)*sqrt(b/(a + b))*arctan(1/2*((a + 2*b)*cos(f*x + e)^2 - b)*s 
qrt(b/(a + b))/(b*cos(f*x + e)*sin(f*x + e)))*sin(f*x + e) + 2*(2*a^2*b - 
a*b^2)*cos(f*x + e) + 4*((a^3 + 2*a^2*b + a*b^2)*f*x*cos(f*x + e)^2 + (a^2 
*b + 2*a*b^2 + b^3)*f*x)*sin(f*x + e))/(((a^5 + 2*a^4*b + a^3*b^2)*f*cos(f 
*x + e)^2 + (a^4*b + 2*a^3*b^2 + a^2*b^3)*f)*sin(f*x + e))]
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.35 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\frac {{\left (5 \, a b^{2} + 2 \, b^{3}\right )} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {{\left (a + b\right )} b}}\right )}{{\left (a^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} \sqrt {{\left (a + b\right )} b}} - \frac {{\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{2} + 2 \, a^{2} + 2 \, a b}{{\left (a^{3} b + 2 \, a^{2} b^{2} + a b^{3}\right )} \tan \left (f x + e\right )^{3} + {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \tan \left (f x + e\right )} - \frac {2 \, {\left (f x + e\right )}}{a^{2}}}{2 \, f} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.45 \[ \int \frac {\cot ^2(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\frac {{\left (5 \, a b^{2} + 2 \, b^{3}\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^{4} + 2 \, a^{3} b + a^{2} b^{2}\right )} \sqrt {a b + b^{2}}} - \frac {2 \, a b \tan \left (f x + e\right )^{2} - b^{2} \tan \left (f x + e\right )^{2} + 2 \, a^{2} + 2 \, a b}{{\left (b \tan \left (f x + e\right )^{3} + a \tan \left (f x + e\right ) + b \tan \left (f x + e\right )\right )} {\left (a^{3} + 2 \, a^{2} b + a b^{2}\right )}} - \frac {2 \, {\left (f x + e\right )}}{a^{2}}}{2 \, f} \] Input:

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

Output:

1/2*((5*a*b^2 + 2*b^3)*(pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan 
(f*x + e)/sqrt(a*b + b^2)))/((a^4 + 2*a^3*b + a^2*b^2)*sqrt(a*b + b^2)) - 
(2*a*b*tan(f*x + e)^2 - b^2*tan(f*x + e)^2 + 2*a^2 + 2*a*b)/((b*tan(f*x + 
e)^3 + a*tan(f*x + e) + b*tan(f*x + e))*(a^3 + 2*a^2*b + a*b^2)) - 2*(f*x 
+ e)/a^2)/f
 

Mupad [B] (verification not implemented)

Time = 19.78 (sec) , antiderivative size = 3146, normalized size of antiderivative = 26.00 \[ \int \frac {\cot ^2(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)^2/(a + b/cos(e + f*x)^2)^2,x)
 

Output:

(atan((((tan(e + f*x)*(128*a^3*b^13 + 1344*a^4*b^12 + 6160*a^5*b^11 + 1616 
0*a^6*b^10 + 26800*a^7*b^9 + 29312*a^8*b^8 + 21424*a^9*b^7 + 10400*a^10*b^ 
6 + 3280*a^11*b^5 + 640*a^12*b^4 + 64*a^13*b^3) - ((-b^3*(a + b)^5)^(1/2)* 
(5*a + 2*b)*(64*a^6*b^12 + 896*a^7*b^11 + 4992*a^8*b^10 + 15360*a^9*b^9 + 
29568*a^10*b^8 + 37632*a^11*b^7 + 32256*a^12*b^6 + 18432*a^13*b^5 + 6720*a 
^14*b^4 + 1408*a^15*b^3 + 128*a^16*b^2 - (tan(e + f*x)*(-b^3*(a + b)^5)^(1 
/2)*(5*a + 2*b)*(512*a^7*b^13 + 5376*a^8*b^12 + 25600*a^9*b^11 + 72960*a^1 
0*b^10 + 138240*a^11*b^9 + 182784*a^12*b^8 + 172032*a^13*b^7 + 115200*a^14 
*b^6 + 53760*a^15*b^5 + 16640*a^16*b^4 + 3072*a^17*b^3 + 256*a^18*b^2))/(4 
*(5*a^6*b + a^7 + a^2*b^5 + 5*a^3*b^4 + 10*a^4*b^3 + 10*a^5*b^2))))/(4*(5* 
a^6*b + a^7 + a^2*b^5 + 5*a^3*b^4 + 10*a^4*b^3 + 10*a^5*b^2)))*(-b^3*(a + 
b)^5)^(1/2)*(5*a + 2*b)*1i)/(4*(5*a^6*b + a^7 + a^2*b^5 + 5*a^3*b^4 + 10*a 
^4*b^3 + 10*a^5*b^2)) + ((tan(e + f*x)*(128*a^3*b^13 + 1344*a^4*b^12 + 616 
0*a^5*b^11 + 16160*a^6*b^10 + 26800*a^7*b^9 + 29312*a^8*b^8 + 21424*a^9*b^ 
7 + 10400*a^10*b^6 + 3280*a^11*b^5 + 640*a^12*b^4 + 64*a^13*b^3) + ((-b^3* 
(a + b)^5)^(1/2)*(5*a + 2*b)*(64*a^6*b^12 + 896*a^7*b^11 + 4992*a^8*b^10 + 
 15360*a^9*b^9 + 29568*a^10*b^8 + 37632*a^11*b^7 + 32256*a^12*b^6 + 18432* 
a^13*b^5 + 6720*a^14*b^4 + 1408*a^15*b^3 + 128*a^16*b^2 + (tan(e + f*x)*(- 
b^3*(a + b)^5)^(1/2)*(5*a + 2*b)*(512*a^7*b^13 + 5376*a^8*b^12 + 25600*a^9 
*b^11 + 72960*a^10*b^10 + 138240*a^11*b^9 + 182784*a^12*b^8 + 172032*a^...
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 784, normalized size of antiderivative = 6.48 \[ \int \frac {\cot ^2(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)^2/(a+b*sec(f*x+e)^2)^2,x)
 

Output:

(5*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 + 2*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**2 - 5*sqrt(b)*sqrt(a 
+ b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)*a 
**2*b - 7*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) - sqrt(a) 
)/sqrt(b))*sin(e + f*x)*a*b**2 - 2*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*t 
an((e + f*x)/2) - sqrt(a))/sqrt(b))*sin(e + f*x)*b**3 + 5*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 + 2*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**2 - 5*sqrt(b)*sqrt(a + b)*atan((sqrt(a + 
 b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + f*x)*a**2*b - 7*sqrt(b)*s 
qrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) + sqrt(a))/sqrt(b))*sin(e + 
f*x)*a*b**2 - 2*sqrt(b)*sqrt(a + b)*atan((sqrt(a + b)*tan((e + f*x)/2) + s 
qrt(a))/sqrt(b))*sin(e + f*x)*b**3 - 2*cos(e + f*x)*sin(e + f*x)**2*a**4 - 
 2*cos(e + f*x)*sin(e + f*x)**2*a**3*b - cos(e + f*x)*sin(e + f*x)**2*a**2 
*b**2 - cos(e + f*x)*sin(e + f*x)**2*a*b**3 + 2*cos(e + f*x)*a**4 + 4*cos( 
e + f*x)*a**3*b + 2*cos(e + f*x)*a**2*b**2 - 2*sin(e + f*x)**3*a**4*f*x - 
6*sin(e + f*x)**3*a**3*b*f*x - 6*sin(e + f*x)**3*a**2*b**2*f*x - 2*sin(e + 
 f*x)**3*a*b**3*f*x + 2*sin(e + f*x)*a**4*f*x + 8*sin(e + f*x)*a**3*b*f*x 
+ 12*sin(e + f*x)*a**2*b**2*f*x + 8*sin(e + f*x)*a*b**3*f*x + 2*sin(e +...