Closed-Form Solution of General Intertemporal Consumption Maximization Models