Consider the differential equation
$$\ddot{x} +n^2 x+h_L (x) =p(t),$$
where $n=1,2,\dots$ is an integer, $p$ is a $2\pi$-periodic function and $h_L$ is the piecewise linear function
$$h_L (x)=\begin{cases}L& \text{if$x\geq 1$},\\
Lx & \text{if$|x|\leq 1$},\\
-L & \text{if$x\leq -1$}.\end{cases}$$
A classical result of Lazer and Leach implies that thisequation has a $2\pi$-periodic solution if and only if
\begin{equation}\label{ll}|\hat{p}_n |<{2L\over \pi},\end{equation}
where
$$\hat{p}_n :={1\over 2\pi}\int_0^{2\pi} p(t)e^{-int}\, dt.$$
In this paper I prove that if $p$ is of class $C^5$ thenthe condition (\ref{ll}) is also necessary and sufficientfor the boundedness of all the solutions of the equation.
The proof of this theorem motivates a new variant ofMoser's Small Twist Theorem. This variant guaranteesthe existence of invariant curves for certain mappingsof the cylinder which have a twist that may depend onthe angle.
1991 Mathematics Subject Classification: 34C11, 58F35.