\(\int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx\) [594]

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 = 29, antiderivative size = 140 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {15 a^2 x}{4}+\frac {3 a^2 \text {arctanh}(\cos (c+d x))}{2 d}-\frac {a^2 \cos (c+d x)}{d}+\frac {a^2 \cos ^5(c+d x)}{5 d}-\frac {2 a^2 \cot (c+d x)}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}-\frac {9 a^2 \cos (c+d x) \sin (c+d x)}{4 d}+\frac {a^2 \cos (c+d x) \sin ^3(c+d x)}{2 d} \] Output:

-15/4*a^2*x+3/2*a^2*arctanh(cos(d*x+c))/d-a^2*cos(d*x+c)/d+1/5*a^2*cos(d*x 
+c)^5/d-2*a^2*cot(d*x+c)/d-1/2*a^2*cot(d*x+c)*csc(d*x+c)/d-9/4*a^2*cos(d*x 
+c)*sin(d*x+c)/d+1/2*a^2*cos(d*x+c)*sin(d*x+c)^3/d
 

Mathematica [A] (verified)

Time = 11.58 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.24 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {(a+a \sin (c+d x))^2 \left (-300 (c+d x)-70 \cos (c+d x)+5 \cos (3 (c+d x))+\cos (5 (c+d x))-80 \cot \left (\frac {1}{2} (c+d x)\right )-10 \csc ^2\left (\frac {1}{2} (c+d x)\right )+120 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-120 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+10 \sec ^2\left (\frac {1}{2} (c+d x)\right )-80 \sin (2 (c+d x))-5 \sin (4 (c+d x))+80 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{80 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4} \] Input:

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

Output:

((a + a*Sin[c + d*x])^2*(-300*(c + d*x) - 70*Cos[c + d*x] + 5*Cos[3*(c + d 
*x)] + Cos[5*(c + d*x)] - 80*Cot[(c + d*x)/2] - 10*Csc[(c + d*x)/2]^2 + 12 
0*Log[Cos[(c + d*x)/2]] - 120*Log[Sin[(c + d*x)/2]] + 10*Sec[(c + d*x)/2]^ 
2 - 80*Sin[2*(c + d*x)] - 5*Sin[4*(c + d*x)] + 80*Tan[(c + d*x)/2]))/(80*d 
*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^4)
 

Rubi [A] (verified)

Time = 0.47 (sec) , antiderivative size = 144, 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.103, Rules used = {3042, 3351, 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 \cos ^3(c+d x) \cot ^3(c+d x) (a \sin (c+d x)+a)^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3351

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {3 a^8 \text {arctanh}(\cos (c+d x))}{2 d}+\frac {a^8 \cos ^5(c+d x)}{5 d}-\frac {a^8 \cos (c+d x)}{d}-\frac {2 a^8 \cot (c+d x)}{d}+\frac {a^8 \sin ^3(c+d x) \cos (c+d x)}{2 d}-\frac {9 a^8 \sin (c+d x) \cos (c+d x)}{4 d}-\frac {a^8 \cot (c+d x) \csc (c+d x)}{2 d}-\frac {15 a^8 x}{4}}{a^6}\)

Input:

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

Output:

