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

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

Optimal result

Integrand size = 29, antiderivative size = 127 \[ \int \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {2 a b \csc (c+d x)}{d}-\frac {a^2 \csc ^2(c+d x)}{2 d}-\frac {\left (2 a^2-b^2\right ) \log (\sin (c+d x))}{d}-\frac {4 a b \sin (c+d x)}{d}+\frac {\left (a^2-2 b^2\right ) \sin ^2(c+d x)}{2 d}+\frac {2 a b \sin ^3(c+d x)}{3 d}+\frac {b^2 \sin ^4(c+d x)}{4 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.13 \[ \int \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {2 a b \csc (c+d x)}{d}-\frac {a^2 \csc ^2(c+d x)}{2 d}-\frac {2 a^2 \log (\sin (c+d x))}{d}+\frac {b^2 \log (\sin (c+d x))}{d}-\frac {4 a b \sin (c+d x)}{d}+\frac {a^2 \sin ^2(c+d x)}{2 d}-\frac {b^2 \sin ^2(c+d x)}{d}+\frac {2 a b \sin ^3(c+d x)}{3 d}+\frac {b^2 \sin ^4(c+d x)}{4 d} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.02, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {3042, 3316, 27, 522, 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 ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3316

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 522

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {\frac {1}{2} b^2 \left (a^2-2 b^2\right ) \sin ^2(c+d x)-\frac {1}{2} a^2 b^2 \csc ^2(c+d x)-b^2 \left (2 a^2-b^2\right ) \log (b \sin (c+d x))+\frac {2}{3} a b^3 \sin ^3(c+d x)-4 a b^3 \sin (c+d x)-2 a b^3 \csc (c+d x)+\frac {1}{4} b^4 \sin ^4(c+d x)}{b^2 d}\)

Input:

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

Output:

(-2*a*b^3*Csc[c + d*x] - (a^2*b^2*Csc[c + d*x]^2)/2 - b^2*(2*a^2 - b^2)*Lo 
g[b*Sin[c + d*x]] - 4*a*b^3*Sin[c + d*x] + (b^2*(a^2 - 2*b^2)*Sin[c + d*x] 
^2)/2 + (2*a*b^3*Sin[c + d*x]^3)/3 + (b^4*Sin[c + d*x]^4)/4)/(b^2*d)
 

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 522
Int[((e_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_. 
), x_Symbol] :> Int[ExpandIntegrand[(e*x)^m*(c + d*x)^n*(a + b*x^2)^p, x], 
x] /; FreeQ[{a, b, c, d, e, m, n}, 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 3316
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_ 
.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Simp[1/(b^p* 
f)   Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x, b* 
Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1) 
/2] && NeQ[a^2 - b^2, 0]
 
Maple [A] (verified)

Time = 3.70 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.11

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cos \left (d x +c \right )^{6}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )^{4}}{2}-\cos \left (d x +c \right )^{2}-2 \ln \left (\sin \left (d x +c \right )\right )\right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{6}}{\sin \left (d x +c \right )}-\left (\frac {8}{3}+\cos \left (d x +c \right )^{4}+\frac {4 \cos \left (d x +c \right )^{2}}{3}\right ) \sin \left (d x +c \right )\right )+b^{2} \left (\frac {\cos \left (d x +c \right )^{4}}{4}+\frac {\cos \left (d x +c \right )^{2}}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(141\)
default \(\frac {a^{2} \left (-\frac {\cos \left (d x +c \right )^{6}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )^{4}}{2}-\cos \left (d x +c \right )^{2}-2 \ln \left (\sin \left (d x +c \right )\right )\right )+2 a b \left (-\frac {\cos \left (d x +c \right )^{6}}{\sin \left (d x +c \right )}-\left (\frac {8}{3}+\cos \left (d x +c \right )^{4}+\frac {4 \cos \left (d x +c \right )^{2}}{3}\right ) \sin \left (d x +c \right )\right )+b^{2} \left (\frac {\cos \left (d x +c \right )^{4}}{4}+\frac {\cos \left (d x +c \right )^{2}}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(141\)
risch \(\frac {i a b \,{\mathrm e}^{3 i \left (d x +c \right )}}{12 d}+\frac {4 i a^{2} c}{d}+2 i a^{2} x -\frac {{\mathrm e}^{2 i \left (d x +c \right )} a^{2}}{8 d}+\frac {3 \,{\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{16 d}-\frac {2 i a \left (i a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{3 i \left (d x +c \right )}-2 b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {2 i b^{2} c}{d}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )} a^{2}}{8 d}+\frac {3 \,{\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{16 d}-\frac {7 i a b \,{\mathrm e}^{-i \left (d x +c \right )}}{4 d}-i b^{2} x +\frac {7 i a b \,{\mathrm e}^{i \left (d x +c \right )}}{4 d}-\frac {i a b \,{\mathrm e}^{-3 i \left (d x +c \right )}}{12 d}-\frac {2 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{d}+\frac {\cos \left (4 d x +4 c \right ) b^{2}}{32 d}\) \(286\)

Input:

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

Output:

1/d*(a^2*(-1/2/sin(d*x+c)^2*cos(d*x+c)^6-1/2*cos(d*x+c)^4-cos(d*x+c)^2-2*l 
n(sin(d*x+c)))+2*a*b*(-1/sin(d*x+c)*cos(d*x+c)^6-(8/3+cos(d*x+c)^4+4/3*cos 
(d*x+c)^2)*sin(d*x+c))+b^2*(1/4*cos(d*x+c)^4+1/2*cos(d*x+c)^2+ln(sin(d*x+c 
))))
 

Fricas [A] (verification not implemented)

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

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

Output:

1/96*(24*b^2*cos(d*x + c)^6 - 24*(2*a^2 - b^2)*cos(d*x + c)^4 + 9*(8*a^2 - 
 9*b^2)*cos(d*x + c)^2 + 24*a^2 + 33*b^2 - 96*((2*a^2 - b^2)*cos(d*x + c)^ 
2 - 2*a^2 + b^2)*log(1/2*sin(d*x + c)) - 64*(a*b*cos(d*x + c)^4 + 4*a*b*co 
s(d*x + c)^2 - 8*a*b)*sin(d*x + c))/(d*cos(d*x + c)^2 - d)
                                                                                    
                                                                                    
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 104, normalized size of antiderivative = 0.82 \[ \int \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {3 \, b^{2} \sin \left (d x + c\right )^{4} + 8 \, a b \sin \left (d x + c\right )^{3} - 48 \, a b \sin \left (d x + c\right ) + 6 \, {\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right )^{2} - 12 \, {\left (2 \, a^{2} - b^{2}\right )} \log \left (\sin \left (d x + c\right )\right ) - \frac {6 \, {\left (4 \, a b \sin \left (d x + c\right ) + a^{2}\right )}}{\sin \left (d x + c\right )^{2}}}{12 \, d} \] Input:

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

Output:

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

Giac [A] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.88 \[ \int \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {3 \, b^{2} \sin \left (d x + c\right )^{4} + 8 \, a b \sin \left (d x + c\right )^{3} + 6 \, a^{2} \sin \left (d x + c\right )^{2} - 12 \, b^{2} \sin \left (d x + c\right )^{2} - 48 \, a b \sin \left (d x + c\right ) - 12 \, {\left (2 \, a^{2} - b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) - \frac {6 \, {\left (4 \, a b \sin \left (d x + c\right ) + a^{2}\right )}}{\sin \left (d x + c\right )^{2}}}{12 \, d} \] Input:

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

Output:

1/12*(3*b^2*sin(d*x + c)^4 + 8*a*b*sin(d*x + c)^3 + 6*a^2*sin(d*x + c)^2 - 
 12*b^2*sin(d*x + c)^2 - 48*a*b*sin(d*x + c) - 12*(2*a^2 - b^2)*log(abs(si 
n(d*x + c))) - 6*(4*a*b*sin(d*x + c) + a^2)/sin(d*x + c)^2)/d
 

Mupad [B] (verification not implemented)

Time = 22.78 (sec) , antiderivative size = 331, normalized size of antiderivative = 2.61 \[ \int \cos ^2(c+d x) \cot ^3(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (2\,a^2-b^2\right )}{d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (14\,a^2-16\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {15\,a^2}{2}-16\,b^2\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (5\,a^2-16\,b^2\right )+\frac {a^2}{2}+48\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\frac {296\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{3}+\frac {272\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{3}+36\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+16\,{\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 {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a^2-b^2\right )}{d}-\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d} \] Input:

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

Output:

(log(tan(c/2 + (d*x)/2)^2 + 1)*(2*a^2 - b^2))/d - (a^2*tan(c/2 + (d*x)/2)^ 
2)/(8*d) - (2*a^2*tan(c/2 + (d*x)/2)^2 - tan(c/2 + (d*x)/2)^6*(14*a^2 - 16 
*b^2) - tan(c/2 + (d*x)/2)^8*((15*a^2)/2 - 16*b^2) - tan(c/2 + (d*x)/2)^4* 
(5*a^2 - 16*b^2) + a^2/2 + 48*a*b*tan(c/2 + (d*x)/2)^3 + (296*a*b*tan(c/2 
+ (d*x)/2)^5)/3 + (272*a*b*tan(c/2 + (d*x)/2)^7)/3 + 36*a*b*tan(c/2 + (d*x 
)/2)^9 + 4*a*b*tan(c/2 + (d*x)/2))/(d*(4*tan(c/2 + (d*x)/2)^2 + 16*tan(c/2 
 + (d*x)/2)^4 + 24*tan(c/2 + (d*x)/2)^6 + 16*tan(c/2 + (d*x)/2)^8 + 4*tan( 
c/2 + (d*x)/2)^10)) - (log(tan(c/2 + (d*x)/2))*(2*a^2 - b^2))/d - (a*b*tan 
(c/2 + (d*x)/2))/d
 

Reduce [B] (verification not implemented)

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

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

Output:

(24*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)**2*a**2 - 12*log(tan((c + d* 
x)/2)**2 + 1)*sin(c + d*x)**2*b**2 - 24*log(tan((c + d*x)/2))*sin(c + d*x) 
**2*a**2 + 12*log(tan((c + d*x)/2))*sin(c + d*x)**2*b**2 + 3*sin(c + d*x)* 
*6*b**2 + 8*sin(c + d*x)**5*a*b + 6*sin(c + d*x)**4*a**2 - 12*sin(c + d*x) 
**4*b**2 - 48*sin(c + d*x)**3*a*b + 9*sin(c + d*x)**2*a**2 - 24*sin(c + d* 
x)*a*b - 6*a**2)/(12*sin(c + d*x)**2*d)