\(\int \cot ^4(c+d x) (a+a \sin (c+d x))^3 \, dx\) [399]

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 10.20 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.50 \[ \int \cot ^4(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^3 (1+\sin (c+d x))^3 \left (-84 (c+d x)-42 \cos (c+d x)+2 \cos (3 (c+d x))-20 \cot \left (\frac {1}{2} (c+d x)\right )-9 \csc ^2\left (\frac {1}{2} (c+d x)\right )+84 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-84 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 \sec ^2\left (\frac {1}{2} (c+d x)\right )+8 \csc ^3(c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )-\frac {1}{2} \csc ^4\left (\frac {1}{2} (c+d x)\right ) \sin (c+d x)-18 \sin (2 (c+d x))+20 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{24 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^6} \] Input:

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

Output:

(a^3*(1 + Sin[c + d*x])^3*(-84*(c + d*x) - 42*Cos[c + d*x] + 2*Cos[3*(c + 
d*x)] - 20*Cot[(c + d*x)/2] - 9*Csc[(c + d*x)/2]^2 + 84*Log[Cos[(c + d*x)/ 
2]] - 84*Log[Sin[(c + d*x)/2]] + 9*Sec[(c + d*x)/2]^2 + 8*Csc[c + d*x]^3*S 
in[(c + d*x)/2]^4 - (Csc[(c + d*x)/2]^4*Sin[c + d*x])/2 - 18*Sin[2*(c + d* 
x)] + 20*Tan[(c + d*x)/2]))/(24*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^6)
 

Rubi [A] (verified)

Time = 0.39 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.03, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3188, 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 \cot ^4(c+d x) (a \sin (c+d x)+a)^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3188

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

((-7*a^7*x)/2 + (7*a^7*ArcTanh[Cos[c + d*x]])/(2*d) - (2*a^7*Cos[c + d*x]) 
/d + (a^7*Cos[c + d*x]^3)/(3*d) - (2*a^7*Cot[c + d*x])/d - (a^7*Cot[c + d* 
x]^3)/(3*d) - (3*a^7*Cot[c + d*x]*Csc[c + d*x])/(2*d) - (3*a^7*Cos[c + d*x 
]*Sin[c + d*x])/(2*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 3188
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_ 
), x_Symbol] :> Simp[a^p   Int[ExpandIntegrand[Sin[e + f*x]^p*((a + b*Sin[e 
 + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a, b, 
e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m 
- p/2, 0])
 
Maple [A] (verified)

Time = 2.43 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.37

method result size
derivativedivides \(\frac {a^{3} \left (\frac {\cos \left (d x +c \right )^{3}}{3}+\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 a^{3} \left (-\frac {\cos \left (d x +c \right )^{5}}{\sin \left (d x +c \right )}-\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+3 a^{3} \left (-\frac {\cos \left (d x +c \right )^{5}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )^{3}}{2}-\frac {3 \cos \left (d x +c \right )}{2}-\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+a^{3} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) \(184\)
default \(\frac {a^{3} \left (\frac {\cos \left (d x +c \right )^{3}}{3}+\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+3 a^{3} \left (-\frac {\cos \left (d x +c \right )^{5}}{\sin \left (d x +c \right )}-\left (\cos \left (d x +c \right )^{3}+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )-\frac {3 d x}{2}-\frac {3 c}{2}\right )+3 a^{3} \left (-\frac {\cos \left (d x +c \right )^{5}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )^{3}}{2}-\frac {3 \cos \left (d x +c \right )}{2}-\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+a^{3} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )}{d}\) \(184\)
risch \(-\frac {7 a^{3} x}{2}+\frac {3 i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {7 a^{3} {\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {7 a^{3} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}-\frac {3 i a^{3} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {a^{3} \left (-6 i {\mathrm e}^{4 i \left (d x +c \right )}+9 \,{\mathrm e}^{5 i \left (d x +c \right )}+24 i {\mathrm e}^{2 i \left (d x +c \right )}-10 i-9 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}+\frac {a^{3} \cos \left (3 d x +3 c \right )}{12 d}\) \(205\)

Input:

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

Output:

1/d*(a^3*(1/3*cos(d*x+c)^3+cos(d*x+c)+ln(csc(d*x+c)-cot(d*x+c)))+3*a^3*(-1 
/sin(d*x+c)*cos(d*x+c)^5-(cos(d*x+c)^3+3/2*cos(d*x+c))*sin(d*x+c)-3/2*d*x- 
3/2*c)+3*a^3*(-1/2/sin(d*x+c)^2*cos(d*x+c)^5-1/2*cos(d*x+c)^3-3/2*cos(d*x+ 
c)-3/2*ln(csc(d*x+c)-cot(d*x+c)))+a^3*(-1/3*cot(d*x+c)^3+cot(d*x+c)+d*x+c) 
)
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.54 \[ \int \cot ^4(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {18 \, a^{3} \cos \left (d x + c\right )^{5} - 56 \, a^{3} \cos \left (d x + c\right )^{3} + 42 \, a^{3} \cos \left (d x + c\right ) + 21 \, {\left (a^{3} \cos \left (d x + c\right )^{2} - a^{3}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 21 \, {\left (a^{3} \cos \left (d x + c\right )^{2} - a^{3}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 2 \, {\left (2 \, a^{3} \cos \left (d x + c\right )^{5} - 21 \, a^{3} d x \cos \left (d x + c\right )^{2} - 14 \, a^{3} \cos \left (d x + c\right )^{3} + 21 \, a^{3} d x + 21 \, a^{3} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{12 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \] Input:

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

Output:

1/12*(18*a^3*cos(d*x + c)^5 - 56*a^3*cos(d*x + c)^3 + 42*a^3*cos(d*x + c) 
+ 21*(a^3*cos(d*x + c)^2 - a^3)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 
 21*(a^3*cos(d*x + c)^2 - a^3)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 
 2*(2*a^3*cos(d*x + c)^5 - 21*a^3*d*x*cos(d*x + c)^2 - 14*a^3*cos(d*x + c) 
^3 + 21*a^3*d*x + 21*a^3*cos(d*x + c))*sin(d*x + c))/((d*cos(d*x + c)^2 - 
d)*sin(d*x + c))
 

Sympy [F]

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

integrate(cot(d*x+c)**4*(a+a*sin(d*x+c))**3,x)
 

Output:

a**3*(Integral(3*sin(c + d*x)*cot(c + d*x)**4, x) + Integral(3*sin(c + d*x 
)**2*cot(c + d*x)**4, x) + Integral(sin(c + d*x)**3*cot(c + d*x)**4, x) + 
Integral(cot(c + d*x)**4, x))
 

Maxima [A] (verification not implemented)

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

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

Output:

1/12*(2*(2*cos(d*x + c)^3 + 6*cos(d*x + c) - 3*log(cos(d*x + c) + 1) + 3*l 
og(cos(d*x + c) - 1))*a^3 - 18*(3*d*x + 3*c + (3*tan(d*x + c)^2 + 2)/(tan( 
d*x + c)^3 + tan(d*x + c)))*a^3 + 4*(3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/ 
tan(d*x + c)^3)*a^3 + 9*a^3*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) - 4*cos(d 
*x + c) + 3*log(cos(d*x + c) + 1) - 3*log(cos(d*x + c) - 1)))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (122) = 244\).

Time = 0.22 (sec) , antiderivative size = 250, normalized size of antiderivative = 1.87 \[ \int \cot ^4(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 27 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 252 \, {\left (d x + c\right )} a^{3} - 252 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 63 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {154 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 153 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 291 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 192 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 195 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 414 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 167 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 27 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{3}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}^{3}}}{72 \, d} \] Input:

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

Output:

1/72*(3*a^3*tan(1/2*d*x + 1/2*c)^3 + 27*a^3*tan(1/2*d*x + 1/2*c)^2 - 252*( 
d*x + c)*a^3 - 252*a^3*log(abs(tan(1/2*d*x + 1/2*c))) + 63*a^3*tan(1/2*d*x 
 + 1/2*c) + (154*a^3*tan(1/2*d*x + 1/2*c)^9 + 153*a^3*tan(1/2*d*x + 1/2*c) 
^8 + 291*a^3*tan(1/2*d*x + 1/2*c)^7 - 192*a^3*tan(1/2*d*x + 1/2*c)^6 - 195 
*a^3*tan(1/2*d*x + 1/2*c)^5 - 414*a^3*tan(1/2*d*x + 1/2*c)^4 - 167*a^3*tan 
(1/2*d*x + 1/2*c)^3 - 72*a^3*tan(1/2*d*x + 1/2*c)^2 - 27*a^3*tan(1/2*d*x + 
 1/2*c) - 3*a^3)/(tan(1/2*d*x + 1/2*c)^3 + tan(1/2*d*x + 1/2*c))^3)/d
 

Mupad [B] (verification not implemented)

Time = 17.70 (sec) , antiderivative size = 339, normalized size of antiderivative = 2.53 \[ \int \cot ^4(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {7\,a^3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}-\frac {7\,a^3\,\mathrm {atan}\left (\frac {49\,a^6}{49\,a^6-49\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {49\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{49\,a^6-49\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {7\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {-17\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+19\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\frac {64\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{3}+73\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+46\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\frac {107\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+8\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+3\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a^3}{3}}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )} \] Input:

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

Output:

(3*a^3*tan(c/2 + (d*x)/2)^2)/(8*d) + (a^3*tan(c/2 + (d*x)/2)^3)/(24*d) - ( 
7*a^3*log(tan(c/2 + (d*x)/2)))/(2*d) - (7*a^3*atan((49*a^6)/(49*a^6 - 49*a 
^6*tan(c/2 + (d*x)/2)) + (49*a^6*tan(c/2 + (d*x)/2))/(49*a^6 - 49*a^6*tan( 
c/2 + (d*x)/2))))/d + (7*a^3*tan(c/2 + (d*x)/2))/(8*d) - (8*a^3*tan(c/2 + 
(d*x)/2)^2 + (107*a^3*tan(c/2 + (d*x)/2)^3)/3 + 46*a^3*tan(c/2 + (d*x)/2)^ 
4 + 73*a^3*tan(c/2 + (d*x)/2)^5 + (64*a^3*tan(c/2 + (d*x)/2)^6)/3 + 19*a^3 
*tan(c/2 + (d*x)/2)^7 - 17*a^3*tan(c/2 + (d*x)/2)^8 + a^3/3 + 3*a^3*tan(c/ 
2 + (d*x)/2))/(d*(8*tan(c/2 + (d*x)/2)^3 + 24*tan(c/2 + (d*x)/2)^5 + 24*ta 
n(c/2 + (d*x)/2)^7 + 8*tan(c/2 + (d*x)/2)^9))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.08 \[ \int \cot ^4(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^{3} \left (-8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5}-36 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}-40 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}-40 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}-36 \cos \left (d x +c \right ) \sin \left (d x +c \right )-8 \cos \left (d x +c \right )-84 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{3}-84 \sin \left (d x +c \right )^{3} d x +67 \sin \left (d x +c \right )^{3}\right )}{24 \sin \left (d x +c \right )^{3} d} \] Input:

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

Output:

(a**3*( - 8*cos(c + d*x)*sin(c + d*x)**5 - 36*cos(c + d*x)*sin(c + d*x)**4 
 - 40*cos(c + d*x)*sin(c + d*x)**3 - 40*cos(c + d*x)*sin(c + d*x)**2 - 36* 
cos(c + d*x)*sin(c + d*x) - 8*cos(c + d*x) - 84*log(tan((c + d*x)/2))*sin( 
c + d*x)**3 - 84*sin(c + d*x)**3*d*x + 67*sin(c + d*x)**3))/(24*sin(c + d* 
x)**3*d)