\[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{\sqrt {a+a \sin (c+d x)}} \, dx \]
Optimal antiderivative \[ \frac {9 \arctanh \! \left (\frac {\cos \left (d x +c \right ) \sqrt {a}}{\sqrt {a +a \sin \left (d x +c \right )}}\right )}{4 d \sqrt {a}}-\frac {2 \cos \! \left (d x +c \right )}{d \sqrt {a +a \sin \! \left (d x +c \right )}}+\frac {\cot \! \left (d x +c \right )}{4 d \sqrt {a +a \sin \! \left (d x +c \right )}}-\frac {\cot \! \left (d x +c \right ) \csc \! \left (d x +c \right )}{2 d \sqrt {a +a \sin \! \left (d x +c \right )}} \]
command
integrate(cos(d*x+c)^4*csc(d*x+c)^3/(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 {\frac {{\left (36 \, \sqrt {2} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {a} + \sqrt {a}}{\sqrt {-a}}\right ) - 18 \, \sqrt {2} \sqrt {-a} \log \left (\sqrt {2} \sqrt {a} + \sqrt {a}\right ) + 54 \, \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {a} + \sqrt {a}}{\sqrt {-a}}\right ) - 27 \, \sqrt {-a} \log \left (\sqrt {2} \sqrt {a} + \sqrt {a}\right ) + 62 \, \sqrt {2} \sqrt {-a} + 82 \, \sqrt {-a}\right )} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{2 \, \sqrt {2} \sqrt {-a} \sqrt {a} + 3 \, \sqrt {-a} \sqrt {a}} + \frac {{\left ({\left (\frac {\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )} - \frac {2}{\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 {17}{\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 {18}{\mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}}{\sqrt {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a}} - \frac {18 \, \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 {9 \, \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 ({\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 )}^{3} - 2 \, {\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} \sqrt {a} + {\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 \, a^{\frac {3}{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 )}^{2} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}}{8 \, d} \]