Optimal. Leaf size=153 \[ -\frac {2 a^2 \cos ^3(c+d x)}{3 d}-\frac {4 a^2 \cos (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}+\frac {a^2 \sin ^3(c+d x) \cos (c+d x)}{4 d}-\frac {5 a^2 \sin (c+d x) \cos (c+d x)}{8 d}+\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}+\frac {5 a^2 x}{8} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.22, antiderivative size = 153, normalized size of antiderivative = 1.00, number of steps used = 17, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2872, 3770, 3767, 8, 3768, 2638, 2635, 2633} \[ -\frac {2 a^2 \cos ^3(c+d x)}{3 d}-\frac {4 a^2 \cos (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}+\frac {a^2 \sin ^3(c+d x) \cos (c+d x)}{4 d}-\frac {5 a^2 \sin (c+d x) \cos (c+d x)}{8 d}+\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}+\frac {5 a^2 x}{8} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2633
Rule 2635
Rule 2638
Rule 2872
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \cot ^4(c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\int \left (-6 a^8 \csc (c+d x)-2 a^8 \csc ^2(c+d x)+2 a^8 \csc ^3(c+d x)+a^8 \csc ^4(c+d x)+6 a^8 \sin (c+d x)+2 a^8 \sin ^2(c+d x)-2 a^8 \sin ^3(c+d x)-a^8 \sin ^4(c+d x)\right ) \, dx}{a^6}\\ &=a^2 \int \csc ^4(c+d x) \, dx-a^2 \int \sin ^4(c+d x) \, dx-\left (2 a^2\right ) \int \csc ^2(c+d x) \, dx+\left (2 a^2\right ) \int \csc ^3(c+d x) \, dx+\left (2 a^2\right ) \int \sin ^2(c+d x) \, dx-\left (2 a^2\right ) \int \sin ^3(c+d x) \, dx-\left (6 a^2\right ) \int \csc (c+d x) \, dx+\left (6 a^2\right ) \int \sin (c+d x) \, dx\\ &=\frac {6 a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {6 a^2 \cos (c+d x)}{d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-\frac {a^2 \cos (c+d x) \sin (c+d x)}{d}+\frac {a^2 \cos (c+d x) \sin ^3(c+d x)}{4 d}-\frac {1}{4} \left (3 a^2\right ) \int \sin ^2(c+d x) \, dx+a^2 \int 1 \, dx+a^2 \int \csc (c+d x) \, dx-\frac {a^2 \operatorname {Subst}\left (\int \left (1+x^2\right ) \, dx,x,\cot (c+d x)\right )}{d}+\frac {\left (2 a^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}+\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=a^2 x+\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {4 a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cos ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-\frac {5 a^2 \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 \cos (c+d x) \sin ^3(c+d x)}{4 d}-\frac {1}{8} \left (3 a^2\right ) \int 1 \, dx\\ &=\frac {5 a^2 x}{8}+\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{d}-\frac {4 a^2 \cos (c+d x)}{d}-\frac {2 a^2 \cos ^3(c+d x)}{3 d}+\frac {a^2 \cot (c+d x)}{d}-\frac {a^2 \cot ^3(c+d x)}{3 d}-\frac {a^2 \cot (c+d x) \csc (c+d x)}{d}-\frac {5 a^2 \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a^2 \cos (c+d x) \sin ^3(c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.37, size = 209, normalized size = 1.37 \[ \frac {a^2 (\sin (c+d x)+1)^2 \left (60 (c+d x)-24 \sin (2 (c+d x))-3 \sin (4 (c+d x))-432 \cos (c+d x)-16 \cos (3 (c+d x))-64 \tan \left (\frac {1}{2} (c+d x)\right )+64 \cot \left (\frac {1}{2} (c+d x)\right )-24 \csc ^2\left (\frac {1}{2} (c+d x)\right )+24 \sec ^2\left (\frac {1}{2} (c+d x)\right )-480 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+480 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-2 \sin (c+d x) \csc ^4\left (\frac {1}{2} (c+d x)\right )+32 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)\right )}{96 d \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )^4} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.75, size = 219, normalized size = 1.43 \[ \frac {6 \, a^{2} \cos \left (d x + c\right )^{7} - 3 \, a^{2} \cos \left (d x + c\right )^{5} + 20 \, a^{2} \cos \left (d x + c\right )^{3} - 15 \, a^{2} \cos \left (d x + c\right ) + 60 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 60 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - {\left (16 \, a^{2} \cos \left (d x + c\right )^{5} - 15 \, a^{2} d x \cos \left (d x + c\right )^{2} + 80 \, a^{2} \cos \left (d x + c\right )^{3} + 15 \, a^{2} d x - 120 \, a^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{24 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.28, size = 274, normalized size = 1.79 \[ \frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, {\left (d x + c\right )} a^{2} - 120 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {220 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3}} + \frac {2 \, {\left (15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 144 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 336 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 304 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 112 \, a^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4}}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.43, size = 223, normalized size = 1.46 \[ \frac {a^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )}+\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}+\frac {5 a^{2} \left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{12 d}+\frac {5 a^{2} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{8 d}+\frac {5 a^{2} x}{8}+\frac {5 a^{2} c}{8 d}-\frac {a^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )^{2}}-\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{d}-\frac {5 a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 d}-\frac {5 a^{2} \cos \left (d x +c \right )}{d}-\frac {5 a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}-\frac {a^{2} \left (\cos ^{7}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.76, size = 190, normalized size = 1.24 \[ -\frac {4 \, {\left (4 \, \cos \left (d x + c\right )^{3} - \frac {6 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + 24 \, \cos \left (d x + c\right ) - 15 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a^{2} + 3 \, {\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} + 25 \, \tan \left (d x + c\right )^{2} + 8}{\tan \left (d x + c\right )^{5} + 2 \, \tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{2} - 4 \, {\left (15 \, d x + 15 \, c + \frac {15 \, \tan \left (d x + c\right )^{4} + 10 \, \tan \left (d x + c\right )^{2} - 2}{\tan \left (d x + c\right )^{5} + \tan \left (d x + c\right )^{3}}\right )} a^{2}}{24 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.93, size = 384, normalized size = 2.51 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {5\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {5\,a^2\,\mathrm {atan}\left (\frac {25\,a^4}{16\,\left (\frac {25\,a^4}{2}+\frac {25\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}\right )}-\frac {25\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,\left (\frac {25\,a^4}{2}+\frac {25\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16}\right )}\right )}{4\,d}-\frac {5\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {-15\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+98\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9-\frac {41\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{3}+232\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-\frac {104\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{3}+\frac {644\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{3}-8\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\frac {248\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{3}-\frac {11\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+2\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a^2}{3}}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+32\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+48\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+32\,{\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\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________