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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-1)]
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 = 118 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=a^2 x-\frac {3 a^2 \text {arctanh}(\cos (c+d x))}{4 d}+\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot ^5(c+d x)}{5 d}+\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{4 d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{2 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.61 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.69 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^2 \left (480 c+480 d x+272 \cot \left (\frac {1}{2} (c+d x)\right )+150 \csc ^2\left (\frac {1}{2} (c+d x)\right )-360 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+360 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-150 \sec ^2\left (\frac {1}{2} (c+d x)\right )+15 \sec ^4\left (\frac {1}{2} (c+d x)\right )-8 \csc ^3(c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )+96 \csc ^5(c+d x) \sin ^6\left (\frac {1}{2} (c+d x)\right )+\frac {1}{2} \csc ^4\left (\frac {1}{2} (c+d x)\right ) (-30+\sin (c+d x))-\frac {3}{2} \csc ^6\left (\frac {1}{2} (c+d x)\right ) \sin (c+d x)-272 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{480 d} \] Input:

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

Output:

(a^2*(480*c + 480*d*x + 272*Cot[(c + d*x)/2] + 150*Csc[(c + d*x)/2]^2 - 36 
0*Log[Cos[(c + d*x)/2]] + 360*Log[Sin[(c + d*x)/2]] - 150*Sec[(c + d*x)/2] 
^2 + 15*Sec[(c + d*x)/2]^4 - 8*Csc[c + d*x]^3*Sin[(c + d*x)/2]^4 + 96*Csc[ 
c + d*x]^5*Sin[(c + d*x)/2]^6 + (Csc[(c + d*x)/2]^4*(-30 + Sin[c + d*x]))/ 
2 - (3*Csc[(c + d*x)/2]^6*Sin[c + d*x])/2 - 272*Tan[(c + d*x)/2]))/(480*d)
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {3042, 3352, 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 ^4(c+d x) \csc ^2(c+d x) (a \sin (c+d x)+a)^2 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3352

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

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {3 a^2 \text {arctanh}(\cos (c+d x))}{4 d}-\frac {a^2 \cot ^5(c+d x)}{5 d}-\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x) \csc (c+d x)}{2 d}+\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{4 d}+a^2 x\)

Input:

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

Output:

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

