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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (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 = 21, antiderivative size = 83 \[ \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {b^2}{2 a^2 (a+b) f \left (b+a \cos ^2(e+f x)\right )}+\frac {b (2 a+b) \log \left (b+a \cos ^2(e+f x)\right )}{2 a^2 (a+b)^2 f}+\frac {\log (\sin (e+f x))}{(a+b)^2 f} \] Output:

1/2*b^2/a^2/(a+b)/f/(b+a*cos(f*x+e)^2)+1/2*b*(2*a+b)*ln(b+a*cos(f*x+e)^2)/ 
a^2/(a+b)^2/f+ln(sin(f*x+e))/(a+b)^2/f
 

Mathematica [A] (verified)

Time = 0.26 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.35 \[ \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {(a+2 b+a \cos (2 (e+f x)))^2 \sec ^4(e+f x) \left (2 \log (\sin (e+f x))+\frac {b (2 a+b) \log \left (a+b-a \sin ^2(e+f x)\right )}{a^2}+\frac {b^2 (a+b)}{a^2 \left (a+b-a \sin ^2(e+f x)\right )}\right )}{8 (a+b)^2 f \left (a+b \sec ^2(e+f x)\right )^2} \] Input:

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

Output:

((a + 2*b + a*Cos[2*(e + f*x)])^2*Sec[e + f*x]^4*(2*Log[Sin[e + f*x]] + (b 
*(2*a + b)*Log[a + b - a*Sin[e + f*x]^2])/a^2 + (b^2*(a + b))/(a^2*(a + b 
- a*Sin[e + f*x]^2))))/(8*(a + b)^2*f*(a + b*Sec[e + f*x]^2)^2)
 

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.01, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 4626, 354, 99, 2009}

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

\(\Big \downarrow \) 4626

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

\(\Big \downarrow \) 354

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

\(\Big \downarrow \) 99

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-1/2*(-(b^2/(a^2*(a + b)*(b + a*Cos[e + f*x]^2))) - Log[1 - Cos[e + f*x]^2 
]/(a + b)^2 - (b*(2*a + b)*Log[b + a*Cos[e + f*x]^2])/(a^2*(a + b)^2))/f
 

Defintions of rubi rules used

rule 99
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], 
 x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | 
| (GtQ[m, 0] && GeQ[n, -1]))
 

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 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4626
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_ 
)]^(m_.), x_Symbol] :> Module[{ff = FreeFactors[Cos[e + f*x], x]}, Simp[-(f 
*ff^(m + n*p - 1))^(-1)   Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*((b + a*(ff* 
x)^n)^p/x^(m + n*p)), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n} 
, x] && IntegerQ[(m - 1)/2] && IntegerQ[n] && IntegerQ[p]
 
Maple [A] (verified)

Time = 2.28 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.10

method result size
derivativedivides \(\frac {\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}+\frac {b \left (\frac {\left (a +b \right ) b}{a^{2} \left (b +a \cos \left (f x +e \right )^{2}\right )}+\frac {\left (2 a +b \right ) \ln \left (b +a \cos \left (f x +e \right )^{2}\right )}{a^{2}}\right )}{2 \left (a +b \right )^{2}}}{f}\) \(91\)
default \(\frac {\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 \left (a +b \right )^{2}}+\frac {b \left (\frac {\left (a +b \right ) b}{a^{2} \left (b +a \cos \left (f x +e \right )^{2}\right )}+\frac {\left (2 a +b \right ) \ln \left (b +a \cos \left (f x +e \right )^{2}\right )}{a^{2}}\right )}{2 \left (a +b \right )^{2}}}{f}\) \(91\)
risch \(\frac {i x}{a^{2}}-\frac {2 i x}{a^{2}+2 a b +b^{2}}-\frac {2 i e}{f \left (a^{2}+2 a b +b^{2}\right )}-\frac {4 i b x}{a \left (a^{2}+2 a b +b^{2}\right )}-\frac {4 i b e}{a f \left (a^{2}+2 a b +b^{2}\right )}-\frac {2 i b^{2} x}{a^{2} \left (a^{2}+2 a b +b^{2}\right )}-\frac {2 i b^{2} e}{a^{2} f \left (a^{2}+2 a b +b^{2}\right )}+\frac {2 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}}{a^{2} f \left (a +b \right ) \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 {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{f \left (a^{2}+2 a b +b^{2}\right )}+\frac {b \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +2 b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a}+1\right )}{a f \left (a^{2}+2 a b +b^{2}\right )}+\frac {b^{2} \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +2 b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a}+1\right )}{2 a^{2} f \left (a^{2}+2 a b +b^{2}\right )}\) \(340\)

