Optimal. Leaf size=131 \[ -\frac {b \left (27 a^2+8 b^2\right ) \cos ^3(c+d x)}{60 d}+\frac {a \left (4 a^2+3 b^2\right ) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} a x \left (4 a^2+3 b^2\right )-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}-\frac {7 a b \cos ^3(c+d x) (a+b \sin (c+d x))}{20 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.19, antiderivative size = 131, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2692, 2862, 2669, 2635, 8} \[ -\frac {b \left (27 a^2+8 b^2\right ) \cos ^3(c+d x)}{60 d}+\frac {a \left (4 a^2+3 b^2\right ) \sin (c+d x) \cos (c+d x)}{8 d}+\frac {1}{8} a x \left (4 a^2+3 b^2\right )-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}-\frac {7 a b \cos ^3(c+d x) (a+b \sin (c+d x))}{20 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2635
Rule 2669
Rule 2692
Rule 2862
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \sin (c+d x))^3 \, dx &=-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}+\frac {1}{5} \int \cos ^2(c+d x) (a+b \sin (c+d x)) \left (5 a^2+2 b^2+7 a b \sin (c+d x)\right ) \, dx\\ &=-\frac {7 a b \cos ^3(c+d x) (a+b \sin (c+d x))}{20 d}-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}+\frac {1}{20} \int \cos ^2(c+d x) \left (5 a \left (4 a^2+3 b^2\right )+b \left (27 a^2+8 b^2\right ) \sin (c+d x)\right ) \, dx\\ &=-\frac {b \left (27 a^2+8 b^2\right ) \cos ^3(c+d x)}{60 d}-\frac {7 a b \cos ^3(c+d x) (a+b \sin (c+d x))}{20 d}-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}+\frac {1}{4} \left (a \left (4 a^2+3 b^2\right )\right ) \int \cos ^2(c+d x) \, dx\\ &=-\frac {b \left (27 a^2+8 b^2\right ) \cos ^3(c+d x)}{60 d}+\frac {a \left (4 a^2+3 b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}-\frac {7 a b \cos ^3(c+d x) (a+b \sin (c+d x))}{20 d}-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}+\frac {1}{8} \left (a \left (4 a^2+3 b^2\right )\right ) \int 1 \, dx\\ &=\frac {1}{8} a \left (4 a^2+3 b^2\right ) x-\frac {b \left (27 a^2+8 b^2\right ) \cos ^3(c+d x)}{60 d}+\frac {a \left (4 a^2+3 b^2\right ) \cos (c+d x) \sin (c+d x)}{8 d}-\frac {7 a b \cos ^3(c+d x) (a+b \sin (c+d x))}{20 d}-\frac {b \cos ^3(c+d x) (a+b \sin (c+d x))^2}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.51, size = 107, normalized size = 0.82 \[ \frac {-10 \left (12 a^2 b+b^3\right ) \cos (3 (c+d x))+15 a \left (4 \left (4 a^2+3 b^2\right ) (c+d x)+8 a^2 \sin (2 (c+d x))-3 b^2 \sin (4 (c+d x))\right )-60 b \left (6 a^2+b^2\right ) \cos (c+d x)+6 b^3 \cos (5 (c+d x))}{480 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.50, size = 98, normalized size = 0.75 \[ \frac {24 \, b^{3} \cos \left (d x + c\right )^{5} - 40 \, {\left (3 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{3} + 15 \, {\left (4 \, a^{3} + 3 \, a b^{2}\right )} d x - 15 \, {\left (6 \, a b^{2} \cos \left (d x + c\right )^{3} - {\left (4 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.62, size = 113, normalized size = 0.86 \[ \frac {b^{3} \cos \left (5 \, d x + 5 \, c\right )}{80 \, d} - \frac {3 \, a b^{2} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {a^{3} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {1}{8} \, {\left (4 \, a^{3} + 3 \, a b^{2}\right )} x - \frac {{\left (12 \, a^{2} b + b^{3}\right )} \cos \left (3 \, d x + 3 \, c\right )}{48 \, d} - \frac {{\left (6 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.20, size = 123, normalized size = 0.94 \[ \frac {b^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-a^{2} b \left (\cos ^{3}\left (d x +c \right )\right )+a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.02, size = 93, normalized size = 0.71 \[ -\frac {480 \, a^{2} b \cos \left (d x + c\right )^{3} - 120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} - 45 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a b^{2} - 32 \, {\left (3 \, \cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3}\right )} b^{3}}{480 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.63, size = 356, normalized size = 2.72 \[ \frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2+3\,b^2\right )}{4\,\left (a^3+\frac {3\,a\,b^2}{4}\right )}\right )\,\left (4\,a^2+3\,b^2\right )}{4\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a\,b^2}{4}-a^3\right )+2\,a^2\,b-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^3+\frac {9\,a\,b^2}{2}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (\frac {3\,a\,b^2}{4}-a^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (2\,a^3+\frac {9\,a\,b^2}{2}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,a^2\,b+\frac {4\,b^3}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (8\,a^2\,b-\frac {4\,b^3}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (12\,a^2\,b+4\,b^3\right )+\frac {4\,b^3}{15}+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {a\,\left (4\,a^2+3\,b^2\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 3.16, size = 236, normalized size = 1.80 \[ \begin {cases} \frac {a^{3} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {a^{3} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a^{3} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} - \frac {a^{2} b \cos ^{3}{\left (c + d x \right )}}{d} + \frac {3 a b^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a b^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 a b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {b^{3} \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {2 b^{3} \cos ^{5}{\left (c + d x \right )}}{15 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\relax (c )}\right )^{3} \cos ^{2}{\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________