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

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 = 92 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {a^3 x}{2}-\frac {3 a^3 \text {arctanh}(\cos (c+d x))}{d}+\frac {3 a^3 \cos (c+d x)}{d}-\frac {a^3 \cos ^3(c+d x)}{3 d}-\frac {a^3 \cot (c+d x)}{d}+\frac {3 a^3 \cos (c+d x) \sin (c+d x)}{2 d} \] Output:

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

Mathematica [A] (verified)

Time = 6.73 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.15 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^3 \, dx=-\frac {a^3 \csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (\cos (c+d x) (15-66 \sin (c+d x))-12 \left (c+d x-6 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+6 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin (c+d x)+\cos (3 (c+d x)) (9+2 \sin (c+d x))\right )}{48 d} \] Input:

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

Output:

-1/48*(a^3*Csc[(c + d*x)/2]*Sec[(c + d*x)/2]*(Cos[c + d*x]*(15 - 66*Sin[c 
+ d*x]) - 12*(c + d*x - 6*Log[Cos[(c + d*x)/2]] + 6*Log[Sin[(c + d*x)/2]]) 
*Sin[c + d*x] + Cos[3*(c + d*x)]*(9 + 2*Sin[c + d*x])))/d
 

Rubi [A] (verified)

Time = 0.34 (sec) , antiderivative size = 96, 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.143, Rules used = {3042, 3188, 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) (a \sin (c+d x)+a)^3 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3188

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

((a^5*x)/2 - (3*a^5*ArcTanh[Cos[c + d*x]])/d + (3*a^5*Cos[c + d*x])/d - (a 
^5*Cos[c + d*x]^3)/(3*d) - (a^5*Cot[c + d*x])/d + (3*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 3188
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*tan[(e_.) + (f_.)*(x_)]^(p_ 
), x_Symbol] :> Simp[a^p   Int[ExpandIntegrand[Sin[e + f*x]^p*((a + b*Sin[e 
 + f*x])^(m - p/2)/(a - b*Sin[e + f*x])^(p/2)), x], x], x] /; FreeQ[{a, b, 
e, f}, x] && EqQ[a^2 - b^2, 0] && IntegersQ[m, p/2] && (LtQ[p, 0] || GtQ[m 
- p/2, 0])
 
Maple [A] (verified)

Time = 1.63 (sec) , antiderivative size = 94, normalized size of antiderivative = 1.02

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

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.32 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^3 \, dx=-\frac {9 \, a^{3} \cos \left (d x + c\right )^{3} + 9 \, a^{3} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 9 \, a^{3} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 3 \, a^{3} \cos \left (d x + c\right ) + {\left (2 \, a^{3} \cos \left (d x + c\right )^{3} - 3 \, a^{3} d x - 18 \, a^{3} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d \sin \left (d x + c\right )} \] Input:

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

Output:

-1/6*(9*a^3*cos(d*x + c)^3 + 9*a^3*log(1/2*cos(d*x + c) + 1/2)*sin(d*x + c 
) - 9*a^3*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + c) - 3*a^3*cos(d*x + c) + 
 (2*a^3*cos(d*x + c)^3 - 3*a^3*d*x - 18*a^3*cos(d*x + c))*sin(d*x + c))/(d 
*sin(d*x + c))
 

Sympy [F]

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

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

Output:

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

Maxima [A] (verification not implemented)

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

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

Output:

-1/12*(4*a^3*cos(d*x + c)^3 - 9*(2*d*x + 2*c + sin(2*d*x + 2*c))*a^3 + 12* 
(d*x + c + 1/tan(d*x + c))*a^3 - 18*a^3*(2*cos(d*x + c) - log(cos(d*x + c) 
 + 1) + log(cos(d*x + c) - 1)))/d
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.76 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {3 \, {\left (d x + c\right )} a^{3} + 18 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {3 \, {\left (6 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (9 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 36 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 16 \, a^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \] Input:

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

Output:

1/6*(3*(d*x + c)*a^3 + 18*a^3*log(abs(tan(1/2*d*x + 1/2*c))) + 3*a^3*tan(1 
/2*d*x + 1/2*c) - 3*(6*a^3*tan(1/2*d*x + 1/2*c) + a^3)/tan(1/2*d*x + 1/2*c 
) - 2*(9*a^3*tan(1/2*d*x + 1/2*c)^5 - 12*a^3*tan(1/2*d*x + 1/2*c)^4 - 36*a 
^3*tan(1/2*d*x + 1/2*c)^2 - 9*a^3*tan(1/2*d*x + 1/2*c) - 16*a^3)/(tan(1/2* 
d*x + 1/2*c)^2 + 1)^3)/d
 

Mupad [B] (verification not implemented)

Time = 17.45 (sec) , antiderivative size = 264, normalized size of antiderivative = 2.87 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^3 \, dx=\frac {3\,a^3\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {a^3\,\mathrm {atan}\left (\frac {a^6}{6\,a^6-a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {6\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{6\,a^6-a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {-7\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+8\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+24\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+3\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {32\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}-a^3}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )} \] Input:

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

Output:

(3*a^3*log(tan(c/2 + (d*x)/2)))/d + (a^3*atan(a^6/(6*a^6 - a^6*tan(c/2 + ( 
d*x)/2)) + (6*a^6*tan(c/2 + (d*x)/2))/(6*a^6 - a^6*tan(c/2 + (d*x)/2))))/d 
 + (a^3*tan(c/2 + (d*x)/2))/(2*d) + (3*a^3*tan(c/2 + (d*x)/2)^2 + 24*a^3*t 
an(c/2 + (d*x)/2)^3 - 3*a^3*tan(c/2 + (d*x)/2)^4 + 8*a^3*tan(c/2 + (d*x)/2 
)^5 - 7*a^3*tan(c/2 + (d*x)/2)^6 - a^3 + (32*a^3*tan(c/2 + (d*x)/2))/3)/(d 
*(2*tan(c/2 + (d*x)/2) + 6*tan(c/2 + (d*x)/2)^3 + 6*tan(c/2 + (d*x)/2)^5 + 
 2*tan(c/2 + (d*x)/2)^7))
 

Reduce [B] (verification not implemented)

Time = 0.17 (sec) , antiderivative size = 107, normalized size of antiderivative = 1.16 \[ \int \cot ^2(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}+9 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}+16 \cos \left (d x +c \right ) \sin \left (d x +c \right )-6 \cos \left (d x +c \right )+18 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )+3 \sin \left (d x +c \right ) d x -16 \sin \left (d x +c \right )\right )}{6 \sin \left (d x +c \right ) d} \] Input:

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

Output:

(a**3*(2*cos(c + d*x)*sin(c + d*x)**3 + 9*cos(c + d*x)*sin(c + d*x)**2 + 1 
6*cos(c + d*x)*sin(c + d*x) - 6*cos(c + d*x) + 18*log(tan((c + d*x)/2))*si 
n(c + d*x) + 3*sin(c + d*x)*d*x - 16*sin(c + d*x)))/(6*sin(c + d*x)*d)