((-15*a^8*x)/4 + (3*a^8*ArcTanh[Cos[c + d*x]])/(2*d) - (a^8*Cos[c + d*x])/ 
d + (a^8*Cos[c + d*x]^5)/(5*d) - (2*a^8*Cot[c + d*x])/d - (a^8*Cot[c + d*x 
]*Csc[c + d*x])/(2*d) - (9*a^8*Cos[c + d*x]*Sin[c + d*x])/(4*d) + (a^8*Cos 
[c + d*x]*Sin[c + d*x]^3)/(2*d))/a^6
 

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 3351
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) 
 + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[1/a^p   Int[Expan 
dTrig[(d*sin[e + f*x])^n*(a - b*sin[e + f*x])^(p/2)*(a + b*sin[e + f*x])^(m 
 + p/2), x], x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && In 
tegersQ[m, n, p/2] && ((GtQ[m, 0] && GtQ[p, 0] && LtQ[-m - p, n, -1]) || (G 
tQ[m, 2] && LtQ[p, 0] && GtQ[m + p/2, 0]))
 
Maple [A] (verified)

Time = 7.06 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.34

method result size
derivativedivides \(\frac {a^{2} \left (\frac {\cos \left (d x +c \right )^{5}}{5}+\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 )+2 a^{2} \left (-\frac {\cos \left (d x +c \right )^{7}}{\sin \left (d x +c \right )}-\left (\cos \left (d x +c \right )^{5}+\frac {5 \cos \left (d x +c \right )^{3}}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )+a^{2} \left (-\frac {\cos \left (d x +c \right )^{7}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )^{5}}{2}-\frac {5 \cos \left (d x +c \right )^{3}}{6}-\frac {5 \cos \left (d x +c \right )}{2}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) \(188\)
default \(\frac {a^{2} \left (\frac {\cos \left (d x +c \right )^{5}}{5}+\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 )+2 a^{2} \left (-\frac {\cos \left (d x +c \right )^{7}}{\sin \left (d x +c \right )}-\left (\cos \left (d x +c \right )^{5}+\frac {5 \cos \left (d x +c \right )^{3}}{4}+\frac {15 \cos \left (d x +c \right )}{8}\right ) \sin \left (d x +c \right )-\frac {15 d x}{8}-\frac {15 c}{8}\right )+a^{2} \left (-\frac {\cos \left (d x +c \right )^{7}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )^{5}}{2}-\frac {5 \cos \left (d x +c \right )^{3}}{6}-\frac {5 \cos \left (d x +c \right )}{2}-\frac {5 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )}{d}\) \(188\)
risch \(-\frac {15 a^{2} x}{4}+\frac {a^{2} {\mathrm e}^{3 i \left (d x +c \right )}}{32 d}+\frac {i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{2 d}-\frac {7 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{16 d}-\frac {7 a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{16 d}-\frac {i a^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{2 d}+\frac {a^{2} {\mathrm e}^{-3 i \left (d x +c \right )}}{32 d}+\frac {a^{2} \left ({\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}-4 i {\mathrm e}^{2 i \left (d x +c \right )}+4 i\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {a^{2} \cos \left (5 d x +5 c \right )}{80 d}-\frac {a^{2} \sin \left (4 d x +4 c \right )}{16 d}\) \(239\)

Input:

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

Output:

1/d*(a^2*(1/5*cos(d*x+c)^5+1/3*cos(d*x+c)^3+cos(d*x+c)+ln(csc(d*x+c)-cot(d 
*x+c)))+2*a^2*(-1/sin(d*x+c)*cos(d*x+c)^7-(cos(d*x+c)^5+5/4*cos(d*x+c)^3+1 
5/8*cos(d*x+c))*sin(d*x+c)-15/8*d*x-15/8*c)+a^2*(-1/2/sin(d*x+c)^2*cos(d*x 
+c)^7-1/2*cos(d*x+c)^5-5/6*cos(d*x+c)^3-5/2*cos(d*x+c)-5/2*ln(csc(d*x+c)-c 
ot(d*x+c))))
 

Fricas [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 199, normalized size of antiderivative = 1.42 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {4 \, a^{2} \cos \left (d x + c\right )^{7} - 4 \, a^{2} \cos \left (d x + c\right )^{5} - 75 \, a^{2} d x \cos \left (d x + c\right )^{2} - 20 \, a^{2} \cos \left (d x + c\right )^{3} + 75 \, a^{2} d x + 30 \, a^{2} \cos \left (d x + c\right ) + 15 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 15 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 5 \, {\left (2 \, a^{2} \cos \left (d x + c\right )^{5} + 5 \, a^{2} \cos \left (d x + c\right )^{3} - 15 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{20 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \] Input:

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

Output:

1/20*(4*a^2*cos(d*x + c)^7 - 4*a^2*cos(d*x + c)^5 - 75*a^2*d*x*cos(d*x + c 
)^2 - 20*a^2*cos(d*x + c)^3 + 75*a^2*d*x + 30*a^2*cos(d*x + c) + 15*(a^2*c 
os(d*x + c)^2 - a^2)*log(1/2*cos(d*x + c) + 1/2) - 15*(a^2*cos(d*x + c)^2 
- a^2)*log(-1/2*cos(d*x + c) + 1/2) - 5*(2*a^2*cos(d*x + c)^5 + 5*a^2*cos( 
d*x + c)^3 - 15*a^2*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^2 - d)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 191, normalized size of antiderivative = 1.36 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {2 \, {\left (6 \, \cos \left (d x + c\right )^{5} + 10 \, \cos \left (d x + c\right )^{3} + 30 \, \cos \left (d x + c\right ) - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a^{2} - 5 \, {\left (4 \, \cos \left (d x + c\right )^{3} - \frac {6 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + 24 \, \cos \left (d x + c\right ) - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a^{2} - 15 \, {\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} + 25 \, \tan \left (d x + c\right )^{2} + 8}{\tan \left (d x + c\right )^{5} + 2 \, \tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{2}}{60 \, d} \] Input:

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

Output:

1/60*(2*(6*cos(d*x + c)^5 + 10*cos(d*x + c)^3 + 30*cos(d*x + c) - 15*log(c 
os(d*x + c) + 1) + 15*log(cos(d*x + c) - 1))*a^2 - 5*(4*cos(d*x + c)^3 - 6 
*cos(d*x + c)/(cos(d*x + c)^2 - 1) + 24*cos(d*x + c) - 15*log(cos(d*x + c) 
 + 1) + 15*log(cos(d*x + c) - 1))*a^2 - 15*(15*d*x + 15*c + (15*tan(d*x + 
c)^4 + 25*tan(d*x + c)^2 + 8)/(tan(d*x + c)^5 + 2*tan(d*x + c)^3 + tan(d*x 
 + c)))*a^2)/d
 

Giac [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 244, normalized size of antiderivative = 1.74 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 150 \, {\left (d x + c\right )} a^{2} - 60 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 40 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {5 \, {\left (18 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}} + \frac {4 \, {\left (45 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 50 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 80 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 80 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 50 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 80 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 45 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 16 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{5}}}{40 \, d} \] Input:

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

Output:

1/40*(5*a^2*tan(1/2*d*x + 1/2*c)^2 - 150*(d*x + c)*a^2 - 60*a^2*log(abs(ta 
n(1/2*d*x + 1/2*c))) + 40*a^2*tan(1/2*d*x + 1/2*c) + 5*(18*a^2*tan(1/2*d*x 
 + 1/2*c)^2 - 8*a^2*tan(1/2*d*x + 1/2*c) - a^2)/tan(1/2*d*x + 1/2*c)^2 + 4 
*(45*a^2*tan(1/2*d*x + 1/2*c)^9 + 50*a^2*tan(1/2*d*x + 1/2*c)^7 - 80*a^2*t 
an(1/2*d*x + 1/2*c)^6 - 80*a^2*tan(1/2*d*x + 1/2*c)^4 - 50*a^2*tan(1/2*d*x 
 + 1/2*c)^3 - 80*a^2*tan(1/2*d*x + 1/2*c)^2 - 45*a^2*tan(1/2*d*x + 1/2*c) 
- 16*a^2)/(tan(1/2*d*x + 1/2*c)^2 + 1)^5)/d
 

Mupad [B] (verification not implemented)

Time = 32.57 (sec) , antiderivative size = 377, normalized size of antiderivative = 2.69 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {3\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}-\frac {15\,a^2\,\mathrm {atan}\left (\frac {225\,a^4}{4\,\left (\frac {45\,a^4}{2}-\frac {225\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}\right )}+\frac {45\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,\left (\frac {45\,a^4}{2}-\frac {225\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}\right )}\right )}{2\,d}-\frac {-14\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}}{2}+\frac {69\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{2}+40\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+37\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+60\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+37\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+38\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {89\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{10}+4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a^2}{2}}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+40\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+40\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d} \] Input:

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

Output:

(a^2*tan(c/2 + (d*x)/2)^2)/(8*d) - (3*a^2*log(tan(c/2 + (d*x)/2)))/(2*d) - 
 (15*a^2*atan((225*a^4)/(4*((45*a^4)/2 - (225*a^4*tan(c/2 + (d*x)/2))/4)) 
+ (45*a^4*tan(c/2 + (d*x)/2))/(2*((45*a^4)/2 - (225*a^4*tan(c/2 + (d*x)/2) 
)/4))))/(2*d) - ((89*a^2*tan(c/2 + (d*x)/2)^2)/10 + 38*a^2*tan(c/2 + (d*x) 
/2)^3 + 37*a^2*tan(c/2 + (d*x)/2)^4 + 60*a^2*tan(c/2 + (d*x)/2)^5 + 37*a^2 
*tan(c/2 + (d*x)/2)^6 + 40*a^2*tan(c/2 + (d*x)/2)^7 + (69*a^2*tan(c/2 + (d 
*x)/2)^8)/2 + (a^2*tan(c/2 + (d*x)/2)^10)/2 - 14*a^2*tan(c/2 + (d*x)/2)^11 
 + a^2/2 + 4*a^2*tan(c/2 + (d*x)/2))/(d*(4*tan(c/2 + (d*x)/2)^2 + 20*tan(c 
/2 + (d*x)/2)^4 + 40*tan(c/2 + (d*x)/2)^6 + 40*tan(c/2 + (d*x)/2)^8 + 20*t 
an(c/2 + (d*x)/2)^10 + 4*tan(c/2 + (d*x)/2)^12)) + (a^2*tan(c/2 + (d*x)/2) 
)/d
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.15 \[ \int \cos ^3(c+d x) \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^{2} \left (8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{6}+20 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5}-16 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}-90 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}-32 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}-80 \cos \left (d x +c \right ) \sin \left (d x +c \right )-20 \cos \left (d x +c \right )-60 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2}-150 \sin \left (d x +c \right )^{2} d x +57 \sin \left (d x +c \right )^{2}\right )}{40 \sin \left (d x +c \right )^{2} d} \] Input:

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

Output:

(a**2*(8*cos(c + d*x)*sin(c + d*x)**6 + 20*cos(c + d*x)*sin(c + d*x)**5 - 
16*cos(c + d*x)*sin(c + d*x)**4 - 90*cos(c + d*x)*sin(c + d*x)**3 - 32*cos 
(c + d*x)*sin(c + d*x)**2 - 80*cos(c + d*x)*sin(c + d*x) - 20*cos(c + d*x) 
 - 60*log(tan((c + d*x)/2))*sin(c + d*x)**2 - 150*sin(c + d*x)**2*d*x + 57 
*sin(c + d*x)**2))/(40*sin(c + d*x)**2*d)