how to maximize utility with two time periods