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

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

Optimal result

Integrand size = 23, antiderivative size = 115 \[ \int \frac {\cot ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {(a+b) \cot ^2(e+f x)}{2 a^2 f}-\frac {\cot ^4(e+f x)}{4 a f}+\frac {\log (\cos (e+f x))}{(a-b) f}+\frac {\left (a^2+a b+b^2\right ) \log (\tan (e+f x))}{a^3 f}+\frac {b^3 \log \left (a+b \tan ^2(e+f x)\right )}{2 a^3 (a-b) f} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

-1/2*(-(((a + b)*Cot[e + f*x]^2)/a^2) + Cot[e + f*x]^4/(2*a) - (b^3*Log[b 
+ a*Cot[e + f*x]^2])/(a^3*(a - b)) - (2*Log[Sin[e + f*x]])/(a - b))/f
 

Rubi [A] (warning: unable to verify)

Time = 0.55 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.92, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3042, 4153, 354, 93, 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 ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 354

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

\(\Big \downarrow \) 93

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(((a + b)*Cot[e + f*x])/a^2 - Cot[e + f*x]^2/(2*a) + ((a^2 + a*b + b^2)*Lo 
g[Tan[e + f*x]^2])/a^3 - Log[1 + Tan[e + f*x]^2]/(a - b) + (b^3*Log[a + b* 
Tan[e + f*x]^2])/(a^3*(a - b)))/(2*f)
 

Defintions of rubi rules used

rule 93
Int[((e_.) + (f_.)*(x_))^(p_)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), 
x_] :> Int[ExpandIntegrand[(e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; Fre 
eQ[{a, b, c, d, e, f}, 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 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 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
Maple [A] (verified)

Time = 1.03 (sec) , antiderivative size = 101, normalized size of antiderivative = 0.88

method result size
parallelrisch \(\frac {2 \ln \left (a +b \tan \left (f x +e \right )^{2}\right ) b^{3}-2 \ln \left (\sec \left (f x +e \right )^{2}\right ) a^{3}+\left (4 a^{3}-4 b^{3}\right ) \ln \left (\tan \left (f x +e \right )\right )-a \cot \left (f x +e \right )^{2} \left (a -b \right ) \left (a \cot \left (f x +e \right )^{2}-2 a -2 b \right )}{4 \left (a -b \right ) a^{3} f}\) \(101\)
derivativedivides \(\frac {\frac {b^{3} \ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 a^{3} \left (a -b \right )}-\frac {1}{4 a \tan \left (f x +e \right )^{4}}-\frac {-b -a}{2 a^{2} \tan \left (f x +e \right )^{2}}+\frac {\left (a^{2}+a b +b^{2}\right ) \ln \left (\tan \left (f x +e \right )\right )}{a^{3}}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a -b \right )}}{f}\) \(108\)
default \(\frac {\frac {b^{3} \ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 a^{3} \left (a -b \right )}-\frac {1}{4 a \tan \left (f x +e \right )^{4}}-\frac {-b -a}{2 a^{2} \tan \left (f x +e \right )^{2}}+\frac {\left (a^{2}+a b +b^{2}\right ) \ln \left (\tan \left (f x +e \right )\right )}{a^{3}}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 \left (a -b \right )}}{f}\) \(108\)
norman \(\frac {-\frac {1}{4 a f}+\frac {\left (a +b \right ) \tan \left (f x +e \right )^{2}}{2 a^{2} f}}{\tan \left (f x +e \right )^{4}}+\frac {\left (a^{2}+a b +b^{2}\right ) \ln \left (\tan \left (f x +e \right )\right )}{a^{3} f}-\frac {\ln \left (1+\tan \left (f x +e \right )^{2}\right )}{2 f \left (a -b \right )}+\frac {b^{3} \ln \left (a +b \tan \left (f x +e \right )^{2}\right )}{2 a^{3} \left (a -b \right ) f}\) \(117\)
risch \(\frac {i x}{a -b}-\frac {2 i x}{a}-\frac {2 i e}{a f}-\frac {2 i b x}{a^{2}}-\frac {2 i b e}{a^{2} f}-\frac {2 i b^{2} x}{a^{3}}-\frac {2 i b^{2} e}{a^{3} f}-\frac {2 i b^{3} x}{\left (a -b \right ) a^{3}}-\frac {2 i b^{3} e}{\left (a -b \right ) a^{3} f}-\frac {2 \left (2 a \,{\mathrm e}^{6 i \left (f x +e \right )}+b \,{\mathrm e}^{6 i \left (f x +e \right )}-2 a \,{\mathrm e}^{4 i \left (f x +e \right )}-2 b \,{\mathrm e}^{4 i \left (f x +e \right )}+2 a \,{\mathrm e}^{2 i \left (f x +e \right )}+b \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{f \,a^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{4}}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{a f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b}{a^{2} f}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right ) b^{2}}{a^{3} f}+\frac {b^{3} \ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a -b}+1\right )}{2 \left (a -b \right ) a^{3} f}\) \(313\)

