Optimal. Leaf size=147 \[ \frac {b \csc ^2(c+d x)}{a^3 d}-\frac {\csc ^3(c+d x)}{3 a^2 d}+\frac {4 b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^5 d}-\frac {4 b \left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a^5 d}-\frac {\left (a^2-b^2\right )^2}{a^4 b d (a+b \sin (c+d x))}+\frac {\left (2 a^2-3 b^2\right ) \csc (c+d x)}{a^4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.21, antiderivative size = 147, 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, 894} \[ -\frac {\left (a^2-b^2\right )^2}{a^4 b d (a+b \sin (c+d x))}+\frac {\left (2 a^2-3 b^2\right ) \csc (c+d x)}{a^4 d}+\frac {4 b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^5 d}-\frac {4 b \left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a^5 d}+\frac {b \csc ^2(c+d x)}{a^3 d}-\frac {\csc ^3(c+d x)}{3 a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 894
Rule 2837
Rubi steps
\begin {align*} \int \frac {\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 \left (b^2-x^2\right )^2}{x^4 (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^5 d}\\ &=\frac {\operatorname {Subst}\left (\int \frac {\left (b^2-x^2\right )^2}{x^4 (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\operatorname {Subst}\left (\int \left (\frac {b^4}{a^2 x^4}-\frac {2 b^4}{a^3 x^3}+\frac {-2 a^2 b^2+3 b^4}{a^4 x^2}+\frac {4 b^2 \left (a^2-b^2\right )}{a^5 x}+\frac {\left (a^2-b^2\right )^2}{a^4 (a+x)^2}+\frac {4 b^2 \left (-a^2+b^2\right )}{a^5 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b d}\\ &=\frac {\left (2 a^2-3 b^2\right ) \csc (c+d x)}{a^4 d}+\frac {b \csc ^2(c+d x)}{a^3 d}-\frac {\csc ^3(c+d x)}{3 a^2 d}+\frac {4 b \left (a^2-b^2\right ) \log (\sin (c+d x))}{a^5 d}-\frac {4 b \left (a^2-b^2\right ) \log (a+b \sin (c+d x))}{a^5 d}-\frac {\left (a^2-b^2\right )^2}{a^4 b d (a+b \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.90, size = 127, normalized size = 0.86 \[ \frac {-a^3 \csc ^3(c+d x)-\frac {3 a \left (a^2-b^2\right )^2}{b (a+b \sin (c+d x))}+3 a \left (2 a^2-3 b^2\right ) \csc (c+d x)+3 a^2 b \csc ^2(c+d x)+12 b (a-b) (a+b) \log (\sin (c+d x))-12 b (a-b) (a+b) \log (a+b \sin (c+d x))}{3 a^5 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.85, size = 401, normalized size = 2.73 \[ \frac {5 \, a^{4} b - 6 \, a^{2} b^{3} - 6 \, {\left (a^{4} b - a^{2} b^{3}\right )} \cos \left (d x + c\right )^{2} - 12 \, {\left (a^{2} b^{3} - b^{5} + {\left (a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{3} b^{2} - a b^{4} - {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) + 12 \, {\left (a^{2} b^{3} - b^{5} + {\left (a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (a^{2} b^{3} - b^{5}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{3} b^{2} - a b^{4} - {\left (a^{3} b^{2} - a b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) - {\left (3 \, a^{5} - 14 \, a^{3} b^{2} + 12 \, a b^{4} - 3 \, {\left (a^{5} - 4 \, a^{3} b^{2} + 4 \, a b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{5} b^{2} d \cos \left (d x + c\right )^{4} - 2 \, a^{5} b^{2} d \cos \left (d x + c\right )^{2} + a^{5} b^{2} d - {\left (a^{6} b d \cos \left (d x + c\right )^{2} - a^{6} b d\right )} \sin \left (d x + c\right )\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.25, size = 211, normalized size = 1.44 \[ \frac {\frac {12 \, {\left (a^{2} b - b^{3}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{5}} - \frac {12 \, {\left (a^{2} b^{2} - b^{4}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{5} b} + \frac {3 \, {\left (4 \, a^{2} b^{3} \sin \left (d x + c\right ) - 4 \, b^{5} \sin \left (d x + c\right ) - a^{5} + 6 \, a^{3} b^{2} - 5 \, a b^{4}\right )}}{{\left (b \sin \left (d x + c\right ) + a\right )} a^{5} b} - \frac {22 \, a^{2} b \sin \left (d x + c\right )^{3} - 22 \, b^{3} \sin \left (d x + c\right )^{3} - 6 \, a^{3} \sin \left (d x + c\right )^{2} + 9 \, a b^{2} \sin \left (d x + c\right )^{2} - 3 \, a^{2} b \sin \left (d x + c\right ) + a^{3}}{a^{5} \sin \left (d x + c\right )^{3}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.84, size = 209, normalized size = 1.42 \[ -\frac {1}{b d \left (a +b \sin \left (d x +c \right )\right )}+\frac {2 b}{d \,a^{2} \left (a +b \sin \left (d x +c \right )\right )}-\frac {b^{3}}{d \,a^{4} \left (a +b \sin \left (d x +c \right )\right )}-\frac {4 b \ln \left (a +b \sin \left (d x +c \right )\right )}{d \,a^{3}}+\frac {4 b^{3} \ln \left (a +b \sin \left (d x +c \right )\right )}{d \,a^{5}}-\frac {1}{3 d \,a^{2} \sin \left (d x +c \right )^{3}}+\frac {2}{d \,a^{2} \sin \left (d x +c \right )}-\frac {3 b^{2}}{d \,a^{4} \sin \left (d x +c \right )}+\frac {b}{d \,a^{3} \sin \left (d x +c \right )^{2}}+\frac {4 b \ln \left (\sin \left (d x +c \right )\right )}{a^{3} d}-\frac {4 b^{3} \ln \left (\sin \left (d x +c \right )\right )}{d \,a^{5}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.32, size = 158, normalized size = 1.07 \[ \frac {\frac {2 \, a^{2} b^{2} \sin \left (d x + c\right ) - a^{3} b - 3 \, {\left (a^{4} - 4 \, a^{2} b^{2} + 4 \, b^{4}\right )} \sin \left (d x + c\right )^{3} + 6 \, {\left (a^{3} b - a b^{3}\right )} \sin \left (d x + c\right )^{2}}{a^{4} b^{2} \sin \left (d x + c\right )^{4} + a^{5} b \sin \left (d x + c\right )^{3}} - \frac {12 \, {\left (a^{2} b - b^{3}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{5}} + \frac {12 \, {\left (a^{2} b - b^{3}\right )} \log \left (\sin \left (d x + c\right )\right )}{a^{5}}}{3 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 11.72, size = 319, normalized size = 2.17 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (16\,a^2\,b-24\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (8\,a\,b^2-\frac {20\,a^3}{3}\right )-\frac {a^3}{3}+\frac {4\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (23\,a^4-44\,a^2\,b^2+16\,b^4\right )}{a}}{d\,\left (8\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+8\,a^5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+16\,b\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{24\,a^2\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (\frac {\frac {a^2}{4}+\frac {b^2}{2}}{a^4}+\frac {5}{8\,a^2}-\frac {2\,b^2}{a^4}\right )}{d}+\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (4\,a^2\,b-4\,b^3\right )}{a^5\,d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{4\,a^3\,d}-\frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (4\,a^2\,b-4\,b^3\right )}{a^5\,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]
________________________________________________________________________________________