\(\int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx\) [1240]

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

5/8*a*b*x-a^2*arctanh(cos(d*x+c))/d+a^2*cos(d*x+c)/d+1/3*a^2*cos(d*x+c)^3/ 
d+1/5*a^2*cos(d*x+c)^5/d-1/7*b^2*cos(d*x+c)^7/d+5/8*a*b*cos(d*x+c)*sin(d*x 
+c)/d+5/12*a*b*cos(d*x+c)^3*sin(d*x+c)/d+1/3*a*b*cos(d*x+c)^5*sin(d*x+c)/d
 

Mathematica [A] (verified)

Time = 0.91 (sec) , antiderivative size = 166, normalized size of antiderivative = 1.06 \[ \int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {4200 a b c+4200 a b d x+105 \left (88 a^2-5 b^2\right ) \cos (c+d x)+35 \left (28 a^2-9 b^2\right ) \cos (3 (c+d x))+84 a^2 \cos (5 (c+d x))-105 b^2 \cos (5 (c+d x))-15 b^2 \cos (7 (c+d x))-6720 a^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+6720 a^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+3150 a b \sin (2 (c+d x))+630 a b \sin (4 (c+d x))+70 a b \sin (6 (c+d x))}{6720 d} \] Input:

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

Output:

(4200*a*b*c + 4200*a*b*d*x + 105*(88*a^2 - 5*b^2)*Cos[c + d*x] + 35*(28*a^ 
2 - 9*b^2)*Cos[3*(c + d*x)] + 84*a^2*Cos[5*(c + d*x)] - 105*b^2*Cos[5*(c + 
 d*x)] - 15*b^2*Cos[7*(c + d*x)] - 6720*a^2*Log[Cos[(c + d*x)/2]] + 6720*a 
^2*Log[Sin[(c + d*x)/2]] + 3150*a*b*Sin[2*(c + d*x)] + 630*a*b*Sin[4*(c + 
d*x)] + 70*a*b*Sin[6*(c + d*x)])/(6720*d)
 

Rubi [A] (verified)

Time = 0.77 (sec) , antiderivative size = 155, normalized size of antiderivative = 0.99, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.444, Rules used = {3042, 3390, 3042, 3115, 3042, 3115, 3042, 3115, 24, 4879, 2010, 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 ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3390

\(\displaystyle \int \cos ^5(c+d x) \cot (c+d x) \left (a^2+b^2 \sin ^2(c+d x)\right )dx+2 a b \int \cos ^6(c+d x)dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \cos (c+d x)^5 \cot (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right )dx+2 a b \int \sin \left (c+d x+\frac {\pi }{2}\right )^6dx\)

\(\Big \downarrow \) 3115

\(\displaystyle \int \cos (c+d x)^5 \cot (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right )dx+2 a b \left (\frac {5}{6} \int \cos ^4(c+d x)dx+\frac {\sin (c+d x) \cos ^5(c+d x)}{6 d}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \cos (c+d x)^5 \cot (c+d x) \left (a^2+b^2 \sin (c+d x)^2\right )dx+2 a b \left (\frac {5}{6} \int \sin \left (c+d x+\frac {\pi }{2}\right )^4dx+\frac {\sin (c+d x) \cos ^5(c+d x)}{6 d}\right )\)

\(\Big \downarrow \) 3115

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3115

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

\(\Big \downarrow \) 24

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

\(\Big \downarrow \) 4879

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

\(\Big \downarrow \) 2010

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

\(\Big \downarrow \) 2009

\(\displaystyle 2 a b \left (\frac {\sin (c+d x) \cos ^5(c+d x)}{6 d}+\frac {5}{6} \left (\frac {\sin (c+d x) \cos ^3(c+d x)}{4 d}+\frac {3}{4} \left (\frac {\sin (c+d x) \cos (c+d x)}{2 d}+\frac {x}{2}\right )\right )\right )-\frac {a^2 \text {arctanh}(\cos (c+d x))-\frac {1}{5} a^2 \cos ^5(c+d x)-\frac {1}{3} a^2 \cos ^3(c+d x)-a^2 \cos (c+d x)+\frac {1}{7} b^2 \cos ^7(c+d x)}{d}\)

Input:

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

Output:

-((a^2*ArcTanh[Cos[c + d*x]] - a^2*Cos[c + d*x] - (a^2*Cos[c + d*x]^3)/3 - 
 (a^2*Cos[c + d*x]^5)/5 + (b^2*Cos[c + d*x]^7)/7)/d) + 2*a*b*((Cos[c + d*x 
]^5*Sin[c + d*x])/(6*d) + (5*((Cos[c + d*x]^3*Sin[c + d*x])/(4*d) + (3*(x/ 
2 + (Cos[c + d*x]*Sin[c + d*x])/(2*d)))/4))/6)
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2010
Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x] 
, x] /; FreeQ[{c, m}, x] && SumQ[u] &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) 
+ (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]
 

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

