Optimal. Leaf size=209 \[ \frac {b \left (27 a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{60 a d}+\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\left (3 a^4-14 a^2 b^2+b^4\right ) \cot (c+d x)}{15 a^2 d}-\frac {3 a b \tanh ^{-1}(\cos (c+d x))}{4 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}+b^2 x \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.52, antiderivative size = 209, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2893, 3047, 3031, 3021, 2735, 3770} \[ -\frac {\left (-14 a^2 b^2+3 a^4+b^4\right ) \cot (c+d x)}{15 a^2 d}+\frac {b \left (27 a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{60 a d}+\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {3 a b \tanh ^{-1}(\cos (c+d x))}{4 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}+b^2 x \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2893
Rule 3021
Rule 3031
Rule 3047
Rule 3770
Rubi steps
\begin {align*} \int \cot ^4(c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}-\frac {\int \csc ^4(c+d x) (a+b \sin (c+d x))^2 \left (2 \left (12 a^2-b^2\right )+2 a b \sin (c+d x)-20 a^2 \sin ^2(c+d x)\right ) \, dx}{20 a^2}\\ &=\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}-\frac {\int \csc ^3(c+d x) (a+b \sin (c+d x)) \left (2 b \left (27 a^2-2 b^2\right )-2 a \left (6 a^2-b^2\right ) \sin (c+d x)-60 a^2 b \sin ^2(c+d x)\right ) \, dx}{60 a^2}\\ &=\frac {b \left (27 a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{60 a d}+\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}+\frac {\int \csc ^2(c+d x) \left (8 \left (3 a^4-14 a^2 b^2+b^4\right )+90 a^3 b \sin (c+d x)+120 a^2 b^2 \sin ^2(c+d x)\right ) \, dx}{120 a^2}\\ &=-\frac {\left (3 a^4-14 a^2 b^2+b^4\right ) \cot (c+d x)}{15 a^2 d}+\frac {b \left (27 a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{60 a d}+\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}+\frac {\int \csc (c+d x) \left (90 a^3 b+120 a^2 b^2 \sin (c+d x)\right ) \, dx}{120 a^2}\\ &=b^2 x-\frac {\left (3 a^4-14 a^2 b^2+b^4\right ) \cot (c+d x)}{15 a^2 d}+\frac {b \left (27 a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{60 a d}+\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}+\frac {1}{4} (3 a b) \int \csc (c+d x) \, dx\\ &=b^2 x-\frac {3 a b \tanh ^{-1}(\cos (c+d x))}{4 d}-\frac {\left (3 a^4-14 a^2 b^2+b^4\right ) \cot (c+d x)}{15 a^2 d}+\frac {b \left (27 a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{60 a d}+\frac {\left (12 a^2-b^2\right ) \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{30 a^2 d}+\frac {b \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{5 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.54, size = 285, normalized size = 1.36 \[ \frac {\left (640 b^2-96 a^2\right ) \cot \left (\frac {1}{2} (c+d x)\right )+\csc ^4\left (\frac {1}{2} (c+d x)\right ) \left (\left (21 a^2-20 b^2\right ) \sin (c+d x)-30 a b\right )+96 a^2 \tan \left (\frac {1}{2} (c+d x)\right )-3 a^2 \sin (c+d x) \csc ^6\left (\frac {1}{2} (c+d x)\right )+192 a^2 \sin ^6\left (\frac {1}{2} (c+d x)\right ) \csc ^5(c+d x)-336 a^2 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+300 a b \csc ^2\left (\frac {1}{2} (c+d x)\right )+30 a b \sec ^4\left (\frac {1}{2} (c+d x)\right )-300 a b \sec ^2\left (\frac {1}{2} (c+d x)\right )+720 a b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-720 a b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-640 b^2 \tan \left (\frac {1}{2} (c+d x)\right )+320 b^2 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+960 b^2 c+960 b^2 d x}{960 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.68, size = 241, normalized size = 1.15 \[ -\frac {8 \, {\left (3 \, a^{2} - 20 \, b^{2}\right )} \cos \left (d x + c\right )^{5} + 280 \, b^{2} \cos \left (d x + c\right )^{3} - 120 \, b^{2} \cos \left (d x + c\right ) + 45 \, {\left (a b \cos \left (d x + c\right )^{4} - 2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 45 \, {\left (a b \cos \left (d x + c\right )^{4} - 2 \, a b \cos \left (d x + c\right )^{2} + a b\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) \sin \left (d x + c\right ) - 30 \, {\left (4 \, b^{2} d x \cos \left (d x + c\right )^{4} - 8 \, b^{2} d x \cos \left (d x + c\right )^{2} - 5 \, a b \cos \left (d x + c\right )^{3} + 4 \, b^{2} d x + 3 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, 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.25, size = 263, normalized size = 1.26 \[ \frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 15 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 20 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 480 \, {\left (d x + c\right )} b^{2} + 360 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 30 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 300 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {822 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 30 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 300 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a b \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} + 20 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 15 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{480 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.50, size = 165, normalized size = 0.79 \[ -\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{5 d \sin \left (d x +c \right )^{5}}-\frac {a b \left (\cos ^{5}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{4}}+\frac {a b \left (\cos ^{5}\left (d x +c \right )\right )}{4 d \sin \left (d x +c \right )^{2}}+\frac {a b \left (\cos ^{3}\left (d x +c \right )\right )}{4 d}+\frac {3 a b \cos \left (d x +c \right )}{4 d}+\frac {3 a b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{4 d}-\frac {b^{2} \left (\cot ^{3}\left (d x +c \right )\right )}{3 d}+\frac {b^{2} \cot \left (d x +c \right )}{d}+b^{2} x +\frac {b^{2} c}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 123, normalized size = 0.59 \[ \frac {40 \, {\left (3 \, d x + 3 \, c + \frac {3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} b^{2} - 15 \, a b {\left (\frac {2 \, {\left (5 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} + 3 \, \log \left (\cos \left (d x + c\right ) + 1\right ) - 3 \, \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - \frac {24 \, a^{2}}{\tan \left (d x + c\right )^{5}}}{120 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.10, size = 346, normalized size = 1.66 \[ \frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{32\,d}-\frac {a^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}-\frac {b^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{32\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{160\,d}+\frac {b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}-\frac {a^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,d}+\frac {5\,b^2\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{16\,d}-\frac {5\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}+\frac {2\,b^2\,\mathrm {atan}\left (\frac {4\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+3\,a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3\,a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-4\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {a\,b\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}-\frac {a\,b\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{32\,d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{32\,d}+\frac {3\,a\,b\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4\,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]
________________________________________________________________________________________