Optimal. Leaf size=55 \[ \frac {1}{2} x \left (a^2+b^2\right )-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.02, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3073, 8} \[ \frac {1}{2} x \left (a^2+b^2\right )-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3073
Rubi steps
\begin {align*} \int (a \cos (c+d x)+b \sin (c+d x))^2 \, dx &=-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{2 d}+\frac {1}{2} \left (a^2+b^2\right ) \int 1 \, dx\\ &=\frac {1}{2} \left (a^2+b^2\right ) x-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.10, size = 52, normalized size = 0.95 \[ \frac {2 \left (a^2+b^2\right ) (c+d x)+\left (a^2-b^2\right ) \sin (2 (c+d x))-2 a b \cos (2 (c+d x))}{4 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.61, size = 52, normalized size = 0.95 \[ -\frac {2 \, a b \cos \left (d x + c\right )^{2} - {\left (a^{2} + b^{2}\right )} d x - {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 3.73, size = 50, normalized size = 0.91 \[ \frac {1}{2} \, {\left (a^{2} + b^{2}\right )} x - \frac {a b \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {{\left (a^{2} - b^{2}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 1.19, size = 70, normalized size = 1.27 \[ \frac {b^{2} \left (-\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\left (\cos ^{2}\left (d x +c \right )\right ) a b +a^{2} \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 = 0.32, size = 68, normalized size = 1.24 \[ -\frac {a b \cos \left (d x + c\right )^{2}}{d} + \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{2}}{4 \, d} + \frac {{\left (2 \, d x + 2 \, c - \sin \left (2 \, d x + 2 \, c\right )\right )} b^{2}}{4 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.48, size = 63, normalized size = 1.15 \[ \frac {a^2\,x}{2}+\frac {b^2\,x}{2}+\frac {a^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}-\frac {b^2\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}-\frac {a\,b\,\cos \left (2\,c+2\,d\,x\right )}{2\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.27, size = 128, normalized size = 2.33 \[ \begin {cases} \frac {a^{2} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {a^{2} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} - \frac {a b \cos ^{2}{\left (c + d x \right )}}{d} + \frac {b^{2} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {b^{2} x \cos ^{2}{\left (c + d x \right )}}{2} - \frac {b^{2} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\relax (c )} + b \sin {\relax (c )}\right )^{2} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________