\[ \int \frac {\cos ^2(c+d x) (A+B \cos (c+d x))}{(a+a \cos (c+d x))^{3/2}} \, dx \]
Optimal antiderivative \[ \frac {\left (A -B \right ) \left (\cos ^{2}\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 (7 A -11 B \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 (9 A -13 B \right ) \sin \! \left (d x +c \right )}{3 a d \sqrt {a +a \cos \! \left (d x +c \right )}}-\frac {\left (3 A -7 B \right ) \sin \! \left (d x +c \right ) \sqrt {a +a \cos \! \left (d x +c \right )}}{6 a^{2} d} \]
command
integrate(cos(d*x+c)^2*(A+B*cos(d*x+c))/(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 {3 \, {\left (7 \, \sqrt {2} A - 11 \, \sqrt {2} B\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 (\frac {3 \, {\left (\sqrt {2} A a - \sqrt {2} B a\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}{a} + \frac {2 \, {\left (15 \, \sqrt {2} A a - 23 \, \sqrt {2} B a\right )}}{a}\right )} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + \frac {27 \, {\left (\sqrt {2} A a - \sqrt {2} B a\right )}}{a}\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 {3}{2}}}}{12 \, d} \]