Optimal. Leaf size=236 \[ -\frac {\left (a^2+6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}+\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\left (15 a^4-80 a^2 b^2+12 b^4\right ) \cot (c+d x) \csc (c+d x)}{240 a^2 d}-\frac {2 a b \cot (c+d x)}{5 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.60, antiderivative size = 236, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2893, 3047, 3031, 3021, 2748, 3767, 8, 3770} \[ -\frac {\left (a^2+6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}+\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}-\frac {\left (-80 a^2 b^2+15 a^4+12 b^4\right ) \cot (c+d x) \csc (c+d x)}{240 a^2 d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {2 a b \cot (c+d x)}{5 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2748
Rule 2893
Rule 3021
Rule 3031
Rule 3047
Rule 3767
Rule 3770
Rubi steps
\begin {align*} \int \cot ^4(c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}-\frac {\int \csc ^5(c+d x) (a+b \sin (c+d x))^2 \left (35 a^2-6 b^2+2 a b \sin (c+d x)-3 \left (10 a^2-b^2\right ) \sin ^2(c+d x)\right ) \, dx}{30 a^2}\\ &=\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}-\frac {\int \csc ^4(c+d x) (a+b \sin (c+d x)) \left (6 b \left (13 a^2-2 b^2\right )-a \left (15 a^2-2 b^2\right ) \sin (c+d x)-b \left (85 a^2-6 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{120 a^2}\\ &=\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}+\frac {\int \csc ^3(c+d x) \left (3 \left (15 a^4-80 a^2 b^2+12 b^4\right )+144 a^3 b \sin (c+d x)+3 b^2 \left (85 a^2-6 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{360 a^2}\\ &=-\frac {\left (15 a^4-80 a^2 b^2+12 b^4\right ) \cot (c+d x) \csc (c+d x)}{240 a^2 d}+\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}+\frac {\int \csc ^2(c+d x) \left (288 a^3 b+45 a^2 \left (a^2+6 b^2\right ) \sin (c+d x)\right ) \, dx}{720 a^2}\\ &=-\frac {\left (15 a^4-80 a^2 b^2+12 b^4\right ) \cot (c+d x) \csc (c+d x)}{240 a^2 d}+\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}+\frac {1}{5} (2 a b) \int \csc ^2(c+d x) \, dx+\frac {1}{16} \left (a^2+6 b^2\right ) \int \csc (c+d x) \, dx\\ &=-\frac {\left (a^2+6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}-\frac {\left (15 a^4-80 a^2 b^2+12 b^4\right ) \cot (c+d x) \csc (c+d x)}{240 a^2 d}+\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}-\frac {(2 a b) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{5 d}\\ &=-\frac {\left (a^2+6 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{16 d}-\frac {2 a b \cot (c+d x)}{5 d}-\frac {\left (15 a^4-80 a^2 b^2+12 b^4\right ) \cot (c+d x) \csc (c+d x)}{240 a^2 d}+\frac {b \left (13 a^2-2 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{60 a d}+\frac {\left (35 a^2-6 b^2\right ) \cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^2}{120 a^2 d}+\frac {b \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^3}{10 a^2 d}-\frac {\cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{6 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.89, size = 319, normalized size = 1.35 \[ \frac {-30 \left (a^2-10 b^2\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )+6 \csc ^4\left (\frac {1}{2} (c+d x)\right ) \left (5 a^2+14 a b \sin (c+d x)-5 b^2\right )+5 a^2 \sec ^6\left (\frac {1}{2} (c+d x)\right )-30 a^2 \sec ^4\left (\frac {1}{2} (c+d x)\right )+30 a^2 \sec ^2\left (\frac {1}{2} (c+d x)\right )+120 a^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-120 a^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+384 a b \tan \left (\frac {1}{2} (c+d x)\right )-384 a b \cot \left (\frac {1}{2} (c+d x)\right )-a \csc ^6\left (\frac {1}{2} (c+d x)\right ) (5 a+12 b \sin (c+d x))+768 a b \sin ^6\left (\frac {1}{2} (c+d x)\right ) \csc ^5(c+d x)-1344 a b \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+30 b^2 \sec ^4\left (\frac {1}{2} (c+d x)\right )-300 b^2 \sec ^2\left (\frac {1}{2} (c+d x)\right )+720 b^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-720 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{1920 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.80, size = 274, normalized size = 1.16 \[ \frac {192 \, a b \cos \left (d x + c\right )^{5} \sin \left (d x + c\right ) + 30 \, {\left (a^{2} - 10 \, b^{2}\right )} \cos \left (d x + c\right )^{5} + 80 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{3} - 30 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right ) - 15 \, {\left ({\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 6 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 15 \, {\left ({\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{6} - 3 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{4} + 3 \, {\left (a^{2} + 6 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} - 6 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{480 \, {\left (d \cos \left (d x + c\right )^{6} - 3 \, d \cos \left (d x + c\right )^{4} + 3 \, d \cos \left (d x + c\right )^{2} - d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.27, size = 309, normalized size = 1.31 \[ \frac {5 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 24 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 30 \, 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} - 240 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 240 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, {\left (a^{2} + 6 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - \frac {294 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 1764 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 240 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 240 \, 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} + 30 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 24 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 5 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6}}}{1920 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.49, size = 253, normalized size = 1.07 \[ -\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{6 d \sin \left (d x +c \right )^{6}}-\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{24 d \sin \left (d x +c \right )^{4}}+\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{48 d \sin \left (d x +c \right )^{2}}+\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{48 d}+\frac {a^{2} \cos \left (d x +c \right )}{16 d}+\frac {a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{16 d}-\frac {2 a b \left (\cos ^{5}\left (d x +c \right )\right )}{5 d \sin \left (d x +c \right )^{5}}-\frac {b^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{4 d \sin \left (d x +c \right )^{4}}+\frac {b^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{8 d \sin \left (d x +c \right )^{2}}+\frac {b^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{8 d}+\frac {3 b^{2} \cos \left (d x +c \right )}{8 d}+\frac {3 b^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.41, size = 180, normalized size = 0.76 \[ \frac {5 \, a^{2} {\left (\frac {2 \, {\left (3 \, \cos \left (d x + c\right )^{5} + 8 \, \cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{6} - 3 \, \cos \left (d x + c\right )^{4} + 3 \, \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 )} - 30 \, b^{2} {\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 {192 \, a b}{\tan \left (d x + c\right )^{5}}}{480 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.67, size = 262, normalized size = 1.11 \[ \frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (\frac {a^2}{16}+\frac {3\,b^2}{8}\right )}{d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{384\,d}+\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{2}-b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {a^2}{2}+8\,b^2\right )-\frac {a^2}{6}+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-8\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-\frac {4\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{5}\right )}{64\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{128}+\frac {b^2}{8}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {a^2}{128}-\frac {b^2}{64}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{16\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{80\,d}+\frac {a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,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]
________________________________________________________________________________________