\(\int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx\) [640]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (verified)
Fricas [A] (verification not implemented)
Sympy [F]
Maxima [B] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 73 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {x}{a^2}-\frac {\text {arctanh}(\cos (c+d x))}{a^2 d}-\frac {\cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a^2 d}+\frac {\cot (c+d x) \csc (c+d x)}{a^2 d} \] Output:

-x/a^2-arctanh(cos(d*x+c))/a^2/d-cot(d*x+c)/a^2/d-1/3*cot(d*x+c)^3/a^2/d+c 
ot(d*x+c)*csc(d*x+c)/a^2/d
 

Mathematica [A] (verified)

Time = 2.89 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.70 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {\left (1+\cot \left (\frac {1}{2} (c+d x)\right )\right )^4 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \left (6 \cos (c+d x)-2 \cos (3 (c+d x))+12 \left (c+d x+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin ^3(c+d x)-6 \sin (2 (c+d x))\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{96 a^2 d (1+\sin (c+d x))^2} \] Input:

Integrate[(Cos[c + d*x]^2*Cot[c + d*x]^4)/(a + a*Sin[c + d*x])^2,x]
 

Output:

-1/96*((1 + Cot[(c + d*x)/2])^4*Sec[(c + d*x)/2]^2*(6*Cos[c + d*x] - 2*Cos 
[3*(c + d*x)] + 12*(c + d*x + Log[Cos[(c + d*x)/2]] - Log[Sin[(c + d*x)/2] 
])*Sin[c + d*x]^3 - 6*Sin[2*(c + d*x)])*Tan[(c + d*x)/2])/(a^2*d*(1 + Sin[ 
c + d*x])^2)
 

Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.05, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {3042, 3354, 3042, 3352, 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 {\cos ^2(c+d x) \cot ^4(c+d x)}{(a \sin (c+d x)+a)^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\cos (c+d x)^6}{\sin (c+d x)^4 (a \sin (c+d x)+a)^2}dx\)

\(\Big \downarrow \) 3354

\(\displaystyle \frac {\int \cot ^2(c+d x) \csc ^2(c+d x) (a-a \sin (c+d x))^2dx}{a^4}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {\cos (c+d x)^2 (a-a \sin (c+d x))^2}{\sin (c+d x)^4}dx}{a^4}\)

\(\Big \downarrow \) 3352

\(\displaystyle \frac {\int \left (a^2 \cot ^2(c+d x)+a^2 \csc ^2(c+d x) \cot ^2(c+d x)-2 a^2 \csc (c+d x) \cot ^2(c+d x)\right )dx}{a^4}\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {a^2 \text {arctanh}(\cos (c+d x))}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot (c+d x)}{d}+\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-a^2 x}{a^4}\)

Input:

Int[(Cos[c + d*x]^2*Cot[c + d*x]^4)/(a + a*Sin[c + d*x])^2,x]
 

Output:

(-(a^2*x) - (a^2*ArcTanh[Cos[c + d*x]])/d - (a^2*Cot[c + d*x])/d - (a^2*Co 
t[c + d*x]^3)/(3*d) + (a^2*Cot[c + d*x]*Csc[c + d*x])/d)/a^4
 

Defintions of rubi rules used

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 3352
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig 
[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x] /; F 
reeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]
 

rule 3354
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(a/g)^(2* 
m)   Int[(g*Cos[e + f*x])^(2*m + p)*((d*Sin[e + f*x])^n/(a - b*Sin[e + f*x] 
)^m), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && 
ILtQ[m, 0]
 
Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.67 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.44

method result size
risch \(-\frac {x}{a^{2}}-\frac {2 \left (3 \,{\mathrm e}^{5 i \left (d x +c \right )}-6 i {\mathrm e}^{2 i \left (d x +c \right )}+2 i-3 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 a^{2} d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d \,a^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d \,a^{2}}\) \(105\)
derivativedivides \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {3}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+8 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-16 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d \,a^{2}}\) \(110\)
default \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}-\frac {3}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+8 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )-16 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d \,a^{2}}\) \(110\)

Input:

