Take a simplified version of the Ramsey–Cass–Koopmans model. We wish to maximize an agent's discounted lifetime utility achieved through consumption
![{\displaystyle max\int _{0}^{\infty }e^{-\rho t}u(c(t))dt}](https://wikimedia.org/api/rest_v1/media/math/render/svg/607a151dc050f8591854bb248ea43d686c5791f5)
subject to the time evolution of capital per effective worker
![{\displaystyle {\dot {k}}={\frac {\partial k}{\partial t}}=f(k(t))-(n+\delta )k(t)-c(t)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/b643e33505ed174682d8fc02cdf5d0cc8e4595f2)
where
is period t consumption,
is period t capital per worker,
is period t production,
is the population growth rate,
is the capital depreciation rate, the agent discounts future utility at rate
, with
and
.
Here,
is the state variable which evolves according to the above equation, and
is the control variable. The Hamiltonian becomes
![{\displaystyle H(k,c,\mu ,t)=e^{-\rho t}u(c(t))+\mu (t){\dot {k}}=e^{-\rho t}u(c(t))+\mu (t)[f(k(t))-(n+\delta )k(t)-c(t)]}](https://wikimedia.org/api/rest_v1/media/math/render/svg/ec42cb2c1452bfe95945ca3e526cbb565930c3fd)
The optimality conditions are
![{\displaystyle {\frac {\partial H}{\partial c}}=0\Rightarrow e^{-\rho t}u'(c)=\mu (t)}](https://wikimedia.org/api/rest_v1/media/math/render/svg/07dbafde54f12793a94e6fae1956e9050d0a6d12)
![{\displaystyle {\frac {\partial H}{\partial k}}=-{\frac {\partial \mu }{\partial t}}=-{\dot {\mu }}\Rightarrow \mu (t)[f'(k)-(n+\delta )]=-{\dot {\mu }}}](https://wikimedia.org/api/rest_v1/media/math/render/svg/fa359da70f6163fd5343ddea0bf2c69f1f9fcf94)
If we let
, then log-differentiating the first optimality condition with respect to
yields
Setting this equal to the second optimality condition yields
This is the Keynes–Ramsey rule or the Euler–Lagrange equation, which gives a condition for consumption in every period which, if followed, ensures maximum lifetime utility.