Solution (source code)

= Solution

Distinguish the <cylindrical radius> $R$ from the spherical radius $r=\sqrt{R^2+z^2}$. A <Taylor expansion> of the central <gravitational potential> for $|z|/R\ll1$ gives
$$
\Phi=-\frac{GM}{R}\left(1+\frac{z^2}{R^2}\right)^{-1/2}
=-\frac{GM}{R}+\frac{GMz^2}{2R^3}+O\left(\frac{GMz^4}{R^5}\right).
$$
Thus the usual <thin-disk expansion of the stellar gravitational potential> is
$$
\boxed{\Phi(R,z)\simeq-\frac{GM}{R}+\frac12\Omega_K^2(R)z^2,\qquad\Omega_K^2=\frac{GM}{R^3}.}
$$
The vertical acceleration is $-\partial_z\Phi=-\Omega_K^2z$. The first term can be omitted when considering only vertical forces at fixed $R$, but must be retained for radial dynamics.