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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (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 = 100 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\text {arctanh}(\cos (c+d x))}{8 a d}-\frac {\cot ^3(c+d x)}{3 a d}-\frac {\cot ^5(c+d x)}{5 a d}-\frac {\cot (c+d x) \csc (c+d x)}{8 a d}+\frac {\cot (c+d x) \csc ^3(c+d x)}{4 a d} \] Output:

-1/8*arctanh(cos(d*x+c))/a/d-1/3*cot(d*x+c)^3/a/d-1/5*cot(d*x+c)^5/a/d-1/8 
*cot(d*x+c)*csc(d*x+c)/a/d+1/4*cot(d*x+c)*csc(d*x+c)^3/a/d
 

Mathematica [A] (verified)

Time = 1.30 (sec) , antiderivative size = 189, normalized size of antiderivative = 1.89 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\csc ^5(c+d x) \left (320 \cos (c+d x)+80 \cos (3 (c+d x))-16 \cos (5 (c+d x))+150 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-150 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)-180 \sin (2 (c+d x))-75 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))+75 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (3 (c+d x))-30 \sin (4 (c+d x))+15 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (5 (c+d x))-15 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (5 (c+d x))\right )}{1920 a d} \] Input:

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

Output:

-1/1920*(Csc[c + d*x]^5*(320*Cos[c + d*x] + 80*Cos[3*(c + d*x)] - 16*Cos[5 
*(c + d*x)] + 150*Log[Cos[(c + d*x)/2]]*Sin[c + d*x] - 150*Log[Sin[(c + d* 
x)/2]]*Sin[c + d*x] - 180*Sin[2*(c + d*x)] - 75*Log[Cos[(c + d*x)/2]]*Sin[ 
3*(c + d*x)] + 75*Log[Sin[(c + d*x)/2]]*Sin[3*(c + d*x)] - 30*Sin[4*(c + d 
*x)] + 15*Log[Cos[(c + d*x)/2]]*Sin[5*(c + d*x)] - 15*Log[Sin[(c + d*x)/2] 
]*Sin[5*(c + d*x)]))/(a*d)
 

Rubi [A] (verified)

Time = 0.67 (sec) , antiderivative size = 98, normalized size of antiderivative = 0.98, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.379, Rules used = {3042, 3318, 3042, 3087, 244, 2009, 3091, 3042, 4255, 3042, 4257}

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 ^4(c+d x) \csc ^2(c+d x)}{a \sin (c+d x)+a} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3318

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \sec \left (c+d x-\frac {\pi }{2}\right )^4 \tan \left (c+d x-\frac {\pi }{2}\right )^2dx}{a}-\frac {\int \sec \left (c+d x-\frac {\pi }{2}\right )^3 \tan \left (c+d x-\frac {\pi }{2}\right )^2dx}{a}\)

\(\Big \downarrow \) 3087

\(\displaystyle \frac {\int \cot ^2(c+d x) \left (\cot ^2(c+d x)+1\right )d(-\cot (c+d x))}{a d}-\frac {\int \sec \left (c+d x-\frac {\pi }{2}\right )^3 \tan \left (c+d x-\frac {\pi }{2}\right )^2dx}{a}\)

\(\Big \downarrow \) 244

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {1}{5} \cot ^5(c+d x)-\frac {1}{3} \cot ^3(c+d x)}{a d}-\frac {\int \sec \left (c+d x-\frac {\pi }{2}\right )^3 \tan \left (c+d x-\frac {\pi }{2}\right )^2dx}{a}\)

\(\Big \downarrow \) 3091

\(\displaystyle \frac {-\frac {1}{5} \cot ^5(c+d x)-\frac {1}{3} \cot ^3(c+d x)}{a d}-\frac {-\frac {1}{4} \int \csc ^3(c+d x)dx-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 d}}{a}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {-\frac {1}{5} \cot ^5(c+d x)-\frac {1}{3} \cot ^3(c+d x)}{a d}-\frac {-\frac {1}{4} \int \csc (c+d x)^3dx-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 d}}{a}\)

\(\Big \downarrow \) 4255

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 244
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p 
, 0]
 

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 3087
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> Simp[1/f   Subst[Int[(b*x)^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + 
f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n - 1) 
/2] && LtQ[0, n, m - 1])
 

rule 3091
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_), x_Symbol] :> Simp[b*(a*Sec[e + f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m 
 + n - 1))), x] - Simp[b^2*((n - 1)/(m + n - 1))   Int[(a*Sec[e + f*x])^m*( 
b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] & 
& NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]
 

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

rule 4255
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) 
  Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] 
&& IntegerQ[2*n]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 0.71 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.24

method result size
derivativedivides \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {1}{5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}}{32 d a}\) \(124\)
default \(\frac {\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{5}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{2}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {1}{5 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}}{32 d a}\) \(124\)
risch \(\frac {15 \,{\mathrm e}^{9 i \left (d x +c \right )}-240 i {\mathrm e}^{6 i \left (d x +c \right )}+90 \,{\mathrm e}^{7 i \left (d x +c \right )}-80 i {\mathrm e}^{4 i \left (d x +c \right )}-80 i {\mathrm e}^{2 i \left (d x +c \right )}-90 \,{\mathrm e}^{3 i \left (d x +c \right )}+16 i-15 \,{\mathrm e}^{i \left (d x +c \right )}}{60 a d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d a}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d a}\) \(146\)