rule 3115
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* 
x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n)   Int[(b*Sin 
[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 
2*n]
 

rule 3390
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[2*a*(b/d) 
Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^(n + 1), x], x] + Int[(g*Cos[e + f* 
x])^p*(d*Sin[e + f*x])^n*(a^2 + b^2*Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, 
e, f, g, n, p}, x] && NeQ[a^2 - b^2, 0]
 

rule 4879
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa 
ctors[Cos[v], x]}, -d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1, Cos[v]/d 
, u/Sin[v], x], x], x, Cos[v]/d]], x] /;  !FalseQ[v] && FunctionOfQ[Nonfree 
Factors[Cos[v], x], u/Sin[v], x]]
 
Maple [A] (verified)

Time = 7.65 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.72

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 b \left (\frac {\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 )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )-\frac {b^{2} \cos \left (d x +c \right )^{7}}{7}}{d}\) \(113\)
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 b \left (\frac {\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 )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )-\frac {b^{2} \cos \left (d x +c \right )^{7}}{7}}{d}\) \(113\)
risch \(\frac {5 a b x}{8}+\frac {11 a^{2} {\mathrm e}^{i \left (d x +c \right )}}{16 d}-\frac {5 \,{\mathrm e}^{i \left (d x +c \right )} b^{2}}{128 d}+\frac {11 a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{16 d}-\frac {5 \,{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{128 d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {b^{2} \cos \left (7 d x +7 c \right )}{448 d}+\frac {a b \sin \left (6 d x +6 c \right )}{96 d}+\frac {\cos \left (5 d x +5 c \right ) a^{2}}{80 d}-\frac {\cos \left (5 d x +5 c \right ) b^{2}}{64 d}+\frac {3 a b \sin \left (4 d x +4 c \right )}{32 d}+\frac {7 a^{2} \cos \left (3 d x +3 c \right )}{48 d}-\frac {3 \cos \left (3 d x +3 c \right ) b^{2}}{64 d}+\frac {15 a b \sin \left (2 d x +2 c \right )}{32 d}\) \(247\)

Input:

int(cos(d*x+c)^5*cot(d*x+c)*(a+b*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*b*(1/6*(cos(d*x+c)^5+5/4*cos(d*x+c)^3+15/8*cos(d*x+c))*sin(d*x 
+c)+5/16*d*x+5/16*c)-1/7*b^2*cos(d*x+c)^7)
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 137, normalized size of antiderivative = 0.87 \[ \int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {120 \, b^{2} \cos \left (d x + c\right )^{7} - 168 \, a^{2} \cos \left (d x + c\right )^{5} - 280 \, a^{2} \cos \left (d x + c\right )^{3} - 525 \, a b d x - 840 \, a^{2} \cos \left (d x + c\right ) + 420 \, a^{2} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 420 \, a^{2} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 35 \, {\left (8 \, a b \cos \left (d x + c\right )^{5} + 10 \, a b \cos \left (d x + c\right )^{3} + 15 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{840 \, d} \] Input:

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

Output:

-1/840*(120*b^2*cos(d*x + c)^7 - 168*a^2*cos(d*x + c)^5 - 280*a^2*cos(d*x 
+ c)^3 - 525*a*b*d*x - 840*a^2*cos(d*x + c) + 420*a^2*log(1/2*cos(d*x + c) 
 + 1/2) - 420*a^2*log(-1/2*cos(d*x + c) + 1/2) - 35*(8*a*b*cos(d*x + c)^5 
+ 10*a*b*cos(d*x + c)^3 + 15*a*b*cos(d*x + c))*sin(d*x + c))/d
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.78 \[ \int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {480 \, b^{2} \cos \left (d x + c\right )^{7} - 112 \, {\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} + 35 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} - 60 \, d x - 60 \, c - 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a b}{3360 \, d} \] Input:

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

Output:

-1/3360*(480*b^2*cos(d*x + c)^7 - 112*(6*cos(d*x + c)^5 + 10*cos(d*x + c)^ 
3 + 30*cos(d*x + c) - 15*log(cos(d*x + c) + 1) + 15*log(cos(d*x + c) - 1)) 
*a^2 + 35*(4*sin(2*d*x + 2*c)^3 - 60*d*x - 60*c - 9*sin(4*d*x + 4*c) - 48* 
sin(2*d*x + 2*c))*a*b)/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 291 vs. \(2 (143) = 286\).

Time = 0.29 (sec) , antiderivative size = 291, normalized size of antiderivative = 1.85 \[ \int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {525 \, {\left (d x + c\right )} a b + 840 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {2 \, {\left (1155 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{13} - 2520 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{12} + 840 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{12} + 980 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{11} - 10080 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{10} + 2975 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 20440 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 4200 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 24640 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 2975 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 16968 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2520 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 980 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 6496 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1155 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1288 \, a^{2} + 120 \, b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{7}}}{840 \, d} \] Input:

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

Output:

1/840*(525*(d*x + c)*a*b + 840*a^2*log(abs(tan(1/2*d*x + 1/2*c))) - 2*(115 
5*a*b*tan(1/2*d*x + 1/2*c)^13 - 2520*a^2*tan(1/2*d*x + 1/2*c)^12 + 840*b^2 
*tan(1/2*d*x + 1/2*c)^12 + 980*a*b*tan(1/2*d*x + 1/2*c)^11 - 10080*a^2*tan 
(1/2*d*x + 1/2*c)^10 + 2975*a*b*tan(1/2*d*x + 1/2*c)^9 - 20440*a^2*tan(1/2 
*d*x + 1/2*c)^8 + 4200*b^2*tan(1/2*d*x + 1/2*c)^8 - 24640*a^2*tan(1/2*d*x 
+ 1/2*c)^6 - 2975*a*b*tan(1/2*d*x + 1/2*c)^5 - 16968*a^2*tan(1/2*d*x + 1/2 
*c)^4 + 2520*b^2*tan(1/2*d*x + 1/2*c)^4 - 980*a*b*tan(1/2*d*x + 1/2*c)^3 - 
 6496*a^2*tan(1/2*d*x + 1/2*c)^2 - 1155*a*b*tan(1/2*d*x + 1/2*c) - 1288*a^ 
2 + 120*b^2)/(tan(1/2*d*x + 1/2*c)^2 + 1)^7)/d
 

Mupad [B] (verification not implemented)

Time = 24.04 (sec) , antiderivative size = 415, normalized size of antiderivative = 2.64 \[ \int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}\,\left (6\,a^2-2\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {146\,a^2}{3}-10\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {202\,a^2}{5}-6\,b^2\right )+\frac {232\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{15}+\frac {176\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{3}+24\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\frac {46\,a^2}{15}-\frac {2\,b^2}{7}+\frac {7\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {85\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{12}-\frac {85\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9}{12}-\frac {7\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}}{3}-\frac {11\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}}{4}+\frac {11\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {5\,a\,b\,\mathrm {atan}\left (\frac {25\,a^2\,b^2}{16\,\left (\frac {5\,a^3\,b}{2}-\frac {25\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}\right )}+\frac {5\,a^3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,\left (\frac {5\,a^3\,b}{2}-\frac {25\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}\right )}\right )}{4\,d} \] Input:

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

Output:

(a^2*log(tan(c/2 + (d*x)/2)))/d + (tan(c/2 + (d*x)/2)^12*(6*a^2 - 2*b^2) + 
 tan(c/2 + (d*x)/2)^8*((146*a^2)/3 - 10*b^2) + tan(c/2 + (d*x)/2)^4*((202* 
a^2)/5 - 6*b^2) + (232*a^2*tan(c/2 + (d*x)/2)^2)/15 + (176*a^2*tan(c/2 + ( 
d*x)/2)^6)/3 + 24*a^2*tan(c/2 + (d*x)/2)^10 + (46*a^2)/15 - (2*b^2)/7 + (7 
*a*b*tan(c/2 + (d*x)/2)^3)/3 + (85*a*b*tan(c/2 + (d*x)/2)^5)/12 - (85*a*b* 
tan(c/2 + (d*x)/2)^9)/12 - (7*a*b*tan(c/2 + (d*x)/2)^11)/3 - (11*a*b*tan(c 
/2 + (d*x)/2)^13)/4 + (11*a*b*tan(c/2 + (d*x)/2))/4)/(d*(7*tan(c/2 + (d*x) 
/2)^2 + 21*tan(c/2 + (d*x)/2)^4 + 35*tan(c/2 + (d*x)/2)^6 + 35*tan(c/2 + ( 
d*x)/2)^8 + 21*tan(c/2 + (d*x)/2)^10 + 7*tan(c/2 + (d*x)/2)^12 + tan(c/2 + 
 (d*x)/2)^14 + 1)) + (5*a*b*atan((25*a^2*b^2)/(16*((5*a^3*b)/2 - (25*a^2*b 
^2*tan(c/2 + (d*x)/2))/16)) + (5*a^3*b*tan(c/2 + (d*x)/2))/(2*((5*a^3*b)/2 
 - (25*a^2*b^2*tan(c/2 + (d*x)/2))/16))))/(4*d)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.34 \[ \int \cos ^5(c+d x) \cot (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {120 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{6} b^{2}+280 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{5} a b +168 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} a^{2}-360 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} b^{2}-910 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} a b -616 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} a^{2}+360 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{2}+1155 \cos \left (d x +c \right ) \sin \left (d x +c \right ) a b +1288 \cos \left (d x +c \right ) a^{2}-120 \cos \left (d x +c \right ) b^{2}+840 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a^{2}-1288 a^{2}+525 a b c +525 a b d x +120 b^{2}}{840 d} \] Input:

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

Output:

(120*cos(c + d*x)*sin(c + d*x)**6*b**2 + 280*cos(c + d*x)*sin(c + d*x)**5* 
a*b + 168*cos(c + d*x)*sin(c + d*x)**4*a**2 - 360*cos(c + d*x)*sin(c + d*x 
)**4*b**2 - 910*cos(c + d*x)*sin(c + d*x)**3*a*b - 616*cos(c + d*x)*sin(c 
+ d*x)**2*a**2 + 360*cos(c + d*x)*sin(c + d*x)**2*b**2 + 1155*cos(c + d*x) 
*sin(c + d*x)*a*b + 1288*cos(c + d*x)*a**2 - 120*cos(c + d*x)*b**2 + 840*l 
og(tan((c + d*x)/2))*a**2 - 1288*a**2 + 525*a*b*c + 525*a*b*d*x + 120*b**2 
)/(840*d)