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

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

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

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.82 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {a \cot ^5(c+d x)}{5 d}+\frac {5 b \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {b \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {3 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {3 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {5 b \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {b \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \] Input:

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

Output:

-1/5*(a*Cot[c + d*x]^5)/d + (5*b*Csc[(c + d*x)/2]^2)/(32*d) - (b*Csc[(c + 
d*x)/2]^4)/(64*d) - (3*b*Log[Cos[(c + d*x)/2]])/(8*d) + (3*b*Log[Sin[(c + 
d*x)/2]])/(8*d) - (5*b*Sec[(c + d*x)/2]^2)/(32*d) + (b*Sec[(c + d*x)/2]^4) 
/(64*d)
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.07, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.370, Rules used = {3042, 3317, 3042, 3087, 15, 3091, 3042, 3091, 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 ^2(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)^6}dx\)

\(\Big \downarrow \) 3317

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3087

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

\(\Big \downarrow \) 15

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

\(\Big \downarrow \) 3091

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3091

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 15
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ 
{a, m}, x] && NeQ[m, -1]
 

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 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.34 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.35

method result size
derivativedivides \(\frac {-\frac {a \cos \left (d x +c \right )^{5}}{5 \sin \left (d x +c \right )^{5}}+b \left (-\frac {\cos \left (d x +c \right )^{5}}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos \left (d x +c \right )^{5}}{8 \sin \left (d x +c \right )^{2}}+\frac {\cos \left (d x +c \right )^{3}}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) \(100\)
default \(\frac {-\frac {a \cos \left (d x +c \right )^{5}}{5 \sin \left (d x +c \right )^{5}}+b \left (-\frac {\cos \left (d x +c \right )^{5}}{4 \sin \left (d x +c \right )^{4}}+\frac {\cos \left (d x +c \right )^{5}}{8 \sin \left (d x +c \right )^{2}}+\frac {\cos \left (d x +c \right )^{3}}{8}+\frac {3 \cos \left (d x +c \right )}{8}+\frac {3 \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )}{d}\) \(100\)
risch \(-\frac {40 i a \,{\mathrm e}^{8 i \left (d x +c \right )}+25 b \,{\mathrm e}^{9 i \left (d x +c \right )}-10 b \,{\mathrm e}^{7 i \left (d x +c \right )}+80 i a \,{\mathrm e}^{4 i \left (d x +c \right )}+10 b \,{\mathrm e}^{3 i \left (d x +c \right )}+8 i a -25 b \,{\mathrm e}^{i \left (d x +c \right )}}{20 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}+\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}-\frac {3 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}\) \(135\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 160 vs. \(2 (66) = 132\).

Time = 0.09 (sec) , antiderivative size = 160, normalized size of antiderivative = 2.16 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {16 \, a \cos \left (d x + c\right )^{5} + 15 \, {\left (b \cos \left (d x + c\right )^{4} - 2 \, 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 ) - 15 \, {\left (b \cos \left (d x + c\right )^{4} - 2 \, 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 ) + 10 \, {\left (5 \, b \cos \left (d x + c\right )^{3} - 3 \, b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{80 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, 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)^2*(a+b*sin(d*x+c)),x, algorithm="fricas" 
)
 

Output:

-1/80*(16*a*cos(d*x + c)^5 + 15*(b*cos(d*x + c)^4 - 2*b*cos(d*x + c)^2 + b 
)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 15*(b*cos(d*x + c)^4 - 2*b*co 
s(d*x + c)^2 + b)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 10*(5*b*cos( 
d*x + c)^3 - 3*b*cos(d*x + c))*sin(d*x + c))/((d*cos(d*x + c)^4 - 2*d*cos( 
d*x + c)^2 + d)*sin(d*x + c))
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.16 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {16 \, a \cot \left (d x + c\right )^{5} + 5 \, b {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \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 )}}{80 \, d} \] Input:

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

Output:

-1/80*(16*a*cot(d*x + c)^5 + 5*b*(2*(5*cos(d*x + c)^3 - 3*cos(d*x + c))/(c 
os(d*x + c)^4 - 2*cos(d*x + c)^2 + 1) + 3*log(cos(d*x + c) + 1) - 3*log(co 
s(d*x + c) - 1)))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 173 vs. \(2 (66) = 132\).

Time = 0.16 (sec) , antiderivative size = 173, normalized size of antiderivative = 2.34 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 5 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 10 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 40 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 120 \, b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 20 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {274 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 20 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 40 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 10 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 5 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 2 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{320 \, d} \] Input:

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

Output:

1/320*(2*a*tan(1/2*d*x + 1/2*c)^5 + 5*b*tan(1/2*d*x + 1/2*c)^4 - 10*a*tan( 
1/2*d*x + 1/2*c)^3 - 40*b*tan(1/2*d*x + 1/2*c)^2 + 120*b*log(abs(tan(1/2*d 
*x + 1/2*c))) + 20*a*tan(1/2*d*x + 1/2*c) - (274*b*tan(1/2*d*x + 1/2*c)^5 
+ 20*a*tan(1/2*d*x + 1/2*c)^4 - 40*b*tan(1/2*d*x + 1/2*c)^3 - 10*a*tan(1/2 
*d*x + 1/2*c)^2 + 5*b*tan(1/2*d*x + 1/2*c) + 2*a)/tan(1/2*d*x + 1/2*c)^5)/ 
d
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.49 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x)) \, dx=\frac {-8 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} a +25 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b +16 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a -10 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -8 \cos \left (d x +c \right ) a +15 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{5} b}{40 \sin \left (d x +c \right )^{5} d} \] Input:

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

Output:

( - 8*cos(c + d*x)*sin(c + d*x)**4*a + 25*cos(c + d*x)*sin(c + d*x)**3*b + 
 16*cos(c + d*x)*sin(c + d*x)**2*a - 10*cos(c + d*x)*sin(c + d*x)*b - 8*co 
s(c + d*x)*a + 15*log(tan((c + d*x)/2))*sin(c + d*x)**5*b)/(40*sin(c + d*x 
)**5*d)