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

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

Optimal result

Integrand size = 27, antiderivative size = 114 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {b \text {arctanh}(\cos (c+d x))}{16 d}-\frac {a \cot ^5(c+d x)}{5 d}-\frac {a \cot ^7(c+d x)}{7 d}-\frac {b \cot (c+d x) \csc (c+d x)}{16 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{8 d}-\frac {b \cot ^3(c+d x) \csc ^3(c+d x)}{6 d} \] Output:

-1/16*b*arctanh(cos(d*x+c))/d-1/5*a*cot(d*x+c)^5/d-1/7*a*cot(d*x+c)^7/d-1/ 
16*b*cot(d*x+c)*csc(d*x+c)/d+1/8*b*cot(d*x+c)*csc(d*x+c)^3/d-1/6*b*cot(d*x 
+c)^3*csc(d*x+c)^3/d
 

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(239\) vs. \(2(114)=228\).

Time = 0.21 (sec) , antiderivative size = 239, normalized size of antiderivative = 2.10 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {2 a \cot (c+d x)}{35 d}-\frac {b \csc ^2\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {b \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {b \csc ^6\left (\frac {1}{2} (c+d x)\right )}{384 d}-\frac {a \cot (c+d x) \csc ^2(c+d x)}{35 d}+\frac {8 a \cot (c+d x) \csc ^4(c+d x)}{35 d}-\frac {a \cot (c+d x) \csc ^6(c+d x)}{7 d}-\frac {b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{16 d}+\frac {b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{16 d}+\frac {b \sec ^2\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {b \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {b \sec ^6\left (\frac {1}{2} (c+d x)\right )}{384 d} \] Input:

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

Output:

(-2*a*Cot[c + d*x])/(35*d) - (b*Csc[(c + d*x)/2]^2)/(64*d) + (b*Csc[(c + d 
*x)/2]^4)/(64*d) - (b*Csc[(c + d*x)/2]^6)/(384*d) - (a*Cot[c + d*x]*Csc[c 
+ d*x]^2)/(35*d) + (8*a*Cot[c + d*x]*Csc[c + d*x]^4)/(35*d) - (a*Cot[c + d 
*x]*Csc[c + d*x]^6)/(7*d) - (b*Log[Cos[(c + d*x)/2]])/(16*d) + (b*Log[Sin[ 
(c + d*x)/2]])/(16*d) + (b*Sec[(c + d*x)/2]^2)/(64*d) - (b*Sec[(c + d*x)/2 
]^4)/(64*d) + (b*Sec[(c + d*x)/2]^6)/(384*d)
 

Rubi [A] (verified)

Time = 0.72 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.06, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.481, Rules used = {3042, 3317, 3042, 3087, 244, 2009, 3091, 3042, 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 \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3317

\(\displaystyle a \int \cot ^4(c+d x) \csc ^4(c+d x)dx+b \int \cot ^4(c+d x) \csc ^3(c+d x)dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3087

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

\(\Big \downarrow \) 244

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

\(\Big \downarrow \) 2009

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

\(\Big \downarrow \) 3091

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3091

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4255

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

\(\displaystyle \frac {a \left (-\frac {1}{7} \cot ^7(c+d x)-\frac {1}{5} \cot ^5(c+d x)\right )}{d}+b \left (\frac {1}{2} \left (\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}\right )-\frac {\cot ^3(c+d x) \csc ^3(c+d x)}{6 d}\right )\)

Input:

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

Output:

(a*(-1/5*Cot[c + d*x]^5 - Cot[c + d*x]^7/7))/d + b*(-1/6*(Cot[c + d*x]^3*C 
sc[c + d*x]^3)/d + ((Cot[c + d*x]*Csc[c + d*x]^3)/(4*d) + (-1/2*ArcTanh[Co 
s[c + d*x]]/d - (Cot[c + d*x]*Csc[c + d*x])/(2*d))/4)/2)
 

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 3317
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[a   Int[(g*Co 
s[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Simp[b/d   Int[(g*Cos[e + f*x])^ 
p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]
 

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.43 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.21

method result size
derivativedivides \(\frac {a \left (-\frac {\cos \left (d x +c \right )^{5}}{7 \sin \left (d x +c \right )^{7}}-\frac {2 \cos \left (d x +c \right )^{5}}{35 \sin \left (d x +c \right )^{5}}\right )+b \left (-\frac {\cos \left (d x +c \right )^{5}}{6 \sin \left (d x +c \right )^{6}}-\frac {\cos \left (d x +c \right )^{5}}{24 \sin \left (d x +c \right )^{4}}+\frac {\cos \left (d x +c \right )^{5}}{48 \sin \left (d x +c \right )^{2}}+\frac {\cos \left (d x +c \right )^{3}}{48}+\frac {\cos \left (d x +c \right )}{16}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )}{d}\) \(138\)
default \(\frac {a \left (-\frac {\cos \left (d x +c \right )^{5}}{7 \sin \left (d x +c \right )^{7}}-\frac {2 \cos \left (d x +c \right )^{5}}{35 \sin \left (d x +c \right )^{5}}\right )+b \left (-\frac {\cos \left (d x +c \right )^{5}}{6 \sin \left (d x +c \right )^{6}}-\frac {\cos \left (d x +c \right )^{5}}{24 \sin \left (d x +c \right )^{4}}+\frac {\cos \left (d x +c \right )^{5}}{48 \sin \left (d x +c \right )^{2}}+\frac {\cos \left (d x +c \right )^{3}}{48}+\frac {\cos \left (d x +c \right )}{16}+\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16}\right )}{d}\) \(138\)
risch \(\frac {105 b \,{\mathrm e}^{13 i \left (d x +c \right )}+3360 i a \,{\mathrm e}^{10 i \left (d x +c \right )}+1540 b \,{\mathrm e}^{11 i \left (d x +c \right )}+3360 i a \,{\mathrm e}^{8 i \left (d x +c \right )}+1085 b \,{\mathrm e}^{9 i \left (d x +c \right )}+6720 i a \,{\mathrm e}^{6 i \left (d x +c \right )}+1344 i a \,{\mathrm e}^{4 i \left (d x +c \right )}-1085 b \,{\mathrm e}^{5 i \left (d x +c \right )}+672 i a \,{\mathrm e}^{2 i \left (d x +c \right )}-1540 b \,{\mathrm e}^{3 i \left (d x +c \right )}-96 i a -105 b \,{\mathrm e}^{i \left (d x +c \right )}}{840 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{7}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{16 d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{16 d}\) \(198\)

Input:

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

Output:

1/d*(a*(-1/7/sin(d*x+c)^7*cos(d*x+c)^5-2/35/sin(d*x+c)^5*cos(d*x+c)^5)+b*( 
-1/6/sin(d*x+c)^6*cos(d*x+c)^5-1/24/sin(d*x+c)^4*cos(d*x+c)^5+1/48/sin(d*x 
+c)^2*cos(d*x+c)^5+1/48*cos(d*x+c)^3+1/16*cos(d*x+c)+1/16*ln(csc(d*x+c)-co 
t(d*x+c))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (102) = 204\).

Time = 0.09 (sec) , antiderivative size = 221, normalized size of antiderivative = 1.94 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {192 \, a \cos \left (d x + c\right )^{7} - 672 \, a \cos \left (d x + c\right )^{5} + 105 \, {\left (b \cos \left (d x + c\right )^{6} - 3 \, b \cos \left (d x + c\right )^{4} + 3 \, b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 105 \, {\left (b \cos \left (d x + c\right )^{6} - 3 \, b \cos \left (d x + c\right )^{4} + 3 \, b \cos \left (d x + c\right )^{2} - b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 70 \, {\left (3 \, b \cos \left (d x + c\right )^{5} + 8 \, b \cos \left (d x + c\right )^{3} - 3 \, b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3360 \, {\left (d \cos \left (d x + c\right )^{6} - 3 \, d \cos \left (d x + c\right )^{4} + 3 \, d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \] Input:

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

Output:

-1/3360*(192*a*cos(d*x + c)^7 - 672*a*cos(d*x + c)^5 + 105*(b*cos(d*x + c) 
^6 - 3*b*cos(d*x + c)^4 + 3*b*cos(d*x + c)^2 - b)*log(1/2*cos(d*x + c) + 1 
/2)*sin(d*x + c) - 105*(b*cos(d*x + c)^6 - 3*b*cos(d*x + c)^4 + 3*b*cos(d* 
x + c)^2 - b)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 70*(3*b*cos(d*x 
+ c)^5 + 8*b*cos(d*x + c)^3 - 3*b*cos(d*x + c))*sin(d*x + c))/((d*cos(d*x 
+ c)^6 - 3*d*cos(d*x + c)^4 + 3*d*cos(d*x + c)^2 - d)*sin(d*x + c))
 

Sympy [F(-1)]

Timed out. \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.04 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {35 \, b {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{5} + 8 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{6} - 3 \, \cos \left (d x + c\right )^{4} + 3 \, \cos \left (d x + c\right )^{2} - 1} - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - \frac {96 \, {\left (7 \, \tan \left (d x + c\right )^{2} + 5\right )} a}{\tan \left (d x + c\right )^{7}}}{3360 \, d} \] Input:

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

Output:

1/3360*(35*b*(2*(3*cos(d*x + c)^5 + 8*cos(d*x + c)^3 - 3*cos(d*x + c))/(co 
s(d*x + c)^6 - 3*cos(d*x + c)^4 + 3*cos(d*x + c)^2 - 1) - 3*log(cos(d*x + 
c) + 1) + 3*log(cos(d*x + c) - 1)) - 96*(7*tan(d*x + c)^2 + 5)*a/tan(d*x + 
 c)^7)/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (102) = 204\).

Time = 0.19 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.01 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 35 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 21 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 105 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 105 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 105 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 840 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 315 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {2178 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 315 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 105 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 105 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 105 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 21 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 35 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7}}}{13440 \, d} \] Input:

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

Output:

1/13440*(15*a*tan(1/2*d*x + 1/2*c)^7 + 35*b*tan(1/2*d*x + 1/2*c)^6 - 21*a* 
tan(1/2*d*x + 1/2*c)^5 - 105*b*tan(1/2*d*x + 1/2*c)^4 - 105*a*tan(1/2*d*x 
+ 1/2*c)^3 - 105*b*tan(1/2*d*x + 1/2*c)^2 + 840*b*log(abs(tan(1/2*d*x + 1/ 
2*c))) + 315*a*tan(1/2*d*x + 1/2*c) - (2178*b*tan(1/2*d*x + 1/2*c)^7 + 315 
*a*tan(1/2*d*x + 1/2*c)^6 - 105*b*tan(1/2*d*x + 1/2*c)^5 - 105*a*tan(1/2*d 
*x + 1/2*c)^4 - 105*b*tan(1/2*d*x + 1/2*c)^3 - 21*a*tan(1/2*d*x + 1/2*c)^2 
 + 35*b*tan(1/2*d*x + 1/2*c) + 15*a)/tan(1/2*d*x + 1/2*c)^7)/d
 

Mupad [B] (verification not implemented)

Time = 35.01 (sec) , antiderivative size = 399, normalized size of antiderivative = 3.50 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {15\,a\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-15\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}-21\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-105\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+315\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-315\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+105\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+21\,a\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-105\,b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}-105\,b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+105\,b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+105\,b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+35\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}-35\,b\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )+840\,b\,\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 )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{13440\,d\,{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,{\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7} \] Input:

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

Output:

(15*a*sin(c/2 + (d*x)/2)^14 - 15*a*cos(c/2 + (d*x)/2)^14 - 21*a*cos(c/2 + 
(d*x)/2)^2*sin(c/2 + (d*x)/2)^12 - 105*a*cos(c/2 + (d*x)/2)^4*sin(c/2 + (d 
*x)/2)^10 + 315*a*cos(c/2 + (d*x)/2)^6*sin(c/2 + (d*x)/2)^8 - 315*a*cos(c/ 
2 + (d*x)/2)^8*sin(c/2 + (d*x)/2)^6 + 105*a*cos(c/2 + (d*x)/2)^10*sin(c/2 
+ (d*x)/2)^4 + 21*a*cos(c/2 + (d*x)/2)^12*sin(c/2 + (d*x)/2)^2 - 105*b*cos 
(c/2 + (d*x)/2)^3*sin(c/2 + (d*x)/2)^11 - 105*b*cos(c/2 + (d*x)/2)^5*sin(c 
/2 + (d*x)/2)^9 + 105*b*cos(c/2 + (d*x)/2)^9*sin(c/2 + (d*x)/2)^5 + 105*b* 
cos(c/2 + (d*x)/2)^11*sin(c/2 + (d*x)/2)^3 + 35*b*cos(c/2 + (d*x)/2)*sin(c 
/2 + (d*x)/2)^13 - 35*b*cos(c/2 + (d*x)/2)^13*sin(c/2 + (d*x)/2) + 840*b*l 
og(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(c/2 + (d*x)/2)^7*sin(c/2 + ( 
d*x)/2)^7)/(13440*d*cos(c/2 + (d*x)/2)^7*sin(c/2 + (d*x)/2)^7)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.26 \[ \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x)) \, dx=\frac {-96 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{6} a -105 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5} b -48 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} a +490 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b +384 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a -280 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -240 \cos \left (d x +c \right ) a +105 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{7} b}{1680 \sin \left (d x +c \right )^{7} d} \] Input:

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

Output:

( - 96*cos(c + d*x)*sin(c + d*x)**6*a - 105*cos(c + d*x)*sin(c + d*x)**5*b 
 - 48*cos(c + d*x)*sin(c + d*x)**4*a + 490*cos(c + d*x)*sin(c + d*x)**3*b 
+ 384*cos(c + d*x)*sin(c + d*x)**2*a - 280*cos(c + d*x)*sin(c + d*x)*b - 2 
40*cos(c + d*x)*a + 105*log(tan((c + d*x)/2))*sin(c + d*x)**7*b)/(1680*sin 
(c + d*x)**7*d)