We give a polynomial time algorithm to compute an optimal energy and fractional weighted flow trade-off schedule for a speed-scalable processor with discrete speeds. The algorithm uses a geometric approach that is based on structural properties obtained from a primal-dual formulation of the problem.