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

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

17/8*a^4*x-4*a^4*arctanh(cos(d*x+c))/d+4*a^4*cos(d*x+c)/d-4/3*a^4*cos(d*x+ 
c)^3/d-a^4*cot(d*x+c)/d+23/8*a^4*cos(d*x+c)*sin(d*x+c)/d+1/4*a^4*cos(d*x+c 
)*sin(d*x+c)^3/d
 

Mathematica [A] (verified)

Time = 12.38 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.17 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx=\frac {a^4 \csc \left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {1}{2} (c+d x)\right ) \left (-48 \cos (c+d x)-147 \cos (3 (c+d x))+3 \cos (5 (c+d x))+408 c \sin (c+d x)+408 d x \sin (c+d x)-768 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+768 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sin (c+d x)+320 \sin (2 (c+d x))-32 \sin (4 (c+d x))\right )}{384 d} \] Input:

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

Output:

(a^4*Csc[(c + d*x)/2]*Sec[(c + d*x)/2]*(-48*Cos[c + d*x] - 147*Cos[3*(c + 
d*x)] + 3*Cos[5*(c + d*x)] + 408*c*Sin[c + d*x] + 408*d*x*Sin[c + d*x] - 7 
68*Log[Cos[(c + d*x)/2]]*Sin[c + d*x] + 768*Log[Sin[(c + d*x)/2]]*Sin[c + 
d*x] + 320*Sin[2*(c + d*x)] - 32*Sin[4*(c + d*x)]))/(384*d)
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.03, 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)^4 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3188

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {-\frac {4 a^6 \text {arctanh}(\cos (c+d x))}{d}-\frac {4 a^6 \cos ^3(c+d x)}{3 d}+\frac {4 a^6 \cos (c+d x)}{d}-\frac {a^6 \cot (c+d x)}{d}+\frac {a^6 \sin ^3(c+d x) \cos (c+d x)}{4 d}+\frac {23 a^6 \sin (c+d x) \cos (c+d x)}{8 d}+\frac {17 a^6 x}{8}}{a^2}\)

Input:

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

Output:

