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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (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 = 27, antiderivative size = 90 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \text {arctanh}(\cos (c+d x))}{8 d}-\frac {a \cot ^3(c+d x)}{3 d}-\frac {a \cot ^5(c+d x)}{5 d}+\frac {a \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a \cot (c+d x) \csc ^3(c+d x)}{4 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 177, normalized size of antiderivative = 1.97 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {2 a \cot (c+d x)}{15 d}+\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {a \csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {a \cot (c+d x) \csc ^2(c+d x)}{15 d}-\frac {a \cot (c+d x) \csc ^4(c+d x)}{5 d}+\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {a \sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d} \] Input:

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

Output:

(2*a*Cot[c + d*x])/(15*d) + (a*Csc[(c + d*x)/2]^2)/(32*d) - (a*Csc[(c + d* 
x)/2]^4)/(64*d) + (a*Cot[c + d*x]*Csc[c + d*x]^2)/(15*d) - (a*Cot[c + d*x] 
*Csc[c + d*x]^4)/(5*d) + (a*Log[Cos[(c + d*x)/2]])/(8*d) - (a*Log[Sin[(c + 
 d*x)/2]])/(8*d) - (a*Sec[(c + d*x)/2]^2)/(32*d) + (a*Sec[(c + d*x)/2]^4)/ 
(64*d)
 

Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.03, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.407, Rules used = {3042, 3317, 3042, 3087, 244, 2009, 3091, 3042, 4255, 3042, 4257}

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 ^2(c+d x) \csc ^4(c+d x) (a \sin (c+d x)+a) \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3317

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3087

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

\(\Big \downarrow \) 244

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

\(\Big \downarrow \) 2009

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

\(\Big \downarrow \) 3091

\(\displaystyle a \left (-\frac {1}{4} \int \csc ^3(c+d x)dx-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 d}\right )+\frac {a \left (-\frac {1}{5} \cot ^5(c+d x)-\frac {1}{3} \cot ^3(c+d x)\right )}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle a \left (-\frac {1}{4} \int \csc (c+d x)^3dx-\frac {\cot (c+d x) \csc ^3(c+d x)}{4 d}\right )+\frac {a \left (-\frac {1}{5} \cot ^5(c+d x)-\frac {1}{3} \cot ^3(c+d x)\right )}{d}\)

\(\Big \downarrow \) 4255

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4257

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 244
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand 
Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, 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 3087
Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_S 
ymbol] :> Simp[1/f   Subst[Int[(b*x)^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + 
f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n - 1) 
/2] && LtQ[0, n, m - 1])
 

