Response of infinite length rods and beams with periodically varying area