20.2 Problem number 469

\[ \int \frac {\cot ^4(c+d x)}{\sqrt {a+a \sin (c+d x)}} \, dx \]

Optimal antiderivative \[ -\frac {7 \arctanh \! \left (\frac {\cos \left (d x +c \right ) \sqrt {a}}{\sqrt {a +a \sin \left (d x +c \right )}}\right )}{8 d \sqrt {a}}+\frac {9 \cot \! \left (d x +c \right )}{8 d \sqrt {a +a \sin \! \left (d x +c \right )}}+\frac {\cot \! \left (d x +c \right ) \csc \! \left (d x +c \right )}{12 d \sqrt {a +a \sin \! \left (d x +c \right )}}-\frac {\cot \! \left (d x +c \right ) \left (\csc ^{2}\left (d x +c \right )\right )}{3 d \sqrt {a +a \sin \! \left (d x +c \right )}} \]

command

integrate(cos(d*x+c)^4*csc(d*x+c)^4/(a+a*sin(d*x+c))^(1/2),x, algorithm="giac")

Giac 1.9.0-11 via sagemath 9.6 output

\[ \text {Exception raised: TypeError} \]

Giac 1.7.0 via sagemath 9.3 output

\[ \frac {\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} {\left ({\left (\frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )} - \frac {3}{a \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {22}{a \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}\right )} - \frac {{\left (210 \, \sqrt {2} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {a} + \sqrt {a}}{\sqrt {-a}}\right ) - 105 \, \sqrt {2} \sqrt {-a} \log \left (\sqrt {2} \sqrt {a} + \sqrt {a}\right ) + 294 \, \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {a} + \sqrt {a}}{\sqrt {-a}}\right ) - 147 \, \sqrt {-a} \log \left (\sqrt {2} \sqrt {a} + \sqrt {a}\right ) - 128 \, \sqrt {2} \sqrt {-a} - 186 \, \sqrt {-a}\right )} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{5 \, \sqrt {2} \sqrt {-a} \sqrt {a} + 7 \, \sqrt {-a} \sqrt {a}} + \frac {42 \, \arctan \left (-\frac {\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}}{\sqrt {-a}}\right )}{\sqrt {-a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )} - \frac {21 \, \log \left ({\left | -\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a} \right |}\right )}{\sqrt {a} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )} - \frac {2 \, {\left (3 \, {\left (\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{5} + 18 \, {\left (\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{4} \sqrt {a} - 48 \, {\left (\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} a^{\frac {3}{2}} - 3 \, {\left (\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )} a^{2} + 22 \, a^{\frac {5}{2}}\right )}}{{\left ({\left (\sqrt {a} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}\right )}^{2} - a\right )}^{3} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}}{48 \, d} \]