Optimal. Leaf size=61 \[ \frac {1}{8} x \left (8 a^2+b^2\right )-\frac {a b \cos (2 c+2 d x)}{2 d}-\frac {b^2 \sin (2 c+2 d x) \cos (2 c+2 d x)}{16 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.03, antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2666, 2644} \[ \frac {1}{8} x \left (8 a^2+b^2\right )-\frac {a b \cos (2 c+2 d x)}{2 d}-\frac {b^2 \sin (2 c+2 d x) \cos (2 c+2 d x)}{16 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2644
Rule 2666
Rubi steps
\begin {align*} \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx &=\int \left (a+\frac {1}{2} b \sin (2 c+2 d x)\right )^2 \, dx\\ &=\frac {1}{8} \left (8 a^2+b^2\right ) x-\frac {a b \cos (2 c+2 d x)}{2 d}-\frac {b^2 \cos (2 c+2 d x) \sin (2 c+2 d x)}{16 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.15, size = 48, normalized size = 0.79 \[ -\frac {-4 \left (8 a^2+b^2\right ) (c+d x)+16 a b \cos (2 (c+d x))+b^2 \sin (4 (c+d x))}{32 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 2.40, size = 63, normalized size = 1.03 \[ -\frac {8 \, a b \cos \left (d x + c\right )^{2} - {\left (8 \, a^{2} + b^{2}\right )} d x + {\left (2 \, b^{2} \cos \left (d x + c\right )^{3} - b^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 46, normalized size = 0.75 \[ \frac {1}{8} \, {\left (8 \, a^{2} + b^{2}\right )} x - \frac {a b \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} - \frac {b^{2} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.24, size = 69, normalized size = 1.13 \[ \frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{3}\left (d x +c \right )\right )}{4}+\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\left (\cos ^{2}\left (d x +c \right )\right ) a b +a^{2} \left (d x +c \right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 48, normalized size = 0.79 \[ a^{2} x - \frac {a b \cos \left (d x + c\right )^{2}}{d} + \frac {{\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} b^{2}}{32 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.03, size = 78, normalized size = 1.28 \[ x\,\left (a^2+\frac {b^2}{8}\right )-\frac {-\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{8}+\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{8}+a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2+a\,b}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.95, size = 129, normalized size = 2.11 \[ \begin {cases} a^{2} x - \frac {a b \cos ^{2}{\left (c + d x \right )}}{d} + \frac {b^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {b^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\relax (c )} \cos {\relax (c )}\right )^{2} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________