Optimal. Leaf size=144 \[ \frac {\left (a^3-9 a b^2-8 b^3\right ) \log (1-\sin (c+d x))}{16 d}-\frac {\left (a^3-9 a b^2+8 b^3\right ) \log (\sin (c+d x)+1)}{16 d}-\frac {\sec ^2(c+d x) \left (\left (a^2+4 b^2\right ) \sin (c+d x)+5 a b\right ) (a+b \sin (c+d x))}{8 d}+\frac {\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.25, antiderivative size = 144, 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 = {2837, 12, 1645, 819, 633, 31} \[ \frac {\left (a^3-9 a b^2-8 b^3\right ) \log (1-\sin (c+d x))}{16 d}-\frac {\left (a^3-9 a b^2+8 b^3\right ) \log (\sin (c+d x)+1)}{16 d}-\frac {\sec ^2(c+d x) \left (\left (a^2+4 b^2\right ) \sin (c+d x)+5 a b\right ) (a+b \sin (c+d x))}{8 d}+\frac {\tan (c+d x) \sec ^3(c+d x) (a+b \sin (c+d x))^3}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 31
Rule 633
Rule 819
Rule 1645
Rule 2837
Rubi steps
\begin {align*} \int \sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan ^2(c+d x) \, dx &=\frac {b^5 \operatorname {Subst}\left (\int \frac {x^2 (a+x)^3}{b^2 \left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {b^3 \operatorname {Subst}\left (\int \frac {x^2 (a+x)^3}{\left (b^2-x^2\right )^3} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}+\frac {b \operatorname {Subst}\left (\int \frac {(a+x)^2 \left (-a b^2-4 b^2 x\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) \left (5 a b+\left (a^2+4 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\operatorname {Subst}\left (\int \frac {a b^2 \left (a^2-9 b^2\right )-8 b^4 x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{8 b d}\\ &=-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) \left (5 a b+\left (a^2+4 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\left (a^3-9 a b^2-8 b^3\right ) \operatorname {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{16 d}+\frac {\left (a^3-9 a b^2+8 b^3\right ) \operatorname {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{16 d}\\ &=\frac {\left (a^3-9 a b^2-8 b^3\right ) \log (1-\sin (c+d x))}{16 d}-\frac {\left (a^3-9 a b^2+8 b^3\right ) \log (1+\sin (c+d x))}{16 d}-\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) \left (5 a b+\left (a^2+4 b^2\right ) \sin (c+d x)\right )}{8 d}+\frac {\sec ^3(c+d x) (a+b \sin (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.39, size = 140, normalized size = 0.97 \[ \frac {\left (a^3-9 a b^2-8 b^3\right ) \log (1-\sin (c+d x))-\left (a^3-9 a b^2+8 b^3\right ) \log (\sin (c+d x)+1)-\frac {(a-b)^3}{(\sin (c+d x)+1)^2}+\frac {(a-7 b) (a-b)^2}{\sin (c+d x)+1}+\frac {(a+b)^2 (a+7 b)}{\sin (c+d x)-1}+\frac {(a+b)^3}{(\sin (c+d x)-1)^2}}{16 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 156, normalized size = 1.08 \[ -\frac {{\left (a^{3} - 9 \, a b^{2} + 8 \, b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{3} - 9 \, a b^{2} - 8 \, b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 12 \, a^{2} b - 4 \, b^{3} + 8 \, {\left (3 \, a^{2} b + 2 \, b^{3}\right )} \cos \left (d x + c\right )^{2} - 2 \, {\left (2 \, a^{3} + 6 \, a b^{2} - {\left (a^{3} + 15 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.27, size = 168, normalized size = 1.17 \[ -\frac {{\left (a^{3} - 9 \, a b^{2} + 8 \, b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (a^{3} - 9 \, a b^{2} - 8 \, b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, b^{3} \sin \left (d x + c\right )^{4} + a^{3} \sin \left (d x + c\right )^{3} + 15 \, a b^{2} \sin \left (d x + c\right )^{3} + 12 \, a^{2} b \sin \left (d x + c\right )^{2} - 4 \, b^{3} \sin \left (d x + c\right )^{2} + a^{3} \sin \left (d x + c\right ) - 9 \, a b^{2} \sin \left (d x + c\right ) - 6 \, a^{2} b\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{2}}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.32, size = 263, normalized size = 1.83 \[ \frac {a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}+\frac {a^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}+\frac {a^{3} \sin \left (d x +c \right )}{8 d}-\frac {a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {3 a^{2} b \left (\sin ^{4}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}+\frac {3 a \,b^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}}-\frac {3 a \,b^{2} \left (\sin ^{5}\left (d x +c \right )\right )}{8 d \cos \left (d x +c \right )^{2}}-\frac {3 a \,b^{2} \left (\sin ^{3}\left (d x +c \right )\right )}{8 d}-\frac {9 a \,b^{2} \sin \left (d x +c \right )}{8 d}+\frac {9 a \,b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8 d}+\frac {b^{3} \left (\tan ^{4}\left (d x +c \right )\right )}{4 d}-\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}-\frac {b^{3} \ln \left (\cos \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 151, normalized size = 1.05 \[ -\frac {{\left (a^{3} - 9 \, a b^{2} + 8 \, b^{3}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (a^{3} - 9 \, a b^{2} - 8 \, b^{3}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left ({\left (a^{3} + 15 \, a b^{2}\right )} \sin \left (d x + c\right )^{3} - 6 \, a^{2} b - 6 \, b^{3} + 4 \, {\left (3 \, a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )^{2} + {\left (a^{3} - 9 \, a b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1}}{16 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.14, size = 299, normalized size = 2.08 \[ \frac {b^3\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (-\frac {a^3}{8}+\frac {9\,a\,b^2}{8}+b^3\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (\frac {a^3}{8}-\frac {9\,a\,b^2}{8}+b^3\right )}{d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {9\,a\,b^2}{4}-\frac {a^3}{4}\right )+2\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (\frac {9\,a\,b^2}{4}-\frac {a^3}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {7\,a^3}{4}+\frac {33\,a\,b^2}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {7\,a^3}{4}+\frac {33\,a\,b^2}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (12\,a^2\,b+8\,b^3\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]
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]
________________________________________________________________________________________