Optimal. Leaf size=108 \[ -\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}+\frac {3}{8} x \left (a^2+b^2\right )^2-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.04, antiderivative size = 108, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3073, 8} \[ -\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}+\frac {3}{8} x \left (a^2+b^2\right )^2-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 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))^4 \, dx &=-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}+\frac {1}{4} \left (3 \left (a^2+b^2\right )\right ) \int (a \cos (c+d x)+b \sin (c+d x))^2 \, dx\\ &=-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}+\frac {1}{8} \left (3 \left (a^2+b^2\right )^2\right ) \int 1 \, dx\\ &=\frac {3}{8} \left (a^2+b^2\right )^2 x-\frac {3 \left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))}{8 d}-\frac {(b \cos (c+d x)-a \sin (c+d x)) (a \cos (c+d x)+b \sin (c+d x))^3}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.43, size = 107, normalized size = 0.99 \[ \frac {8 \left (a^4-b^4\right ) \sin (2 (c+d x))+12 \left (a^2+b^2\right )^2 (c+d x)-16 a b \left (a^2+b^2\right ) \cos (2 (c+d x))-4 a b \left (a^2-b^2\right ) \cos (4 (c+d x))+\left (a^4-6 a^2 b^2+b^4\right ) \sin (4 (c+d x))}{32 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.93, size = 121, normalized size = 1.12 \[ -\frac {16 \, a b^{3} \cos \left (d x + c\right )^{2} + 8 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{4} - 3 \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d x - {\left (2 \, {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{3} + {\left (3 \, a^{4} + 6 \, a^{2} b^{2} - 5 \, b^{4}\right )} \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 = 2.92, size = 122, normalized size = 1.13 \[ \frac {3}{8} \, {\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} x - \frac {{\left (a^{3} b - a b^{3}\right )} \cos \left (4 \, d x + 4 \, c\right )}{8 \, d} - \frac {{\left (a^{3} b + a b^{3}\right )} \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} + \frac {{\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {{\left (a^{4} - b^{4}\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 = 30.89, size = 153, normalized size = 1.42 \[ \frac {b^{4} \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 )+a \,b^{3} \left (\sin ^{4}\left (d x +c \right )\right )+6 a^{2} b^{2} \left (-\frac {\left (\cos ^{3}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )-\left (\cos ^{4}\left (d x +c \right )\right ) a^{3} b +a^{4} \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 136, normalized size = 1.26 \[ -\frac {a^{3} b \cos \left (d x + c\right )^{4}}{d} + \frac {a b^{3} \sin \left (d x + c\right )^{4}}{d} + \frac {{\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^{4}}{32 \, d} + \frac {3 \, {\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} a^{2} b^{2}}{16 \, d} + \frac {{\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) - 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} b^{4}}{32 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.96, size = 320, normalized size = 2.96 \[ \frac {3\,\mathrm {atan}\left (\frac {3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,\left (\frac {3\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )}\right )\,{\left (a^2+b^2\right )}^2}{4\,d}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (\frac {3\,a^4}{4}-\frac {21\,a^2\,b^2}{2}+\frac {11\,b^4}{4}\right )-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (-\frac {5\,a^4}{4}+\frac {3\,a^2\,b^2}{2}+\frac {3\,b^4}{4}\right )+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+16\,a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {3\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )\,{\left (a^2+b^2\right )}^2}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.22, size = 381, normalized size = 3.53 \[ \begin {cases} \frac {3 a^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 a^{4} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {3 a^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {5 a^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} - \frac {a^{3} b \cos ^{4}{\left (c + d x \right )}}{d} + \frac {3 a^{2} b^{2} x \sin ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{2} + \frac {3 a^{2} b^{2} x \cos ^{4}{\left (c + d x \right )}}{4} + \frac {3 a^{2} b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{4 d} - \frac {3 a^{2} b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{4 d} + \frac {a b^{3} \sin ^{4}{\left (c + d x \right )}}{d} + \frac {3 b^{4} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {3 b^{4} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {3 b^{4} x \cos ^{4}{\left (c + d x \right )}}{8} - \frac {5 b^{4} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {3 b^{4} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\relax (c )} + b \sin {\relax (c )}\right )^{4} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________