Optimal. Leaf size=229 \[ \frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}+\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {a \left (2 a^2+83 b^2\right ) \sin (c+d x) \cos (c+d x)}{40 d}-\frac {3}{8} a x \left (4 a^2-3 b^2\right )-\frac {3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}+\frac {\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.68, antiderivative size = 229, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2894, 3049, 3033, 3023, 2735, 3770} \[ \frac {\left (56 a^2 b^2+a^4-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}+\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {a \left (2 a^2+83 b^2\right ) \sin (c+d x) \cos (c+d x)}{40 d}-\frac {3}{8} a x \left (4 a^2-3 b^2\right )-\frac {3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2894
Rule 3023
Rule 3033
Rule 3049
Rule 3770
Rubi steps
\begin {align*} \int \cos ^2(c+d x) \cot ^2(c+d x) (a+b \sin (c+d x))^3 \, dx &=-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac {\int \csc (c+d x) (a+b \sin (c+d x))^3 \left (-15 b^2+6 a b \sin (c+d x)+\left (a^2+20 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{5 a b}\\ &=\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac {\int \csc (c+d x) (a+b \sin (c+d x))^2 \left (-60 a b^2+27 a^2 b \sin (c+d x)+3 a \left (a^2+28 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{20 a b}\\ &=\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac {\int \csc (c+d x) (a+b \sin (c+d x)) \left (-180 a^2 b^2+3 a b \left (29 a^2-4 b^2\right ) \sin (c+d x)+3 a^2 \left (2 a^2+83 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{60 a b}\\ &=\frac {a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac {\int \csc (c+d x) \left (-360 a^3 b^2+45 a^2 b \left (4 a^2-3 b^2\right ) \sin (c+d x)+12 a \left (a^4+56 a^2 b^2-2 b^4\right ) \sin ^2(c+d x)\right ) \, dx}{120 a b}\\ &=\frac {\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac {a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}-\frac {\int \csc (c+d x) \left (-360 a^3 b^2+45 a^2 b \left (4 a^2-3 b^2\right ) \sin (c+d x)\right ) \, dx}{120 a b}\\ &=-\frac {3}{8} a \left (4 a^2-3 b^2\right ) x+\frac {\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac {a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}+\left (3 a^2 b\right ) \int \csc (c+d x) \, dx\\ &=-\frac {3}{8} a \left (4 a^2-3 b^2\right ) x-\frac {3 a^2 b \tanh ^{-1}(\cos (c+d x))}{d}+\frac {\left (a^4+56 a^2 b^2-2 b^4\right ) \cos (c+d x)}{10 b d}+\frac {a \left (2 a^2+83 b^2\right ) \cos (c+d x) \sin (c+d x)}{40 d}+\frac {\left (a^2+28 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^2}{20 b d}+\frac {\left (a^2+20 b^2\right ) \cos (c+d x) (a+b \sin (c+d x))^3}{20 a b d}-\frac {\cos (c+d x) (a+b \sin (c+d x))^4}{5 b d}-\frac {\cot (c+d x) (a+b \sin (c+d x))^4}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.04, size = 194, normalized size = 0.85 \[ \frac {-40 a^3 \sin (2 (c+d x))+80 a^3 \tan \left (\frac {1}{2} (c+d x)\right )-80 a^3 \cot \left (\frac {1}{2} (c+d x)\right )-240 a^3 c-240 a^3 d x+10 \left (4 a^2 b-b^3\right ) \cos (3 (c+d x))-20 b \left (b^2-30 a^2\right ) \cos (c+d x)+480 a^2 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-480 a^2 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+120 a b^2 \sin (2 (c+d x))+15 a b^2 \sin (4 (c+d x))+180 a b^2 c+180 a b^2 d x-2 b^3 \cos (5 (c+d x))}{160 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.78, size = 179, normalized size = 0.78 \[ -\frac {30 \, a b^{2} \cos \left (d x + c\right )^{5} + 60 \, a^{2} b \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 60 \, a^{2} b \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 5 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right ) + {\left (8 \, b^{3} \cos \left (d x + c\right )^{5} - 40 \, a^{2} b \cos \left (d x + c\right )^{3} - 120 \, a^{2} b \cos \left (d x + c\right ) + 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} d x\right )} \sin \left (d x + c\right )}{40 \, d \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.30, size = 345, normalized size = 1.51 \[ \frac {120 \, a^{2} b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 20 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 15 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )} - \frac {20 \, {\left (6 \, a^{2} b \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 (20 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 75 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 240 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} - 40 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{8} + 40 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 720 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 880 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 80 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 40 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 560 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 20 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 75 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 160 \, a^{2} b - 8 \, b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{5}}}{40 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.54, size = 216, normalized size = 0.94 \[ -\frac {a^{3} \left (\cos ^{5}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )}-\frac {a^{3} \left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{d}-\frac {3 a^{3} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{2 d}-\frac {3 a^{3} x}{2}-\frac {3 a^{3} c}{2 d}+\frac {a^{2} b \left (\cos ^{3}\left (d x +c \right )\right )}{d}+\frac {3 a^{2} b \cos \left (d x +c \right )}{d}+\frac {3 a^{2} b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{d}+\frac {3 a \,b^{2} \sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4 d}+\frac {9 a \,b^{2} \cos \left (d x +c \right ) \sin \left (d x +c \right )}{8 d}+\frac {9 a \,b^{2} x}{8}+\frac {9 a \,b^{2} c}{8 d}-\frac {\left (\cos ^{5}\left (d x +c \right )\right ) b^{3}}{5 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.51, size = 143, normalized size = 0.62 \[ -\frac {32 \, b^{3} \cos \left (d x + c\right )^{5} + 80 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} + 2}{\tan \left (d x + c\right )^{3} + \tan \left (d x + c\right )}\right )} a^{3} - 80 \, {\left (2 \, \cos \left (d x + c\right )^{3} + 6 \, \cos \left (d x + c\right ) - 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} a^{2} b - 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2}}{160 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.59, size = 674, normalized size = 2.94 \[ \frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (16\,a^2\,b-\frac {4\,b^3}{5}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (a^3+3\,a\,b^2\right )-10\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (3\,a\,b^2-14\,a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {15\,a\,b^2}{2}-7\,a^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,\left (\frac {15\,a\,b^2}{2}-a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (24\,a^2\,b-4\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (88\,a^2\,b-8\,b^3\right )-a^3+56\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+72\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{d\,\left (2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+10\,{\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^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {3\,a\,\mathrm {atan}\left (\frac {\frac {3\,a\,\left (4\,a^2-3\,b^2\right )\,\left (\frac {9\,a\,b^2}{4}-3\,a^3+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2-3\,b^2\right )\,9{}\mathrm {i}}{4}\right )}{8}+\frac {3\,a\,\left (4\,a^2-3\,b^2\right )\,\left (\frac {9\,a\,b^2}{4}-3\,a^3+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2-3\,b^2\right )\,9{}\mathrm {i}}{4}\right )}{8}}{2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a^6-\frac {27\,a^4\,b^2}{2}+\frac {81\,a^2\,b^4}{16}\right )-18\,a^5\,b+\frac {27\,a^3\,b^3}{2}-\frac {a\,\left (4\,a^2-3\,b^2\right )\,\left (\frac {9\,a\,b^2}{4}-3\,a^3+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2-3\,b^2\right )\,9{}\mathrm {i}}{4}\right )\,3{}\mathrm {i}}{8}+\frac {a\,\left (4\,a^2-3\,b^2\right )\,\left (\frac {9\,a\,b^2}{4}-3\,a^3+6\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2-3\,b^2\right )\,9{}\mathrm {i}}{4}\right )\,3{}\mathrm {i}}{8}}\right )\,\left (4\,a^2-3\,b^2\right )}{4\,d}+\frac {3\,a^2\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \]
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]
________________________________________________________________________________________