Imagine you’re planning years of saving and spending — every dollar you spend today is a dollar you can’t invest for tomorrow. Or picture a factory manager deciding how much to produce now, knowing that today’s output wears down the machines for next month. This chapter gives you the tools to make those kinds of decisions optimally. We’ll build two powerful methods — dynamic programming for step-by-step time, and optimal control for smooth, continuous time — and show how they make clear the logic of “what to do now, given everything that follows.”