Optimal. Leaf size=120 \[ \frac {\left (a^2-2 b^2\right ) \sin (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{d}-\frac {a^2 \csc ^3(c+d x)}{3 d}+\frac {a b \sin ^2(c+d x)}{d}-\frac {a b \csc ^2(c+d x)}{d}-\frac {4 a b \log (\sin (c+d x))}{d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.14, antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {2837, 12, 948} \[ \frac {\left (a^2-2 b^2\right ) \sin (c+d x)}{d}+\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{d}-\frac {a^2 \csc ^3(c+d x)}{3 d}+\frac {a b \sin ^2(c+d x)}{d}-\frac {a b \csc ^2(c+d x)}{d}-\frac {4 a b \log (\sin (c+d x))}{d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 948
Rule 2837
Rubi steps
\begin {align*} \int \cos (c+d x) \cot ^4(c+d x) (a+b \sin (c+d x))^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {b^4 (a+x)^2 \left (b^2-x^2\right )^2}{x^4} \, dx,x,b \sin (c+d x)\right )}{b^5 d}\\ &=\frac {\operatorname {Subst}\left (\int \frac {(a+x)^2 \left (b^2-x^2\right )^2}{x^4} \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\operatorname {Subst}\left (\int \left (a^2 \left (1-\frac {2 b^2}{a^2}\right )+\frac {a^2 b^4}{x^4}+\frac {2 a b^4}{x^3}+\frac {-2 a^2 b^2+b^4}{x^2}-\frac {4 a b^2}{x}+2 a x+x^2\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\left (2 a^2-b^2\right ) \csc (c+d x)}{d}-\frac {a b \csc ^2(c+d x)}{d}-\frac {a^2 \csc ^3(c+d x)}{3 d}-\frac {4 a b \log (\sin (c+d x))}{d}+\frac {\left (a^2-2 b^2\right ) \sin (c+d x)}{d}+\frac {a b \sin ^2(c+d x)}{d}+\frac {b^2 \sin ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.28, size = 103, normalized size = 0.86 \[ \frac {3 \left (a^2-2 b^2\right ) \sin (c+d x)+\left (6 a^2-3 b^2\right ) \csc (c+d x)-a^2 \csc ^3(c+d x)+3 a b \sin ^2(c+d x)-3 a b \csc ^2(c+d x)-12 a b \log (\sin (c+d x))+b^2 \sin ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.99, size = 158, normalized size = 1.32 \[ \frac {2 \, b^{2} \cos \left (d x + c\right )^{6} - 6 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + 24 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 24 \, {\left (a b \cos \left (d x + c\right )^{2} - a b\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) \sin \left (d x + c\right ) - 16 \, a^{2} + 16 \, b^{2} - 3 \, {\left (2 \, a b \cos \left (d x + c\right )^{4} - 3 \, a b \cos \left (d x + c\right )^{2} - a b\right )} \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.28, size = 127, normalized size = 1.06 \[ \frac {b^{2} \sin \left (d x + c\right )^{3} + 3 \, a b \sin \left (d x + c\right )^{2} - 12 \, a b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right ) + 3 \, a^{2} \sin \left (d x + c\right ) - 6 \, b^{2} \sin \left (d x + c\right ) + \frac {22 \, a b \sin \left (d x + c\right )^{3} + 6 \, a^{2} \sin \left (d x + c\right )^{2} - 3 \, b^{2} \sin \left (d x + c\right )^{2} - 3 \, a b \sin \left (d x + c\right ) - a^{2}}{\sin \left (d x + c\right )^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.50, size = 255, normalized size = 2.12 \[ -\frac {a^{2} \left (\cos ^{6}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{3}}+\frac {a^{2} \left (\cos ^{6}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )}+\frac {8 a^{2} \sin \left (d x +c \right )}{3 d}+\frac {a^{2} \sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{d}+\frac {4 a^{2} \sin \left (d x +c \right ) \left (\cos ^{2}\left (d x +c \right )\right )}{3 d}-\frac {a b \left (\cos ^{6}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )^{2}}-\frac {a b \left (\cos ^{4}\left (d x +c \right )\right )}{d}-\frac {2 a b \left (\cos ^{2}\left (d x +c \right )\right )}{d}-\frac {4 a b \ln \left (\sin \left (d x +c \right )\right )}{d}-\frac {b^{2} \left (\cos ^{6}\left (d x +c \right )\right )}{d \sin \left (d x +c \right )}-\frac {8 b^{2} \sin \left (d x +c \right )}{3 d}-\frac {\sin \left (d x +c \right ) b^{2} \left (\cos ^{4}\left (d x +c \right )\right )}{d}-\frac {4 \sin \left (d x +c \right ) b^{2} \left (\cos ^{2}\left (d x +c \right )\right )}{3 d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.33, size = 103, normalized size = 0.86 \[ \frac {b^{2} \sin \left (d x + c\right )^{3} + 3 \, a b \sin \left (d x + c\right )^{2} - 12 \, a b \log \left (\sin \left (d x + c\right )\right ) + 3 \, {\left (a^{2} - 2 \, b^{2}\right )} \sin \left (d x + c\right ) - \frac {3 \, a b \sin \left (d x + c\right ) - 3 \, {\left (2 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{2} + a^{2}}{\sin \left (d x + c\right )^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.71, size = 315, normalized size = 2.62 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (6\,a^2-4\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (23\,a^2-36\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (36\,a^2-44\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {158\,a^2}{3}-\frac {164\,b^2}{3}\right )-\frac {a^2}{3}-6\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+26\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+30\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-2\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+24\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}-\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {7\,a^2}{8}-\frac {b^2}{2}\right )}{d}-\frac {a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,d}-\frac {4\,a\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}+\frac {4\,a\,b\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________