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

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 = 21, antiderivative size = 126 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {4 a b \csc (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc ^2(c+d x)}{2 d}-\frac {2 a b \csc ^3(c+d x)}{3 d}-\frac {a^2 \csc ^4(c+d x)}{4 d}+\frac {\left (a^2-2 b^2\right ) \log (\sin (c+d x))}{d}+\frac {2 a b \sin (c+d x)}{d}+\frac {b^2 \sin ^2(c+d x)}{2 d} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.31 (sec) , antiderivative size = 111, normalized size of antiderivative = 0.88, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3200, 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 \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3200

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

\(\Big \downarrow \) 522

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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 3200
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p 
_.), x_Symbol] :> Simp[1/f   Subst[Int[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1) 
/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2 - b 
^2, 0] && IntegerQ[(p + 1)/2]
 
Maple [A] (verified)

Time = 1.94 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.25

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cot \left (d x +c \right )^{4}}{4}+\frac {\cot \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}}{3 \sin \left (d x +c \right )^{3}}+\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 )^{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 )}{d}\) \(157\)
default \(\frac {a^{2} \left (-\frac {\cot \left (d x +c \right )^{4}}{4}+\frac {\cot \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}}{3 \sin \left (d x +c \right )^{3}}+\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 )^{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 )}{d}\) \(157\)
risch \(-i a^{2} x +2 i b^{2} x -\frac {{\mathrm e}^{2 i \left (d x +c \right )} b^{2}}{8 d}-\frac {i a b \,{\mathrm e}^{i \left (d x +c \right )}}{d}+\frac {i a b \,{\mathrm e}^{-i \left (d x +c \right )}}{d}-\frac {{\mathrm e}^{-2 i \left (d x +c \right )} b^{2}}{8 d}-\frac {2 i a^{2} c}{d}+\frac {4 i b^{2} c}{d}+\frac {2 i \left (6 i a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-3 i b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+12 a b \,{\mathrm e}^{7 i \left (d x +c \right )}-6 i a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+6 i b^{2} {\mathrm e}^{4 i \left (d x +c \right )}-28 a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 i a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-3 i b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+28 a b \,{\mathrm e}^{3 i \left (d x +c \right )}-12 a b \,{\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}+\frac {a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {2 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{d}\) \(305\)

Input:

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

Output:

1/d*(a^2*(-1/4*cot(d*x+c)^4+1/2*cot(d*x+c)^2+ln(sin(d*x+c)))+2*a*b*(-1/3/s 
in(d*x+c)^3*cos(d*x+c)^6+1/sin(d*x+c)*cos(d*x+c)^6+(8/3+cos(d*x+c)^4+4/3*c 
os(d*x+c)^2)*sin(d*x+c))+b^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*ln(sin(d*x+c))))
 

Fricas [A] (verification not implemented)

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

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

Giac [A] (verification not implemented)

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 22.63 (sec) , antiderivative size = 310, normalized size of antiderivative = 2.46 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {5\,a^2}{2}-2\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {23\,a^2}{4}-4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (3\,a^2+30\,b^2\right )-\frac {a^2}{4}+\frac {76\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {356\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{3}+92\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}}{d\,\left (16\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+32\,{\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\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )\,\left (a^2-2\,b^2\right )}{d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-2\,b^2\right )}{d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {3\,a^2}{16}-\frac {b^2}{8}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,d}+\frac {7\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,d} \] Input:

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

Output:

(tan(c/2 + (d*x)/2)^2*((5*a^2)/2 - 2*b^2) + tan(c/2 + (d*x)/2)^4*((23*a^2) 
/4 - 4*b^2) + tan(c/2 + (d*x)/2)^6*(3*a^2 + 30*b^2) - a^2/4 + (76*a*b*tan( 
c/2 + (d*x)/2)^3)/3 + (356*a*b*tan(c/2 + (d*x)/2)^5)/3 + 92*a*b*tan(c/2 + 
(d*x)/2)^7 - (4*a*b*tan(c/2 + (d*x)/2))/3)/(d*(16*tan(c/2 + (d*x)/2)^4 + 3 
2*tan(c/2 + (d*x)/2)^6 + 16*tan(c/2 + (d*x)/2)^8)) - (log(tan(c/2 + (d*x)/ 
2)^2 + 1)*(a^2 - 2*b^2))/d - (a^2*tan(c/2 + (d*x)/2)^4)/(64*d) + (log(tan( 
c/2 + (d*x)/2))*(a^2 - 2*b^2))/d + (tan(c/2 + (d*x)/2)^2*((3*a^2)/16 - b^2 
/8))/d - (a*b*tan(c/2 + (d*x)/2)^3)/(12*d) + (7*a*b*tan(c/2 + (d*x)/2))/(4 
*d)
 

Reduce [B] (verification not implemented)

Time = 0.18 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.73 \[ \int \cot ^5(c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-192 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{4} a^{2}+384 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d x +c \right )^{4} b^{2}+192 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{4} a^{2}-384 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{4} b^{2}+96 \sin \left (d x +c \right )^{6} b^{2}+384 \sin \left (d x +c \right )^{5} a b -147 \sin \left (d x +c \right )^{4} a^{2}+96 \sin \left (d x +c \right )^{4} b^{2}+768 \sin \left (d x +c \right )^{3} a b +192 \sin \left (d x +c \right )^{2} a^{2}-96 \sin \left (d x +c \right )^{2} b^{2}-128 \sin \left (d x +c \right ) a b -48 a^{2}}{192 \sin \left (d x +c \right )^{4} d} \] Input:

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

Output:

( - 192*log(tan((c + d*x)/2)**2 + 1)*sin(c + d*x)**4*a**2 + 384*log(tan((c 
 + d*x)/2)**2 + 1)*sin(c + d*x)**4*b**2 + 192*log(tan((c + d*x)/2))*sin(c 
+ d*x)**4*a**2 - 384*log(tan((c + d*x)/2))*sin(c + d*x)**4*b**2 + 96*sin(c 
 + d*x)**6*b**2 + 384*sin(c + d*x)**5*a*b - 147*sin(c + d*x)**4*a**2 + 96* 
sin(c + d*x)**4*b**2 + 768*sin(c + d*x)**3*a*b + 192*sin(c + d*x)**2*a**2 
- 96*sin(c + d*x)**2*b**2 - 128*sin(c + d*x)*a*b - 48*a**2)/(192*sin(c + d 
*x)**4*d)