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

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.22, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.480, Rules used = {3042, 3317, 3042, 25, 3071, 252, 262, 216, 3072, 252, 262, 219}

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 (c+d x) \cot ^3(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)^3}dx\)

\(\Big \downarrow \) 3317

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 3071

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

\(\Big \downarrow \) 252

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

\(\Big \downarrow \) 262

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

\(\Big \downarrow \) 216

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

\(\Big \downarrow \) 3072

\(\displaystyle -\frac {a \int \frac {\cos ^4(c+d x)}{\left (1-\cos ^2(c+d x)\right )^2}d\cos (c+d x)}{d}-\frac {b \left (\frac {3}{2} (\cot (c+d x)-\arctan (\cot (c+d x)))-\frac {\cot ^3(c+d x)}{2 \left (\cot ^2(c+d x)+1\right )}\right )}{d}\)

\(\Big \downarrow \) 252

\(\displaystyle -\frac {a \left (\frac {\cos ^3(c+d x)}{2 \left (1-\cos ^2(c+d x)\right )}-\frac {3}{2} \int \frac {\cos ^2(c+d x)}{1-\cos ^2(c+d x)}d\cos (c+d x)\right )}{d}-\frac {b \left (\frac {3}{2} (\cot (c+d x)-\arctan (\cot (c+d x)))-\frac {\cot ^3(c+d x)}{2 \left (\cot ^2(c+d x)+1\right )}\right )}{d}\)

\(\Big \downarrow \) 262

\(\displaystyle -\frac {a \left (\frac {\cos ^3(c+d x)}{2 \left (1-\cos ^2(c+d x)\right )}-\frac {3}{2} \left (\int \frac {1}{1-\cos ^2(c+d x)}d\cos (c+d x)-\cos (c+d x)\right )\right )}{d}-\frac {b \left (\frac {3}{2} (\cot (c+d x)-\arctan (\cot (c+d x)))-\frac {\cot ^3(c+d x)}{2 \left (\cot ^2(c+d x)+1\right )}\right )}{d}\)

\(\Big \downarrow \) 219

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 252
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x 
)^(m - 1)*((a + b*x^2)^(p + 1)/(2*b*(p + 1))), x] - Simp[c^2*((m - 1)/(2*b* 
(p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c 
}, x] && LtQ[p, -1] && GtQ[m, 1] &&  !ILtQ[(m + 2*p + 3)/2, 0] && IntBinomi 
alQ[a, b, c, 2, m, p, x]
 

rule 262
Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[c*(c*x) 
^(m - 1)*((a + b*x^2)^(p + 1)/(b*(m + 2*p + 1))), x] - Simp[a*c^2*((m - 1)/ 
(b*(m + 2*p + 1)))   Int[(c*x)^(m - 2)*(a + b*x^2)^p, x], x] /; FreeQ[{a, b 
, c, p}, x] && GtQ[m, 2 - 1] && NeQ[m + 2*p + 1, 0] && IntBinomialQ[a, b, c 
, 2, m, p, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3071
Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[b*(ff/f)   Subst[I 
nt[(ff*x)^(m + n)/(b^2 + ff^2*x^2)^(m/2 + 1), x], x, b*(Tan[e + f*x]/ff)], 
x]] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2]
 

rule 3072
Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_ 
Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Simp[ff/f   Subst[Int[ 
(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)], x 
]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]
 

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]
 
Maple [A] (verified)

Time = 1.08 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.35

