Solution (source code)

= Solution

The <Pythagorean trigonometric identity> makes the second factor $1+\cos^2\theta$, which is strictly positive. It is therefore enough to solve $\sin\theta-\cos\theta\le0$. The <sine addition formula> gives
$$
\sin\theta-\cos\theta=\sqrt2\sin(\theta-\pi/4).
$$
The shifted <angle> lies between $\pi/4$ and $5\pi/4$. On this interval the <sine> is nonpositive precisely from $\pi$ onwards. Restoring the original <angle> and retaining its strict upper bound gives
$$
\boxed{\frac{5\pi}{4}\le\theta<\frac{3\pi}{2}.}
$$