Input:

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

Output:

1/f*(1/2/(a+b)^2*ln(1+cos(f*x+e))+1/2/(a+b)^2*ln(-1+cos(f*x+e))+1/2*b/(a+b 
)^2*((a+b)*b/a^2/(b+a*cos(f*x+e)^2)+(2*a+b)/a^2*ln(b+a*cos(f*x+e)^2)))
 

Fricas [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.66 \[ \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {a b^{2} + b^{3} + {\left (2 \, a b^{2} + b^{3} + {\left (2 \, a^{2} b + a b^{2}\right )} \cos \left (f x + e\right )^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) + 2 \, {\left (a^{3} \cos \left (f x + e\right )^{2} + a^{2} b\right )} \log \left (\frac {1}{2} \, \sin \left (f x + e\right )\right )}{2 \, {\left ({\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{4} b + 2 \, a^{3} b^{2} + a^{2} b^{3}\right )} f\right )}} \] Input:

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

Output:

1/2*(a*b^2 + b^3 + (2*a*b^2 + b^3 + (2*a^2*b + a*b^2)*cos(f*x + e)^2)*log( 
a*cos(f*x + e)^2 + b) + 2*(a^3*cos(f*x + e)^2 + a^2*b)*log(1/2*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)
                                                                                    
                                                                                    
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.41 \[ \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\frac {b^{2}}{a^{4} + 2 \, a^{3} b + a^{2} b^{2} - {\left (a^{4} + a^{3} b\right )} \sin \left (f x + e\right )^{2}} + \frac {{\left (2 \, a b + b^{2}\right )} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{4} + 2 \, a^{3} b + a^{2} b^{2}} + \frac {\log \left (\sin \left (f x + e\right )^{2}\right )}{a^{2} + 2 \, a b + b^{2}}}{2 \, f} \] Input:

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

Output:

1/2*(b^2/(a^4 + 2*a^3*b + a^2*b^2 - (a^4 + a^3*b)*sin(f*x + e)^2) + (2*a*b 
 + b^2)*log(a*sin(f*x + e)^2 - a - b)/(a^4 + 2*a^3*b + a^2*b^2) + log(sin( 
f*x + e)^2)/(a^2 + 2*a*b + b^2))/f
 

Giac [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.42 \[ \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {{\left (2 \, a b + b^{2}\right )} \log \left ({\left | a \cos \left (f x + e\right )^{2} + b \right |}\right )}{2 \, {\left (a^{4} f + 2 \, a^{3} b f + a^{2} b^{2} f\right )}} + \frac {\log \left ({\left | -\cos \left (f x + e\right )^{2} + 1 \right |}\right )}{2 \, {\left (a^{2} f + 2 \, a b f + b^{2} f\right )}} + \frac {a b^{2} + b^{3}}{2 \, {\left (a \cos \left (f x + e\right )^{2} + b\right )} {\left (a + b\right )}^{2} a^{2} f} \] Input:

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

Output:

1/2*(2*a*b + b^2)*log(abs(a*cos(f*x + e)^2 + b))/(a^4*f + 2*a^3*b*f + a^2* 
b^2*f) + 1/2*log(abs(-cos(f*x + e)^2 + 1))/(a^2*f + 2*a*b*f + b^2*f) + 1/2 
*(a*b^2 + b^3)/((a*cos(f*x + e)^2 + b)*(a + b)^2*a^2*f)
 

Mupad [B] (verification not implemented)

Time = 15.28 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.28 \[ \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx=\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )}{f\,\left (a^2+2\,a\,b+b^2\right )}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,a^2\,f}-\frac {b}{2\,a\,f\,\left (a+b\right )\,\left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )}+\frac {b\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )\,\left (2\,a+b\right )}{2\,a^2\,f\,{\left (a+b\right )}^2} \] Input:

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

