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

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

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

Mathematica [A] (verified)

Time = 6.67 (sec) , antiderivative size = 355, normalized size of antiderivative = 1.91 \[ \int \cot ^4(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {a \left (2 a^2-9 b^2\right ) (c+d x)}{2 d}+\frac {b \left (-12 a^2+5 b^2\right ) \cos (c+d x)}{4 d}+\frac {b^3 \cos (3 (c+d x))}{12 d}+\frac {\left (4 a^3 \cos \left (\frac {1}{2} (c+d x)\right )-9 a b^2 \cos \left (\frac {1}{2} (c+d x)\right )\right ) \csc \left (\frac {1}{2} (c+d x)\right )}{6 d}-\frac {3 a^2 b \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {a^3 \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{24 d}+\frac {\left (9 a^2 b-2 b^3\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {\left (-9 a^2 b+2 b^3\right ) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {3 a^2 b \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}+\frac {\sec \left (\frac {1}{2} (c+d x)\right ) \left (-4 a^3 \sin \left (\frac {1}{2} (c+d x)\right )+9 a b^2 \sin \left (\frac {1}{2} (c+d x)\right )\right )}{6 d}-\frac {3 a b^2 \sin (2 (c+d x))}{4 d}+\frac {a^3 \sec ^2\left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {1}{2} (c+d x)\right )}{24 d} \] Input:

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

Output:

(a*(2*a^2 - 9*b^2)*(c + d*x))/(2*d) + (b*(-12*a^2 + 5*b^2)*Cos[c + d*x])/( 
4*d) + (b^3*Cos[3*(c + d*x)])/(12*d) + ((4*a^3*Cos[(c + d*x)/2] - 9*a*b^2* 
Cos[(c + d*x)/2])*Csc[(c + d*x)/2])/(6*d) - (3*a^2*b*Csc[(c + d*x)/2]^2)/( 
8*d) - (a^3*Cot[(c + d*x)/2]*Csc[(c + d*x)/2]^2)/(24*d) + ((9*a^2*b - 2*b^ 
3)*Log[Cos[(c + d*x)/2]])/(2*d) + ((-9*a^2*b + 2*b^3)*Log[Sin[(c + d*x)/2] 
])/(2*d) + (3*a^2*b*Sec[(c + d*x)/2]^2)/(8*d) + (Sec[(c + d*x)/2]*(-4*a^3* 
Sin[(c + d*x)/2] + 9*a*b^2*Sin[(c + d*x)/2]))/(6*d) - (3*a*b^2*Sin[2*(c + 
d*x)])/(4*d) + (a^3*Sec[(c + d*x)/2]^2*Tan[(c + d*x)/2])/(24*d)
 

Rubi [A] (verified)

Time = 0.45 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.04, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3042, 3201, 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+b \sin (c+d x))^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3201

\(\displaystyle \int \left (a^3 \cot ^4(c+d x)+3 a^2 b \cos (c+d x) \cot ^3(c+d x)+3 a b^2 \cos ^2(c+d x) \cot ^2(c+d x)+b^3 \cos ^3(c+d x) \cot (c+d x)\right )dx\)

\(\Big \downarrow \) 2009

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

Input:

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

Output:

a^3*x - (9*a*b^2*x)/2 + (9*a^2*b*ArcTanh[Cos[c + d*x]])/(2*d) - (b^3*ArcTa 
nh[Cos[c + d*x]])/d - (9*a^2*b*Cos[c + d*x])/(2*d) + (b^3*Cos[c + d*x])/d 
+ (b^3*Cos[c + d*x]^3)/(3*d) + (a^3*Cot[c + d*x])/d - (9*a*b^2*Cot[c + d*x 
])/(2*d) + (3*a*b^2*Cos[c + d*x]^2*Cot[c + d*x])/(2*d) - (3*a^2*b*Cos[c + 
d*x]*Cot[c + d*x]^2)/(2*d) - (a^3*Cot[c + d*x]^3)/(3*d)
 

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 3201
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((g_.)*tan[(e_.) + (f_.)*( 
x_)])^(p_.), x_Symbol] :> Int[ExpandIntegrand[(g*Tan[e + f*x])^p, (a + b*Si 
n[e + f*x])^m, x], x] /; FreeQ[{a, b, e, f, g, p}, x] && NeQ[a^2 - b^2, 0] 
&& IGtQ[m, 0]
 
Maple [A] (verified)

Time = 2.92 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.00

method result size
derivativedivides \(\frac {a^{3} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+3 a^{2} b \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 )+3 a \,b^{2} \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 )+b^{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 )}{d}\) \(186\)
default \(\frac {a^{3} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+3 a^{2} b \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 )+3 a \,b^{2} \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 )+b^{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 )}{d}\) \(186\)
risch \(a^{3} x -\frac {9 a \,b^{2} x}{2}+\frac {3 i a \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {3 b \,{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 d}+\frac {5 b^{3} {\mathrm e}^{i \left (d x +c \right )}}{8 d}-\frac {3 b \,{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 d}+\frac {5 b^{3} {\mathrm e}^{-i \left (d x +c \right )}}{8 d}-\frac {3 i a \,b^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}+\frac {a \left (12 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}-18 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+9 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-12 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+36 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+8 i a^{2}-18 i b^{2}-9 a b \,{\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 {9 a^{2} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}-\frac {9 a^{2} b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}+\frac {b^{3} \cos \left (3 d x +3 c \right )}{12 d}\) \(338\)

Input:

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

Output:

1/d*(a^3*(-1/3*cot(d*x+c)^3+cot(d*x+c)+d*x+c)+3*a^2*b*(-1/2/sin(d*x+c)^2*c 
os(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))) 
+3*a*b^2*(-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)+b^3*(1/3*cos(d*x+c)^3+cos(d*x+c)+ln(csc(d*x+c)-cot(d*x+ 
c))))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 293, normalized size of antiderivative = 1.58 \[ \int \cot ^4(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {18 \, a b^{2} \cos \left (d x + c\right )^{5} + 8 \, {\left (2 \, a^{3} - 9 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (9 \, a^{2} b - 2 \, b^{3} - {\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 3 \, {\left (9 \, a^{2} b - 2 \, b^{3} - {\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 6 \, {\left (2 \, a^{3} - 9 \, a b^{2}\right )} \cos \left (d x + c\right ) + 2 \, {\left (2 \, b^{3} \cos \left (d x + c\right )^{5} + 3 \, {\left (2 \, a^{3} - 9 \, a b^{2}\right )} d x \cos \left (d x + c\right )^{2} - 2 \, {\left (9 \, a^{2} b - 2 \, b^{3}\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left (2 \, a^{3} - 9 \, a b^{2}\right )} d x + 3 \, {\left (9 \, a^{2} b - 2 \, b^{3}\right )} \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+b*sin(d*x+c))^3,x, algorithm="fricas")
 

Output:

1/12*(18*a*b^2*cos(d*x + c)^5 + 8*(2*a^3 - 9*a*b^2)*cos(d*x + c)^3 - 3*(9* 
a^2*b - 2*b^3 - (9*a^2*b - 2*b^3)*cos(d*x + c)^2)*log(1/2*cos(d*x + c) + 1 
/2)*sin(d*x + c) + 3*(9*a^2*b - 2*b^3 - (9*a^2*b - 2*b^3)*cos(d*x + c)^2)* 
log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 6*(2*a^3 - 9*a*b^2)*cos(d*x + 
c) + 2*(2*b^3*cos(d*x + c)^5 + 3*(2*a^3 - 9*a*b^2)*d*x*cos(d*x + c)^2 - 2* 
(9*a^2*b - 2*b^3)*cos(d*x + c)^3 - 3*(2*a^3 - 9*a*b^2)*d*x + 3*(9*a^2*b - 
2*b^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+b \sin (c+d x))^3 \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{3} \cot ^{4}{\left (c + d x \right )}\, dx \] Input:

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.01 \[ \int \cot ^4(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {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} - 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 b^{2} + 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 )} b^{3} + 9 \, a^{2} b {\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+b*sin(d*x+c))^3,x, algorithm="maxima")
 

Output:

1/12*(4*(3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/tan(d*x + c)^3)*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*b^2 
+ 2*(2*cos(d*x + c)^3 + 6*cos(d*x + c) - 3*log(cos(d*x + c) + 1) + 3*log(c 
os(d*x + c) - 1))*b^3 + 9*a^2*b*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) - 4*c 
os(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. 421 vs. \(2 (174) = 348\).

Time = 0.20 (sec) , antiderivative size = 421, normalized size of antiderivative = 2.26 \[ \int \cot ^4(c+d x) (a+b \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^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 45 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 108 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 36 \, {\left (2 \, a^{3} - 9 \, a b^{2}\right )} {\left (d x + c\right )} - 36 \, {\left (9 \, a^{2} b - 2 \, b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {198 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 44 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 45 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 108 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 135 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 156 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 132 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 324 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 351 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 156 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 126 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 540 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 315 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 148 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 36 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 108 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 27 \, a^{2} b \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+b*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^2*b*tan(1/2*d*x + 1/2*c)^2 - 45* 
a^3*tan(1/2*d*x + 1/2*c) + 108*a*b^2*tan(1/2*d*x + 1/2*c) + 36*(2*a^3 - 9* 
a*b^2)*(d*x + c) - 36*(9*a^2*b - 2*b^3)*log(abs(tan(1/2*d*x + 1/2*c))) + ( 
198*a^2*b*tan(1/2*d*x + 1/2*c)^9 - 44*b^3*tan(1/2*d*x + 1/2*c)^9 + 45*a^3* 
tan(1/2*d*x + 1/2*c)^8 + 108*a*b^2*tan(1/2*d*x + 1/2*c)^8 + 135*a^2*b*tan( 
1/2*d*x + 1/2*c)^7 + 156*b^3*tan(1/2*d*x + 1/2*c)^7 + 132*a^3*tan(1/2*d*x 
+ 1/2*c)^6 - 324*a*b^2*tan(1/2*d*x + 1/2*c)^6 - 351*a^2*b*tan(1/2*d*x + 1/ 
2*c)^5 + 156*b^3*tan(1/2*d*x + 1/2*c)^5 + 126*a^3*tan(1/2*d*x + 1/2*c)^4 - 
 540*a*b^2*tan(1/2*d*x + 1/2*c)^4 - 315*a^2*b*tan(1/2*d*x + 1/2*c)^3 + 148 
*b^3*tan(1/2*d*x + 1/2*c)^3 + 36*a^3*tan(1/2*d*x + 1/2*c)^2 - 108*a*b^2*ta 
n(1/2*d*x + 1/2*c)^2 - 27*a^2*b*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 = 18.10 (sec) , antiderivative size = 405, normalized size of antiderivative = 2.18 \[ \int \cot ^4(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {9\,a^2\,b}{2}-b^3\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )\,\left (\frac {a\,b^2\,9{}\mathrm {i}}{2}-a^3\,1{}\mathrm {i}\right )}{d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a\,b^2}{2}-\frac {5\,a^3}{8}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (12\,a\,b^2-4\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (5\,a^3+12\,a\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (60\,a\,b^2-14\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (36\,a\,b^2-\frac {44\,a^3}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (51\,a^2\,b-32\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (57\,a^2\,b-\frac {64\,b^3}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (105\,a^2\,b-32\,b^3\right )+\frac {a^3}{3}+3\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{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 )}+\frac {3\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )\,\left (2\,a^2-9\,b^2\right )\,1{}\mathrm {i}}{2\,d} \] Input:

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

Output:

(a^3*tan(c/2 + (d*x)/2)^3)/(24*d) - (log(tan(c/2 + (d*x)/2))*((9*a^2*b)/2 
- b^3))/d - (log(tan(c/2 + (d*x)/2) + 1i)*((a*b^2*9i)/2 - a^3*1i))/d + (ta 
n(c/2 + (d*x)/2)*((3*a*b^2)/2 - (5*a^3)/8))/d - (tan(c/2 + (d*x)/2)^2*(12* 
a*b^2 - 4*a^3) - tan(c/2 + (d*x)/2)^8*(12*a*b^2 + 5*a^3) + tan(c/2 + (d*x) 
/2)^4*(60*a*b^2 - 14*a^3) + tan(c/2 + (d*x)/2)^6*(36*a*b^2 - (44*a^3)/3) + 
 tan(c/2 + (d*x)/2)^7*(51*a^2*b - 32*b^3) + tan(c/2 + (d*x)/2)^3*(57*a^2*b 
 - (64*b^3)/3) + tan(c/2 + (d*x)/2)^5*(105*a^2*b - 32*b^3) + a^3/3 + 3*a^2 
*b*tan(c/2 + (d*x)/2))/(d*(8*tan(c/2 + (d*x)/2)^3 + 24*tan(c/2 + (d*x)/2)^ 
5 + 24*tan(c/2 + (d*x)/2)^7 + 8*tan(c/2 + (d*x)/2)^9)) + (3*a^2*b*tan(c/2 
+ (d*x)/2)^2)/(8*d) - (a*log(tan(c/2 + (d*x)/2) - 1i)*(2*a^2 - 9*b^2)*1i)/ 
(2*d)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 265, normalized size of antiderivative = 1.42 \[ \int \cot ^4(c+d x) (a+b \sin (c+d x))^3 \, dx=\frac {-8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5} b^{3}-36 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} a \,b^{2}-72 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a^{2} b +32 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b^{3}+32 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{3}-72 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a \,b^{2}-36 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a^{2} b -8 \cos \left (d x +c \right ) a^{3}-108 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{3} a^{2} b +24 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{3} b^{3}+24 \sin \left (d x +c \right )^{3} a^{3} d x +99 \sin \left (d x +c \right )^{3} a^{2} b -108 \sin \left (d x +c \right )^{3} a \,b^{2} d x -32 \sin \left (d x +c \right )^{3} b^{3}}{24 \sin \left (d x +c \right )^{3} d} \] Input:

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

Output:

( - 8*cos(c + d*x)*sin(c + d*x)**5*b**3 - 36*cos(c + d*x)*sin(c + d*x)**4* 
a*b**2 - 72*cos(c + d*x)*sin(c + d*x)**3*a**2*b + 32*cos(c + d*x)*sin(c + 
d*x)**3*b**3 + 32*cos(c + d*x)*sin(c + d*x)**2*a**3 - 72*cos(c + d*x)*sin( 
c + d*x)**2*a*b**2 - 36*cos(c + d*x)*sin(c + d*x)*a**2*b - 8*cos(c + d*x)* 
a**3 - 108*log(tan((c + d*x)/2))*sin(c + d*x)**3*a**2*b + 24*log(tan((c + 
d*x)/2))*sin(c + d*x)**3*b**3 + 24*sin(c + d*x)**3*a**3*d*x + 99*sin(c + d 
*x)**3*a**2*b - 108*sin(c + d*x)**3*a*b**2*d*x - 32*sin(c + d*x)**3*b**3)/ 
(24*sin(c + d*x)**3*d)