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.0342727, antiderivative size = 61, normalized size of antiderivative = 1., 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 2666
Rule 2644
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.157421, 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]
________________________________________________________________________________________
Maple [A] time = 0.049, size = 69, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ({b}^{2} \left ( -{\frac{\sin \left ( dx+c \right ) \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{4}}+{\frac{\sin \left ( dx+c \right ) \cos \left ( dx+c \right ) }{8}}+{\frac{dx}{8}}+{\frac{c}{8}} \right ) - \left ( \cos \left ( dx+c \right ) \right ) ^{2}ab+{a}^{2} \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.998978, size = 65, normalized size = 1.07 \begin{align*} 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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.41165, size = 146, normalized size = 2.39 \begin{align*} -\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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.15868, size = 129, normalized size = 2.11 \begin{align*} \begin{cases} a^{2} x + \frac{a b \sin ^{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{\left (c \right )} \cos{\left (c \right )}\right )^{2} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.13387, size = 62, normalized size = 1.02 \begin{align*} \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} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]