---
title: "Investment in continuous time"
author:
  - name: "Fan Wang"
    affiliation: "Department of Economics, University of Houston"
    url: "https://fanwangecon.github.io/"
date: "2026-11-30"
---

**Part of [Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics](https://fanwangecon.github.io/Stam4Econ/).**  
[Main Stam4Econ site](https://fanwangecon.github.io/Stam4Econ/) | [View this section in the book](https://fanwangecon.github.io/Stam4Econ/dynamic_programming_continuous/overview.html#investment-in-continuous-time) | [Author: Fan Wang](https://fanwangecon.github.io/) | [DOI: 10.5281/zenodo.24696926](https://doi.org/10.5281/zenodo.24696926)  
Date: 2026-11-30 | [HTML](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/dynamic_programming_continuous/hamiltonian_example.html) | [PDF](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/dynamic_programming_continuous/hamiltonian_example.pdf) | [QMD](https://fanwangecon.github.io/Stam4Econ/htmlpdfq/dynamic_programming_continuous/hamiltonian_example.qmd)

## Investment in continuous time

### The continuous time investment problem without uncertainty

Consider the following deterministic optimal growth problem. We maximize lifetime utility:

$$
\max_{c(t)} \int_0^\infty e^{-\rho t} u(c(t)) \, dt
$$

subject to the capital accumulation equation (there is no depreciation):

$$
\dot{k}(t) = f(k(t)) - c(t)
$$

The state variable is capital $k(t)$, with initial condition $k(0)$ given. At time $t=0$, the decision-maker chooses a feasible consumption path, which together with the capital law of motion determines the capital path.

### The Hamiltonian and Pontryagin's maximum principle

The present-value Hamiltonian for this problem is:

$$
H^p = e^{-\rho t} u(c(t)) + \lambda^p(t) [f(k(t)) - c(t)]
$$

Here $\lambda^p(t)$ is the present-value costate, $c(t)$ is the control, and $k(t)$ is the state. The equivalent current-value costate is $\lambda^c(t)=e^{\rho t}\lambda^p(t)$, and the current-value Hamiltonian is $H^c=e^{\rho t}H^p=u(c(t))+\lambda^c(t)[f(k(t))-c(t)]$. Its costate equation is $\dot{\lambda}^c(t)=\rho\lambda^c(t)-\partial H^c/\partial k(t)$. The equations below consistently use present values.

This is very similar to how we set up the Lagrangian. (1) We set up the lagrangian with a minus sign in front of the lagrange multiplier. Here the sign is positive in front of the "costate variable". But actually we are doing the same thing, because in the parenthesis next to the costate variable, we have resources minus choices, rather than choices minus resources. (2) For the lagrangian, we "copy" over both the objective function and the resource constraint. Here, we copy over the capital law of motion at moment in time $t$, and similarly, we copy over the present-value of utility at moment in time $t$.

### Pontryagin's maximum principle

Following Pontryagin's maximum principle gives us the following conditions for optimality.

First, just like how we proceeded with the Lagragian, we take derivative of the Hamiltonian with respect to the control variable $c(t)$ and set it equal to zero, this is the optimality condition:

$$
\frac{\partial H^p}{\partial c(t)} = e^{-\rho t} u'(c(t)) - \lambda^p(t) = 0 \implies \lambda^p(t) = e^{-\rho t} u'(c(t))
$$

Second, we have an additional optimality condition that we did not have with the Lagrangian, which is the costate equation. The intuition behind this equation is that the costate variable is the shadow price of the state variable, so we need to know how the shadow price evolves over time. And the way it eolves over time is the negative of the partial derivative of the Hamiltonian with respect to the state variable. The co-state equation is given by:

$$
\dot{\lambda}^p(t) =  - \frac{\partial H^p}{\partial k(t)} =  - \lambda^p(t) f'(k(t))
$$

Third, we have what is called the state equation. This is similar to the Lagrangian's derivative with respect to the lagrange multiplier, which gives us the resource constraint. The difference here is that this derivative is not equal to zero like in the Lagrangian case, but rather it is equal to the derivative of the state variable with respect to time:

$$
\dot{k}(t) = \frac{\partial H^p}{\partial \lambda^p(t)} = f(k(t)) - c(t)
$$

Fourth, we have the transversality condition:

$$
\lim_{t \to \infty} \lambda^p(t) k(t) = 0
$$

The transversality condition says that the present value of the costate variable times the state variable goes to zero as time goes to infinity. Why is this important? Since the costate variable can be interpreted as the shadow price of the state variable, so this condition says that the present value of the shadow price of capital times the amount of capital goes to zero as time goes to infinity. Under standard assumptions, an optimal path must satisfy this terminal condition; a candidate that violates it is not optimal.

### Solving the system of equations

Given the equations derived above, we have a system of equations. The equations might seem unfamiliar with the dot and the $(t)$ notations, but it is just a system of equations, with functions and their derivatives. Similar to how we dealt with the optimality conditions from the Lagrangian, we want to rearrange terms to get rid of the co-state variables, so we end up with a system including only $c(t)$ and $k(t)$ and their time derivatives. 

First, we now take derivative of the co-state variable with respect to $t$, using the optimality condition above. This was not done in the lagrangian because the lagrange multiplier is a constant. But now the co-state variable is a function of time, so we can take its derivative with respect to time. Specifically:

$$
\dot{\lambda}^p(t) = \frac{d}{dt} (e^{-\rho t} u'(c(t))) = -\rho e^{-\rho t} u'(c(t)) + e^{-\rho t} u''(c(t)) \dot{c}(t)
$$

Note that because $c(t)$ is a function of time, we need to use the chain rule to take the derivative of $u'(c(t))$ with respect to time, which gives us $u''(c(t)) \dot{c}(t)$ at the end.

Second, using the $\frac{\partial H^p}{\partial c(t)}$ optimality condition, the present-value costate equation, and the result from step (1), we can eliminate $\dot{\lambda}^p(t)$ and $\lambda^p(t)$. We have:

$$
-\rho e^{-\rho t} u'(c(t)) + e^{-\rho t} u''(c(t)) \dot{c}(t)  = - f'(k(t)) e^{-\rho t} u'(c(t))
$$

Rearranging gives us:

$$
\dot{c}(t) = \frac{u'(c(t))}{-u''(c(t))} (f'(k(t)) - \rho)
$$

Third, together with our state equation, now we have two differential equations with two unknowns, $c(t)$ and $k(t)$:

\begin{align*}
\dot{c}(t) &= \frac{u'(c(t))}{-u''(c(t))} (f'(k(t)) - \rho)\\
\dot{k}(t) &= f(k(t)) - c(t)
\end{align*}

### Steady state consumption, capital, and value 

At steady state, we have $\dot{c}(t) = 0$ and $\dot{k}(t) = 0$, so we can solve for the steady state values of $c$ and $k$:

\begin{align*}
0 &= \frac{u'(c^*)}{-u''(c^*)} (f'(k^*) - \rho) \implies f'(k^*) = \rho\\
0 &= f(k^*) - c^* \implies c^* = f(k^*)
\end{align*}

Suppose the production function is Cobb-Douglas, $f(k)=k^\alpha$ with $0<\alpha<1$, and the utility function is CRRA, $u(c)=\frac{c^{1-\sigma}}{1-\sigma}$ with $\sigma>0$ and $\sigma\ne1$. For log utility, the limiting case is $u(c)=\log c$. With $\rho>0$, the steady-state capital and consumption are:

$$
\begin{gathered}
% \rho = f'(k^*) = \alpha (k^*)^{\alpha - 1}\\
k^* = \left(\frac{\alpha}{\rho}\right)^{\frac{1}{1-\alpha}}\\
c^{\ast} =  (k^*)^\alpha = \left(\frac{\alpha}{\rho}\right)^{\frac{\alpha}{1-\alpha}}\\
V(k^*) = \int_0^\infty e^{-\rho t} u(c^*) dt = \frac{u(c^*)}{\rho} = \frac{1}{\rho} \cdot \frac{\left(\frac{\alpha}{\rho}\right)^{\frac{\alpha(1-\sigma)}{1-\alpha}}}{1-\sigma}
\end{gathered}
$$


### Solution to consumption and capital functions over time given linear technology

What if we are not at a steady state? Start from the full system we derived earlier:

\begin{align*}
\dot c(t) &= \frac{u'(c(t))}{-u''(c(t))}\left(f'(k(t))-\rho\right),\\
\dot k(t) &= f(k(t)) - c(t).
\end{align*}

Now impose log utility and linear technology, $u(c)=\log c$ and $f(k)=Ak$ with $A>0$. Then:

\begin{align*}
u'(c) &= \frac{1}{c},\\
u''(c) &= -\frac{1}{c^2},\\
f'(k) &= A.
\end{align*}

Substituting these objects into the full ODE system gives:

\begin{align*}
\dot c(t) &= c(t)(A-\rho),\\
\dot k(t) &= Ak(t)-c(t).
\end{align*}

The first equation is directly separable:

\begin{align*}
\frac{\dot c(t)}{c(t)}=A-\rho
\quad\Rightarrow\quad
c(t)=c_0 e^{(A-\rho)t}.
\end{align*}

Substitute this into the capital law of motion:

\begin{align*}
\dot k(t)-Ak(t)=-c_0 e^{(A-\rho)t}.
\end{align*}

Solving this linear ODE gives:

\begin{align*}
k(t)=\left(k_0-\frac{c_0}{\rho}\right)e^{At}+\frac{c_0}{\rho}e^{(A-\rho)t}.
\end{align*}

The solutions are indexed by initial consumption $c_0=c(0)$ and initial capital $k_0=k(0)$. The initial capital is given, while initial consumption must be chosen; together they determine both paths.

Now, is there a condition that can help us pin down $c_0=c(0)$? Yes, the transversality condition links the present-value costate and the state. From the $\partial H^p/\partial c$ first-order condition,

\begin{align*}
\lambda^p(t)=e^{-\rho t}u'(c(t))=\frac{e^{-\rho t}}{c(t)}=\frac{1}{c_0}e^{-At}.
\end{align*}

And now combining this with the transversality condition, we have:

\begin{align*}
\lim_{t\to\infty}\lambda^p(t)k(t) =
\lim_{t\to\infty}\frac{k_0-\frac{c_0}{\rho}}{c_0} + \frac{1}{\rho}e^{-\rho t} = 
\lim_{t\to\infty}\frac{k_0-\frac{c_0}{\rho}}{c_0} = 
0.
\end{align*}

Since the denominator cannot be be zero, the numerator must be zero, therefore:

\begin{align*}
k_0-\frac{c_0}{\rho}=0
\quad\Rightarrow\quad
c_0=\rho k_0.
\end{align*}

Now we know what $c_0$ is, given the exogenous state variable $k_0$. Invoking the Transversality condition to resolve the value of $c_0$ might seem odd in the first place, because that is about $t\rightarrow \infty$, why does it pin down what is happening at $t=0$? It does because we just showed that $c(t)$ and $k(t)$ at all times are linked to $c_0$ and $k_0$ through those specific functional forms, so any condition on $c(t)$ and $k(t)$ is also a condition on $c(0)$ and $k(0)$. The use of the Transversality condition eliminates the first term from our $k(t)$ equation, giving us two simple expressions:

\begin{align*}
k(t)&=k_0 e^{(A-\rho)t},\\
\text{and } c(t)&=\rho k_0 e^{(A-\rho)t},\\
\end{align*}

and $\frac{c(t)}{k(t)}=\rho$ for all $t$. In conclusion, for this problem:

- If $A-\rho=0$, there is no shift in $k(t)$ and $c(t)$ over time, indicating a steady state that is identical to the initial state (but differing depending on what the initial $k_0$ is).
- If $A>\rho$, both $k(t)$ and $c(t)$ grow towards infinity. 
- If $A<\rho$, both $k(t)$ and $c(t)$ decay towards zero. 