Defintions of rubi rules used

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 3352
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n 
_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Int[ExpandTrig 
[(g*cos[e + f*x])^p, (d*sin[e + f*x])^n*(a + b*sin[e + f*x])^m, x], x] /; F 
reeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2 - b^2, 0] && IGtQ[m, 0]
 
Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.10

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+2 a^{2} \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 )-\frac {a^{2} \cos \left (d x +c \right )^{5}}{5 \sin \left (d x +c \right )^{5}}}{d}\) \(130\)
default \(\frac {a^{2} \left (-\frac {\cot \left (d x +c \right )^{3}}{3}+\cot \left (d x +c \right )+d x +c \right )+2 a^{2} \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 )-\frac {a^{2} \cos \left (d x +c \right )^{5}}{5 \sin \left (d x +c \right )^{5}}}{d}\) \(130\)
risch \(a^{2} x -\frac {a^{2} \left (-60 i {\mathrm e}^{8 i \left (d x +c \right )}+75 \,{\mathrm e}^{9 i \left (d x +c \right )}+360 i {\mathrm e}^{6 i \left (d x +c \right )}-30 \,{\mathrm e}^{7 i \left (d x +c \right )}-320 i {\mathrm e}^{4 i \left (d x +c \right )}+280 i {\mathrm e}^{2 i \left (d x +c \right )}+30 \,{\mathrm e}^{3 i \left (d x +c \right )}-68 i-75 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{30 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{4 d}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{4 d}\) \(163\)

Input:

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

Output:

1/d*(a^2*(-1/3*cot(d*x+c)^3+cot(d*x+c)+d*x+c)+2*a^2*(-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)))-1/5*a^2/sin(d*x+c)^5*cos(d*x+c)^5)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 239 vs. \(2 (108) = 216\).

Time = 0.12 (sec) , antiderivative size = 239, normalized size of antiderivative = 2.03 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {136 \, a^{2} \cos \left (d x + c\right )^{5} - 280 \, a^{2} \cos \left (d x + c\right )^{3} + 120 \, a^{2} \cos \left (d x + c\right ) - 45 \, {\left (a^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 45 \, {\left (a^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 30 \, {\left (4 \, a^{2} d x \cos \left (d x + c\right )^{4} - 8 \, a^{2} d x \cos \left (d x + c\right )^{2} - 5 \, a^{2} \cos \left (d x + c\right )^{3} + 4 \, a^{2} d x + 3 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, {\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+a*sin(d*x+c))^2,x, algorithm="frica 
s")
 

Output:

1/120*(136*a^2*cos(d*x + c)^5 - 280*a^2*cos(d*x + c)^3 + 120*a^2*cos(d*x + 
 c) - 45*(a^2*cos(d*x + c)^4 - 2*a^2*cos(d*x + c)^2 + a^2)*log(1/2*cos(d*x 
 + c) + 1/2)*sin(d*x + c) + 45*(a^2*cos(d*x + c)^4 - 2*a^2*cos(d*x + c)^2 
+ a^2)*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) + 30*(4*a^2*d*x*cos(d*x + 
 c)^4 - 8*a^2*d*x*cos(d*x + c)^2 - 5*a^2*cos(d*x + c)^3 + 4*a^2*d*x + 3*a^ 
2*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(-1)]

Timed out. \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\text {Timed out} \] Input:

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.05 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=-\frac {24 \, a^{2} \cot \left (d x + c\right )^{5} - 40 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} + 15 \, a^{2} {\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 )}}{120 \, d} \] Input:

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

Output:

-1/120*(24*a^2*cot(d*x + c)^5 - 40*(3*d*x + 3*c + (3*tan(d*x + c)^2 - 1)/t 
an(d*x + c)^3)*a^2 + 15*a^2*(2*(5*cos(d*x + c)^3 - 3*cos(d*x + c))/(cos(d* 
x + c)^4 - 2*cos(d*x + c)^2 + 1) + 3*log(cos(d*x + c) + 1) - 3*log(cos(d*x 
 + c) - 1)))/d
 

Giac [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 207, normalized size of antiderivative = 1.75 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 480 \, {\left (d x + c\right )} a^{2} + 360 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 270 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {822 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 270 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \] Input:

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

Output:

1/480*(3*a^2*tan(1/2*d*x + 1/2*c)^5 + 15*a^2*tan(1/2*d*x + 1/2*c)^4 + 5*a^ 
2*tan(1/2*d*x + 1/2*c)^3 - 120*a^2*tan(1/2*d*x + 1/2*c)^2 + 480*(d*x + c)* 
a^2 + 360*a^2*log(abs(tan(1/2*d*x + 1/2*c))) - 270*a^2*tan(1/2*d*x + 1/2*c 
) - (822*a^2*tan(1/2*d*x + 1/2*c)^5 - 270*a^2*tan(1/2*d*x + 1/2*c)^4 - 120 
*a^2*tan(1/2*d*x + 1/2*c)^3 + 5*a^2*tan(1/2*d*x + 1/2*c)^2 + 15*a^2*tan(1/ 
2*d*x + 1/2*c) + 3*a^2)/tan(1/2*d*x + 1/2*c)^5)/d
 

Mupad [B] (verification not implemented)

Time = 17.91 (sec) , antiderivative size = 275, normalized size of antiderivative = 2.33 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{96\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{32\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{96\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{32\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}+\frac {2\,a^2\,\mathrm {atan}\left (\frac {4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,a^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4\,d}+\frac {9\,a^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,d}-\frac {9\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,d} \] Input:

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

Output:

(a^2*cot(c/2 + (d*x)/2)^2)/(4*d) - (a^2*cot(c/2 + (d*x)/2)^3)/(96*d) - (a^ 
2*cot(c/2 + (d*x)/2)^4)/(32*d) - (a^2*cot(c/2 + (d*x)/2)^5)/(160*d) - (a^2 
*tan(c/2 + (d*x)/2)^2)/(4*d) + (a^2*tan(c/2 + (d*x)/2)^3)/(96*d) + (a^2*ta 
n(c/2 + (d*x)/2)^4)/(32*d) + (a^2*tan(c/2 + (d*x)/2)^5)/(160*d) + (2*a^2*a 
tan((4*cos(c/2 + (d*x)/2) + 3*sin(c/2 + (d*x)/2))/(3*cos(c/2 + (d*x)/2) - 
4*sin(c/2 + (d*x)/2))))/d + (3*a^2*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/ 
2)))/(4*d) + (9*a^2*cot(c/2 + (d*x)/2))/(16*d) - (9*a^2*tan(c/2 + (d*x)/2) 
)/(16*d)
 

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.01 \[ \int \cot ^4(c+d x) \csc ^2(c+d x) (a+a \sin (c+d x))^2 \, dx=\frac {a^{2} \left (68 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}+75 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+4 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}-30 \cos \left (d x +c \right ) \sin \left (d x +c \right )-12 \cos \left (d x +c \right )+45 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{5}+60 \sin \left (d x +c \right )^{5} d x \right )}{60 \sin \left (d x +c \right )^{5} d} \] Input:

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

Output:

(a**2*(68*cos(c + d*x)*sin(c + d*x)**4 + 75*cos(c + d*x)*sin(c + d*x)**3 + 
 4*cos(c + d*x)*sin(c + d*x)**2 - 30*cos(c + d*x)*sin(c + d*x) - 12*cos(c 
+ d*x) + 45*log(tan((c + d*x)/2))*sin(c + d*x)**5 + 60*sin(c + d*x)**5*d*x 
))/(60*sin(c + d*x)**5*d)