Optimal. Leaf size=132 \[ \frac {\left (-3 a^2 B+2 a A b+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^4 d}-\frac {\left (a^2-b^2\right ) (A b-a B) (a+b \sin (c+d x))^3}{3 b^4 d}-\frac {(A b-3 a B) (a+b \sin (c+d x))^5}{5 b^4 d}-\frac {B (a+b \sin (c+d x))^6}{6 b^4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 132, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.065, Rules used = {2837, 772} \[ \frac {\left (-3 a^2 B+2 a A b+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^4 d}-\frac {\left (a^2-b^2\right ) (A b-a B) (a+b \sin (c+d x))^3}{3 b^4 d}-\frac {(A b-3 a B) (a+b \sin (c+d x))^5}{5 b^4 d}-\frac {B (a+b \sin (c+d x))^6}{6 b^4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 772
Rule 2837
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {\operatorname {Subst}\left (\int (a+x)^2 \left (A+\frac {B x}{b}\right ) \left (b^2-x^2\right ) \, dx,x,b \sin (c+d x)\right )}{b^3 d}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {\left (-a^2+b^2\right ) (A b-a B) (a+x)^2}{b}+\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) (a+x)^3}{b}+\frac {(-A b+3 a B) (a+x)^4}{b}-\frac {B (a+x)^5}{b}\right ) \, dx,x,b \sin (c+d x)\right )}{b^3 d}\\ &=-\frac {\left (a^2-b^2\right ) (A b-a B) (a+b \sin (c+d x))^3}{3 b^4 d}+\frac {\left (2 a A b-3 a^2 B+b^2 B\right ) (a+b \sin (c+d x))^4}{4 b^4 d}-\frac {(A b-3 a B) (a+b \sin (c+d x))^5}{5 b^4 d}-\frac {B (a+b \sin (c+d x))^6}{6 b^4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.25, size = 111, normalized size = 0.84 \[ \frac {(a+b \sin (c+d x))^3 \left (a^3 B+3 b \left (a^2 (-B)+2 a A b+5 b^2 B\right ) \sin (c+d x)-2 a^2 A b-6 b^2 (2 A b-a B) \sin ^2(c+d x)-5 a b^2 B+20 A b^3-10 b^3 B \sin ^3(c+d x)\right )}{60 b^4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.47, size = 120, normalized size = 0.91 \[ \frac {10 \, B b^{2} \cos \left (d x + c\right )^{6} - 15 \, {\left (B a^{2} + 2 \, A a b + B b^{2}\right )} \cos \left (d x + c\right )^{4} - 4 \, {\left (3 \, {\left (2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{4} - 10 \, A a^{2} - 4 \, B a b - 2 \, A b^{2} - {\left (5 \, A a^{2} + 2 \, B a b + A b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.27, size = 168, normalized size = 1.27 \[ -\frac {10 \, B b^{2} \sin \left (d x + c\right )^{6} + 24 \, B a b \sin \left (d x + c\right )^{5} + 12 \, A b^{2} \sin \left (d x + c\right )^{5} + 15 \, B a^{2} \sin \left (d x + c\right )^{4} + 30 \, A a b \sin \left (d x + c\right )^{4} - 15 \, B b^{2} \sin \left (d x + c\right )^{4} + 20 \, A a^{2} \sin \left (d x + c\right )^{3} - 40 \, B a b \sin \left (d x + c\right )^{3} - 20 \, A b^{2} \sin \left (d x + c\right )^{3} - 30 \, B a^{2} \sin \left (d x + c\right )^{2} - 60 \, A a b \sin \left (d x + c\right )^{2} - 60 \, A a^{2} \sin \left (d x + c\right )}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.48, size = 169, normalized size = 1.28 \[ \frac {\frac {a^{2} A \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}-\frac {B \,a^{2} \left (\cos ^{4}\left (d x +c \right )\right )}{4}-\frac {A a b \left (\cos ^{4}\left (d x +c \right )\right )}{2}+2 B a b \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )+A \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )+B \,b^{2} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{4}\left (d x +c \right )\right )}{6}-\frac {\left (\cos ^{4}\left (d x +c \right )\right )}{12}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 128, normalized size = 0.97 \[ -\frac {10 \, B b^{2} \sin \left (d x + c\right )^{6} + 12 \, {\left (2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )^{5} + 15 \, {\left (B a^{2} + 2 \, A a b - B b^{2}\right )} \sin \left (d x + c\right )^{4} - 60 \, A a^{2} \sin \left (d x + c\right ) + 20 \, {\left (A a^{2} - 2 \, B a b - A b^{2}\right )} \sin \left (d x + c\right )^{3} - 30 \, {\left (B a^{2} + 2 \, A a b\right )} \sin \left (d x + c\right )^{2}}{60 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.30, size = 127, normalized size = 0.96 \[ \frac {{\sin \left (c+d\,x\right )}^2\,\left (\frac {B\,a^2}{2}+A\,b\,a\right )-{\sin \left (c+d\,x\right )}^5\,\left (\frac {A\,b^2}{5}+\frac {2\,B\,a\,b}{5}\right )+{\sin \left (c+d\,x\right )}^3\,\left (-\frac {A\,a^2}{3}+\frac {2\,B\,a\,b}{3}+\frac {A\,b^2}{3}\right )-{\sin \left (c+d\,x\right )}^4\,\left (\frac {B\,a^2}{4}+\frac {A\,a\,b}{2}-\frac {B\,b^2}{4}\right )-\frac {B\,b^2\,{\sin \left (c+d\,x\right )}^6}{6}+A\,a^2\,\sin \left (c+d\,x\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 3.68, size = 228, normalized size = 1.73 \[ \begin {cases} \frac {2 A a^{2} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {A a^{2} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} - \frac {A a b \cos ^{4}{\left (c + d x \right )}}{2 d} + \frac {2 A b^{2} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {A b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} - \frac {B a^{2} \cos ^{4}{\left (c + d x \right )}}{4 d} + \frac {4 B a b \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {2 B a b \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {B b^{2} \sin ^{6}{\left (c + d x \right )}}{12 d} + \frac {B b^{2} \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4 d} & \text {for}\: d \neq 0 \\x \left (A + B \sin {\relax (c )}\right ) \left (a + b \sin {\relax (c )}\right )^{2} \cos ^{3}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________