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

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

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

Mathematica [A] (verified)

Time = 0.63 (sec) , antiderivative size = 133, normalized size of antiderivative = 1.33 \[ \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^3 \left (-22 \csc ^2\left (\frac {1}{2} (c+d x)\right )+22 \sec ^2\left (\frac {1}{2} (c+d x)\right )+\sec ^4\left (\frac {1}{2} (c+d x)\right )-8 \left (8 c+8 d x-13 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+13 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-8 \csc ^3(c+d x) \sin ^4\left (\frac {1}{2} (c+d x)\right )\right )-\csc ^4\left (\frac {1}{2} (c+d x)\right ) (1+4 \sin (c+d x))\right )}{64 d} \] Input:

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

Output:

(a^3*(-22*Csc[(c + d*x)/2]^2 + 22*Sec[(c + d*x)/2]^2 + Sec[(c + d*x)/2]^4 
- 8*(8*c + 8*d*x - 13*Log[Cos[(c + d*x)/2]] + 13*Log[Sin[(c + d*x)/2]] - 8 
*Csc[c + d*x]^3*Sin[(c + d*x)/2]^4) - Csc[(c + d*x)/2]^4*(1 + 4*Sin[c + d* 
x])))/(64*d)
 

Rubi [A] (verified)

Time = 0.43 (sec) , antiderivative size = 100, 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 ^2(c+d x) \csc ^3(c+d x) (a \sin (c+d x)+a)^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3352

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

-(a^3*x) + (13*a^3*ArcTanh[Cos[c + d*x]])/(8*d) - (a^3*Cot[c + d*x])/d - ( 
a^3*Cot[c + d*x]^3)/d - (11*a^3*Cot[c + d*x]*Csc[c + d*x])/(8*d) - (a^3*Co 
t[c + d*x]*Csc[c + d*x]^3)/(4*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 [C] (verified)

Result contains complex when optimal does not.

Time = 0.33 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.38

method result size
risch \(-a^{3} x +\frac {a^{3} \left (11 \,{\mathrm e}^{7 i \left (d x +c \right )}-19 \,{\mathrm e}^{5 i \left (d x +c \right )}+16 i {\mathrm e}^{6 i \left (d x +c \right )}-19 \,{\mathrm e}^{3 i \left (d x +c \right )}+11 \,{\mathrm e}^{i \left (d x +c \right )}-16 i {\mathrm e}^{2 i \left (d x +c \right )}\right )}{4 d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{4}}+\frac {13 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{8 d}-\frac {13 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{8 d}\) \(138\)
derivativedivides \(\frac {a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )+3 a^{3} \left (-\frac {\cos \left (d x +c \right )^{3}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )-\frac {a^{3} \cos \left (d x +c \right )^{3}}{\sin \left (d x +c \right )^{3}}+a^{3} \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 )}{d}\) \(164\)
default \(\frac {a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )+3 a^{3} \left (-\frac {\cos \left (d x +c \right )^{3}}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )-\frac {a^{3} \cos \left (d x +c \right )^{3}}{\sin \left (d x +c \right )^{3}}+a^{3} \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 )}{d}\) \(164\)

Input:

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

Output:

-a^3*x+1/4*a^3/d/(exp(2*I*(d*x+c))-1)^4*(11*exp(7*I*(d*x+c))-19*exp(5*I*(d 
*x+c))+16*I*exp(6*I*(d*x+c))-19*exp(3*I*(d*x+c))+11*exp(I*(d*x+c))-16*I*ex 
p(2*I*(d*x+c)))+13/8*a^3/d*ln(exp(I*(d*x+c))+1)-13/8*a^3/d*ln(exp(I*(d*x+c 
))-1)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (94) = 188\).

