Solution (source code)

= Solution

Suppose a nonconstant <periodic orbit> exists for the continuously differentiable planar <vector field>. Uniqueness implies that its image over a minimal period is a simple closed curve, enclosing a region $\Omega$ of positive area. Along the orbit, the differential form $f\,dy-g\,dx$ vanishes because $dx=f\,dt$ and $dy=g\,dt$. <Green's theorem>, with positive orientation, therefore gives
$$
0=\oint_{\partial\Omega}(f\,dy-g\,dx)=\iint_\Omega(f_x+g_y)\,dx\,dy<0,
$$
a contradiction. This is the <Bendixson-Dulac criterion> in the whole plane; the fact that the enclosed region also lies in the domain is essential.

For the second-order equation set $y=\dot x$. The equivalent system is $\dot x=y$, $\dot y=-(1+x^2)y-\cos x$. Its <divergence> is $\boxed{-(1+x^2)<0}$ throughout the plane. Hence \b[there are no nonconstant periodic solutions].

The nonconstant qualification is necessary: the <equilibrium> solutions $x(t)\equiv\pi/2+k\pi$, $k\in\mathbb Z$, do exist and are periodic in the literal sense of satisfying every positive period. The source's usual dynamical interpretation of “<periodic solution>” here is a nonconstant <periodic orbit>.