Periodic solutions of nonlinear equations obtained by linear superposition