Optimal. Leaf size=81 \[ 2 x \left (3 a^2+b^2\right )-\frac {6 a^2 \cos (d+e x)}{e}+\frac {6 a b \sin (d+e x)}{e}-\frac {2 (a \sin (d+e x)+a+b \cos (d+e x)) (a \cos (d+e x)-b \sin (d+e x))}{e} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 81, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3120, 2637, 2638} \[ 2 x \left (3 a^2+b^2\right )-\frac {6 a^2 \cos (d+e x)}{e}+\frac {6 a b \sin (d+e x)}{e}-\frac {2 (a \sin (d+e x)+a+b \cos (d+e x)) (a \cos (d+e x)-b \sin (d+e x))}{e} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2637
Rule 2638
Rule 3120
Rubi steps
\begin {align*} \int (2 a+2 b \cos (d+e x)+2 a \sin (d+e x))^2 \, dx &=-\frac {2 (a+b \cos (d+e x)+a \sin (d+e x)) (a \cos (d+e x)-b \sin (d+e x))}{e}+\frac {1}{2} \int \left (4 \left (3 a^2+b^2\right )+12 a b \cos (d+e x)+12 a^2 \sin (d+e x)\right ) \, dx\\ &=2 \left (3 a^2+b^2\right ) x-\frac {2 (a+b \cos (d+e x)+a \sin (d+e x)) (a \cos (d+e x)-b \sin (d+e x))}{e}+\left (6 a^2\right ) \int \sin (d+e x) \, dx+(6 a b) \int \cos (d+e x) \, dx\\ &=2 \left (3 a^2+b^2\right ) x-\frac {6 a^2 \cos (d+e x)}{e}+\frac {6 a b \sin (d+e x)}{e}-\frac {2 (a+b \cos (d+e x)+a \sin (d+e x)) (a \cos (d+e x)-b \sin (d+e x))}{e}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.14, size = 92, normalized size = 1.14 \[ 4 \left (\frac {\left (3 a^2+b^2\right ) (d+e x)}{2 e}-\frac {\left (a^2-b^2\right ) \sin (2 (d+e x))}{4 e}-\frac {2 a^2 \cos (d+e x)}{e}+\frac {2 a b \sin (d+e x)}{e}-\frac {a b \cos (2 (d+e x))}{2 e}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.76, size = 72, normalized size = 0.89 \[ -\frac {2 \, {\left (2 \, a b \cos \left (e x + d\right )^{2} - {\left (3 \, a^{2} + b^{2}\right )} e x + 4 \, a^{2} \cos \left (e x + d\right ) - {\left (4 \, a b - {\left (a^{2} - b^{2}\right )} \cos \left (e x + d\right )\right )} \sin \left (e x + d\right )\right )}}{e} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.16, size = 79, normalized size = 0.98 \[ -2 \, a b \cos \left (2 \, x e + 2 \, d\right ) e^{\left (-1\right )} - 8 \, a^{2} \cos \left (x e + d\right ) e^{\left (-1\right )} + 8 \, a b e^{\left (-1\right )} \sin \left (x e + d\right ) - {\left (a^{2} - b^{2}\right )} e^{\left (-1\right )} \sin \left (2 \, x e + 2 \, d\right ) + 2 \, {\left (3 \, a^{2} + b^{2}\right )} x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.23, size = 101, normalized size = 1.25 \[ \frac {4 a^{2} \left (e x +d \right )+8 a b \sin \left (e x +d \right )-8 a^{2} \cos \left (e x +d \right )+4 b^{2} \left (\frac {\sin \left (e x +d \right ) \cos \left (e x +d \right )}{2}+\frac {e x}{2}+\frac {d}{2}\right )-4 \left (\cos ^{2}\left (e x +d \right )\right ) a b +4 a^{2} \left (-\frac {\sin \left (e x +d \right ) \cos \left (e x +d \right )}{2}+\frac {e x}{2}+\frac {d}{2}\right )}{e} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 99, normalized size = 1.22 \[ 4 \, a^{2} x - \frac {4 \, a b \cos \left (e x + d\right )^{2}}{e} + \frac {{\left (2 \, e x + 2 \, d - \sin \left (2 \, e x + 2 \, d\right )\right )} a^{2}}{e} + \frac {{\left (2 \, e x + 2 \, d + \sin \left (2 \, e x + 2 \, d\right )\right )} b^{2}}{e} - 8 \, a {\left (\frac {a \cos \left (e x + d\right )}{e} - \frac {b \sin \left (e x + d\right )}{e}\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.72, size = 127, normalized size = 1.57 \[ \frac {x\,\left (12\,a^2+4\,b^2\right )}{2}+\frac {{\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}^2\,\left (16\,a\,b-16\,a^2\right )+{\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}^3\,\left (4\,a^2+16\,a\,b-4\,b^2\right )-16\,a^2+\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )\,\left (-4\,a^2+16\,a\,b+4\,b^2\right )}{e\,\left ({\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}^4+2\,{\mathrm {tan}\left (\frac {d}{2}+\frac {e\,x}{2}\right )}^2+1\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.31, size = 170, normalized size = 2.10 \[ \begin {cases} 2 a^{2} x \sin ^{2}{\left (d + e x \right )} + 2 a^{2} x \cos ^{2}{\left (d + e x \right )} + 4 a^{2} x - \frac {2 a^{2} \sin {\left (d + e x \right )} \cos {\left (d + e x \right )}}{e} - \frac {8 a^{2} \cos {\left (d + e x \right )}}{e} + \frac {8 a b \sin {\left (d + e x \right )}}{e} - \frac {4 a b \cos ^{2}{\left (d + e x \right )}}{e} + 2 b^{2} x \sin ^{2}{\left (d + e x \right )} + 2 b^{2} x \cos ^{2}{\left (d + e x \right )} + \frac {2 b^{2} \sin {\left (d + e x \right )} \cos {\left (d + e x \right )}}{e} & \text {for}\: e \neq 0 \\x \left (2 a \sin {\relax (d )} + 2 a + 2 b \cos {\relax (d )}\right )^{2} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________