int(cos(d*x+c)^2*cot(d*x+c)^4/(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
 

Output:

-x/a^2-2/3*(3*exp(5*I*(d*x+c))-6*I*exp(2*I*(d*x+c))+2*I-3*exp(I*(d*x+c)))/ 
a^2/d/(exp(2*I*(d*x+c))-1)^3+1/d/a^2*ln(exp(I*(d*x+c))-1)-1/d/a^2*ln(exp(I 
*(d*x+c))+1)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.90 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {4 \, \cos \left (d x + c\right )^{3} + 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 3 \, {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 6 \, {\left (d x \cos \left (d x + c\right )^{2} - d x + \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) - 6 \, \cos \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )} \] Input:

integrate(cos(d*x+c)^2*cot(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="frica 
s")
 

Output:

-1/6*(4*cos(d*x + c)^3 + 3*(cos(d*x + c)^2 - 1)*log(1/2*cos(d*x + c) + 1/2 
)*sin(d*x + c) - 3*(cos(d*x + c)^2 - 1)*log(-1/2*cos(d*x + c) + 1/2)*sin(d 
*x + c) + 6*(d*x*cos(d*x + c)^2 - d*x + cos(d*x + c))*sin(d*x + c) - 6*cos 
(d*x + c))/((a^2*d*cos(d*x + c)^2 - a^2*d)*sin(d*x + c))
 

Sympy [F]

\[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\int \frac {\cos ^{2}{\left (c + d x \right )} \cot ^{4}{\left (c + d x \right )}}{\sin ^{2}{\left (c + d x \right )} + 2 \sin {\left (c + d x \right )} + 1}\, dx}{a^{2}} \] Input:

integrate(cos(d*x+c)**2*cot(d*x+c)**4/(a+a*sin(d*x+c))**2,x)
 

Output:

Integral(cos(c + d*x)**2*cot(c + d*x)**4/(sin(c + d*x)**2 + 2*sin(c + d*x) 
 + 1), x)/a**2
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 176 vs. \(2 (71) = 142\).

Time = 0.12 (sec) , antiderivative size = 176, normalized size of antiderivative = 2.41 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {48 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {24 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} + \frac {{\left (\frac {6 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {9 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{3}}{a^{2} \sin \left (d x + c\right )^{3}}}{24 \, d} \] Input:

integrate(cos(d*x+c)^2*cot(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="maxim 
a")
 

Output:

1/24*((9*sin(d*x + c)/(cos(d*x + c) + 1) - 6*sin(d*x + c)^2/(cos(d*x + c) 
+ 1)^2 + sin(d*x + c)^3/(cos(d*x + c) + 1)^3)/a^2 - 48*arctan(sin(d*x + c) 
/(cos(d*x + c) + 1))/a^2 + 24*log(sin(d*x + c)/(cos(d*x + c) + 1))/a^2 + ( 
6*sin(d*x + c)/(cos(d*x + c) + 1) - 9*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 
- 1)*(cos(d*x + c) + 1)^3/(a^2*sin(d*x + c)^3))/d
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.88 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=-\frac {\frac {24 \, {\left (d x + c\right )}}{a^{2}} - \frac {24 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{2}} + \frac {44 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1}{a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}} - \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 9 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{24 \, d} \] Input:

integrate(cos(d*x+c)^2*cot(d*x+c)^4/(a+a*sin(d*x+c))^2,x, algorithm="giac" 
)
 

Output:

-1/24*(24*(d*x + c)/a^2 - 24*log(abs(tan(1/2*d*x + 1/2*c)))/a^2 + (44*tan( 
1/2*d*x + 1/2*c)^3 + 9*tan(1/2*d*x + 1/2*c)^2 - 6*tan(1/2*d*x + 1/2*c) + 1 
)/(a^2*tan(1/2*d*x + 1/2*c)^3) - (a^4*tan(1/2*d*x + 1/2*c)^3 - 6*a^4*tan(1 
/2*d*x + 1/2*c)^2 + 9*a^4*tan(1/2*d*x + 1/2*c))/a^6)/d
 

Mupad [B] (verification not implemented)

Time = 32.90 (sec) , antiderivative size = 261, normalized size of antiderivative = 3.58 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6-6\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+9\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-9\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+48\,\mathrm {atan}\left (\frac {\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+24\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a^2\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3} \] Input:

int((cos(c + d*x)^2*cot(c + d*x)^4)/(a + a*sin(c + d*x))^2,x)
 

Output:

(sin(c/2 + (d*x)/2)^6 - cos(c/2 + (d*x)/2)^6 - 6*cos(c/2 + (d*x)/2)*sin(c/ 
2 + (d*x)/2)^5 + 6*cos(c/2 + (d*x)/2)^5*sin(c/2 + (d*x)/2) + 9*cos(c/2 + ( 
d*x)/2)^2*sin(c/2 + (d*x)/2)^4 - 9*cos(c/2 + (d*x)/2)^4*sin(c/2 + (d*x)/2) 
^2 + 48*atan((cos(c/2 + (d*x)/2) - sin(c/2 + (d*x)/2))/(cos(c/2 + (d*x)/2) 
 + sin(c/2 + (d*x)/2)))*cos(c/2 + (d*x)/2)^3*sin(c/2 + (d*x)/2)^3 + 24*log 
(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(c/2 + (d*x)/2)^3*sin(c/2 + (d* 
x)/2)^3)/(24*a^2*d*cos(c/2 + (d*x)/2)^3*sin(c/2 + (d*x)/2)^3)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.19 \[ \int \frac {\cos ^2(c+d x) \cot ^4(c+d x)}{(a+a \sin (c+d x))^2} \, dx=\frac {-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}+3 \cos \left (d x +c \right ) \sin \left (d x +c \right )-\cos \left (d x +c \right )+3 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{3}-3 \sin \left (d x +c \right )^{3} d x}{3 \sin \left (d x +c \right )^{3} a^{2} d} \] Input:

int(cos(d*x+c)^2*cot(d*x+c)^4/(a+a*sin(d*x+c))^2,x)
 

Output:

( - 2*cos(c + d*x)*sin(c + d*x)**2 + 3*cos(c + d*x)*sin(c + d*x) - cos(c + 
 d*x) + 3*log(tan((c + d*x)/2))*sin(c + d*x)**3 - 3*sin(c + d*x)**3*d*x)/( 
3*sin(c + d*x)**3*a**2*d)