((17*a^6*x)/8 - (4*a^6*ArcTanh[Cos[c + d*x]])/d + (4*a^6*Cos[c + d*x])/d - 
 (4*a^6*Cos[c + d*x]^3)/(3*d) - (a^6*Cot[c + d*x])/d + (23*a^6*Cos[c + d*x 
]*Sin[c + d*x])/(8*d) + (a^6*Cos[c + d*x]*Sin[c + d*x]^3)/(4*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 = 5.10 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.17

method result size
derivativedivides \(\frac {a^{4} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {4 a^{4} \cos \left (d x +c \right )^{3}}{3}+6 a^{4} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+4 a^{4} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+a^{4} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) \(136\)
default \(\frac {a^{4} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\frac {4 a^{4} \cos \left (d x +c \right )^{3}}{3}+6 a^{4} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+4 a^{4} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )+a^{4} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) \(136\)
risch \(\frac {17 a^{4} x}{8}-\frac {3 i a^{4} {\mathrm e}^{2 i \left (d x +c \right )}}{4 d}+\frac {3 a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {3 a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {3 i a^{4} {\mathrm e}^{-2 i \left (d x +c \right )}}{4 d}-\frac {2 i a^{4}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}-\frac {4 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}+\frac {4 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {a^{4} \sin \left (4 d x +4 c \right )}{32 d}-\frac {a^{4} \cos \left (3 d x +3 c \right )}{3 d}\) \(174\)

Input:

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

Output:

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

Fricas [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 135, normalized size of antiderivative = 1.16 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx=\frac {6 \, a^{4} \cos \left (d x + c\right )^{5} - 81 \, a^{4} \cos \left (d x + c\right )^{3} - 48 \, a^{4} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 48 \, a^{4} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) + 51 \, a^{4} \cos \left (d x + c\right ) - {\left (32 \, a^{4} \cos \left (d x + c\right )^{3} - 51 \, a^{4} d x - 96 \, a^{4} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, d \sin \left (d x + c\right )} \] Input:

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

Output:

1/24*(6*a^4*cos(d*x + c)^5 - 81*a^4*cos(d*x + c)^3 - 48*a^4*log(1/2*cos(d* 
x + c) + 1/2)*sin(d*x + c) + 48*a^4*log(-1/2*cos(d*x + c) + 1/2)*sin(d*x + 
 c) + 51*a^4*cos(d*x + c) - (32*a^4*cos(d*x + c)^3 - 51*a^4*d*x - 96*a^4*c 
os(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))^4 \, dx=a^{4} \left (\int 4 \sin {\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}\, dx + \int 6 \sin ^{2}{\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}\, dx + \int 4 \sin ^{3}{\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}\, dx + \int \sin ^{4}{\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))**4,x)
 

Output:

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

Maxima [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.01 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx=-\frac {128 \, a^{4} \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{4} - 144 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{4} + 96 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{4} - 192 \, a^{4} {\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 )}}{96 \, d} \] Input:

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

Output:

-1/96*(128*a^4*cos(d*x + c)^3 - 3*(4*d*x + 4*c - sin(4*d*x + 4*c))*a^4 - 1 
44*(2*d*x + 2*c + sin(2*d*x + 2*c))*a^4 + 96*(d*x + c + 1/tan(d*x + c))*a^ 
4 - 192*a^4*(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.17 (sec) , antiderivative size = 194, normalized size of antiderivative = 1.67 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx=\frac {51 \, {\left (d x + c\right )} a^{4} + 96 \, a^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 12 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {12 \, {\left (8 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{4}\right )}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )} - \frac {2 \, {\left (69 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 93 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 192 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 93 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 256 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 69 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 64 \, a^{4}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \] Input:

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

Output:

1/24*(51*(d*x + c)*a^4 + 96*a^4*log(abs(tan(1/2*d*x + 1/2*c))) + 12*a^4*ta 
n(1/2*d*x + 1/2*c) - 12*(8*a^4*tan(1/2*d*x + 1/2*c) + a^4)/tan(1/2*d*x + 1 
/2*c) - 2*(69*a^4*tan(1/2*d*x + 1/2*c)^7 + 93*a^4*tan(1/2*d*x + 1/2*c)^5 - 
 192*a^4*tan(1/2*d*x + 1/2*c)^4 - 93*a^4*tan(1/2*d*x + 1/2*c)^3 - 256*a^4* 
tan(1/2*d*x + 1/2*c)^2 - 69*a^4*tan(1/2*d*x + 1/2*c) - 64*a^4)/(tan(1/2*d* 
x + 1/2*c)^2 + 1)^4)/d
 

Mupad [B] (verification not implemented)

Time = 17.90 (sec) , antiderivative size = 295, normalized size of antiderivative = 2.54 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx=\frac {4\,a^4\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {17\,a^4\,\mathrm {atan}\left (\frac {289\,a^8}{16\,\left (34\,a^8-\frac {289\,a^8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}\right )}+\frac {34\,a^8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{34\,a^8-\frac {289\,a^8\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}}\right )}{4\,d}+\frac {-\frac {25\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{2}-\frac {39\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{2}+32\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\frac {19\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{2}+\frac {128\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}+\frac {15\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{2}+\frac {32\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}-a^4}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+12\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\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 )}+\frac {a^4\,\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))^4,x)
 

Output:

(4*a^4*log(tan(c/2 + (d*x)/2)))/d + (17*a^4*atan((289*a^8)/(16*(34*a^8 - ( 
289*a^8*tan(c/2 + (d*x)/2))/16)) + (34*a^8*tan(c/2 + (d*x)/2))/(34*a^8 - ( 
289*a^8*tan(c/2 + (d*x)/2))/16)))/(4*d) + ((15*a^4*tan(c/2 + (d*x)/2)^2)/2 
 + (128*a^4*tan(c/2 + (d*x)/2)^3)/3 + (19*a^4*tan(c/2 + (d*x)/2)^4)/2 + 32 
*a^4*tan(c/2 + (d*x)/2)^5 - (39*a^4*tan(c/2 + (d*x)/2)^6)/2 - (25*a^4*tan( 
c/2 + (d*x)/2)^8)/2 - a^4 + (32*a^4*tan(c/2 + (d*x)/2))/3)/(d*(2*tan(c/2 + 
 (d*x)/2) + 8*tan(c/2 + (d*x)/2)^3 + 12*tan(c/2 + (d*x)/2)^5 + 8*tan(c/2 + 
 (d*x)/2)^7 + 2*tan(c/2 + (d*x)/2)^9)) + (a^4*tan(c/2 + (d*x)/2))/(2*d)
 

Reduce [B] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 123, normalized size of antiderivative = 1.06 \[ \int \cot ^2(c+d x) (a+a \sin (c+d x))^4 \, dx=\frac {a^{4} \left (6 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4}+32 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3}+69 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2}+64 \cos \left (d x +c \right ) \sin \left (d x +c \right )-24 \cos \left (d x +c \right )+96 \,\mathrm {log}\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \sin \left (d x +c \right )+51 \sin \left (d x +c \right ) d x -64 \sin \left (d x +c \right )\right )}{24 \sin \left (d x +c \right ) d} \] Input:

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

Output:

(a**4*(6*cos(c + d*x)*sin(c + d*x)**4 + 32*cos(c + d*x)*sin(c + d*x)**3 + 
69*cos(c + d*x)*sin(c + d*x)**2 + 64*cos(c + d*x)*sin(c + d*x) - 24*cos(c 
+ d*x) + 96*log(tan((c + d*x)/2))*sin(c + d*x) + 51*sin(c + d*x)*d*x - 64* 
sin(c + d*x)))/(24*sin(c + d*x)*d)