rule 3091
Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^( 
n_), x_Symbol] :> Simp[b*(a*Sec[e + f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m 
 + n - 1))), x] - Simp[b^2*((n - 1)/(m + n - 1))   Int[(a*Sec[e + f*x])^m*( 
b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] & 
& NeQ[m + n - 1, 0] && IntegersQ[2*m, 2*n]
 

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]
 

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

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 
Maple [A] (verified)

Time = 0.32 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.22

method result size
derivativedivides \(\frac {a \left (-\frac {\cos \left (d x +c \right )^{3}}{4 \sin \left (d x +c \right )^{4}}-\frac {\cos \left (d x +c \right )^{3}}{8 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{8}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )+a \left (-\frac {\cos \left (d x +c \right )^{3}}{5 \sin \left (d x +c \right )^{5}}-\frac {2 \cos \left (d x +c \right )^{3}}{15 \sin \left (d x +c \right )^{3}}\right )}{d}\) \(110\)
default \(\frac {a \left (-\frac {\cos \left (d x +c \right )^{3}}{4 \sin \left (d x +c \right )^{4}}-\frac {\cos \left (d x +c \right )^{3}}{8 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{8}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8}\right )+a \left (-\frac {\cos \left (d x +c \right )^{3}}{5 \sin \left (d x +c \right )^{5}}-\frac {2 \cos \left (d x +c \right )^{3}}{15 \sin \left (d x +c \right )^{3}}\right )}{d}\) \(110\)
risch \(-\frac {a \left (15 \,{\mathrm e}^{9 i \left (d x +c \right )}+240 i {\mathrm e}^{6 i \left (d x +c \right )}+90 \,{\mathrm e}^{7 i \left (d x +c \right )}+80 i {\mathrm e}^{4 i \left (d x +c \right )}+80 i {\mathrm e}^{2 i \left (d x +c \right )}-90 \,{\mathrm e}^{3 i \left (d x +c \right )}-16 i-15 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{60 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{5}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}\) \(140\)

Input:

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

Output:

1/d*(a*(-1/4/sin(d*x+c)^4*cos(d*x+c)^3-1/8/sin(d*x+c)^2*cos(d*x+c)^3-1/8*c 
os(d*x+c)-1/8*ln(csc(d*x+c)-cot(d*x+c)))+a*(-1/5/sin(d*x+c)^5*cos(d*x+c)^3 
-2/15/sin(d*x+c)^3*cos(d*x+c)^3))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 169 vs. \(2 (80) = 160\).

Time = 0.09 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.88 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {32 \, a \cos \left (d x + c\right )^{5} - 80 \, a \cos \left (d x + c\right )^{3} + 15 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, 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 ) \sin \left (d x + c\right ) - 15 \, {\left (a \cos \left (d x + c\right )^{4} - 2 \, 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 ) \sin \left (d x + c\right ) - 30 \, {\left (a \cos \left (d x + c\right )^{3} + a \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{240 \, {\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)^2*csc(d*x+c)^4*(a+a*sin(d*x+c)),x, algorithm="fricas" 
)
 

Output:

1/240*(32*a*cos(d*x + c)^5 - 80*a*cos(d*x + c)^3 + 15*(a*cos(d*x + c)^4 - 
2*a*cos(d*x + c)^2 + a)*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 15*(a*c 
os(d*x + c)^4 - 2*a*cos(d*x + c)^2 + a)*log(-1/2*cos(d*x + c) + 1/2)*sin(d 
*x + c) - 30*(a*cos(d*x + c)^3 + a*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]

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

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

Output:

a*(Integral(cot(c + d*x)**2*csc(c + d*x)**4, x) + Integral(sin(c + d*x)*co 
t(c + d*x)**2*csc(c + d*x)**4, x))
 

Maxima [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.02 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=-\frac {15 \, a {\left (\frac {2 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {16 \, {\left (5 \, \tan \left (d x + c\right )^{2} + 3\right )} a}{\tan \left (d x + c\right )^{5}}}{240 \, d} \] Input:

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

Output:

-1/240*(15*a*(2*(cos(d*x + c)^3 + cos(d*x + c))/(cos(d*x + c)^4 - 2*cos(d* 
x + c)^2 + 1) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)) + 16*(5*tan 
(d*x + c)^2 + 3)*a/tan(d*x + c)^5)/d
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 144, normalized size of antiderivative = 1.60 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {6 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 10 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 60 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {274 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 60 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 10 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 6 \, a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{960 \, d} \] Input:

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

Output:

1/960*(6*a*tan(1/2*d*x + 1/2*c)^5 + 15*a*tan(1/2*d*x + 1/2*c)^4 + 10*a*tan 
(1/2*d*x + 1/2*c)^3 - 120*a*log(abs(tan(1/2*d*x + 1/2*c))) - 60*a*tan(1/2* 
d*x + 1/2*c) + (274*a*tan(1/2*d*x + 1/2*c)^5 + 60*a*tan(1/2*d*x + 1/2*c)^4 
 - 10*a*tan(1/2*d*x + 1/2*c)^2 - 15*a*tan(1/2*d*x + 1/2*c) - 6*a)/tan(1/2* 
d*x + 1/2*c)^5)/d
 

Mupad [B] (verification not implemented)

Time = 18.11 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.59 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{96\,d}-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}-\frac {a\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (-2\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2}+\frac {a}{5}\right )}{32\,d} \] Input:

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

Output:

(a*tan(c/2 + (d*x)/2)^3)/(96*d) - (a*tan(c/2 + (d*x)/2))/(16*d) + (a*tan(c 
/2 + (d*x)/2)^4)/(64*d) + (a*tan(c/2 + (d*x)/2)^5)/(160*d) - (a*log(tan(c/ 
2 + (d*x)/2)))/(8*d) - (cot(c/2 + (d*x)/2)^5*(a/5 + (a*tan(c/2 + (d*x)/2)) 
/2 + (a*tan(c/2 + (d*x)/2)^2)/3 - 2*a*tan(c/2 + (d*x)/2)^4))/(32*d)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.17 \[ \int \cot ^2(c+d x) \csc ^4(c+d x) (a+a \sin (c+d x)) \, dx=\frac {a \left (16 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}+15 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+8 \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 )-24 \cos \left (d x +c \right )-15 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{5}\right )}{120 \sin \left (d x +c \right )^{5} d} \] Input:

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

Output:

(a*(16*cos(c + d*x)*sin(c + d*x)**4 + 15*cos(c + d*x)*sin(c + d*x)**3 + 8* 
cos(c + d*x)*sin(c + d*x)**2 - 30*cos(c + d*x)*sin(c + d*x) - 24*cos(c + d 
*x) - 15*log(tan((c + d*x)/2))*sin(c + d*x)**5))/(120*sin(c + d*x)**5*d)