# Continuous time optimization with two laws of motion (the Hamiltonian with two laws of motion)

How would we deal with a continuous time optimal control problem with two laws of motion? Suppose we have the following RCK like environment with human capital investment. $$\max_{c(t),k(t),h(t)}\int_{t=0}^\infty e^{-\rho t} u(c(t)) dt$$ subject to: $$\dot{k}(t)=Ak(t)^\alpha h(t)^{1-\alpha}-\delta_k k(t)-h(t)-c(t)$$ $$\dot{h}(t)=Ak(t)^\alpha h(t)^{1-\alpha}-\delta_h h(t)-k(t)-c(t)$$ $$Ak(t)^\alpha h(t)^{1-\alpha}=c(t)+k(t)+h(t)$$ $$u(c(t))=\frac{c(t)^{1-\theta}}{1-\theta}$$

If the logic extends over from an environment with a Lagrangian I'd check the optimal of maximizing over each constraint separately and then verify the solution with it with the other constraint. for example if we were discussing utility maximization with calorie and budget constraints we would conciser only one constraint at a time. In this context however we are looking at laws of motion.

Does the logic change?

In this case you have two state variables, so as you say, you have to check the FOC ($$J$$ is the Hamiltonian) for $$\frac{\partial J}{\partial K}=-\dot\lambda_1$$ and $$\frac{\partial J}{\partial H}=-\dot\lambda_2$$ (besides the FOC for control variables). In this sense the logic is the same as Lagrangian (in static context), there are as many lagrangians, as there are constraints (dynamics/laws of movement in this context). Hope this helps!