Input:

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

Output:

1/32/d/a*(1/5*tan(1/2*d*x+1/2*c)^5-1/2*tan(1/2*d*x+1/2*c)^4+1/3*tan(1/2*d* 
x+1/2*c)^3-2*tan(1/2*d*x+1/2*c)-1/3/tan(1/2*d*x+1/2*c)^3+4*ln(tan(1/2*d*x+ 
1/2*c))+1/2/tan(1/2*d*x+1/2*c)^4+2/tan(1/2*d*x+1/2*c)-1/5/tan(1/2*d*x+1/2* 
c)^5)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.61 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {32 \, \cos \left (d x + c\right )^{5} - 80 \, \cos \left (d x + c\right )^{3} - 15 \, {\left (\cos \left (d x + c\right )^{4} - 2 \, \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 ) + 15 \, {\left (\cos \left (d x + c\right )^{4} - 2 \, \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 ) + 30 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, {\left (a d \cos \left (d x + c\right )^{4} - 2 \, a d \cos \left (d x + c\right )^{2} + a d\right )} \sin \left (d x + c\right )} \] Input:

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

Output:

1/240*(32*cos(d*x + c)^5 - 80*cos(d*x + c)^3 - 15*(cos(d*x + c)^4 - 2*cos( 
d*x + c)^2 + 1)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 15*(cos(d*x + c 
)^4 - 2*cos(d*x + c)^2 + 1)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 30 
*(cos(d*x + c)^3 + cos(d*x + c))*sin(d*x + c))/((a*d*cos(d*x + c)^4 - 2*a* 
d*cos(d*x + c)^2 + a*d)*sin(d*x + c))
 

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (90) = 180\).

Time = 0.04 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.95 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {\frac {60 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {10 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {15 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {6 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}}{a} - \frac {120 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {{\left (\frac {15 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {10 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {60 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - 6\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{5}}{a \sin \left (d x + c\right )^{5}}}{960 \, d} \] Input:

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

Output:

-1/960*((60*sin(d*x + c)/(cos(d*x + c) + 1) - 10*sin(d*x + c)^3/(cos(d*x + 
 c) + 1)^3 + 15*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 6*sin(d*x + c)^5/(co 
s(d*x + c) + 1)^5)/a - 120*log(sin(d*x + c)/(cos(d*x + c) + 1))/a - (15*si 
n(d*x + c)/(cos(d*x + c) + 1) - 10*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 + 6 
0*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 - 6)*(cos(d*x + c) + 1)^5/(a*sin(d*x 
 + c)^5))/d
 

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.57 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\frac {120 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} + \frac {6 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 10 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 60 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{5}} - \frac {274 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 60 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 10 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6}{a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{960 \, d} \] Input:

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

Output:

1/960*(120*log(abs(tan(1/2*d*x + 1/2*c)))/a + (6*a^4*tan(1/2*d*x + 1/2*c)^ 
5 - 15*a^4*tan(1/2*d*x + 1/2*c)^4 + 10*a^4*tan(1/2*d*x + 1/2*c)^3 - 60*a^4 
*tan(1/2*d*x + 1/2*c))/a^5 - (274*tan(1/2*d*x + 1/2*c)^5 - 60*tan(1/2*d*x 
+ 1/2*c)^4 + 10*tan(1/2*d*x + 1/2*c)^2 - 15*tan(1/2*d*x + 1/2*c) + 6)/(a*t 
an(1/2*d*x + 1/2*c)^5))/d
 

Mupad [B] (verification not implemented)

Time = 17.66 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.51 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{96\,a\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,a\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,a\,d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,a\,d}+\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}-\frac {1}{5}\right )}{32\,a\,d} \] Input:

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

Output:

tan(c/2 + (d*x)/2)^3/(96*a*d) - tan(c/2 + (d*x)/2)^4/(64*a*d) + tan(c/2 + 
(d*x)/2)^5/(160*a*d) + log(tan(c/2 + (d*x)/2))/(8*a*d) - tan(c/2 + (d*x)/2 
)/(16*a*d) + (cot(c/2 + (d*x)/2)^5*(tan(c/2 + (d*x)/2)/2 - tan(c/2 + (d*x) 
/2)^2/3 + 2*tan(c/2 + (d*x)/2)^4 - 1/5))/(32*a*d)
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.07 \[ \int \frac {\cot ^4(c+d x) \csc ^2(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {16 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}-15 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}+30 \cos \left (d x +c \right ) \sin \left (d x +c \right )-24 \cos \left (d x +c \right )+15 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{5}}{120 \sin \left (d x +c \right )^{5} a d} \] Input:

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

Output:

(16*cos(c + d*x)*sin(c + d*x)**4 - 15*cos(c + d*x)*sin(c + d*x)**3 + 8*cos 
(c + d*x)*sin(c + d*x)**2 + 30*cos(c + d*x)*sin(c + d*x) - 24*cos(c + d*x) 
 + 15*log(tan((c + d*x)/2))*sin(c + d*x)**5)/(120*sin(c + d*x)**5*a*d)