\(m - g(x, y)\) has to be zero, because there is the budget rest 

Canonical Hamiltonian

Defined as:
\(H[x(t), y(t), \lambda(t), t] = f[x(t), y(t), t] + \lambda(t) g[x(t), y(t), t]\)
Where \(\lambda (t)\) is the costate variable (similar to Lagrangian). Using this equation, one simply takes the integrand under the sign and adds it to the product of the costate variable times the constraint. The necessary conditions for maximization are:
  1. \(\frac{\partial H}{\partial y} = 0\)
  2. \(\frac{\partial \lambda}{\partial t} = \dot \lambda = - \frac{\partial H}{\partial x}\) and \(\frac{\partial x}{\partial t} = \dot x = \frac{\partial H}{\partial \lambda}\)
  3. \(x(0) = x_0\) and \(x(T) = x_T\)

Marginal Concepts