method result size
derivativedivides \(\frac {a \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 )+b \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 )}{d}\) \(116\)
default \(\frac {a \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 )+b \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 )}{d}\) \(116\)
risch \(-\frac {3 b x}{2}+\frac {i b \,{\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i b \,{\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {i \left (i a \,{\mathrm e}^{3 i \left (d x +c \right )}+i a \,{\mathrm e}^{i \left (d x +c \right )}+2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}-\frac {3 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}\) \(165\)

Input:

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

Output:

1/d*(a*(-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)))+b*(-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))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.62 \[ \int \cos (c+d x) \cot ^3(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {6 \, b d x \cos \left (d x + c\right )^{2} + 4 \, a \cos \left (d x + c\right )^{3} - 6 \, b d x - 6 \, a \cos \left (d x + c\right ) - 3 \, {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 3 \, {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, {\left (b \cos \left (d x + c\right )^{3} - 3 \, b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \] Input:

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

Output:

-1/4*(6*b*d*x*cos(d*x + c)^2 + 4*a*cos(d*x + c)^3 - 6*b*d*x - 6*a*cos(d*x 
+ c) - 3*(a*cos(d*x + c)^2 - a)*log(1/2*cos(d*x + c) + 1/2) + 3*(a*cos(d*x 
 + c)^2 - a)*log(-1/2*cos(d*x + c) + 1/2) + 2*(b*cos(d*x + c)^3 - 3*b*cos( 
d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^2 - d)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.17 \[ \int \cos (c+d x) \cot ^3(c+d x) (a+b \sin (c+d x)) \, dx=-\frac {2 \, {\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 )} b - a {\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 )}}{4 \, d} \] Input:

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

Output:

-1/4*(2*(3*d*x + 3*c + (3*tan(d*x + c)^2 + 2)/(tan(d*x + c)^3 + tan(d*x + 
c)))*b - a*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) - 4*cos(d*x + c) + 3*log(c 
os(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. 163 vs. \(2 (78) = 156\).

Time = 0.17 (sec) , antiderivative size = 163, normalized size of antiderivative = 1.90 \[ \int \cos (c+d x) \cot ^3(c+d x) (a+b \sin (c+d x)) \, dx=\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, {\left (d x + c\right )} b - 12 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {6 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 5 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 16 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 12 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{{\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 )}^{2}}}{8 \, d} \] Input:

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

Output:

1/8*(a*tan(1/2*d*x + 1/2*c)^2 - 12*(d*x + c)*b - 12*a*log(abs(tan(1/2*d*x 
+ 1/2*c))) + 4*b*tan(1/2*d*x + 1/2*c) + (6*a*tan(1/2*d*x + 1/2*c)^6 + 4*b* 
tan(1/2*d*x + 1/2*c)^5 - 5*a*tan(1/2*d*x + 1/2*c)^4 - 16*b*tan(1/2*d*x + 1 
/2*c)^3 - 12*a*tan(1/2*d*x + 1/2*c)^2 - 4*b*tan(1/2*d*x + 1/2*c) - a)/(tan 
(1/2*d*x + 1/2*c)^3 + tan(1/2*d*x + 1/2*c))^2)/d
 

Mupad [B] (verification not implemented)

Time = 33.22 (sec) , antiderivative size = 236, normalized size of antiderivative = 2.74 \[ \int \cos (c+d x) \cot ^3(c+d x) (a+b \sin (c+d x)) \, dx=\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {-2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {17\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+8\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+9\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a}{2}}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+8\,{\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 {3\,b\,\mathrm {atan}\left (\frac {9\,b^2}{9\,a\,b-9\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {9\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{9\,a\,b-9\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {3\,a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d} \] Input:

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

Output:

(b*tan(c/2 + (d*x)/2))/(2*d) - (a/2 + 2*b*tan(c/2 + (d*x)/2) + 9*a*tan(c/2 
 + (d*x)/2)^2 + (17*a*tan(c/2 + (d*x)/2)^4)/2 + 8*b*tan(c/2 + (d*x)/2)^3 - 
 2*b*tan(c/2 + (d*x)/2)^5)/(d*(4*tan(c/2 + (d*x)/2)^2 + 8*tan(c/2 + (d*x)/ 
2)^4 + 4*tan(c/2 + (d*x)/2)^6)) - (3*b*atan((9*b^2)/(9*a*b - 9*b^2*tan(c/2 
 + (d*x)/2)) + (9*a*b*tan(c/2 + (d*x)/2))/(9*a*b - 9*b^2*tan(c/2 + (d*x)/2 
))))/d + (a*tan(c/2 + (d*x)/2)^2)/(8*d) - (3*a*log(tan(c/2 + (d*x)/2)))/(2 
*d)
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.36 \[ \int \cos (c+d x) \cot ^3(c+d x) (a+b \sin (c+d x)) \, dx=\frac {-2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b -4 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a -4 \cos \left (d x +c \right ) \sin \left (d x +c \right ) b -2 \cos \left (d x +c \right ) a -6 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{2} a +5 \sin \left (d x +c \right )^{2} a -6 \sin \left (d x +c \right )^{2} b d x}{4 \sin \left (d x +c \right )^{2} d} \] Input:

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

Output:

( - 2*cos(c + d*x)*sin(c + d*x)**3*b - 4*cos(c + d*x)*sin(c + d*x)**2*a - 
4*cos(c + d*x)*sin(c + d*x)*b - 2*cos(c + d*x)*a - 6*log(tan((c + d*x)/2)) 
*sin(c + d*x)**2*a + 5*sin(c + d*x)**2*a - 6*sin(c + d*x)**2*b*d*x)/(4*sin 
(c + d*x)**2*d)