Optimal. Leaf size=288 \[ \frac {a^2 \cos ^3(c+d x)}{3 d}-\frac {a^2 \cos (c+d x)}{d}-\frac {\left (2 a c+b^2\right ) \cos ^5(c+d x)}{5 d}+\frac {2 \left (2 a c+b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {\left (2 a c+b^2\right ) \cos (c+d x)}{d}-\frac {a b \sin ^3(c+d x) \cos (c+d x)}{2 d}-\frac {3 a b \sin (c+d x) \cos (c+d x)}{4 d}+\frac {3 a b x}{4}-\frac {b c \sin ^5(c+d x) \cos (c+d x)}{3 d}-\frac {5 b c \sin ^3(c+d x) \cos (c+d x)}{12 d}-\frac {5 b c \sin (c+d x) \cos (c+d x)}{8 d}+\frac {5 b c x}{8}+\frac {c^2 \cos ^7(c+d x)}{7 d}-\frac {3 c^2 \cos ^5(c+d x)}{5 d}+\frac {c^2 \cos ^3(c+d x)}{d}-\frac {c^2 \cos (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.40, antiderivative size = 288, normalized size of antiderivative = 1.00, number of steps used = 16, number of rules used = 5, integrand size = 38, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.132, Rules used = {4394, 3256, 2633, 2635, 8} \[ \frac {a^2 \cos ^3(c+d x)}{3 d}-\frac {a^2 \cos (c+d x)}{d}-\frac {\left (2 a c+b^2\right ) \cos ^5(c+d x)}{5 d}+\frac {2 \left (2 a c+b^2\right ) \cos ^3(c+d x)}{3 d}-\frac {\left (2 a c+b^2\right ) \cos (c+d x)}{d}-\frac {a b \sin ^3(c+d x) \cos (c+d x)}{2 d}-\frac {3 a b \sin (c+d x) \cos (c+d x)}{4 d}+\frac {3 a b x}{4}-\frac {b c \sin ^5(c+d x) \cos (c+d x)}{3 d}-\frac {5 b c \sin ^3(c+d x) \cos (c+d x)}{12 d}-\frac {5 b c \sin (c+d x) \cos (c+d x)}{8 d}+\frac {5 b c x}{8}+\frac {c^2 \cos ^7(c+d x)}{7 d}-\frac {3 c^2 \cos ^5(c+d x)}{5 d}+\frac {c^2 \cos ^3(c+d x)}{d}-\frac {c^2 \cos (c+d x)}{d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2633
Rule 2635
Rule 3256
Rule 4394
Rubi steps
\begin {align*} \int \sin (c+d x) \left (a \sin (c+d x)+b \sin ^2(c+d x)+c \sin ^3(c+d x)\right )^2 \, dx &=\int \sin ^3(c+d x) \left (a+b \sin (c+d x)+c \sin ^2(c+d x)\right )^2 \, dx\\ &=\int \left (a^2 \sin ^3(c+d x)+2 a b \sin ^4(c+d x)+\left (b^2+2 a c\right ) \sin ^5(c+d x)+2 b c \sin ^6(c+d x)+c^2 \sin ^7(c+d x)\right ) \, dx\\ &=a^2 \int \sin ^3(c+d x) \, dx+(2 a b) \int \sin ^4(c+d x) \, dx+(2 b c) \int \sin ^6(c+d x) \, dx+c^2 \int \sin ^7(c+d x) \, dx+\left (b^2+2 a c\right ) \int \sin ^5(c+d x) \, dx\\ &=-\frac {a b \cos (c+d x) \sin ^3(c+d x)}{2 d}-\frac {b c \cos (c+d x) \sin ^5(c+d x)}{3 d}+\frac {1}{2} (3 a b) \int \sin ^2(c+d x) \, dx+\frac {1}{3} (5 b c) \int \sin ^4(c+d x) \, dx-\frac {a^2 \operatorname {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}-\frac {c^2 \operatorname {Subst}\left (\int \left (1-3 x^2+3 x^4-x^6\right ) \, dx,x,\cos (c+d x)\right )}{d}-\frac {\left (b^2+2 a c\right ) \operatorname {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {a^2 \cos (c+d x)}{d}-\frac {c^2 \cos (c+d x)}{d}-\frac {\left (b^2+2 a c\right ) \cos (c+d x)}{d}+\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {c^2 \cos ^3(c+d x)}{d}+\frac {2 \left (b^2+2 a c\right ) \cos ^3(c+d x)}{3 d}-\frac {3 c^2 \cos ^5(c+d x)}{5 d}-\frac {\left (b^2+2 a c\right ) \cos ^5(c+d x)}{5 d}+\frac {c^2 \cos ^7(c+d x)}{7 d}-\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}-\frac {a b \cos (c+d x) \sin ^3(c+d x)}{2 d}-\frac {5 b c \cos (c+d x) \sin ^3(c+d x)}{12 d}-\frac {b c \cos (c+d x) \sin ^5(c+d x)}{3 d}+\frac {1}{4} (3 a b) \int 1 \, dx+\frac {1}{4} (5 b c) \int \sin ^2(c+d x) \, dx\\ &=\frac {3 a b x}{4}-\frac {a^2 \cos (c+d x)}{d}-\frac {c^2 \cos (c+d x)}{d}-\frac {\left (b^2+2 a c\right ) \cos (c+d x)}{d}+\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {c^2 \cos ^3(c+d x)}{d}+\frac {2 \left (b^2+2 a c\right ) \cos ^3(c+d x)}{3 d}-\frac {3 c^2 \cos ^5(c+d x)}{5 d}-\frac {\left (b^2+2 a c\right ) \cos ^5(c+d x)}{5 d}+\frac {c^2 \cos ^7(c+d x)}{7 d}-\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}-\frac {5 b c \cos (c+d x) \sin (c+d x)}{8 d}-\frac {a b \cos (c+d x) \sin ^3(c+d x)}{2 d}-\frac {5 b c \cos (c+d x) \sin ^3(c+d x)}{12 d}-\frac {b c \cos (c+d x) \sin ^5(c+d x)}{3 d}+\frac {1}{8} (5 b c) \int 1 \, dx\\ &=\frac {3 a b x}{4}+\frac {5 b c x}{8}-\frac {a^2 \cos (c+d x)}{d}-\frac {c^2 \cos (c+d x)}{d}-\frac {\left (b^2+2 a c\right ) \cos (c+d x)}{d}+\frac {a^2 \cos ^3(c+d x)}{3 d}+\frac {c^2 \cos ^3(c+d x)}{d}+\frac {2 \left (b^2+2 a c\right ) \cos ^3(c+d x)}{3 d}-\frac {3 c^2 \cos ^5(c+d x)}{5 d}-\frac {\left (b^2+2 a c\right ) \cos ^5(c+d x)}{5 d}+\frac {c^2 \cos ^7(c+d x)}{7 d}-\frac {3 a b \cos (c+d x) \sin (c+d x)}{4 d}-\frac {5 b c \cos (c+d x) \sin (c+d x)}{8 d}-\frac {a b \cos (c+d x) \sin ^3(c+d x)}{2 d}-\frac {5 b c \cos (c+d x) \sin ^3(c+d x)}{12 d}-\frac {b c \cos (c+d x) \sin ^5(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.45, size = 167, normalized size = 0.58 \[ \frac {-105 \left (48 a^2+80 a c+40 b^2+35 c^2\right ) \cos (c+d x)+35 \left (16 a^2+40 a c+20 b^2+21 c^2\right ) \cos (3 (c+d x))-21 \left (c (8 a+7 c)+4 b^2\right ) \cos (5 (c+d x))+840 b (6 a+5 c) (c+d x)-210 b (16 a+15 c) \sin (2 (c+d x))+210 b (2 a+3 c) \sin (4 (c+d x))-70 b c \sin (6 (c+d x))+15 c^2 \cos (7 (c+d x))}{6720 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.96, size = 162, normalized size = 0.56 \[ \frac {120 \, c^{2} \cos \left (d x + c\right )^{7} - 168 \, {\left (b^{2} + 2 \, a c + 3 \, c^{2}\right )} \cos \left (d x + c\right )^{5} + 280 \, {\left (a^{2} + 2 \, b^{2} + 4 \, a c + 3 \, c^{2}\right )} \cos \left (d x + c\right )^{3} + 105 \, {\left (6 \, a b + 5 \, b c\right )} d x - 840 \, {\left (a^{2} + b^{2} + 2 \, a c + c^{2}\right )} \cos \left (d x + c\right ) - 35 \, {\left (8 \, b c \cos \left (d x + c\right )^{5} - 2 \, {\left (6 \, a b + 13 \, b c\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left (10 \, a b + 11 \, b c\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{840 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 186, normalized size = 0.65 \[ \frac {1}{8} \, {\left (6 \, a b + 5 \, b c\right )} x + \frac {c^{2} \cos \left (7 \, d x + 7 \, c\right )}{448 \, d} - \frac {b c \sin \left (6 \, d x + 6 \, c\right )}{96 \, d} - \frac {{\left (4 \, b^{2} + 8 \, a c + 7 \, c^{2}\right )} \cos \left (5 \, d x + 5 \, c\right )}{320 \, d} + \frac {{\left (16 \, a^{2} + 20 \, b^{2} + 40 \, a c + 21 \, c^{2}\right )} \cos \left (3 \, d x + 3 \, c\right )}{192 \, d} - \frac {{\left (48 \, a^{2} + 40 \, b^{2} + 80 \, a c + 35 \, c^{2}\right )} \cos \left (d x + c\right )}{64 \, d} + \frac {{\left (2 \, a b + 3 \, b c\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} - \frac {{\left (16 \, a b + 15 \, b c\right )} \sin \left (2 \, d x + 2 \, c\right )}{32 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.09, size = 213, normalized size = 0.74 \[ \frac {-\frac {c^{2} \left (\frac {16}{5}+\sin ^{6}\left (d x +c \right )+\frac {6 \left (\sin ^{4}\left (d x +c \right )\right )}{5}+\frac {8 \left (\sin ^{2}\left (d x +c \right )\right )}{5}\right ) \cos \left (d x +c \right )}{7}+2 c b \left (-\frac {\left (\sin ^{5}\left (d x +c \right )+\frac {5 \left (\sin ^{3}\left (d x +c \right )\right )}{4}+\frac {15 \sin \left (d x +c \right )}{8}\right ) \cos \left (d x +c \right )}{6}+\frac {5 d x}{16}+\frac {5 c}{16}\right )-\frac {2 a c \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}-\frac {b^{2} \left (\frac {8}{3}+\sin ^{4}\left (d x +c \right )+\frac {4 \left (\sin ^{2}\left (d x +c \right )\right )}{3}\right ) \cos \left (d x +c \right )}{5}+2 a b \left (-\frac {\left (\sin ^{3}\left (d x +c \right )+\frac {3 \sin \left (d x +c \right )}{2}\right ) \cos \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )-\frac {a^{2} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.40, size = 218, normalized size = 0.76 \[ \frac {1120 \, {\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} a^{2} + 210 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) - 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a b - 224 \, {\left (3 \, \cos \left (d x + c\right )^{5} - 10 \, \cos \left (d x + c\right )^{3} + 15 \, \cos \left (d x + c\right )\right )} b^{2} - 448 \, {\left (3 \, \cos \left (d x + c\right )^{5} - 10 \, \cos \left (d x + c\right )^{3} + 15 \, \cos \left (d x + c\right )\right )} a c + 35 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} + 60 \, d x + 60 \, c + 9 \, \sin \left (4 \, d x + 4 \, c\right ) - 48 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b c + 96 \, {\left (5 \, \cos \left (d x + c\right )^{7} - 21 \, \cos \left (d x + c\right )^{5} + 35 \, \cos \left (d x + c\right )^{3} - 35 \, \cos \left (d x + c\right )\right )} c^{2}}{3360 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 4.52, size = 456, normalized size = 1.58 \[ \frac {b\,\mathrm {atan}\left (\frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (6\,a+5\,c\right )}{4\,\left (\frac {3\,a\,b}{2}+\frac {5\,b\,c}{4}\right )}\right )\,\left (6\,a+5\,c\right )}{4\,d}-\frac {b\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,\left (6\,a+5\,c\right )}{4\,d}-\frac {\frac {32\,a\,c}{15}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}\,\left (\frac {3\,a\,b}{2}+\frac {5\,b\,c}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (10\,a\,b+\frac {25\,b\,c}{3}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}\,\left (10\,a\,b+\frac {25\,b\,c}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {31\,a\,b}{2}+\frac {283\,b\,c}{12}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9\,\left (\frac {31\,a\,b}{2}+\frac {283\,b\,c}{12}\right )+4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {52\,a^2}{3}+\frac {64\,c\,a}{3}+\frac {32\,b^2}{3}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {88\,a^2}{3}+\frac {160\,a\,c}{3}+\frac {80\,b^2}{3}+32\,c^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {28\,a^2}{3}+\frac {224\,a\,c}{15}+\frac {112\,b^2}{15}+\frac {32\,c^2}{5}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (24\,a^2+\frac {224\,a\,c}{5}+\frac {112\,b^2}{5}+\frac {96\,c^2}{5}\right )+\frac {4\,a^2}{3}+\frac {16\,b^2}{15}+\frac {32\,c^2}{35}+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {3\,a\,b}{2}+\frac {5\,b\,c}{4}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}+7\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}+21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+35\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+21\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+7\,{\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 [A] time = 6.81, size = 541, normalized size = 1.88 \[ \begin {cases} - \frac {a^{2} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 a^{2} \cos ^{3}{\left (c + d x \right )}}{3 d} + \frac {3 a b x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {3 a b x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a b x \cos ^{4}{\left (c + d x \right )}}{4} - \frac {5 a b \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {3 a b \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} - \frac {2 a c \sin ^{4}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {8 a c \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {16 a c \cos ^{5}{\left (c + d x \right )}}{15 d} - \frac {b^{2} \sin ^{4}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {4 b^{2} \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {8 b^{2} \cos ^{5}{\left (c + d x \right )}}{15 d} + \frac {5 b c x \sin ^{6}{\left (c + d x \right )}}{8} + \frac {15 b c x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{8} + \frac {15 b c x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{8} + \frac {5 b c x \cos ^{6}{\left (c + d x \right )}}{8} - \frac {11 b c \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {5 b c \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {5 b c \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{8 d} - \frac {c^{2} \sin ^{6}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 c^{2} \sin ^{4}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{d} - \frac {8 c^{2} \sin ^{2}{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{5 d} - \frac {16 c^{2} \cos ^{7}{\left (c + d x \right )}}{35 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\relax (c )} + b \sin ^{2}{\relax (c )} + c \sin ^{3}{\relax (c )}\right )^{2} \sin {\relax (c )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________