Optimal. Leaf size=261 \[ -\frac {\left (2 a^2+7 b^2\right ) \cot (c+d x)}{35 d}+\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\left (3 a^4-18 a^2 b^2+4 b^4\right ) \cot (c+d x) \csc ^2(c+d x)}{105 a^2 d}-\frac {a b \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a b \cot (c+d x) \csc (c+d x)}{8 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.63, antiderivative size = 261, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 9, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.310, Rules used = {2893, 3047, 3031, 3021, 2748, 3768, 3770, 3767, 8} \[ -\frac {\left (2 a^2+7 b^2\right ) \cot (c+d x)}{35 d}+\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}-\frac {\left (-18 a^2 b^2+3 a^4+4 b^4\right ) \cot (c+d x) \csc ^2(c+d x)}{105 a^2 d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {a b \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a b \cot (c+d x) \csc (c+d x)}{8 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2748
Rule 2893
Rule 3021
Rule 3031
Rule 3047
Rule 3767
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \cot ^4(c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}-\frac {\int \csc ^6(c+d x) (a+b \sin (c+d x))^2 \left (12 \left (4 a^2-b^2\right )+2 a b \sin (c+d x)-2 \left (21 a^2-4 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{42 a^2}\\ &=\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}-\frac {\int \csc ^5(c+d x) (a+b \sin (c+d x)) \left (2 b \left (53 a^2-12 b^2\right )-2 a \left (9 a^2-b^2\right ) \sin (c+d x)-2 b \left (57 a^2-8 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{210 a^2}\\ &=\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}+\frac {\int \csc ^4(c+d x) \left (24 \left (3 a^4-18 a^2 b^2+4 b^4\right )+210 a^3 b \sin (c+d x)+8 b^2 \left (57 a^2-8 b^2\right ) \sin ^2(c+d x)\right ) \, dx}{840 a^2}\\ &=-\frac {\left (3 a^4-18 a^2 b^2+4 b^4\right ) \cot (c+d x) \csc ^2(c+d x)}{105 a^2 d}+\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}+\frac {\int \csc ^3(c+d x) \left (630 a^3 b+72 a^2 \left (2 a^2+7 b^2\right ) \sin (c+d x)\right ) \, dx}{2520 a^2}\\ &=-\frac {\left (3 a^4-18 a^2 b^2+4 b^4\right ) \cot (c+d x) \csc ^2(c+d x)}{105 a^2 d}+\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}+\frac {1}{4} (a b) \int \csc ^3(c+d x) \, dx+\frac {1}{35} \left (2 a^2+7 b^2\right ) \int \csc ^2(c+d x) \, dx\\ &=-\frac {a b \cot (c+d x) \csc (c+d x)}{8 d}-\frac {\left (3 a^4-18 a^2 b^2+4 b^4\right ) \cot (c+d x) \csc ^2(c+d x)}{105 a^2 d}+\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}+\frac {1}{8} (a b) \int \csc (c+d x) \, dx-\frac {\left (2 a^2+7 b^2\right ) \operatorname {Subst}(\int 1 \, dx,x,\cot (c+d x))}{35 d}\\ &=-\frac {a b \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {\left (2 a^2+7 b^2\right ) \cot (c+d x)}{35 d}-\frac {a b \cot (c+d x) \csc (c+d x)}{8 d}-\frac {\left (3 a^4-18 a^2 b^2+4 b^4\right ) \cot (c+d x) \csc ^2(c+d x)}{105 a^2 d}+\frac {b \left (53 a^2-12 b^2\right ) \cot (c+d x) \csc ^3(c+d x)}{420 a d}+\frac {2 \left (4 a^2-b^2\right ) \cot (c+d x) \csc ^4(c+d x) (a+b \sin (c+d x))^2}{35 a^2 d}+\frac {2 b \cot (c+d x) \csc ^5(c+d x) (a+b \sin (c+d x))^3}{21 a^2 d}-\frac {\cot (c+d x) \csc ^6(c+d x) (a+b \sin (c+d x))^3}{7 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.33, size = 322, normalized size = 1.23 \[ -\frac {\csc ^7(c+d x) \left (840 \left (6 a^2+b^2\right ) \cos (c+d x)+168 \left (14 a^2-b^2\right ) \cos (3 (c+d x))+336 a^2 \cos (5 (c+d x))-48 a^2 \cos (7 (c+d x))+2170 a b \sin (2 (c+d x))+3080 a b \sin (4 (c+d x))+210 a b \sin (6 (c+d x))-3675 a b \sin (c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+2205 a b \sin (3 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-735 a b \sin (5 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+105 a b \sin (7 (c+d x)) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+3675 a b \sin (c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-2205 a b \sin (3 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )+735 a b \sin (5 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-105 a b \sin (7 (c+d x)) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-504 b^2 \cos (5 (c+d x))-168 b^2 \cos (7 (c+d x))\right )}{53760 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.61, size = 248, normalized size = 0.95 \[ -\frac {48 \, {\left (2 \, a^{2} + 7 \, b^{2}\right )} \cos \left (d x + c\right )^{7} - 336 \, {\left (a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{5} + 105 \, {\left (a b \cos \left (d x + c\right )^{6} - 3 \, a b \cos \left (d x + c\right )^{4} + 3 \, 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 ) - 105 \, {\left (a b \cos \left (d x + c\right )^{6} - 3 \, a b \cos \left (d x + c\right )^{4} + 3 \, 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 ) - 70 \, {\left (3 \, a b \cos \left (d x + c\right )^{5} + 8 \, a b \cos \left (d x + c\right )^{3} - 3 \, a b \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{1680 \, {\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 )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.29, size = 347, normalized size = 1.33 \[ \frac {15 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 21 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 84 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 420 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1680 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 315 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 840 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {4356 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 315 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} + 840 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 105 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 420 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 210 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 21 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 84 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 70 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7}}}{13440 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.47, size = 194, normalized size = 0.74 \[ -\frac {a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{7 d \sin \left (d x +c \right )^{7}}-\frac {2 a^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{35 d \sin \left (d x +c \right )^{5}}-\frac {a b \left (\cos ^{5}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{6}}-\frac {a b \left (\cos ^{5}\left (d x +c \right )\right )}{12 d \sin \left (d x +c \right )^{4}}+\frac {a b \left (\cos ^{5}\left (d x +c \right )\right )}{24 d \sin \left (d x +c \right )^{2}}+\frac {a b \left (\cos ^{3}\left (d x +c \right )\right )}{24 d}+\frac {a b \cos \left (d x +c \right )}{8 d}+\frac {a b \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8 d}-\frac {b^{2} \left (\cos ^{5}\left (d x +c \right )\right )}{5 d \sin \left (d x +c \right )^{5}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 134, normalized size = 0.51 \[ \frac {35 \, a b {\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 )} - \frac {336 \, b^{2}}{\tan \left (d x + c\right )^{5}} - \frac {48 \, {\left (7 \, \tan \left (d x + c\right )^{2} + 5\right )} a^{2}}{\tan \left (d x + c\right )^{7}}}{1680 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.92, size = 302, normalized size = 1.16 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{896\,d}+\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{5}-\frac {4\,b^2}{5}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (3\,a^2+8\,b^2\right )-\frac {a^2}{7}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (a^2+4\,b^2\right )+2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5-\frac {2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}\right )}{128\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a^2}{128}+\frac {b^2}{16}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {a^2}{128}+\frac {b^2}{32}\right )}{d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {a^2}{640}-\frac {b^2}{160}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{64\,d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}+\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{192\,d}+\frac {a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\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]
________________________________________________________________________________________