Optimal control theory is applied to compute control for a single-degree-of-freedom heave wave energy converter. The goal is to maximize the energy extraction per cycle. Both constrained and unconstrained optimal control problems are presented. Both periodic and non-periodic excitation forces are considered. In contrast to prior work, it is shown that for this non-autonomous system, the optimal control, in general, includes both singular arc and bang-bang modes. Conditions that determine the switching times to/from the singular arc are derived. Simulation results show that the proposed optimal control solution matches the solution obtained using the complex conjugate control. A generic linear dynamic model is used in the simulations. The main advantage of the proposed control is that it finds the optimal control without the need for wave prediction; it only requires the knowledge of the excitation force and its derivatives at the current time.