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