Integrand size = 11, antiderivative size = 152 \[ \int (a \cot (x)+b \csc (x))^5 \, dx=\frac {1}{8} a^2 b \left (7 a^2-3 b^2\right ) \cos (x)+\frac {1}{8} (b+a \cos (x))^2 \left (2 a \left (2 a^2-b^2\right )+b \left (5 a^2-3 b^2\right ) \cos (x)\right ) \csc ^2(x)-\frac {1}{4} (b+a \cos (x))^4 (a+b \cos (x)) \csc ^4(x)+\frac {1}{16} (a+b)^3 \left (8 a^2-9 a b+3 b^2\right ) \log (1-\cos (x))+\frac {1}{16} (a-b)^3 \left (8 a^2+9 a b+3 b^2\right ) \log (1+\cos (x)) \]
[Out]
Time = 0.24 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.636, Rules used = {4477, 2747, 753, 833, 788, 647, 31} \[ \int (a \cot (x)+b \csc (x))^5 \, dx=\frac {1}{8} a^2 b \left (7 a^2-3 b^2\right ) \cos (x)+\frac {1}{16} (a+b)^3 \left (8 a^2-9 a b+3 b^2\right ) \log (1-\cos (x))+\frac {1}{16} (a-b)^3 \left (8 a^2+9 a b+3 b^2\right ) \log (\cos (x)+1)+\frac {1}{8} \csc ^2(x) (a \cos (x)+b)^2 \left (b \left (5 a^2-3 b^2\right ) \cos (x)+2 a \left (2 a^2-b^2\right )\right )-\frac {1}{4} \csc ^4(x) (a \cos (x)+b)^4 (a+b \cos (x)) \]
[In]
[Out]
Rule 31
Rule 647
Rule 753
Rule 788
Rule 833
Rule 2747
Rule 4477
Rubi steps \begin{align*} \text {integral}& = \int (b+a \cos (x))^5 \csc ^5(x) \, dx \\ & = -\left (a^5 \text {Subst}\left (\int \frac {(b+x)^5}{\left (a^2-x^2\right )^3} \, dx,x,a \cos (x)\right )\right ) \\ & = -\frac {1}{4} (b+a \cos (x))^4 (a+b \cos (x)) \csc ^4(x)+\frac {1}{4} a^3 \text {Subst}\left (\int \frac {(b+x)^3 \left (4 a^2-3 b^2+b x\right )}{\left (a^2-x^2\right )^2} \, dx,x,a \cos (x)\right ) \\ & = \frac {1}{8} (b+a \cos (x))^2 \left (2 a \left (2 a^2-b^2\right )+b \left (5 a^2-3 b^2\right ) \cos (x)\right ) \csc ^2(x)-\frac {1}{4} (b+a \cos (x))^4 (a+b \cos (x)) \csc ^4(x)-\frac {1}{8} a \text {Subst}\left (\int \frac {(b+x) \left (8 a^4-7 a^2 b^2+3 b^4+b \left (7 a^2-3 b^2\right ) x\right )}{a^2-x^2} \, dx,x,a \cos (x)\right ) \\ & = \frac {1}{8} a^2 b \left (7 a^2-3 b^2\right ) \cos (x)+\frac {1}{8} (b+a \cos (x))^2 \left (2 a \left (2 a^2-b^2\right )+b \left (5 a^2-3 b^2\right ) \cos (x)\right ) \csc ^2(x)-\frac {1}{4} (b+a \cos (x))^4 (a+b \cos (x)) \csc ^4(x)+\frac {1}{8} a \text {Subst}\left (\int \frac {-a^2 b \left (7 a^2-3 b^2\right )-b \left (8 a^4-7 a^2 b^2+3 b^4\right )-\left (8 a^4-7 a^2 b^2+3 b^4+b^2 \left (7 a^2-3 b^2\right )\right ) x}{a^2-x^2} \, dx,x,a \cos (x)\right ) \\ & = \frac {1}{8} a^2 b \left (7 a^2-3 b^2\right ) \cos (x)+\frac {1}{8} (b+a \cos (x))^2 \left (2 a \left (2 a^2-b^2\right )+b \left (5 a^2-3 b^2\right ) \cos (x)\right ) \csc ^2(x)-\frac {1}{4} (b+a \cos (x))^4 (a+b \cos (x)) \csc ^4(x)-\frac {1}{16} \left ((a+b)^3 \left (8 a^2-9 a b+3 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a-x} \, dx,x,a \cos (x)\right )-\frac {1}{16} \left ((a-b)^3 \left (8 a^2+9 a b+3 b^2\right )\right ) \text {Subst}\left (\int \frac {1}{-a-x} \, dx,x,a \cos (x)\right ) \\ & = \frac {1}{8} a^2 b \left (7 a^2-3 b^2\right ) \cos (x)+\frac {1}{8} (b+a \cos (x))^2 \left (2 a \left (2 a^2-b^2\right )+b \left (5 a^2-3 b^2\right ) \cos (x)\right ) \csc ^2(x)-\frac {1}{4} (b+a \cos (x))^4 (a+b \cos (x)) \csc ^4(x)+\frac {1}{16} (a+b)^3 \left (8 a^2-9 a b+3 b^2\right ) \log (1-\cos (x))+\frac {1}{16} (a-b)^3 \left (8 a^2+9 a b+3 b^2\right ) \log (1+\cos (x)) \\ \end{align*}
Time = 0.60 (sec) , antiderivative size = 143, normalized size of antiderivative = 0.94 \[ \int (a \cot (x)+b \csc (x))^5 \, dx=\frac {1}{64} \left (2 (7 a-3 b) (a+b)^4 \csc ^2\left (\frac {x}{2}\right )-(a+b)^5 \csc ^4\left (\frac {x}{2}\right )+8 (a-b)^3 \left (8 a^2+9 a b+3 b^2\right ) \log \left (\cos \left (\frac {x}{2}\right )\right )+8 (a+b)^3 \left (8 a^2-9 a b+3 b^2\right ) \log \left (\sin \left (\frac {x}{2}\right )\right )+2 (a-b)^4 (7 a+3 b) \sec ^2\left (\frac {x}{2}\right )-(a-b)^5 \sec ^4\left (\frac {x}{2}\right )\right ) \]
[In]
[Out]
Time = 30.27 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.10
method | result | size |
default | \(b^{5} \left (\left (-\frac {\csc \left (x \right )^{3}}{4}-\frac {3 \csc \left (x \right )}{8}\right ) \cot \left (x \right )+\frac {3 \ln \left (\csc \left (x \right )-\cot \left (x \right )\right )}{8}\right )-\frac {5 a \,b^{4}}{4 \sin \left (x \right )^{4}}+10 a^{2} b^{3} \left (-\frac {\cos \left (x \right )^{3}}{4 \sin \left (x \right )^{4}}-\frac {\cos \left (x \right )^{3}}{8 \sin \left (x \right )^{2}}-\frac {\cos \left (x \right )}{8}-\frac {\ln \left (\csc \left (x \right )-\cot \left (x \right )\right )}{8}\right )-\frac {5 a^{3} b^{2} \cos \left (x \right )^{4}}{2 \sin \left (x \right )^{4}}+5 a^{4} b \left (-\frac {\cos \left (x \right )^{5}}{4 \sin \left (x \right )^{4}}+\frac {\cos \left (x \right )^{5}}{8 \sin \left (x \right )^{2}}+\frac {\cos \left (x \right )^{3}}{8}+\frac {3 \cos \left (x \right )}{8}+\frac {3 \ln \left (\csc \left (x \right )-\cot \left (x \right )\right )}{8}\right )+a^{5} \left (-\frac {\cot \left (x \right )^{4}}{4}+\frac {\cot \left (x \right )^{2}}{2}+\ln \left (\sin \left (x \right )\right )\right )\) | \(167\) |
parts | \(a^{5} \left (-\frac {\cot \left (x \right )^{4}}{4}+\frac {\cot \left (x \right )^{2}}{2}-\frac {\ln \left (1+\cot \left (x \right )^{2}\right )}{2}\right )+b^{5} \left (\left (-\frac {\csc \left (x \right )^{3}}{4}-\frac {3 \csc \left (x \right )}{8}\right ) \cot \left (x \right )+\frac {3 \ln \left (\csc \left (x \right )-\cot \left (x \right )\right )}{8}\right )+5 a^{4} b \left (-\frac {\cos \left (x \right )^{5}}{4 \sin \left (x \right )^{4}}+\frac {\cos \left (x \right )^{5}}{8 \sin \left (x \right )^{2}}+\frac {\cos \left (x \right )^{3}}{8}+\frac {3 \cos \left (x \right )}{8}+\frac {3 \ln \left (\csc \left (x \right )-\cot \left (x \right )\right )}{8}\right )-\frac {5 a^{3} b^{2} \cot \left (x \right )^{4}}{2}+10 a^{2} b^{3} \left (-\frac {\cos \left (x \right )^{3}}{4 \sin \left (x \right )^{4}}-\frac {\cos \left (x \right )^{3}}{8 \sin \left (x \right )^{2}}-\frac {\cos \left (x \right )}{8}-\frac {\ln \left (\csc \left (x \right )-\cot \left (x \right )\right )}{8}\right )-\frac {5 b^{4} \csc \left (x \right )^{4} a}{4}\) | \(169\) |
risch | \(-i a^{5} x -\frac {{\mathrm e}^{i x} \left (25 a^{4} b \,{\mathrm e}^{6 i x}+10 a^{2} b^{3} {\mathrm e}^{6 i x}-3 b^{5} {\mathrm e}^{6 i x}+16 a^{5} {\mathrm e}^{5 i x}+80 b^{2} a^{3} {\mathrm e}^{5 i x}+15 a^{4} b \,{\mathrm e}^{4 i x}+70 a^{2} b^{3} {\mathrm e}^{4 i x}+11 b^{5} {\mathrm e}^{4 i x}-16 a^{5} {\mathrm e}^{3 i x}+80 a \,b^{4} {\mathrm e}^{3 i x}+15 a^{4} b \,{\mathrm e}^{2 i x}+70 a^{2} b^{3} {\mathrm e}^{2 i x}+11 b^{5} {\mathrm e}^{2 i x}+16 a^{5} {\mathrm e}^{i x}+80 a^{3} b^{2} {\mathrm e}^{i x}+25 a^{4} b +10 a^{2} b^{3}-3 b^{5}\right )}{4 \left ({\mathrm e}^{2 i x}-1\right )^{4}}+\ln \left ({\mathrm e}^{i x}-1\right ) a^{5}+\frac {15 \ln \left ({\mathrm e}^{i x}-1\right ) a^{4} b}{8}-\frac {5 \ln \left ({\mathrm e}^{i x}-1\right ) a^{2} b^{3}}{4}+\frac {3 \ln \left ({\mathrm e}^{i x}-1\right ) b^{5}}{8}+\ln \left ({\mathrm e}^{i x}+1\right ) a^{5}-\frac {15 \ln \left ({\mathrm e}^{i x}+1\right ) a^{4} b}{8}+\frac {5 \ln \left ({\mathrm e}^{i x}+1\right ) a^{2} b^{3}}{4}-\frac {3 \ln \left ({\mathrm e}^{i x}+1\right ) b^{5}}{8}\) | \(352\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 292 vs. \(2 (142) = 284\).
Time = 0.27 (sec) , antiderivative size = 292, normalized size of antiderivative = 1.92 \[ \int (a \cot (x)+b \csc (x))^5 \, dx=\frac {12 \, a^{5} + 40 \, a^{3} b^{2} - 20 \, a b^{4} - 2 \, {\left (25 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (x\right )^{3} - 16 \, {\left (a^{5} + 5 \, a^{3} b^{2}\right )} \cos \left (x\right )^{2} + 10 \, {\left (3 \, a^{4} b - 2 \, a^{2} b^{3} - b^{5}\right )} \cos \left (x\right ) + {\left (8 \, a^{5} - 15 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5} + {\left (8 \, a^{5} - 15 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (x\right )^{4} - 2 \, {\left (8 \, a^{5} - 15 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (x\right )^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + {\left (8 \, a^{5} + 15 \, a^{4} b - 10 \, a^{2} b^{3} + 3 \, b^{5} + {\left (8 \, a^{5} + 15 \, a^{4} b - 10 \, a^{2} b^{3} + 3 \, b^{5}\right )} \cos \left (x\right )^{4} - 2 \, {\left (8 \, a^{5} + 15 \, a^{4} b - 10 \, a^{2} b^{3} + 3 \, b^{5}\right )} \cos \left (x\right )^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{16 \, {\left (\cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{2} + 1\right )}} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 308 vs. \(2 (141) = 282\).
Time = 51.39 (sec) , antiderivative size = 308, normalized size of antiderivative = 2.03 \[ \int (a \cot (x)+b \csc (x))^5 \, dx=- \frac {a^{5} \log {\left (\csc ^{2}{\left (x \right )} \right )}}{2} - \frac {a^{5} \csc ^{4}{\left (x \right )}}{4} + a^{5} \csc ^{2}{\left (x \right )} + \frac {15 a^{4} b \log {\left (\cos {\left (x \right )} - 1 \right )}}{16} - \frac {15 a^{4} b \log {\left (\cos {\left (x \right )} + 1 \right )}}{16} - \frac {25 a^{4} b \cos ^{3}{\left (x \right )}}{8 \cos ^{4}{\left (x \right )} - 16 \cos ^{2}{\left (x \right )} + 8} + \frac {15 a^{4} b \cos {\left (x \right )}}{8 \cos ^{4}{\left (x \right )} - 16 \cos ^{2}{\left (x \right )} + 8} - \frac {5 a^{3} b^{2} \cot ^{4}{\left (x \right )}}{2} - \frac {5 a^{2} b^{3} \log {\left (\cos {\left (x \right )} - 1 \right )}}{8} + \frac {5 a^{2} b^{3} \log {\left (\cos {\left (x \right )} + 1 \right )}}{8} - \frac {10 a^{2} b^{3} \cos ^{3}{\left (x \right )}}{8 \cos ^{4}{\left (x \right )} - 16 \cos ^{2}{\left (x \right )} + 8} - \frac {10 a^{2} b^{3} \cos {\left (x \right )}}{8 \cos ^{4}{\left (x \right )} - 16 \cos ^{2}{\left (x \right )} + 8} - \frac {5 a b^{4} \csc ^{4}{\left (x \right )}}{4} + \frac {3 b^{5} \log {\left (\cos {\left (x \right )} - 1 \right )}}{16} - \frac {3 b^{5} \log {\left (\cos {\left (x \right )} + 1 \right )}}{16} + \frac {3 b^{5} \cos ^{3}{\left (x \right )}}{8 \cos ^{4}{\left (x \right )} - 16 \cos ^{2}{\left (x \right )} + 8} - \frac {5 b^{5} \cos {\left (x \right )}}{8 \cos ^{4}{\left (x \right )} - 16 \cos ^{2}{\left (x \right )} + 8} \]
[In]
[Out]
none
Time = 0.23 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.24 \[ \int (a \cot (x)+b \csc (x))^5 \, dx=-\frac {5}{2} \, a^{3} b^{2} \cot \left (x\right )^{4} - \frac {5}{16} \, a^{4} b {\left (\frac {2 \, {\left (5 \, \cos \left (x\right )^{3} - 3 \, \cos \left (x\right )\right )}}{\cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{2} + 1} + 3 \, \log \left (\cos \left (x\right ) + 1\right ) - 3 \, \log \left (\cos \left (x\right ) - 1\right )\right )} + \frac {1}{16} \, b^{5} {\left (\frac {2 \, {\left (3 \, \cos \left (x\right )^{3} - 5 \, \cos \left (x\right )\right )}}{\cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{2} + 1} - 3 \, \log \left (\cos \left (x\right ) + 1\right ) + 3 \, \log \left (\cos \left (x\right ) - 1\right )\right )} - \frac {5}{8} \, a^{2} b^{3} {\left (\frac {2 \, {\left (\cos \left (x\right )^{3} + \cos \left (x\right )\right )}}{\cos \left (x\right )^{4} - 2 \, \cos \left (x\right )^{2} + 1} - \log \left (\cos \left (x\right ) + 1\right ) + \log \left (\cos \left (x\right ) - 1\right )\right )} + \frac {1}{4} \, a^{5} {\left (\frac {4 \, \sin \left (x\right )^{2} - 1}{\sin \left (x\right )^{4}} + 2 \, \log \left (\sin \left (x\right )^{2}\right )\right )} - \frac {5 \, a b^{4}}{4 \, \sin \left (x\right )^{4}} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.11 \[ \int (a \cot (x)+b \csc (x))^5 \, dx=\frac {1}{16} \, {\left (8 \, a^{5} - 15 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5}\right )} \log \left (\cos \left (x\right ) + 1\right ) + \frac {1}{16} \, {\left (8 \, a^{5} + 15 \, a^{4} b - 10 \, a^{2} b^{3} + 3 \, b^{5}\right )} \log \left (-\cos \left (x\right ) + 1\right ) + \frac {6 \, a^{5} + 20 \, a^{3} b^{2} - 10 \, a b^{4} - {\left (25 \, a^{4} b + 10 \, a^{2} b^{3} - 3 \, b^{5}\right )} \cos \left (x\right )^{3} - 8 \, {\left (a^{5} + 5 \, a^{3} b^{2}\right )} \cos \left (x\right )^{2} + 5 \, {\left (3 \, a^{4} b - 2 \, a^{2} b^{3} - b^{5}\right )} \cos \left (x\right )}{8 \, {\left (\cos \left (x\right ) + 1\right )}^{2} {\left (\cos \left (x\right ) - 1\right )}^{2}} \]
[In]
[Out]
Time = 28.98 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.14 \[ \int (a \cot (x)+b \csc (x))^5 \, dx={\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (\frac {5\,\left (a+b\right )\,{\left (a-b\right )}^4}{32}+\frac {{\left (a-b\right )}^5}{32}\right )-\frac {\frac {5\,a\,b^4}{4}+\frac {5\,a^4\,b}{4}-{\mathrm {tan}\left (\frac {x}{2}\right )}^2\,\left (3\,a^5+10\,a^4\,b+10\,a^3\,b^2-5\,a\,b^4-2\,b^5\right )+\frac {a^5}{4}+\frac {b^5}{4}+\frac {5\,a^2\,b^3}{2}+\frac {5\,a^3\,b^2}{2}}{16\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4}-a^5\,\ln \left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+1\right )+\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,\left (a^5+\frac {15\,a^4\,b}{8}-\frac {5\,a^2\,b^3}{4}+\frac {3\,b^5}{8}\right )-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^4\,{\left (a-b\right )}^5}{64} \]
[In]
[Out]