Output:

log(tan(e + f*x))/(f*(2*a*b + a^2 + b^2)) - log(tan(e + f*x)^2 + 1)/(2*a^2 
*f) - b/(2*a*f*(a + b)*(a + b + b*tan(e + f*x)^2)) + (b*log(a + b + b*tan( 
e + f*x)^2)*(2*a + b))/(2*a^2*f*(a + b)^2)
 

Reduce [B] (verification not implemented)

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

Output:

( - 2*log(tan((e + f*x)/2)**2 + 1)*sin(e + f*x)**2*a**3 - 4*log(tan((e + f 
*x)/2)**2 + 1)*sin(e + f*x)**2*a**2*b - 2*log(tan((e + f*x)/2)**2 + 1)*sin 
(e + f*x)**2*a*b**2 + 2*log(tan((e + f*x)/2)**2 + 1)*a**3 + 6*log(tan((e + 
 f*x)/2)**2 + 1)*a**2*b + 6*log(tan((e + f*x)/2)**2 + 1)*a*b**2 + 2*log(ta 
n((e + f*x)/2)**2 + 1)*b**3 + 2*log(sqrt(a + b)*tan((e + f*x)/2)**2 + sqrt 
(a + b) - 2*sqrt(a)*tan((e + f*x)/2))*sin(e + f*x)**2*a**2*b + log(sqrt(a 
+ b)*tan((e + f*x)/2)**2 + sqrt(a + b) - 2*sqrt(a)*tan((e + f*x)/2))*sin(e 
 + f*x)**2*a*b**2 - 2*log(sqrt(a + b)*tan((e + f*x)/2)**2 + sqrt(a + b) - 
2*sqrt(a)*tan((e + f*x)/2))*a**2*b - 3*log(sqrt(a + b)*tan((e + f*x)/2)**2 
 + sqrt(a + b) - 2*sqrt(a)*tan((e + f*x)/2))*a*b**2 - log(sqrt(a + b)*tan( 
(e + f*x)/2)**2 + sqrt(a + b) - 2*sqrt(a)*tan((e + f*x)/2))*b**3 + 2*log(s 
qrt(a + b)*tan((e + f*x)/2)**2 + sqrt(a + b) + 2*sqrt(a)*tan((e + f*x)/2)) 
*sin(e + f*x)**2*a**2*b + log(sqrt(a + b)*tan((e + f*x)/2)**2 + sqrt(a + b 
) + 2*sqrt(a)*tan((e + f*x)/2))*sin(e + f*x)**2*a*b**2 - 2*log(sqrt(a + b) 
*tan((e + f*x)/2)**2 + sqrt(a + b) + 2*sqrt(a)*tan((e + f*x)/2))*a**2*b - 
3*log(sqrt(a + b)*tan((e + f*x)/2)**2 + sqrt(a + b) + 2*sqrt(a)*tan((e + f 
*x)/2))*a*b**2 - log(sqrt(a + b)*tan((e + f*x)/2)**2 + sqrt(a + b) + 2*sqr 
t(a)*tan((e + f*x)/2))*b**3 + 2*log(tan((e + f*x)/2))*sin(e + f*x)**2*a**3 
 - 2*log(tan((e + f*x)/2))*a**3 - 2*log(tan((e + f*x)/2))*a**2*b - sin(e + 
 f*x)**2*a*b**2)/(2*a**2*f*(sin(e + f*x)**2*a**3 + 2*sin(e + f*x)**2*a*...