Input:

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

Output:

1/4*(2*ln(a+b*tan(f*x+e)^2)*b^3-2*ln(sec(f*x+e)^2)*a^3+(4*a^3-4*b^3)*ln(ta 
n(f*x+e))-a*cot(f*x+e)^2*(a-b)*(a*cot(f*x+e)^2-2*a-2*b))/(a-b)/a^3/f
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 898 vs. \(2 (97) = 194\).

Time = 36.78 (sec) , antiderivative size = 898, normalized size of antiderivative = 7.81 \[ \int \frac {\cot ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\text {Too large to display} \] Input:

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

Output:

Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(e, 0) & Eq(f, 0)), ((-log(tan(e 
 + f*x)**2 + 1)/(2*f) + log(tan(e + f*x))/f + 1/(2*f*tan(e + f*x)**2) - 1/ 
(4*f*tan(e + f*x)**4))/a, Eq(b, 0)), ((log(tan(e + f*x)**2 + 1)/(2*f) - lo 
g(tan(e + f*x))/f - 1/(2*f*tan(e + f*x)**2) + 1/(4*f*tan(e + f*x)**4) - 1/ 
(6*f*tan(e + f*x)**6))/b, Eq(a, 0)), (-6*log(tan(e + f*x)**2 + 1)*tan(e + 
f*x)**6/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) - 6*log(tan(e + f* 
x)**2 + 1)*tan(e + f*x)**4/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4) 
 + 12*log(tan(e + f*x))*tan(e + f*x)**6/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan 
(e + f*x)**4) + 12*log(tan(e + f*x))*tan(e + f*x)**4/(4*a*f*tan(e + f*x)** 
6 + 4*a*f*tan(e + f*x)**4) + 6*tan(e + f*x)**4/(4*a*f*tan(e + f*x)**6 + 4* 
a*f*tan(e + f*x)**4) + 3*tan(e + f*x)**2/(4*a*f*tan(e + f*x)**6 + 4*a*f*ta 
n(e + f*x)**4) - 1/(4*a*f*tan(e + f*x)**6 + 4*a*f*tan(e + f*x)**4), Eq(a, 
b)), (zoo*x/a, Eq(e, -f*x)), (x*cot(e)**5/(a + b*tan(e)**2), Eq(f, 0)), (- 
2*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**4/(4*a**4*f*tan(e + f*x)**4 
- 4*a**3*b*f*tan(e + f*x)**4) + 4*a**3*log(tan(e + f*x))*tan(e + f*x)**4/( 
4*a**4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + 2*a**3*tan(e + f* 
x)**2/(4*a**4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) - a**3/(4*a* 
*4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + a**2*b/(4*a**4*f*tan( 
e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) - 2*a*b**2*tan(e + f*x)**2/(4*a* 
*4*f*tan(e + f*x)**4 - 4*a**3*b*f*tan(e + f*x)**4) + 2*b**3*log(-sqrt(-...
 

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [F]

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

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

Output:

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