Time = 0.09 (sec) , antiderivative size = 190, normalized size of antiderivative = 1.90 \[ \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^3 \, dx=-\frac {16 \, a^{3} d x \cos \left (d x + c\right )^{4} - 32 \, a^{3} d x \cos \left (d x + c\right )^{2} - 22 \, a^{3} \cos \left (d x + c\right )^{3} + 16 \, a^{3} d x + 16 \, a^{3} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 26 \, a^{3} \cos \left (d x + c\right ) - 13 \, {\left (a^{3} \cos \left (d x + c\right )^{4} - 2 \, a^{3} \cos \left (d x + c\right )^{2} + a^{3}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 13 \, {\left (a^{3} \cos \left (d x + c\right )^{4} - 2 \, a^{3} \cos \left (d x + c\right )^{2} + a^{3}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{16 \, {\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)^2*csc(d*x+c)^3*(a+a*sin(d*x+c))^3,x, algorithm="frica 
s")
 

Output:

-1/16*(16*a^3*d*x*cos(d*x + c)^4 - 32*a^3*d*x*cos(d*x + c)^2 - 22*a^3*cos( 
d*x + c)^3 + 16*a^3*d*x + 16*a^3*cos(d*x + c)*sin(d*x + c) + 26*a^3*cos(d* 
x + c) - 13*(a^3*cos(d*x + c)^4 - 2*a^3*cos(d*x + c)^2 + a^3)*log(1/2*cos( 
d*x + c) + 1/2) + 13*(a^3*cos(d*x + c)^4 - 2*a^3*cos(d*x + c)^2 + a^3)*log 
(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^4 - 2*d*cos(d*x + c)^2 + d)
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [A] (verification not implemented)

Time = 0.11 (sec) , antiderivative size = 147, normalized size of antiderivative = 1.47 \[ \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^3 \, dx=-\frac {16 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{3} + a^{3} {\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 )} - 12 \, a^{3} {\left (\frac {2 \, \cos \left (d x + c\right )}{\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 \, a^{3}}{\tan \left (d x + c\right )^{3}}}{16 \, d} \] Input:

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

Output:

-1/16*(16*(d*x + c + 1/tan(d*x + c))*a^3 + a^3*(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)) - 12*a^3*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) + log 
(cos(d*x + c) + 1) - log(cos(d*x + c) - 1)) + 16*a^3/tan(d*x + c)^3)/d
 

Giac [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.74 \[ \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 192 \, {\left (d x + c\right )} a^{3} - 312 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {650 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \] Input:

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

Output:

1/192*(3*a^3*tan(1/2*d*x + 1/2*c)^4 + 24*a^3*tan(1/2*d*x + 1/2*c)^3 + 72*a 
^3*tan(1/2*d*x + 1/2*c)^2 - 192*(d*x + c)*a^3 - 312*a^3*log(abs(tan(1/2*d* 
x + 1/2*c))) + 24*a^3*tan(1/2*d*x + 1/2*c) + (650*a^3*tan(1/2*d*x + 1/2*c) 
^4 - 24*a^3*tan(1/2*d*x + 1/2*c)^3 - 72*a^3*tan(1/2*d*x + 1/2*c)^2 - 24*a^ 
3*tan(1/2*d*x + 1/2*c) - 3*a^3)/tan(1/2*d*x + 1/2*c)^4)/d
 

Mupad [B] (verification not implemented)

Time = 18.45 (sec) , antiderivative size = 237, normalized size of antiderivative = 2.37 \[ \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {a^3\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{8\,d}-\frac {a^3\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {3\,a^3\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{8\,d}+\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {2\,a^3\,\mathrm {atan}\left (\frac {8\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+13\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{13\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-8\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {13\,a^3\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{8\,d}-\frac {a^3\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d} \] Input:

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

Output:

(3*a^3*tan(c/2 + (d*x)/2)^2)/(8*d) - (a^3*cot(c/2 + (d*x)/2)^3)/(8*d) - (a 
^3*cot(c/2 + (d*x)/2)^4)/(64*d) - (3*a^3*cot(c/2 + (d*x)/2)^2)/(8*d) + (a^ 
3*tan(c/2 + (d*x)/2)^3)/(8*d) + (a^3*tan(c/2 + (d*x)/2)^4)/(64*d) - (2*a^3 
*atan((8*cos(c/2 + (d*x)/2) + 13*sin(c/2 + (d*x)/2))/(13*cos(c/2 + (d*x)/2 
) - 8*sin(c/2 + (d*x)/2))))/d - (13*a^3*log(sin(c/2 + (d*x)/2)/cos(c/2 + ( 
d*x)/2)))/(8*d) - (a^3*cot(c/2 + (d*x)/2))/(8*d) + (a^3*tan(c/2 + (d*x)/2) 
)/(8*d)
 

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 87, normalized size of antiderivative = 0.87 \[ \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^{3} \left (-11 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}-8 \cos \left (d x +c \right ) \sin \left (d x +c \right )-2 \cos \left (d x +c \right )-13 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )^{4}-8 \sin \left (d x +c \right )^{4} d x \right )}{8 \sin \left (d x +c \right )^{4} d} \] Input:

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

Output:

(a**3*( - 11*cos(c + d*x)*sin(c + d*x)**2 - 8*cos(c + d*x)*sin(c + d*x) - 
2*cos(c + d*x) - 13*log(tan((c + d*x)/2))*sin(c + d*x)**4 - 8*sin(c + d*x) 
**4*d*x))/(8*sin(c + d*x)**4*d)