\[ \int \frac {\sqrt {b \cos (c+d x)} \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right )}{\sqrt {\cos (c+d x)}} \, dx \]
Optimal antiderivative \[ \frac {A x \sqrt {b \cos \left (d x +c \right )}}{\sqrt {\cos \left (d x +c \right )}}+\frac {C x \sqrt {b \cos \left (d x +c \right )}}{2 \sqrt {\cos \left (d x +c \right )}}+\frac {B \sin \left (d x +c \right ) \sqrt {b \cos \left (d x +c \right )}}{d \sqrt {\cos \left (d x +c \right )}}+\frac {C \sin \left (d x +c \right ) \left (\sqrt {\cos }\left (d x +c \right )\right ) \sqrt {b \cos \left (d x +c \right )}}{2 d} \]
command
integrate((A+B*cos(d*x+c)+C*cos(d*x+c)**2)*(b*cos(d*x+c))**(1/2)/cos(d*x+c)**(1/2),x)
Sympy 1.10.1 under Python 3.10.4 output
\[ \begin {cases} \frac {A x \sqrt {b \cos {\left (c + d x \right )}}}{\sqrt {\cos {\left (c + d x \right )}}} + \frac {B \sqrt {b \cos {\left (c + d x \right )}} \sin {\left (c + d x \right )}}{d \sqrt {\cos {\left (c + d x \right )}}} + \frac {C x \sqrt {b \cos {\left (c + d x \right )}} \sin ^{2}{\left (c + d x \right )}}{2 \sqrt {\cos {\left (c + d x \right )}}} + \frac {C x \sqrt {b \cos {\left (c + d x \right )}} \cos ^{\frac {3}{2}}{\left (c + d x \right )}}{2} + \frac {C \sqrt {b \cos {\left (c + d x \right )}} \sin {\left (c + d x \right )} \sqrt {\cos {\left (c + d x \right )}}}{2 d} & \text {for}\: d \neq 0 \\\frac {x \sqrt {b \cos {\left (c \right )}} \left (A + B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right )}{\sqrt {\cos {\left (c \right )}}} & \text {otherwise} \end {cases} \]
Sympy 1.8 under Python 3.8.8 output
\[ \text {Timed out} \]________________________________________________________________________________________