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

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

Optimal result

Integrand size = 27, antiderivative size = 98 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^3 \, dx=-\frac {5 a^3 x}{2}-\frac {5 a^3 \text {arctanh}(\cos (c+d x))}{2 d}+\frac {3 a^3 \cos (c+d x)}{d}-\frac {3 a^3 \cot (c+d x)}{d}-\frac {a^3 \cot (c+d x) \csc (c+d x)}{2 d}+\frac {a^3 \cos (c+d x) \sin (c+d x)}{2 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.83 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.14 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^3 \left (-20 c-20 d x+24 \cos (c+d x)-12 \cot \left (\frac {1}{2} (c+d x)\right )-\csc ^2\left (\frac {1}{2} (c+d x)\right )-20 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+20 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+\sec ^2\left (\frac {1}{2} (c+d x)\right )+2 \sin (2 (c+d x))+12 \tan \left (\frac {1}{2} (c+d x)\right )\right )}{8 d} \] Input:

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

Output:

(a^3*(-20*c - 20*d*x + 24*Cos[c + d*x] - 12*Cot[(c + d*x)/2] - Csc[(c + d* 
x)/2]^2 - 20*Log[Cos[(c + d*x)/2]] + 20*Log[Sin[(c + d*x)/2]] + Sec[(c + d 
*x)/2]^2 + 2*Sin[2*(c + d*x)] + 12*Tan[(c + d*x)/2]))/(8*d)
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.04, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {3042, 3351, 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 (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)^3}dx\)

\(\Big \downarrow \) 3351

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

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 3351
Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) 
 + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[1/a^p   Int[Expan 
dTrig[(d*sin[e + f*x])^n*(a - b*sin[e + f*x])^(p/2)*(a + b*sin[e + f*x])^(m 
 + p/2), x], x], x] /; FreeQ[{a, b, d, e, f}, x] && EqQ[a^2 - b^2, 0] && In 
tegersQ[m, n, p/2] && ((GtQ[m, 0] && GtQ[p, 0] && LtQ[-m - p, n, -1]) || (G 
tQ[m, 2] && LtQ[p, 0] && GtQ[m + p/2, 0]))
 
Maple [A] (verified)

Time = 0.84 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.33

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

Input:

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

Output:

1/d*(a^3*(1/2*sin(d*x+c)*cos(d*x+c)+1/2*d*x+1/2*c)+3*a^3*(cos(d*x+c)+ln(cs 
c(d*x+c)-cot(d*x+c)))+3*a^3*(-cot(d*x+c)-d*x-c)+a^3*(-1/2/sin(d*x+c)^2*cos 
(d*x+c)^3-1/2*cos(d*x+c)-1/2*ln(csc(d*x+c)-cot(d*x+c))))
 

Fricas [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 159, normalized size of antiderivative = 1.62 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^3 \, dx=-\frac {10 \, a^{3} d x \cos \left (d x + c\right )^{2} - 12 \, a^{3} \cos \left (d x + c\right )^{3} - 10 \, a^{3} d x + 10 \, a^{3} \cos \left (d x + c\right ) + 5 \, {\left (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 ) - 5 \, {\left (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 ) - 2 \, {\left (a^{3} \cos \left (d x + c\right )^{3} + 5 \, a^{3} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \] Input:

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

Output:

-1/4*(10*a^3*d*x*cos(d*x + c)^2 - 12*a^3*cos(d*x + c)^3 - 10*a^3*d*x + 10* 
a^3*cos(d*x + c) + 5*(a^3*cos(d*x + c)^2 - a^3)*log(1/2*cos(d*x + c) + 1/2 
) - 5*(a^3*cos(d*x + c)^2 - a^3)*log(-1/2*cos(d*x + c) + 1/2) - 2*(a^3*cos 
(d*x + c)^3 + 5*a^3*cos(d*x + c))*sin(d*x + c))/(d*cos(d*x + c)^2 - d)
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

1/4*((2*d*x + 2*c + sin(2*d*x + 2*c))*a^3 - 12*(d*x + c + 1/tan(d*x + c))* 
a^3 + a^3*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) + log(cos(d*x + c) + 1) - l 
og(cos(d*x + c) - 1)) + 6*a^3*(2*cos(d*x + c) - log(cos(d*x + c) + 1) + lo 
g(cos(d*x + c) - 1)))/d
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 184 vs. \(2 (90) = 180\).

Time = 0.17 (sec) , antiderivative size = 184, normalized size of antiderivative = 1.88 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 20 \, {\left (d x + c\right )} a^{3} + 20 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 12 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {10 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 20 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 27 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 16 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 36 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}^{2}}}{8 \, d} \] Input:

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

Output:

1/8*(a^3*tan(1/2*d*x + 1/2*c)^2 - 20*(d*x + c)*a^3 + 20*a^3*log(abs(tan(1/ 
2*d*x + 1/2*c))) + 12*a^3*tan(1/2*d*x + 1/2*c) - (10*a^3*tan(1/2*d*x + 1/2 
*c)^6 + 20*a^3*tan(1/2*d*x + 1/2*c)^5 - 27*a^3*tan(1/2*d*x + 1/2*c)^4 + 16 
*a^3*tan(1/2*d*x + 1/2*c)^3 - 36*a^3*tan(1/2*d*x + 1/2*c)^2 + 12*a^3*tan(1 
/2*d*x + 1/2*c) + a^3)/(tan(1/2*d*x + 1/2*c)^3 + tan(1/2*d*x + 1/2*c))^2)/ 
d
 

Mupad [B] (verification not implemented)

Time = 17.89 (sec) , antiderivative size = 259, normalized size of antiderivative = 2.64 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {5\,a^3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{2\,d}-\frac {10\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-\frac {47\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+8\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-23\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+6\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a^3}{2}}{d\,\left (4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+8\,{\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 {5\,a^3\,\mathrm {atan}\left (\frac {25\,a^6}{25\,a^6+25\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {25\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{25\,a^6+25\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d} \] Input:

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

Output:

(a^3*tan(c/2 + (d*x)/2)^2)/(8*d) + (5*a^3*log(tan(c/2 + (d*x)/2)))/(2*d) - 
 (8*a^3*tan(c/2 + (d*x)/2)^3 - 23*a^3*tan(c/2 + (d*x)/2)^2 - (47*a^3*tan(c 
/2 + (d*x)/2)^4)/2 + 10*a^3*tan(c/2 + (d*x)/2)^5 + a^3/2 + 6*a^3*tan(c/2 + 
 (d*x)/2))/(d*(4*tan(c/2 + (d*x)/2)^2 + 8*tan(c/2 + (d*x)/2)^4 + 4*tan(c/2 
 + (d*x)/2)^6)) + (5*a^3*atan((25*a^6)/(25*a^6 + 25*a^6*tan(c/2 + (d*x)/2) 
) - (25*a^6*tan(c/2 + (d*x)/2))/(25*a^6 + 25*a^6*tan(c/2 + (d*x)/2))))/d + 
 (3*a^3*tan(c/2 + (d*x)/2))/(2*d)
 

Reduce [B] (verification not implemented)

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

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

Output:

(a**3*(2*cos(c + d*x)*sin(c + d*x)**3 + 12*cos(c + d*x)*sin(c + d*x)**2 - 
12*cos(c + d*x)*sin(c + d*x) - 2*cos(c + d*x) + 10*log(tan((c + d*x)/2))*s 
in(c + d*x)**2 - 10*sin(c + d*x)**2*d*x - 11*sin(c + d*x)**2))/(4*sin(c + 
d*x)**2*d)