\[ \int \frac {\cos ^3(c+d x) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+a \cos (c+d x))^{3/2}} \, dx \]
Optimal antiderivative \[ -\frac {\left (A -B +C \right ) \left (\cos ^{4}\left (d x +c \right )\right ) \sin \! \left (d x +c \right )}{2 d \left (a +a \cos \! \left (d x +c \right )\right )^{\frac {3}{2}}}+\frac {\left (11 A -15 B +19 C \right ) \arctanh \! \left (\frac {\sin \left (d x +c \right ) \sqrt {a}\, \sqrt {2}}{2 \sqrt {a +a \cos \left (d x +c \right )}}\right ) \sqrt {2}}{4 a^{\frac {3}{2}} d}-\frac {\left (455 A -651 B +799 C \right ) \sin \! \left (d x +c \right )}{105 a d \sqrt {a +a \cos \! \left (d x +c \right )}}-\frac {\left (35 A -63 B +67 C \right ) \left (\cos ^{2}\left (d x +c \right )\right ) \sin \! \left (d x +c \right )}{70 a d \sqrt {a +a \cos \! \left (d x +c \right )}}+\frac {\left (7 A -7 B +11 C \right ) \left (\cos ^{3}\left (d x +c \right )\right ) \sin \! \left (d x +c \right )}{14 a d \sqrt {a +a \cos \! \left (d x +c \right )}}+\frac {\left (245 A -273 B +397 C \right ) \sin \! \left (d x +c \right ) \sqrt {a +a \cos \! \left (d x +c \right )}}{210 a^{2} d} \]
command
integrate(cos(d*x+c)^3*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)/(a+a*cos(d*x+c))^(3/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 {105 \, {\left (11 \, \sqrt {2} A - 15 \, \sqrt {2} B + 19 \, \sqrt {2} C\right )} \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 )}{a^{\frac {3}{2}}} + \frac {{\left ({\left ({\left ({\left (\frac {105 \, {\left (\sqrt {2} A a^{5} - \sqrt {2} B a^{5} + \sqrt {2} C a^{5}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}{a^{3}} + \frac {4 \, {\left (455 \, \sqrt {2} A a^{5} - 693 \, \sqrt {2} B a^{5} + 877 \, \sqrt {2} C a^{5}\right )}}{a^{3}}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \frac {14 \, {\left (305 \, \sqrt {2} A a^{5} - 453 \, \sqrt {2} B a^{5} + 517 \, \sqrt {2} C a^{5}\right )}}{a^{3}}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \frac {140 \, {\left (25 \, \sqrt {2} A a^{5} - 39 \, \sqrt {2} B a^{5} + 47 \, \sqrt {2} C a^{5}\right )}}{a^{3}}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \frac {105 \, {\left (9 \, \sqrt {2} A a^{5} - 17 \, \sqrt {2} B a^{5} + 17 \, \sqrt {2} C a^{5}\right )}}{a^{3}}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a\right )}^{\frac {7}{2}}}}{420 \, d} \]