Solution (source code)

= Solution

Use the <tangent half-angle substitution> $t=\tan(x/2)$, so $\cos x=(1-t^2)/(1+t^2)$ and $dx=2\,dt/(1+t^2)$. Then
$$
\int\frac{dx}{5+3\cos x}=\int\frac{2\,dt}{5(1+t^2)+3(1-t^2)}=\int\frac{dt}{t^2+4}.
$$
The <inverse tangent> <antiderivative> gives
$$
\boxed{\frac12\arctan\left(\frac12\tan\frac x2\right)+C.}
$$
This expression applies on each <interval> $( (2j-1)\pi,(2j+1)\pi)$ for an integer $j$. Although $5+3\cos x\geq2$ everywhere, the chosen <inverse tangent> expression jumps at the endpoints because the substitution has a pole there. A global continuous <antiderivative> is obtained by adding $j\pi/2$ on that <interval>, using one common $C$, and extending by <continuity> at the endpoints.