We study the following energy-efficient scheduling problem. We are given a set of n jobs which have to be scheduled by a single processor whose speed can be varied dynamically. Each job $$J_j$$Jj is characterized by a processing requirement (work) $$p_j$$pj, a release date $$r_j$$rj, and a deadline $$d_j$$dj. We are also given a budget of energy E which must not be exceeded and our objective is to maximize the throughput (i.e., the number of jobs which are completed on time). We show that the problem can be solved optimally via dynamic programming in $$O(n^4 \log n \log P)$$O(n4lognlogP) time when all jobs have the same release date, where P is the sum of the processing requirements of the jobs. For the more general case with agreeable deadlines where the jobs can be ordered so that, for every $$i < j$$i