Optimal. Leaf size=238 \[ \frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {2 b^4 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^6 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}-\frac {b \left (a^4+4 a^2 b^2-8 b^4\right ) \tanh ^{-1}(\cos (c+d x))}{8 a^6 d}+\frac {\left (2 a^4+5 a^2 b^2-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 1.23, antiderivative size = 238, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2889, 3056, 3055, 3001, 3770, 2660, 618, 204} \[ -\frac {2 b^4 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{a^6 d}+\frac {\left (5 a^2 b^2+2 a^4-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {b \left (4 a^2 b^2+a^4-8 b^4\right ) \tanh ^{-1}(\cos (c+d x))}{8 a^6 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 618
Rule 2660
Rule 2889
Rule 3001
Rule 3055
Rule 3056
Rule 3770
Rubi steps
\begin {align*} \int \frac {\cot ^2(c+d x) \csc ^4(c+d x)}{a+b \sin (c+d x)} \, dx &=\int \frac {\csc ^6(c+d x) \left (1-\sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx\\ &=-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}+\frac {\int \frac {\csc ^5(c+d x) \left (-5 b-a \sin (c+d x)+4 b \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{5 a}\\ &=\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}+\frac {\int \frac {\csc ^4(c+d x) \left (-4 \left (a^2-5 b^2\right )+a b \sin (c+d x)-15 b^2 \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{20 a^2}\\ &=\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}+\frac {\int \frac {\csc ^3(c+d x) \left (15 b \left (a^2-4 b^2\right )-a \left (8 a^2+5 b^2\right ) \sin (c+d x)-8 b \left (a^2-5 b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{60 a^3}\\ &=-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}+\frac {\int \frac {\csc ^2(c+d x) \left (-8 \left (2 a^4+5 a^2 b^2-15 b^4\right )-a b \left (a^2-20 b^2\right ) \sin (c+d x)+15 b^2 \left (a^2-4 b^2\right ) \sin ^2(c+d x)\right )}{a+b \sin (c+d x)} \, dx}{120 a^4}\\ &=\frac {\left (2 a^4+5 a^2 b^2-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}+\frac {\int \frac {\csc (c+d x) \left (15 b \left (a^4+4 a^2 b^2-8 b^4\right )+15 a b^2 \left (a^2-4 b^2\right ) \sin (c+d x)\right )}{a+b \sin (c+d x)} \, dx}{120 a^5}\\ &=\frac {\left (2 a^4+5 a^2 b^2-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}-\frac {\left (b^4 \left (a^2-b^2\right )\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{a^6}+\frac {\left (b \left (a^4+4 a^2 b^2-8 b^4\right )\right ) \int \csc (c+d x) \, dx}{8 a^6}\\ &=-\frac {b \left (a^4+4 a^2 b^2-8 b^4\right ) \tanh ^{-1}(\cos (c+d x))}{8 a^6 d}+\frac {\left (2 a^4+5 a^2 b^2-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}-\frac {\left (2 b^4 \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^6 d}\\ &=-\frac {b \left (a^4+4 a^2 b^2-8 b^4\right ) \tanh ^{-1}(\cos (c+d x))}{8 a^6 d}+\frac {\left (2 a^4+5 a^2 b^2-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}+\frac {\left (4 b^4 \left (a^2-b^2\right )\right ) \operatorname {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^6 d}\\ &=-\frac {2 b^4 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{a^6 d}-\frac {b \left (a^4+4 a^2 b^2-8 b^4\right ) \tanh ^{-1}(\cos (c+d x))}{8 a^6 d}+\frac {\left (2 a^4+5 a^2 b^2-15 b^4\right ) \cot (c+d x)}{15 a^5 d}-\frac {b \left (a^2-4 b^2\right ) \cot (c+d x) \csc (c+d x)}{8 a^4 d}+\frac {\left (a^2-5 b^2\right ) \cot (c+d x) \csc ^2(c+d x)}{15 a^3 d}+\frac {b \cot (c+d x) \csc ^3(c+d x)}{4 a^2 d}-\frac {\cot (c+d x) \csc ^4(c+d x)}{5 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.85, size = 506, normalized size = 2.13 \[ \frac {-64 a^5 \tan \left (\frac {1}{2} (c+d x)\right )-3 a^5 \sin (c+d x) \csc ^6\left (\frac {1}{2} (c+d x)\right )+a^5 \sin (c+d x) \csc ^4\left (\frac {1}{2} (c+d x)\right )-16 a^5 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+6 a^5 \tan \left (\frac {1}{2} (c+d x)\right ) \sec ^4\left (\frac {1}{2} (c+d x)\right )+15 a^4 b \csc ^4\left (\frac {1}{2} (c+d x)\right )-30 a^4 b \csc ^2\left (\frac {1}{2} (c+d x)\right )-15 a^4 b \sec ^4\left (\frac {1}{2} (c+d x)\right )+30 a^4 b \sec ^2\left (\frac {1}{2} (c+d x)\right )+120 a^4 b \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-120 a^4 b \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-160 a^3 b^2 \tan \left (\frac {1}{2} (c+d x)\right )-20 a^3 b^2 \sin (c+d x) \csc ^4\left (\frac {1}{2} (c+d x)\right )+320 a^3 b^2 \sin ^4\left (\frac {1}{2} (c+d x)\right ) \csc ^3(c+d x)+120 a^2 b^3 \csc ^2\left (\frac {1}{2} (c+d x)\right )-120 a^2 b^3 \sec ^2\left (\frac {1}{2} (c+d x)\right )+480 a^2 b^3 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )-480 a^2 b^3 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-1920 b^4 \sqrt {a^2-b^2} \tan ^{-1}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )+32 \left (2 a^5+5 a^3 b^2-15 a b^4\right ) \cot \left (\frac {1}{2} (c+d x)\right )+480 a b^4 \tan \left (\frac {1}{2} (c+d x)\right )-960 b^5 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+960 b^5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{960 a^6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.95, size = 959, normalized size = 4.03 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.20, size = 444, normalized size = 1.87 \[ \frac {\frac {6 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 15 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 10 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 120 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 60 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 120 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 480 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{5}} + \frac {120 \, {\left (a^{4} b + 4 \, a^{2} b^{3} - 8 \, b^{5}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a^{6}} - \frac {1920 \, {\left (a^{2} b^{4} - b^{6}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (a) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{6}} - \frac {274 \, a^{4} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 1096 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 2192 \, b^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 60 \, a^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 480 \, a b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 120 \, a^{2} b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 10 \, a^{5} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 40 \, a^{3} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 15 \, a^{4} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 6 \, a^{5}}{a^{6} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5}}}{960 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.50, size = 439, normalized size = 1.84 \[ \frac {\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )}{160 d a}-\frac {\left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b}{64 d \,a^{2}}+\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{96 d a}+\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{2}}{24 d \,a^{3}}-\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b^{3}}{8 d \,a^{4}}-\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{16 a d}-\frac {b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d \,a^{3}}+\frac {b^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d \,a^{5}}-\frac {1}{160 d a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}-\frac {1}{96 d a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}-\frac {b^{2}}{24 d \,a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}+\frac {1}{16 a d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {b^{2}}{8 d \,a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-\frac {b^{4}}{2 d \,a^{5} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {b}{64 d \,a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}+\frac {b^{3}}{8 d \,a^{4} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d \,a^{2}}+\frac {b^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{4}}-\frac {b^{5} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,a^{6}}-\frac {2 \sqrt {a^{2}-b^{2}}\, b^{4} \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{d \,a^{6}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.08, size = 1007, normalized size = 4.23 \[ \text {result too large to display} \]
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]
________________________________________________________________________________________