Optimal. Leaf size=152 \[ \frac {b \left (2 a^2-b^2\right ) \cot (c+d x)}{2 d}+\frac {a \left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{8 d}+\frac {a \left (a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}+b^3 (-x) \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.51, antiderivative size = 152, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {2889, 3048, 3047, 3031, 3021, 2735, 3770} \[ \frac {b \left (2 a^2-b^2\right ) \cot (c+d x)}{2 d}+\frac {a \left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{8 d}+\frac {a \left (a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}+b^3 (-x) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2735
Rule 2889
Rule 3021
Rule 3031
Rule 3047
Rule 3048
Rule 3770
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3 \, dx &=\int \csc ^5(c+d x) (a+b \sin (c+d x))^3 \left (1-\sin ^2(c+d x)\right ) \, dx\\ &=-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}+\frac {1}{4} \int \csc ^4(c+d x) (a+b \sin (c+d x))^2 \left (3 b-a \sin (c+d x)-4 b \sin ^2(c+d x)\right ) \, dx\\ &=-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}+\frac {1}{12} \int \csc ^3(c+d x) (a+b \sin (c+d x)) \left (-3 \left (a^2-2 b^2\right )-9 a b \sin (c+d x)-12 b^2 \sin ^2(c+d x)\right ) \, dx\\ &=\frac {a \left (a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}-\frac {1}{24} \int \csc ^2(c+d x) \left (12 b \left (2 a^2-b^2\right )+3 a \left (a^2+12 b^2\right ) \sin (c+d x)+24 b^3 \sin ^2(c+d x)\right ) \, dx\\ &=\frac {b \left (2 a^2-b^2\right ) \cot (c+d x)}{2 d}+\frac {a \left (a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}-\frac {1}{24} \int \csc (c+d x) \left (3 a \left (a^2+12 b^2\right )+24 b^3 \sin (c+d x)\right ) \, dx\\ &=-b^3 x+\frac {b \left (2 a^2-b^2\right ) \cot (c+d x)}{2 d}+\frac {a \left (a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}-\frac {1}{8} \left (a \left (a^2+12 b^2\right )\right ) \int \csc (c+d x) \, dx\\ &=-b^3 x+\frac {a \left (a^2+12 b^2\right ) \tanh ^{-1}(\cos (c+d x))}{8 d}+\frac {b \left (2 a^2-b^2\right ) \cot (c+d x)}{2 d}+\frac {a \left (a^2-2 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 d}-\frac {b \cot (c+d x) \csc ^2(c+d x) (a+b \sin (c+d x))^2}{4 d}-\frac {\cot (c+d x) \csc ^3(c+d x) (a+b \sin (c+d x))^3}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 6.23, size = 690, normalized size = 4.54 \[ \frac {\left (a^3-12 a b^2\right ) \sin ^3(c+d x) \csc ^2\left (\frac {1}{2} (c+d x)\right ) (a \csc (c+d x)+b)^3}{32 d (a+b \sin (c+d x))^3}+\frac {\left (-a^3-12 a b^2\right ) \sin ^3(c+d x) \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a \csc (c+d x)+b)^3}{8 d (a+b \sin (c+d x))^3}+\frac {\left (12 a b^2-a^3\right ) \sin ^3(c+d x) \sec ^2\left (\frac {1}{2} (c+d x)\right ) (a \csc (c+d x)+b)^3}{32 d (a+b \sin (c+d x))^3}+\frac {\left (a^3+12 a b^2\right ) \sin ^3(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right ) (a \csc (c+d x)+b)^3}{8 d (a+b \sin (c+d x))^3}-\frac {a^3 \sin ^3(c+d x) \csc ^4\left (\frac {1}{2} (c+d x)\right ) (a \csc (c+d x)+b)^3}{64 d (a+b \sin (c+d x))^3}+\frac {a^3 \sin ^3(c+d x) \sec ^4\left (\frac {1}{2} (c+d x)\right ) (a \csc (c+d x)+b)^3}{64 d (a+b \sin (c+d x))^3}+\frac {\sin ^3(c+d x) \csc \left (\frac {1}{2} (c+d x)\right ) \left (a^2 b \cos \left (\frac {1}{2} (c+d x)\right )-b^3 \cos \left (\frac {1}{2} (c+d x)\right )\right ) (a \csc (c+d x)+b)^3}{2 d (a+b \sin (c+d x))^3}+\frac {\sin ^3(c+d x) \sec \left (\frac {1}{2} (c+d x)\right ) \left (b^3 \sin \left (\frac {1}{2} (c+d x)\right )-a^2 b \sin \left (\frac {1}{2} (c+d x)\right )\right ) (a \csc (c+d x)+b)^3}{2 d (a+b \sin (c+d x))^3}-\frac {a^2 b \sin ^3(c+d x) \cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right ) (a \csc (c+d x)+b)^3}{8 d (a+b \sin (c+d x))^3}+\frac {a^2 b \sin ^3(c+d x) \tan \left (\frac {1}{2} (c+d x)\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right ) (a \csc (c+d x)+b)^3}{8 d (a+b \sin (c+d x))^3}-\frac {b^3 (c+d x) \sin ^3(c+d x) (a \csc (c+d x)+b)^3}{d (a+b \sin (c+d x))^3} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.63, size = 265, normalized size = 1.74 \[ -\frac {16 \, b^{3} d x \cos \left (d x + c\right )^{4} - 32 \, b^{3} d x \cos \left (d x + c\right )^{2} + 16 \, b^{3} d x + 2 \, {\left (a^{3} - 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + 2 \, {\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right ) - {\left ({\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{4} + a^{3} + 12 \, a b^{2} - 2 \, {\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{4} + a^{3} + 12 \, a b^{2} - 2 \, {\left (a^{3} + 12 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 16 \, {\left (b^{3} \cos \left (d x + c\right ) + {\left (a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{3}\right )} \sin \left (d x + c\right )}{16 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, 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.26, size = 234, normalized size = 1.54 \[ \frac {3 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 24 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 192 \, {\left (d x + c\right )} b^{3} - 72 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 96 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, {\left (a^{3} + 12 \, a b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {50 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 600 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 72 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 96 \, b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 72 \, a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 24 \, a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.48, size = 207, normalized size = 1.36 \[ -\frac {a^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{4 d \sin \left (d x +c \right )^{4}}-\frac {a^{3} \left (\cos ^{3}\left (d x +c \right )\right )}{8 d \sin \left (d x +c \right )^{2}}-\frac {a^{3} \cos \left (d x +c \right )}{8 d}-\frac {a^{3} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8 d}-\frac {a^{2} b \left (\cos ^{3}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )^{3}}-\frac {3 a \,b^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{2 d \sin \left (d x +c \right )^{2}}-\frac {3 a \,b^{2} \cos \left (d x +c \right )}{2 d}-\frac {3 a \,b^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2 d}-b^{3} x -\frac {\cot \left (d x +c \right ) b^{3}}{d}-\frac {b^{3} c}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.42, size = 149, normalized size = 0.98 \[ -\frac {16 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} b^{3} + a^{3} {\left (\frac {2 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 12 \, a b^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {16 \, a^{2} b}{\tan \left (d x + c\right )^{3}}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.87, size = 348, normalized size = 2.29 \[ \frac {a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {a^3\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {a^3\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{8\,d}-\frac {b^3\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}+\frac {b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {2\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+12\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2+8\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3+12\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^2-8\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^3}\right )}{d}-\frac {3\,a\,b^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,d}+\frac {3\,a^2\,b\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {3\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{8\,d}-\frac {3\,a\,b^2\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}-\frac {a^2\,b\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{8\,d}+\frac {3\,a\,b^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{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]
________________________________________________________________________________________