A first-order differential equation is a functional equation in which only the unknown function and its first derivative appear. We start with linear problems, for which an analytical treatment is always possible, before turning to nonlinear equations. In the latter case a solution cannot always be exhibited, and one has to resort to a trick (a change of variable may make the problem linear), to an approximation (a Taylor expansion), to graphical analysis (to derive properties of the solution without computing it) or to the computer. The numerical computations are done in Python, and the solutions of the exercises are given in collapsible blocks. The note ends with an application to the Solow model, where the explicit solution of the second-order approximation of the transition dynamics is obtained.
Linear equations with constant coefficients
In this section, we consider a differential equation of the form:
\[ \dot y(t) + a\,y(t) = b \]
where \(a\) and \(b\) are real parameters and \(\dot y\) denotes the derivative of \(y\) with respect to time. We distinguish two cases according to whether \(b\) is zero or not.
The homogeneous case
We start with the simplest case, where the constant \(b\) is zero:
\[ \dot y(t) + a\,y(t) = 0 \]
A differential equation is said to be homogeneous when the dynamics is not affected if \(y(t)\) and \(\dot y(t)\) are multiplied by the same constant. This equation can be written equivalently as:
\[ \frac{\dot y(t)}{y(t)} = -a \]
The dynamics therefore corresponds to an assumption of growth at a constant rate. To solve the differential equation, that is to exhibit an expression of \(y\) in terms of the parameter \(a\) and of \(t\), it suffices to know how to differentiate the logarithm. Indeed, since \(\frac{\mathrm d}{\mathrm dt}\log u(t) = \dot u(t)/u(t)\), the previous equation also reads:
\[ \frac{\mathrm d}{\mathrm dt}\log y(t) = -a \]
This equation tells us that the changes in the logarithm of \(y\) are constant. To obtain \(\log y(T)\) we sum these changes between \(0\) and \(T\), that is, we integrate both sides:
\begin{equation*} \begin{split} \int_0^T \frac{\mathrm d}{\mathrm dt}\log y(t)\,\mathrm dt = -\int_0^T a\,\mathrm dt &\Leftrightarrow \bigl[\log y(t)\bigr]_0^T = -aT\\ &\Leftrightarrow \log y(T) - \log y(0) = -aT\\ &\Leftrightarrow \frac{y(T)}{y(0)} = e^{-aT} \end{split} \end{equation*}where the last equivalence is obtained by applying the inverse of the natural logarithm, the exponential. This transformation takes us back to the variable of interest, \(y(t)\) rather than \(\log y(t)\). Finally:
\[ y(t) = y(0)\,e^{-at} \qquad \forall t\in\mathbb R^+ \]
This is the solution of the homogeneous first-order linear differential equation with constant coefficient. It depends on the initial condition, on the variable \(t\) and on the parameter \(a\).
If the initial condition is zero, then \(y(t)=0\) for all \(t\) in \(\mathbb R^+\). Zero is said to be the steady state, or the fixed point, of this dynamics.
The properties of the dynamics are tied to the sign of the parameter \(a\). If \(a>0\) then, for any initial condition \(y(0)\), \(\lim_{t\to\infty}y(t)=0\): the dynamics is stable, in the long run the variable \(y\) reaches the steady state, and the long-run level does not depend on the initial condition. Conversely, if \(a < 0\) then, for any initial condition \(y(0)\neq0\), \(\lim_{t\to\infty}|y(t)|=\infty\): the variable diverges, towards \(-\infty\) or \(+\infty\) depending on the sign of the initial condition. The figure below illustrates these cases.
The non-homogeneous case
We now turn to the case \(b\neq0\), that is to a problem of the form:
\[ \dot y(t) + a\,y(t) = b \]
The solution is obtained in four steps.
Step 1. The general solution of the associated homogeneous equation. The associated equation without right-hand side is \(\dot y(t) = -a\,y(t)\). We already met it in the previous section; we shall look for its general solution following a slightly different route. Assuming \(y\neq0\), we have equivalently \(\frac{\mathrm d}{\mathrm dt}\log y(t) = -a\). The derivative with respect to \(t\) of the logarithm of \(y(t)\) equals \(-a\) for all \(t\), so the antiderivatives of both sides coincide up to a constant:
\[ \log y(t) + \gamma_1 = -at + \gamma_2 \]
or \(\log y(t) = -at + \gamma\), since we will not be able to identify the two constants \(\gamma_1\) and \(\gamma_2\) separately (we shall understand why later). Applying the exponential, we finally get:
\[ y_1(t) = \Gamma e^{-at} \]
where \(\Gamma = e^{\gamma}\). This equation defines a continuum of functions indexed by the constant \(\Gamma\); each is a solution of the equation without right-hand side. It is in this sense that it is a general solution. At this stage, the constant \(\Gamma\) is not determined.
Step 2. A particular solution of the complete equation. We choose the simplest possible one, the constant solution:
\[ y_2(t) = \frac{b}{a} \qquad \forall t \]
It is the steady state of the complete equation: if \(y(t)=b/a\) then \(y(t+\Delta)=b/a\) for all \(\Delta>0\). Note in passing that we have implicitly assumed \(a\neq0\). If this assumption fails, a constant function is not a particular solution and another one must be sought (see the exercise below).
Step 3. The general solution of the complete equation. Adding the general solution of the equation without right-hand side and a particular solution of the complete equation, we obtain the general solution of the complete equation:
\[ y(t) = y_1(t) + y_2(t) = \Gamma e^{-at} + \frac{b}{a} \]
This solution is general in that the parameter \(\Gamma\) is still not determined. It fixes the shape of the solution function, but not its level. Choosing a value for \(\Gamma\) amounts to choosing one path among infinitely many possible paths.
Step 4. Solution of the complete equation. Choosing \(\Gamma\) is easy if we know the value of \(y\) at some instant. For instance, we may know the initial condition \(y(0)=y_0\) (one also speaks of a boundary condition). At instant \(0\) we have \(y(0) = \Gamma + b/a\), that is \(\Gamma = y_0 - b/a\). Hence the solution of the non-homogeneous differential equation is:
\[ y(t) = \left(y_0 - \frac{b}{a}\right)e^{-at} + \frac{b}{a} \]
This solution is only valid if \(a\neq0\). Otherwise, the solution is obtained much more simply. We would indeed have \(\dot y(t) = b\) and, integrating with respect to \(t\), \(y(t) = \gamma + bt\) where \(\gamma\) is an arbitrary constant fixed by an initial condition. The four-step approach is not recommended in that case, even though it remains feasible (exercise below).
The solution receives the same interpretation as in the homogeneous case. The dynamics is stable if and only if the parameter \(a\) is positive. In that case, for any initial condition \(y(0)\), we have \(\lim_{t\to\infty}y(t)=b/a\). If the parameter \(a\) is negative, the variable \(y(t)\) diverges towards \(+\infty\) or \(-\infty\) depending on the sign of \(y(0)-b/a\), as long as \(y(0)\neq b/a\). If the initial condition equals the steady state, then \(y(t)=b/a\) for all \(t\), whatever the sign of \(a\). The solution can be written in the following form:
\[ y(t) = e^{-at}\,y_0 + \left(1-e^{-at}\right)\frac{b}{a} \]
The level of \(y\) at instant \(t\) is a convex combination of the initial condition and of the steady state. If \(a>0\), the influence of the initial condition tends to vanish while the weight of the steady state (the target) tends to one.
Show that, even in the case \(a=0\), it is possible to solve the non-homogeneous differential equation \(\dot y(t) + a\,y(t) = b\) following the four-step approach described above. Hint: look for a non-constant solution of the complete equation.
Solution
With \(a=0\) the equation reads \(\dot y(t) = b\). Step 1: the equation without right-hand side is \(\dot y(t)=0\), whose general solution is the constant function \(y_1(t)=\Gamma\). Step 2: a constant function cannot be a solution of the complete equation since its derivative is zero and not equal to \(b\); we therefore look for a particular solution linear in \(t\), \(y_2(t)=ct\), and the equation imposes \(c=b\). Step 3: the general solution is \(y(t) = \Gamma + bt\). Step 4: the initial condition gives \(\Gamma=y_0\), hence \(y(t) = y_0 + bt\). We recover the result of direct integration. Note that this solution cannot be obtained as the limit of \(\left(y_0 - b/a\right)e^{-at} + b/a\) as \(a\) tends to zero term by term, each of the two terms diverging; but the form \(e^{-at}y_0 + \frac{1-e^{-at}}{a}\,b\) does have \(y_0+bt\) as its limit, since \(\frac{1-e^{-at}}{a}\to t\).
Dynamics of a market price
Suppose the demand and supply functions of a good are given by:
\begin{cases} Q_d = \alpha - \beta P & (\alpha,\beta>0)\\ Q_s = \gamma + \delta P & (\gamma,\delta>0) \end{cases}where \(P\) is the price of the good. The parameters \(\beta\) and \(\delta\) measure the sensitivity of demand and supply to a change in the price (they are not elasticities). Equating the quantities supplied and demanded, we obtain the market-clearing price:
\[ P^{\star} = \frac{\alpha-\gamma}{\beta+\delta} \]
which we assume strictly positive, which requires \(\alpha>\gamma\): at a zero price, demand exceeds supply. A priori, the actual price \(P\) differs from \(P^{\star}\). We shall show that if the price rises when demand exceeds supply, and falls when supply exceeds demand, then the actual price converges to the market-clearing price. We formalise this assumption by supposing that:
\[ \dot P(t) = j\,\bigl(Q_d(t) - Q_s(t)\bigr) \]
with \(j>0\). The price is invariant if and only if supply equals demand. Substituting the supply and demand functions, we obtain the following differential equation for the price of the good:
\[ \dot P(t) + j(\beta+\delta)\,P(t) = j(\alpha-\gamma) \]
Applying the formula of the previous section, we directly get:
\[ P(t) = \bigl[P(0) - P^{\star}\bigr]e^{-\kappa t} + P^{\star} \]
with \(\kappa \equiv j(\beta+\delta)\). Since \(\kappa>0\), the price converges in the long run to \(P^{\star}\). Convergence is monotonically increasing if \(P(0)\) is below \(P^{\star}\), that is if there is initially excess demand, and monotonically decreasing if \(P(0)\) is above \(P^{\star}\), that is if there is initially excess supply. \(P^{\star}\) is a particular solution of the differential equation; it represents the intertemporal equilibrium level of the variable of interest. The term \([P(0)-P^{\star}]e^{-\kappa t}\) accounts for the deviations from this equilibrium level.
Solve the following differential equations:
- (i) \(\dot y(t) + 4y(t) = 12\) with \(y(0)=2\).
- (ii) \(\dot y(t) - 2y(t) = 0\) with \(y(0)=9\).
- (iii) \(\dot y(t) + 10y(t) = 15\) with \(y(0)=0\).
- (iv) \(2\dot y(t) + 4y(t) = 6\) with \(y(0)=3/2\).
- (v) \(\dot y(t) + y(t) = 4\) with \(y(0)=0\).
- (vi) \(\dot y(t) = 23\) with \(y(0)=1\).
- (vii) \(3\dot y(t) + 6y(t) = 5\) with \(y(0)=0\).
Solution
We apply the formula \(y(t) = (y_0 - b/a)e^{-at} + b/a\), after dividing the equation, where necessary, by the coefficient of \(\dot y\).
- (i) \(a=4\), \(b=12\), steady state \(3\): \(y(t) = 3 - e^{-4t}\).
- (ii) Homogeneous equation with \(a=-2\): \(y(t) = 9e^{2t}\), the dynamics is unstable.
- (iii) \(a=10\), \(b=15\), steady state \(3/2\): \(y(t) = \frac32\left(1-e^{-10t}\right)\).
- (iv) Dividing by \(2\), \(\dot y + 2y = 3\), whose steady state is \(3/2\). The initial condition equals the steady state: \(y(t)=3/2\) for all \(t\).
- (v) \(a=1\), \(b=4\): \(y(t) = 4\left(1-e^{-t}\right)\).
- (vi) \(a=0\): we integrate directly, \(y(t) = 1 + 23t\).
- (vii) Dividing by \(3\), \(\dot y + 2y = 5/3\), whose steady state is \(5/6\): \(y(t) = \frac56\left(1-e^{-2t}\right)\).
Linear equations with variable coefficients
The homogeneous case
We consider a problem of the form:
\[ \dot y(t) + a(t)\,y(t) = 0 \]
where \(a(t)\) is a continuous real function. We can solve this equation following the same route as in the case of constant coefficients. The growth rate of \(y\) at instant \(t\) is \(\dot y(t)/y(t) = -a(t)\), or, using the properties of the logarithm:
\[ \frac{\mathrm d}{\mathrm dt}\log y(t) = -a(t) \]
Integrating both sides between \(0\) and \(t\), the initial condition being assumed known, we get \(\log y(t) - \log y(0) = -\int_0^t a(\tau)\,\mathrm d\tau\), or equivalently:
\[ y(t) = y(0)\,e^{-\int_0^t a(\tau)\,\mathrm d\tau} \]
One checks that if \(a(t)=a\) for all \(t\), then \(\int_0^t a(\tau)\,\mathrm d\tau = at\) and we recover the solution obtained with constant coefficients. The stability conditions are less trivial here, since everything depends on the shape of the function \(a(t)\). Writing \(A(t) = \int_0^t a(\tau)\,\mathrm d\tau\), we have \(|y(t)| = |y(0)|e^{-A(t)}\) and three cases arise:
- the variable \(y\) converges to the zero steady state if and only if \(A(t)\) tends to \(+\infty\);
- it converges to a finite non-zero limit if and only if \(A(t)\) has a finite limit;
- it remains bounded, without necessarily converging, if and only if \(A(t)\) is bounded below.
The dynamics diverges in the remaining case, that is if \(A(t)\) is not bounded below. A function \(a\) bounded below by a strictly positive constant guarantees convergence to zero, as in the constant case. But \(a(t) = (1+t)^{-2}\), though strictly positive, gives \(A(t) = 1-(1+t)^{-1}\) and \(y(t)\) converges to \(y(0)e^{-1}\) without ever reaching the steady state; and \(a(t) = \cos t\) gives \(A(t) = \sin t\), so that \(y(t)\) oscillates indefinitely between \(y(0)e^{-1}\) and \(y(0)e\). The sign of \(a\) at a given instant only tells us the direction of change of \(y\) at that instant.
Exact differential equations
We leave the world of linear differential equations for a moment to introduce a tool which will allow us to build the solution of a non-homogeneous linear differential equation with variable coefficients.
Let \(F(y,t)\) be a continuously differentiable function of two variables. Its total differential is:
\[ \mathrm dF(y,t) = \frac{\partial F}{\partial y}\,\mathrm dy + \frac{\partial F}{\partial t}\,\mathrm dt \]
The equation \[ \frac{\partial F}{\partial y}\,\mathrm dy + \frac{\partial F}{\partial t}\,\mathrm dt = 0 \] is an exact differential equation, because the left-hand side is exactly the differential of \(F(y,t)\).
Let \(F(y,t) = y^2t + k\), where \(k\) is a constant. We have \(\mathrm dF = 2yt\,\mathrm dy + y^2\,\mathrm dt\). Thus \(2yt\,\mathrm dy + y^2\,\mathrm dt = 0\), or equivalently \(\dot y + \frac{y^2}{2yt} = 0\), is an exact differential equation.
In general, the differential equation:
\[ M\,\mathrm dy + N\,\mathrm dt = 0 \]
is exact if and only if there exists a function \(F(y,t)\) such that \(M = \partial F/\partial y\) and \(N = \partial F/\partial t\). We lack a test to know whether a differential equation is exact, that is, whether there exists a function \(F\) from which the functions \(M\) and \(N\) derive. We know that a Hessian matrix is symmetric (Young's theorem), that is \(\frac{\partial^2F}{\partial t\partial y} = \frac{\partial^2F}{\partial y\partial t}\). Hence the differential equation is exact if and only if:
\[ \frac{\partial M}{\partial t} = \frac{\partial N}{\partial y} \]
This condition gives us a test to assess whether a differential equation is exact1.
Applying this test to the previous example, where \(M=2yt\) and \(N=y^2\), we get \(\partial M/\partial t = 2y\) and \(\partial N/\partial y = 2y\). The test concludes that it is indeed an exact differential equation.
An exact differential equation, by definition, tells us that \(\mathrm dF(y,t) = 0\). Its general solution must therefore be of the form:
\[ F(y,t) = c \]
where \(c\) is a real constant. Solving an exact differential equation means exhibiting an antiderivative \(F(y,t)\) and setting it equal to a constant.
Solution method. Since \(M = \partial F/\partial y\), the function \(F\) must contain an integral of \(M\) with respect to the variable \(y\). We should therefore have:
\[ F(y,t) = \int M\,\mathrm dy + \psi(t) \]
The partial derivative \(M\) is integrated with respect to \(y\) only, treating \(t\) as a constant. Since, when differentiating \(F(y,t)\) partially with respect to \(y\), any additive term not depending on \(y\) disappears, care must be taken to reintroduce these terms in the integration process. This is exactly the role of the term \(\psi(t)\). It is relatively easy to evaluate \(\int M\,\mathrm dy\); determining the function \(\psi(t)\) is often less obvious.
We want to solve the differential equation \(\dot y + \frac{y}{2t} = 0\). Multiplying both sides by \(2yt\,\mathrm dt\), we get \(2yt\,\mathrm dy + y^2\,\mathrm dt = 0\). We therefore have \(M=2yt\) and \(N=y^2\), and we solve this equation in four steps.
- (i) Set \(F(y,t) = \int 2yt\,\mathrm dy + \psi(t) = y^2t + \psi(t)\), where \(\psi(t)\) remains to be determined and where we have redefined \(\psi(t)\) to include the constant of integration.
- (ii) The partial derivative with respect to \(t\) is \(\partial F/\partial t = y^2 + \psi'(t)\). Comparing with \(N=y^2\), we deduce that the function \(\psi(t)\) must satisfy \(\psi'(t)=0\) for all \(t\).
- (iii) We therefore know that \(\psi(t) = \kappa\in\mathbb R\) for all \(t\).
- (iv) Finally, \(F(y,t) = y^2t + \kappa\) and the solution of the exact differential equation must be of the form \(y^2t + \kappa = c\). Since the constants \(\kappa\) and \(c\) are not individually identifiable, we still have \(y^2t = \tilde c\), with \(\tilde c\geq0\), hence finally, for \(t>0\): \[ y(t) = \bar c\,t^{-\frac12} \] where \(\bar c = \pm\sqrt{\tilde c}\) is a real constant, with the sign of \(y\), which can be determined from an initial condition.
Consider the differential equation: \[ \dot y + \frac{y+3t^2}{t+2y} = 0 \] Equivalently, we have \((t+2y)\,\mathrm dy + (y+3t^2)\,\mathrm dt = 0\). Is it an exact differential equation? We have \(M = t+2y\) and \(N = y+3t^2\), and we check that \(\partial M/\partial t = 1 = \partial N/\partial y\). We are therefore indeed dealing with an exact differential equation, which we solve in four steps.
- (i) Set \(F(y,t) = \int(t+2y)\,\mathrm dy + \psi(t) = yt + y^2 + \psi(t)\), where \(\psi(t)\) remains to be determined.
- (ii) The partial derivative with respect to \(t\) is \(\partial F/\partial t = y + \psi'(t)\). Comparing with \(N = y+3t^2\), we deduce that \(\psi'(t) = 3t^2\) for all \(t\).
- (iii) We therefore know that \(\psi(t) = t^3 + \kappa\) with \(\kappa\in\mathbb R\).
- (iv) Finally, \(F(y,t) = yt + y^2 + t^3 + \kappa\) and the solution of the differential equation is of the form: \[ yt + y^2 + t^3 = c \] where \(c\) is a real constant. One checks that it is indeed the solution by differentiating this relation with respect to \(t\). It defines \(y\) implicitly as a function of \(t\); here it can even be made explicit, since it is a quadratic equation in \(y\).
The procedure described in these two examples can be applied to any exact differential equation. In some cases, the procedure can also be applied to a non-exact differential equation, if an equivalent exact differential equation can be found.
Consider the differential equation \(2t\,\mathrm dy + y\,\mathrm dt = 0\). One easily checks that it is not exact: \(\partial M/\partial t = 2\) and \(\partial N/\partial y = 1\). However, multiplying each term by \(y\), we are back to the previous example and therefore obtain an exact differential equation. \(y\) is said to be an integrating factor of the equation.
The non-homogeneous case
We consider a problem of the form:
\[ \dot y(t) + a(t)\,y(t) = b(t) \]
where \(a(t)\) and \(b(t)\) are continuous real functions. This problem can be written equivalently as:
\[ \mathrm dy + \bigl(a(t)y - b(t)\bigr)\mathrm dt = 0 \]
We have \(M=1\) and \(N = ay-b\); one immediately sees that this is not an exact differential equation, unless \(a\) is identically zero. Nevertheless it is possible to exhibit an integrating factor, which we denote \(\mathcal I\), so as to obtain an exact differential equation. The integrating factor is such that:
\[ \mathcal I\,\mathrm dy + \mathcal I\bigl(a(t)y - b(t)\bigr)\mathrm dt = 0 \]
is an exact differential equation. For this, it is necessary and sufficient that the condition \(\partial M/\partial t = \partial N/\partial y\), with \(M = \mathcal I\) and \(N = \mathcal I(ay-b)\), be satisfied. The integrating factor is therefore such that \(\dot{\mathcal I} = \mathcal I a\), or equivalently:
\[ \frac{\dot{\mathcal I}(t)}{\mathcal I(t)} = a(t) \]
The growth rate of the integrating factor must equal \(a(t)\). The integrating factor is therefore defined by a differential equation we know how to solve:
\[ \mathcal I(t) = A\,e^{\int_0^t a(\tau)\,\mathrm d\tau} \]
for any non-zero real value of \(A\). Without loss of generality we set \(A=1\).
The general solution of the first-order linear differential equation with variable coefficients \(\dot y(t) + a(t)\,y(t) = b(t)\) is: \[ y(t) = e^{-\int_0^t a(\tau)\,\mathrm d\tau}\left(c + \int_0^t b(s)\,e^{\int_0^s a(\tau)\,\mathrm d\tau}\,\mathrm ds\right) \] where the constant \(c\) is determined by the initial condition: if \(y(0)=y_0\) is known, then \(c = y_0\).
The transformed differential equation: \[ e^{\int_0^t a(\tau)\,\mathrm d\tau}\,\mathrm dy + e^{\int_0^t a(\tau)\,\mathrm d\tau}\bigl(a(t)y - b(t)\bigr)\mathrm dt = 0 \] is exact by construction. We solve it following the four steps described above.
- (i) Set \(F(y,t) = \int e^{\int_0^t a(\tau)\,\mathrm d\tau}\,\mathrm dy + \psi(t) = y\,e^{\int_0^t a(\tau)\,\mathrm d\tau} + \psi(t)\), where \(\psi(t)\) remains to be determined.
- (ii) The partial derivative with respect to \(t\) is: \[ \frac{\partial F}{\partial t} = y\,a(t)\,e^{\int_0^t a(\tau)\,\mathrm d\tau} + \psi'(t) \] Comparing with \(N\) we obtain a restriction on the function \(\psi\): \(\psi'(t) = -b(t)\,e^{\int_0^t a(\tau)\,\mathrm d\tau}\).
- (iii) The function \(\psi\) is therefore, the initial instant being zero: \[ \psi(t) = \int_0^t\psi'(s)\,\mathrm ds = -\int_0^t b(s)\,e^{\int_0^s a(\tau)\,\mathrm d\tau}\,\mathrm ds \] We cannot go further here, because the functions \(a\) and \(b\) are not specified.
- (iv) Finally, substituting the expression of \(\psi(t)\) into the postulated function \(F(y,t)\), the solution satisfies: \[ y(t)\,e^{\int_0^t a(\tau)\,\mathrm d\tau} - \int_0^t b(s)\,e^{\int_0^s a(\tau)\,\mathrm d\tau}\,\mathrm ds = c \] which gives the stated expression. At \(t=0\) both integrals vanish and we get \(y(0)=c\).
Consider the differential equation \(\dot y(t) + 2t\,y(t) = t\), the initial condition \(y(0)\) being known. We have \(a(t)=2t\) and \(b(t)=t\), hence \(\int_0^t a(\tau)\,\mathrm d\tau = t^2\). Applying the previous result, we get: \[ y(t) = e^{-t^2}\left(y(0) + \int_0^t s\,e^{s^2}\,\mathrm ds\right) \] Noting that \(\frac{\mathrm d}{\mathrm ds}e^{s^2} = 2s\,e^{s^2}\), the integral equals \(\frac12\left(e^{t^2}-1\right)\) and: \[ y(t) = e^{-t^2}\left(y(0) - \frac12\right) + \frac12 \] Note that \(1/2\) is a constant particular solution of the differential equation: it is a steady state, stable in this example since the exponential term tends to zero as \(t\) tends to infinity. It could have been obtained directly by looking, as in the constant-coefficient case, for a constant particular solution, then adding the general solution \(\Gamma e^{-t^2}\) of the homogeneous equation.
Solve the following differential equations:
- (a) \(\dot y + 5y = 15\).
- (b) \(\dot y + 2ty = 0\).
- (c) \(\dot y + 2ty = t\) with \(y(0)=3/2\).
- (d) \(\dot y + t^2y = 5t^2\) with \(y(0)=6\).
- (e) \(2\dot y + 12y + 2e^t = 0\) with \(y(0)=6/7\).
- (f) \(\dot y + y = t\).
Solution
When the initial condition is not given, we settle for the general solution, indexed by a constant \(\Gamma\).
- (a) Constant coefficients, steady state \(3\): \(y(t) = 3 + \Gamma e^{-5t}\), with \(\Gamma = y(0)-3\).
- (b) Homogeneous equation with \(a(t)=2t\), hence \(\int_0^t a = t^2\): \(y(t) = \Gamma e^{-t^2}\), with \(\Gamma = y(0)\).
- (c) This is the example treated above: \(y(t) = \frac12 + \left(\frac32-\frac12\right)e^{-t^2} = \frac12 + e^{-t^2}\).
- (d) \(a(t)=t^2\), \(b(t)=5t^2\), hence \(\int_0^t a = t^3/3\) and the integrating factor is \(e^{t^3/3}\). One observes that \(5\) is a constant particular solution, hence \(y(t) = 5 + \Gamma e^{-t^3/3}\) and, with the initial condition, \(y(t) = 5 + e^{-t^3/3}\). The general formula gives the same result, the integral \(\int_0^t 5s^2e^{s^3/3}\,\mathrm ds = 5\left(e^{t^3/3}-1\right)\) being computed without difficulty.
- (e) Dividing by \(2\), \(\dot y + 6y = -e^t\). The homogeneous equation has general solution \(\Gamma e^{-6t}\). The right-hand side not being constant, we look for a particular solution of the same form, \(y_2(t) = Ae^t\): substituting, \(A + 6A = -1\), that is \(A = -1/7\). The general solution is \(y(t) = \Gamma e^{-6t} - \frac17e^t\) and the initial condition gives \(\Gamma - \frac17 = \frac67\), that is \(\Gamma=1\): \(y(t) = e^{-6t} - \frac17 e^t\). The solution diverges towards \(-\infty\), even though the coefficient \(a=6\) is positive: it is the right-hand side which diverges.
- (f) We look for an affine particular solution, \(y_2(t) = ct + d\): substituting, \(c + ct + d = t\) imposes \(c=1\) and \(d=-1\). The general solution is \(y(t) = t - 1 + \Gamma e^{-t}\), with \(\Gamma = y(0)+1\). In the long run \(y\) follows the line \(t-1\), lagging \(t\) by one unit.
Nonlinear equations
In this section we are interested in differential equations which can be written in the form:
\[ f(y,t)\,\mathrm dy + g(y,t)\,\mathrm dt = 0 \]
or, equivalently, \(\dot y(t) = h\bigl(y(t),t\bigr)\) with \(h(y,t) = -g(y,t)/f(y,t)\). One may recognise an exact differential equation, if the condition \(\partial f/\partial t = \partial g/\partial y\) holds; we already know how to solve this type of equation.
Separable problems
We consider here the case where \(f\) does not depend on \(t\) and \(g\) does not depend on \(y\). This class of problems is very easy to solve: each side is integrated separately.
Consider the differential equation \(3y^2\,\mathrm dy = t\,\mathrm dt\). Integrating both sides, \(\int 3y^2\,\mathrm dy = \int t\,\mathrm dt\), we directly obtain \(y^3 + \gamma_1 = \frac12t^2 + \gamma_2\), or \(y^3 = \frac12t^2 + \gamma\), since the two constants of integration are not separately identifiable. We therefore have: \[ y(t) = \left(\frac12t^2 + \gamma\right)^{\frac13} \] We can then fix \(\gamma\) from the initial condition, evaluating the last equation at \(t=0\). We get \(\gamma = y(0)^3\) and: \[ y(t) = \left(\frac12t^2 + y(0)^3\right)^{\frac13} \]
Consider the differential equation \(2t\,\mathrm dy + y\,\mathrm dt = 0\). A priori, it does not belong to the class discussed here, since \(\mathrm dy\) is associated with a function of \(t\) and not of \(y\). But dividing both sides by \(2yt\), we obtain: \[ \frac{\mathrm dy}{y} + \frac{\mathrm dt}{2t} = 0 \] Note in passing that this transformation makes the differential equation exact, besides making it separable. Integrating, we get \(\log y + \frac12\log t = \gamma\), that is \(y\,t^{\frac12} = e^{\gamma}\) and finally: \[ y(t) = \Gamma\,t^{-\frac12} \] This solution is not defined at zero, which we knew from the transformation of the initial problem, which implicitly assumes \(y\neq0\) and \(t\neq0\): to fix the constant \(\Gamma\), one must choose a strictly positive initial instant. We recover, by a third route, the solution of the example treated with an integrating factor.
Reduction to a linear dynamics: Bernoulli's equation
The differential equation of the form: \[ \dot y(t) + R(t)\,y(t) = Q(t)\,y(t)^m \] with \(m\notin\{0,1\}\), is a Bernoulli equation.
For \(m=0\) we recover the non-homogeneous linear equation, and for \(m=1\) the homogeneous linear equation with coefficient \(R-Q\). In the other cases the equation is nonlinear, but it can always be reduced to a linear differential equation by a change of variable. Divide both sides by \(y^m\):
\[ y(t)^{-m}\dot y(t) + R(t)\,y(t)^{1-m} = Q(t) \]
and set \(z = y^{1-m}\), so that \(\dot z = (1-m)y^{-m}\dot y\). The equation then reads \(\frac{1}{1-m}\dot z(t) + R(t)\,z(t) = Q(t)\), or:
\[ \dot z(t) + (1-m)\bigl[R(t)\,z(t) - Q(t)\bigr] = 0 \]
This is a linear differential equation with variable coefficients. We can therefore solve it, then express \(y\) in terms of \(z\) to obtain the solution of the original equation.
Consider the differential equation: \[ \dot y(t) + t\,y(t) = 3t\,y(t)^2 \] Dividing by \(y^2\), we get \(\dot y\,y^{-2} + t\,y^{-1} - 3t = 0\). Set \(z = y^{-1}\), so that \(\dot z = -y^{-2}\dot y\); the dynamics of \(z\) reads \(-\dot z + tz - 3t = 0\), or equivalently: \[ \dot z - t\,z + 3t = 0 \] This is a linear equation with variable coefficients, with \(a(t)=-t\) and \(b(t)=-3t\). Applying the general formula, we directly get: \[ z(t) = e^{\frac{t^2}{2}}\left(A - 3\int_0^t s\,e^{-\frac{s^2}{2}}\,\mathrm ds\right) = e^{\frac{t^2}{2}}\left(A-3\right) + 3 \] It remains to reverse the transformation, since the variable of interest is \(y\) and not \(z\). We have \(y = z^{-1}\) and, using the initial condition to determine the constant, \(A = 1/y(0)\): \[ y(t) = \frac{1}{e^{\frac{t^2}{2}}\left(\frac{1}{y(0)}-3\right) + 3} \]
Find the solution of the following differential equation: \[ \dot y(t) + \frac{1}{t}\,y(t) = y(t)^3 \] with \(t_0>0\) the initial instant, the initial condition \(y(t_0)\) being known.
Solution
This is a Bernoulli equation with \(m=3\), \(R(t)=1/t\) and \(Q(t)=1\). We divide by \(y^3\) and set \(z = y^{-2}\), so that \(\dot z = -2y^{-3}\dot y\). We get \(-\frac12\dot z + \frac{z}{t} = 1\), that is: \[ \dot z - \frac{2}{t}\,z = -2 \] The integrating factor is \(e^{-\int 2/t} = t^{-2}\), and the equation reads \(\frac{\mathrm d}{\mathrm dt}\left(t^{-2}z\right) = -2t^{-2}\), hence \(t^{-2}z = \frac{2}{t} + C\) and \(z(t) = 2t + Ct^2\). Going back to \(y\): \[ y(t) = \pm\left(2t + Ct^2\right)^{-\frac12} \] the sign being that of \(y(t_0)\), and the constant being fixed by the initial condition, \(C = \left(y(t_0)^{-2} - 2t_0\right)/t_0^2\). The solution is only defined as long as \(2t + Ct^2\) remains strictly positive: if \(C < 0\), that is if \(y(t_0)^2 > 1/(2t_0)\), it blows up in finite time \(t^{\star} = -2/C\). One checks that \(y = 0\) is a steady state, and that for \(C\geq0\) the solution converges to zero like \(t^{-1}\) or \(t^{-1/2}\).
Qualitative approach
A nonlinear differential equation cannot always be solved analytically. In many cases we have to settle for numerical solutions, for a quantitative approach (see the next section), or graphical ones, if a qualitative approach is enough. With a graphical approach, one can for instance investigate the stability of the dynamics.
We are interested here in a dynamics of the form:
\[ \dot y = f(y) \]
where \(f\) is a continuous function not depending on time. One then speaks of an autonomous differential equation. The dynamics can be represented graphically in the \((y,\dot y)\) plane. The figure below gives two examples: in the left chart the function \(f\) is monotonically decreasing, in the right one it is monotonically increasing. Reading these charts rests on three observations:
- when \(f(y)>0\), the change \(\dot y\) is positive and so \(y\) increases;
- when \(f(y) < 0\), the change \(\dot y\) is negative and so \(y\) decreases;
- when \(f(y)=0\), the change \(\dot y\) is zero and so \(y\) does not move.
These three observations explain how we oriented the arrows on the horizontal axis. These arrows describe the direction of change of the variable \(y\). For instance, in the left chart, \(f(y)\) is positive when \(y < y_a^{\star}\) and negative when \(y>y_a^{\star}\). Thus \(y\) increases when its level is low relative to \(y_a^{\star}\), and the arrows point to the right; \(y\) decreases when its level is high, and the arrows point to the left.
\(y_a^{\star}\) and \(y_b^{\star}\) are the steady states, the fixed points of the dynamics. A single glance at these charts tells us about their properties: \(y_a^{\star}\) is stable (if for some reason one moves away from \(y_a^{\star}\), one comes back to it), unlike \(y_b^{\star}\) which is unstable (if one moves away from \(y_b^{\star}\), one never comes back).
These charts suggest that if \(f\) is monotonically decreasing then the dynamics is stable, and that if \(f\) is monotonically increasing then the dynamics is unstable. In fact we should distinguish global stability from local stability. The figure below shows that the function \(f\) can be much more "twisted". In that case \(y_a^{\star}\) and \(y_c^{\star}\) are locally stable steady states and \(y_b^{\star}\) is an unstable steady state. \(y_a^{\star}\) is locally stable, in the sense that if one moves moderately away from \(y_a^{\star}\) one comes back to it, but if one moves too far, beyond \(y_b^{\star}\), one never returns to \(y_a^{\star}\).
Two ideas are worth retaining from these examples:
- the steady state, if it exists, is not always unique. One can also imagine cases where it does not exist;
- stability, local or global, can only arise if the function \(f\), called the transition function, is, at least locally, decreasing.
In retrospect, point 2 is consistent with what we saw in the linear case. Consider the linear differential equation \(\dot y = b - ay\). The stability properties depend on the sign of the parameter \(a\): the dynamics is stable if and only if \(a\) is positive, that is if there is a decreasing relation between the change and the level. In that case, for any initial condition, \(y(t)\) converges to \(b/a\).
Numerical approach
The approach described in the previous section may not suffice if one wants
more precise information about the solution. One then resorts to numerical
computation. This task is relatively simple with scientific software; we use
here the solve_ivp function of the scipy library, which implements by
default an adaptive-step Runge-Kutta method of order 4(5), the same as
Matlab's ode45 function. These functions solve problems of the form:
\[ \dot y(t) = f\bigl(t, y(t)\bigr) \]
where the initial condition \(y(t_0)\) is given, over the time interval \([t_0,t_1]\).
As an example we shall numerically solve the nonlinear differential equation of the example treated above; since we have an analytical solution, we will be able to assess the accuracy of the numerical solution. As a reminder, the analytical solution is:
\[ y(t) = \frac{1}{e^{\frac{t^2}{2}}\left(\frac{1}{y(0)}-3\right) + 3} \]
Before embarking on the numerical study of the dynamics, the properties of this solution deserve discussion. We observe the following points.
- \(y^{\star} = 1/3\) is a steady state. To check it, one can substitute \(y(t) = 1/3\) into the differential equation. If \(y(0) = 1/3\) then \(y(t) = 1/3\) for all \(t\).
- If \(y(0) < 1/3\) then \(\lim_{t\to\infty}y(t) = 0^+\). The steady state \(y^{\star}\) is therefore not stable; it is zero, the other steady state, which attracts these paths.
- The case \(y(0) > 1/3\) deserves special treatment. The denominator \(3 - e^{t^2/2}\left(3 - 1/y(0)\right)\) is then a decreasing function of \(t\), positive at \(t=0\), which vanishes at: \[ t^{\star} = \sqrt{2\log\frac{3}{3-\frac{1}{y(0)}}} \] The solution has a vertical asymptote at \(t^{\star}\): for all \(t < t^{\star}\), \(y(t)\) is monotonically increasing with \(\lim_{t\to t^{\star}}y(t) = +\infty\). The path ceases to exist at \(t^{\star}\). The formula remains defined beyond, but it then describes another solution of the equation, negative, increasing from \(-\infty\) to \(0^-\), which is not connected to the initial condition.
The properties of the solution depend radically on the initial condition. The numerical approach of the case \(y(0) < 1/3\) poses no problem, unlike the complementary case, because of the vertical asymptote.
We start by defining the function \(f(t,y)\) associated with the differential equation, written in the form \(\dot y(t) = 3t\,y(t)^2 - t\,y(t)\), then the exact solution:
def bernoulli(t, y):
"""Right-hand side of the differential equation dy/dt = 3ty² - ty."""
return 3*t*y**2 - t*y
def exact(t, y0):
"""Analytical solution for the initial condition y0."""
return 1/(np.exp(t**2/2)*(1/y0 - 3) + 3)
The following script solves the equation for two initial conditions, on
either side of the steady state. In the case \(y_0>y^{\star}\), the terminal
instant is set short of \(t^{\star}\), since no solver can follow the solution
up to a vertical asymptote. The solve_ivp function returns an object whose
t attribute contains the instants at which the solver evaluated the
solution, and whose sol attribute, obtained thanks to the dense_output
option, allows the solution to be interpolated at any point of the
interval.
ystar = 1/3
solutions = {}
for y0 in (0.9*ystar, 1.1*ystar):
if y0 > ystar:
tstar = np.sqrt(2*np.log(3/(3 - 1/y0)))
t1 = 0.9*tstar
else:
t1 = 10.0
solutions[y0] = solve_ivp(bernoulli, (0, t1), [y0], dense_output=True)
The figure above shows the results obtained for \(y_0 = 0.9\,y^{\star}\)
and \(y_0 = 1.1\,y^{\star}\). With the default tolerances, a relative tolerance
of \(10^{-3}\) and an absolute tolerance of \(10^{-6}\), the solver makes do with
\(29\) steps in the first case and \(8\) steps in the second: the error is at
most \(4.3\times10^{-5}\) in absolute value in the first case, and
\(5.7\times10^{-4}\) in the second. One observes that the errors are almost
zero where the path of \(y\) is flat and become larger where the path is
steeper, in particular as the asymptote is approached. These errors shrink
if the solver is asked for a more accurate approximation: with rtol=1e-8
and atol=1e-11, the number of steps rises to \(127\) and \(32\), and the
maximum error drops to \(1.2\times10^{-8}\) and \(3.8\times10^{-8}\). Accuracy
is paid for in evaluations of the bernoulli function, which is of no
consequence here but may be for large systems.
This application teaches us that it is always useful to investigate the properties of the solution before embarking on a numerical computation, with the analytical solution when it is available (but then the numerical solution becomes pointless, except as a check) or with the qualitative approach. Some preliminary thought is always a good idea. In the case \(y_0>y^{\star}\), the solver fails if one tries to obtain the solution for \(t\in[0,T]\) with \(T\) too close to \(t^{\star}\), where the path is very steep, or a fortiori beyond \(t^{\star}\); and there is no guarantee that it will signal its failure other than by aberrant values.
Adaptive-step solvers such as solve_ivp choose the length of the time
steps themselves so as to meet the requested tolerances. Fixed-step schemes,
in particular the Euler scheme, are presented in the note on the Solow model
in discrete time; the note on the simulation of the Solow model uses the
odeint function of scipy, which relies on another family of methods.
Local approximation
As in the section on the qualitative approach, we are interested here in an autonomous dynamics \(\dot y = f(y)\), where \(f\) is a continuous and differentiable function not depending on time. So far we have only considered global approaches. The qualitative approach and the analytical approach are global, because we characterise or obtain the solution for all possible values of \(t\) and independently of the level of \(y\). The numerical approach is also global, because it is valid on an interval of values of \(t\) independently of the level of \(y\). Here we take a local approach, in the sense that what we will be able to say about \(y\) will only be relevant in a neighbourhood of a specific level of the variable.
If the function \(f\) is differentiable at \(\bar y\), a first-order Taylor expansion gives:
\[ \dot y = f(\bar y) + f'(\bar y)(y-\bar y) + O\bigl(|y-\bar y|^2\bigr) \]
If we drop the residual term, which tends to zero faster than \(|y-\bar y|\) as \(y\) approaches \(\bar y\), we have:
\[ \dot y \approx f(\bar y) + f'(\bar y)(y-\bar y) \]
In a neighbourhood of \(\bar y\), the dynamics is approximately linear. The quality of the approximation depends on the distance from \(y\) to \(\bar y\). We know how to solve this differential equation, it is an equation with constant coefficients. But one must bear in mind that the solution we will obtain by applying the results of the first section will only be acceptable for values of \(y\) in a neighbourhood of \(\bar y\). It is in this sense that this approach is local.
A priori we can choose any point \(\bar y\), provided the function \(f\) is differentiable there. Usually the model is approximated around a steady state of the dynamics, \(y^{\star}\). This eliminates the constant, since by definition \(\dot y\) is zero at the steady state. We thus have:
\[ \dot y \approx f'(y^{\star})(y-y^{\star}) \]
Another motivation is that if this steady state is stable, then we are sure that if \(y(0)\) is in a neighbourhood of \(y^{\star}\), \(y(t)\) will remain in that same neighbourhood, which guarantees the quality of the approximation. Note that in the case of multiple steady states, there is a degree of freedom in the choice of the point around which \(f\) is approximated. The properties of the approximate solution can be very different, for instance in terms of stability.
The geometric interpretation of this approximation is direct. Making a first-order approximation, also called a linearisation, means replacing the function \(f\) by its tangent at \(y^{\star}\). The figure below illustrates this replacement, for the transition function of the Solow model which we shall meet again in the next section.
Finally, note that a priori nothing prevents us from considering orders of approximation higher than one. In some cases it may be necessary, so as not to miss interesting properties of the variable under study, to go for a second- or third-order approximation. The second-order expansion around the steady state:
\[ \dot y \approx f'(y^{\star})(y-y^{\star}) + \frac12f''(y^{\star})(y-y^{\star})^2 \]
is a Bernoulli equation with constant coefficients, with \(m=2\), whose explicit solution we therefore know how to exhibit. This is what we shall do for the Solow model.
Application: the Solow model
The Solow model is a continuous-time dynamic model describing the evolution of the stock of physical capital, or of output, in a closed economy. We shall not go into it in detail here, it is presented in the note on the Solow model; the aim is simply to apply the methods presented above.
We take a neoclassical production function2, \(Y(t) = F\bigl(K(t), A(t)L(t)\bigr)\), with \(L(t) = e^{nt}\) the population and \(A(t) = e^{gt}\) the index of labour efficiency3. The law of motion of the stock of physical capital is:
\[ \dot K(t) = sY(t) - \delta K(t) \]
with \(s\in\,]0,1[\) the exogenous saving rate and \(\delta\in[0,1]\) the depreciation rate of capital. This equation simply tells us that the capital stock increases if and only if investment dominates depreciation. Substituting the production function, one sees clearly that this is a first-order nonlinear differential equation:
\[ \dot K(t) = sF\bigl(K(t), e^{(n+g)t}\bigr) - \delta K(t) \]
This differential equation is non-autonomous: the relation between the change in the capital stock and its level depends on time, through the term \(e^{(n+g)t}\) which represents the growth of efficient labour. The first thing to do is to reduce it to an autonomous differential equation. To this end, it suffices to remove the demographic and technological trends. Let \(\hat k(t) = K(t)/\bigl(A(t)L(t)\bigr)\) be the capital stock per efficient worker, "purged" of population growth and technical progress. One easily checks that the dynamics of capital per efficient worker is given by:
\[ \dot{\hat k}(t) = sf\bigl(\hat k(t)\bigr) - (n+g+\delta)\,\hat k(t) \]
where \(f(\hat k) = F(\hat k, 1) = \hat y\) is output per efficient worker. This is indeed an autonomous differential equation. If the production function is neoclassical, there exists a unique strictly positive steady state \(\hat k^{\star}\). In passing, note that \(\hat k=0\) is also a steady state, called trivial, which we shall set aside. To be convinced of this existence and uniqueness result, it suffices to rewrite the equation in the form:
\[ \frac{\dot{\hat k}(t)}{\hat k(t)} = s\,\frac{f\bigl(\hat k(t)\bigr)}{\hat k(t)} - (n+g+\delta) \]
The growth rate of capital per efficient worker is strictly positive if and only if gross investment per unit of capital strictly exceeds the effective depreciation rate \(n+g+\delta\). The first term on the right-hand side equals the average product of capital multiplied by the saving rate. It is strictly positive, monotonically decreasing, because the returns to capital are decreasing, and tends to infinity at zero and to zero at infinity by the Inada conditions. Hence the curve of gross investment per unit of capital necessarily crosses the horizontal line at height \(n+g+\delta\) exactly once: the steady state is unique, and it satisfies:
\[ \frac{\hat y^{\star}}{\hat k^{\star}} = \frac{n+g+\delta}{s} \]
In what follows we shall seek to describe the dynamics of output per efficient worker, and more specifically the dynamics of adjustment towards the steady state, by computing the speed of convergence. Differentiating \(\hat y(t) = f(\hat k(t))\) with respect to \(t\), we obtain:
\[ \frac{\dot{\hat y}(t)}{\hat y(t)} = s\,r\bigl(\hat k(t)\bigr) - (n+g+\delta)\,\alpha\bigl(\hat k(t)\bigr) \]
with \(r(\hat k) = f'(\hat k)\) the marginal product of capital, which in a perfectly competitive environment corresponds to the real interest rate, and \(\alpha(\hat k) = \hat kf'(\hat k)/f(\hat k)\) the elasticity of output with respect to capital, or, in a perfectly competitive environment, the share of capital income in total income. By definition of \(\alpha\), the steady state also satisfies \(\hat y^{\star}/\hat k^{\star} = r^{\star}/\alpha^{\star}\). Finally, we shall use the elasticity of substitution between capital and labour, defined here, which in terms of the intensive technology reads:
\[ \sigma(\hat k) = -\frac{f'(\hat k)\bigl[f(\hat k) - \hat kf'(\hat k)\bigr]}{\hat k\,f(\hat k)\,f''(\hat k)} \qquad\Leftrightarrow\qquad \frac{\hat kf''(\hat k)}{f'(\hat k)} = -\frac{1-\alpha(\hat k)}{\sigma(\hat k)} \]
We shall sometimes assume that the technology is of the CES type (for constant elasticity of substitution). This production function is more general than the Cobb-Douglas function, but it is not neoclassical, the Inada conditions not being satisfied. In that case the existence of the steady state \(\hat k^{\star}>0\) is no longer guaranteed and depends on the values of the parameters. We set:
\[ \hat y(t) = \left(\gamma_1\,\hat k(t)^{\rho} + \gamma_2\right)^{\frac1\rho} \]
with \(\rho\in\,]-\infty,1]\), \(\sigma = (1-\rho)^{-1}\), that is \(\rho = 1-1/\sigma\), the constant elasticity of substitution between the factors, and \(\gamma_1+\gamma_2=1\). We recover the Cobb-Douglas function, which is neoclassical, when \(\rho\to0\), that is \(\sigma\to1\). The average product \(f(\hat k)/\hat k = \left(\gamma_1 + \gamma_2\hat k^{-\rho}\right)^{1/\rho}\) is still decreasing, but it no longer spans the whole of \(]0,\infty[\), hence the existence conditions of the steady state:
- if \(\rho\in\,]0,1]\), the factors being more substitutable than in the Cobb-Douglas case, the average product decreases from infinity to \(\gamma_1^{1/\rho}\), and the unique steady state \(\hat k^{\star}>0\) exists if and only if \(s\gamma_1^{1/\rho} < n+g+\delta\), that is if the saving rate is not too high;
- if \(\rho < 0\), the factors being less substitutable than in the Cobb-Douglas case, the average product decreases from \(\gamma_1^{1/\rho}\) to zero, and the unique steady state \(\hat k^{\star}>0\) exists if and only if \(s\gamma_1^{1/\rho} > n+g+\delta\), that is if the saving rate is not too low;
- if \(\rho=0\) the production function is Cobb-Douglas, and the existence and uniqueness of the steady state are guaranteed whatever the values of the parameters.
With this technology, the interest rate and the share of capital income are written as functions of \(\hat y\):
\[ r(\hat y) = \gamma_1^{\frac1\rho}\left(1-\gamma_2\,\hat y^{-\rho}\right)^{-\frac{1-\rho}{\rho}} \qquad\text{and}\qquad \alpha(\hat y) = 1-\gamma_2\,\hat y^{-\rho} \]
The capital share is an increasing function of output per efficient worker if and only if \(\rho>0\), that is if and only if the elasticity of substitution exceeds one. At the steady state, \(\alpha^{\star} = \gamma_1\left(s/(n+g+\delta)\right)^{\rho}\).
Throughout what follows we use the calibration of the previous notes: \(s=0.20\), \(n=0.02\), \(g=0.02\), \(\delta=0.10\), and a capital share at the steady state \(\alpha^{\star}=0.36\). To compare technologies for a given steady state, we set \(\gamma_1\) so that \(\alpha^{\star}=0.36\) whatever the elasticity of substitution: \(\gamma_1 = \alpha^{\star}\left((n+g+\delta)/s\right)^{\rho}\) and \(\gamma_2 = 1-\gamma_1\).
s, n, g, delta, alphastar = 0.20, 0.02, 0.02, 0.10, 0.36
mu = n + g + delta
def technology(sigma):
"""Intensive CES production function, its derivative, the elasticity of
output with respect to capital and the steady state, for an elasticity of
substitution sigma, with alpha* = 0.36 whatever sigma."""
rho = 1 - 1/sigma
if abs(rho) < 1e-12: # Cobb-Douglas
f = lambda k: k**alphastar
fprime = lambda k: alphastar*k**(alphastar-1)
kstar = (s/mu)**(1/(1-alphastar))
else:
g1 = alphastar*(mu/s)**rho
g2 = 1 - g1
f = lambda k: (g1*k**rho + g2)**(1/rho)
fprime = lambda k: g1*k**(rho-1)*(g1*k**rho + g2)**(1/rho-1)
kstar = ((mu/s)**rho*(1-alphastar)/g2)**(-1/rho)
alpha = lambda k: k*fprime(k)/f(k)
return f, fprime, alpha, kstar
def transition(sigma, k0, T=80.0):
"""Exact path of capital per efficient worker, by numerical integration."""
f, fprime, alpha, kstar = technology(sigma)
dk = lambda t, k: s*f(k) - mu*k
return solve_ivp(dk, (0, T), [k0], dense_output=True, rtol=1e-10, atol=1e-12)
Characterising the adjustment without approximation
The speed of convergence is defined as the opposite of the growth rate of the growth rate of output per efficient worker:
\[ \beta(t) = -\frac{\dot g_{\hat y}(t)}{g_{\hat y}(t)} \qquad\text{with}\qquad g_{\hat y}(t) = \frac{\dot{\hat y}(t)}{\hat y(t)} \]
It measures the speed at which the growth rate dies out, as the economy approaches its steady state. It will be convenient, here and in the following sections, to reason on the logarithmic deviation of capital from its steady-state level, \(u(t) = \log\bigl(\hat k(t)/\hat k^{\star}\bigr)\), whose dynamics reads:
\[ \dot u = G(u) \equiv s\,\frac{f(\hat k^{\star}e^{u})}{\hat k^{\star}e^{u}} - (n+g+\delta) \]
with \(G(0)=0\). Two derivatives will keep coming back. First, noting that \(\mathrm d\hat k/\mathrm du = \hat k\):
\[ G'(u) = \hat k\,\frac{\mathrm d}{\mathrm d\hat k}\left[s\frac{f(\hat k)}{\hat k}\right] = s\left[f'(\hat k) - \frac{f(\hat k)}{\hat k}\right] = -s\frac{f(\hat k)}{\hat k}\bigl[1-\alpha(\hat k)\bigr] \]
Second, differentiating \(\log\alpha = \log\hat k + \log f' - \log f\) with respect to \(u\) and using the definition of the elasticity of substitution:
\[ \frac{\mathrm d\alpha}{\mathrm du} = \alpha\left[1 + \frac{\hat kf''}{f'} - \alpha\right] = \alpha(\hat k)\bigl[1-\alpha(\hat k)\bigr]\left[1-\frac{1}{\sigma(\hat k)}\right] \]
The speed of convergence of output per efficient worker is, at any instant of the transition: \[ \beta(t) = (n+g+\delta)\bigl[1-\alpha(\hat k)\bigr]\left[1 + \frac{1}{\sigma(\hat k)}\left(\frac{\hat y/\hat y^{\star}}{\hat k/\hat k^{\star}} - 1\right)\right] \]
The growth rate of output is \(g_{\hat y} = \alpha(\hat k)\,g_{\hat k}\) and \(g_{\hat k} = \dot u = G(u)\). Differentiating with respect to time, \(\dot g_{\hat y} = \left[\frac{\mathrm d\alpha}{\mathrm du}G(u) + \alpha G'(u)\right]G(u)\), hence: \[ \beta = -G'(u) - \frac{1}{\alpha}\frac{\mathrm d\alpha}{\mathrm du}G(u) = s\frac{f}{\hat k}(1-\alpha) - (1-\alpha)\left(1-\frac1\sigma\right)\left(s\frac{f}{\hat k} - (n+g+\delta)\right) \] that is, collecting the terms in \(sf/\hat k\): \[ \beta = (1-\alpha)\left[\frac{1}{\sigma}\,s\frac{f}{\hat k} + (n+g+\delta)\left(1-\frac1\sigma\right)\right] = (n+g+\delta)(1-\alpha)\left[1 + \frac1\sigma\left(\frac{sf/\hat k}{n+g+\delta} - 1\right)\right] \] It remains to note that, by the steady-state condition, \(\frac{sf(\hat k)/\hat k}{n+g+\delta} = \frac{\hat y/\hat k}{\hat y^{\star}/\hat k^{\star}}\).
For a Cobb-Douglas technology, the elasticity of substitution is unitary and \(\hat y/\hat y^{\star} = (\hat k/\hat k^{\star})^{\alpha}\), so that we recover the result of Barro and Sala-i-Martin (1995, appendix to chapter 1):
\[ \beta_1(t) = (n+g+\delta)(1-\alpha)\left(\frac{\hat y(t)}{\hat y^{\star}}\right)^{-\frac{1-\alpha}{\alpha}} > 0 \]
The speed of convergence decreases along the transition if and only if the economy reaches its steady state from below, that is if \(g_{\hat y}>0\). At the steady state we recover the standard result, established in the next section by linearising the model: \(\beta_1(t)\to\beta^{\star} = (1-\alpha)(n+g+\delta)\). The note on the simulation of the Solow model plots this speed along the transition.
More generally, when the production function is of the CES type, we have \(\hat y/\hat k = \gamma_1^{1/\rho}\alpha(\hat y)^{-1/\rho}\), since \(\alpha = \gamma_1(\hat k/\hat y)^{\rho}\), and the speed of convergence can be expressed in terms of the capital share alone:
\[ \beta_{\sigma}(t) = (n+g+\delta)\bigl[1-\alpha(\hat y)\bigr]\left[1 + \frac1\sigma\left(\left(\frac{\alpha(\hat y)}{\alpha^{\star}}\right)^{\frac{\sigma}{1-\sigma}} - 1\right)\right] \]
with \(\alpha(\hat y) = 1-\gamma_2\hat y^{-\rho}\). The direction of change of the capital share during the transition depends on the sign of \(\rho\): it increases with output if \(\sigma>1\) and decreases if \(\sigma < 1\). It would be tempting to deduce the direction of change of the speed of convergence from the factor \(1-\alpha(\hat y)\) alone: an increasing capital share would slow convergence down, a decreasing share would speed it up, so that the direction of change of \(\beta_{\sigma}\) would depend on the sign of \(\rho\). But the bracketed term also varies, in the opposite direction, and it is the one that prevails.
In a neighbourhood of the steady state, the speed of convergence varies with the deviation \(u = \log(\hat k/\hat k^{\star})\) according to: \[ \left.\frac{\mathrm d\beta_{\sigma}}{\mathrm du}\right|_{u=0} = -(n+g+\delta)(1-\alpha^{\star})\left[\alpha^{\star} + \frac{1-2\alpha^{\star}}{\sigma}\right] \] This derivative is negative as soon as \(\alpha^{\star} < 1/2\), whatever the elasticity of substitution. An economy below its steady state therefore converges faster than \(\beta^{\star}\), and its speed of convergence decreases during the transition; an economy above converges more slowly than \(\beta^{\star}\), and its speed increases.
Write \(\beta = (1-\alpha)\left[\frac{\phi}{\sigma} + (n+g+\delta)\left(1-\frac1\sigma\right)\right]\) with \(\phi = sf(\hat k)/\hat k\). We have \(\mathrm d\phi/\mathrm du = G'(u) = -\phi(1-\alpha)\) and \(\mathrm d(1-\alpha)/\mathrm du = -\alpha(1-\alpha)(1-1/\sigma)\). At the steady state \(\phi = n+g+\delta\), and the bracket equals \(n+g+\delta\), hence: \[ \frac{\mathrm d\beta}{\mathrm du} = -\alpha(1-\alpha)\left(1-\frac1\sigma\right)(n+g+\delta) - (1-\alpha)\frac{(n+g+\delta)(1-\alpha)}{\sigma} = -(n+g+\delta)(1-\alpha)\left[\alpha + \frac{1-2\alpha}{\sigma}\right] \] The first term is the effect of the capital share, positive when \(\sigma < 1\); the second is the effect of the bracket, always negative, and it dominates the first if and only if \(1-2\alpha+\alpha\sigma>0\), which is guaranteed for \(\alpha < 1/2\).
The figure below confirms this result, and shows what happens far from the steady state. The three technologies share the same steady state and the same asymptotic speed \(\beta^{\star} = 0.0896\), by construction of the calibration. From below, the speed of convergence starts from a level that is higher the more substitutable the factors, and decreases towards \(\beta^{\star}\); for \(\sigma=0.5\) it is almost flat during the first years, the effect of the capital share then almost exactly offsetting that of the bracket. From above, the speed increases towards \(\beta^{\star}\) in all three cases. For \(\sigma=0.5\) it is even negative during the first years: output decreases faster and faster before slowing down. Nothing paradoxical, since \(g_{\hat y} = \alpha\,g_{\hat k}\) and, far above the steady state, the capital share is very low (\(0.12\) against \(0.36\) at the steady state) and rises quickly, while the rate of decline of capital fades only slowly.
We retain that the speed of adjustment towards the steady state is not constant, but changes along the transition, and that its direction of change depends first of all on the initial position relative to the steady state; the elasticity of substitution between the factors modulates the size of these variations, and can change their shape far from the steady state. In this section we have not solved any differential equation, for instance to compute the level of output per efficient worker at instant \(t\). This is generally not possible4, and one must then resort to a numerical approach, as we did to draw the figure, or consider an approximation of the differential equation. Note nevertheless that, without even trying to solve the differential equation, we were able to learn fairly precise things about the transition dynamics.
Characterising the adjustment with a linearisation of the dynamics
Let us now apply the local approximation to the dynamics of the deviation \(u = \log(\hat k/\hat k^{\star})\), whose steady state is \(u=0\).
In a neighbourhood of the steady state, the dynamics of capital per efficient worker is approximately linear: \[ \dot u \approx -\beta\,u \qquad\text{with}\qquad \beta = (n+g+\delta)(1-\alpha^{\star}) \] and the same holds for output per efficient worker: \[ \frac{\mathrm d\log\hat y(t)}{\mathrm dt} \approx -\beta\log\frac{\hat y(t)}{\hat y^{\star}} \] For a CES production function, \(\beta = (n+g+\delta)\left[1-\gamma_1\left(\frac{s}{n+g+\delta}\right)^{\rho}\right]\).
The first-order Taylor expansion of \(G\) around zero gives \(\dot u \approx G'(0)\,u\), and \(G'(0) = -s\frac{f(\hat k^{\star})}{\hat k^{\star}}(1-\alpha^{\star}) = -(n+g+\delta)(1-\alpha^{\star})\) by the steady-state condition. For output, the first-order expansion of \(\log f(\hat k^{\star}e^{u})\) gives \(\log(\hat y/\hat y^{\star}) \approx \alpha^{\star}u\), since the derivative of \(\log f(\hat k^{\star}e^{u})\) with respect to \(u\) is \(\alpha(\hat k)\); thus \(\frac{\mathrm d}{\mathrm dt}\log\hat y = \alpha(\hat k)\dot u \approx -\beta\alpha^{\star}u \approx -\beta\log(\hat y/\hat y^{\star})\). Finally, for the CES, \(\alpha^{\star} = \gamma_1(\hat k^{\star}/\hat y^{\star})^{\rho} = \gamma_1\left(s/(n+g+\delta)\right)^{\rho}\).
By considering a first-order Taylor expansion around the steady state, we lose information about the transition dynamics: here the speed of adjustment towards the steady state is constant. Note nevertheless that the speed of convergence obtained here is the limit, as \(t\) tends to infinity, of the speed of convergence obtained in the previous section. This asymptotic equivalence is not surprising, since the stability of the steady state guarantees that, once \(t\) is large enough, output per efficient worker is arbitrarily close to the steady state. Finally, note that we were able to carry out the computations without specifying the production function: this is generally the case when an approximation of the model is considered.
We have lost part of the properties of the transition, but we can now solve the dynamics, that is, compute the level of output per efficient worker at any instant. Obviously, this solution will only be valid in a neighbourhood of the steady state. The linear equation with constant coefficient tells us that the growth rate of the distance to the steady state is negative and constant: for any initial condition, the distance is absorbed in infinite time, \(u(t) = u(0)e^{-\beta t}\), and likewise for output. Substituting the definition of the deviation, we obtain:
\[ \hat y(t) = \hat y^{\star\,\omega(t)}\,\hat y(0)^{1-\omega(t)} \qquad\text{with}\qquad 0\leq\omega(t) = 1-e^{-\beta t}\xrightarrow[t\to\infty]{}1 \]
Output per efficient worker at instant \(t\) is a weighted geometric mean of its initial value and of its steady-state value, the weight of the latter tending to one. For our calibration, \(\beta^{\star} = 0.0896\) and the half-life of the deviation from the steady state is \(\log 2/\beta^{\star} = 7.7\) years.
Characterising the adjustment with a second-order approximation
One could expand the dynamics of output to second order, as we just did to first order, but the second derivative is then very cumbersome and does not lend itself to a solution. By reasoning on the capital deviation \(u\) rather than on the output deviation, the computation takes a few lines, and the approximate equation can be solved explicitly.
In a neighbourhood of the steady state, the dynamics of the deviation \(u = \log(\hat k/\hat k^{\star})\) is, to second order: \[ \dot u \approx -\beta\,u + \gamma\,u^2 \qquad\text{with}\qquad \gamma = \frac{\beta}{2}\left(1-\frac{\alpha^{\star}}{\sigma^{\star}}\right) \] where \(\sigma^{\star} = \sigma(\hat k^{\star})\) is the elasticity of substitution at the steady state.
The second-order Taylor expansion of \(G\) around zero reads \(\dot u \approx G'(0)u + \frac12G''(0)u^2\). We know \(G'(0) = -\beta\). Differentiating \(G'(u) = -\phi(\hat k)\bigl[1-\alpha(\hat k)\bigr]\), with \(\phi = sf/\hat k\), we get: \[ G''(u) = -\frac{\mathrm d\phi}{\mathrm du}(1-\alpha) + \phi\,\frac{\mathrm d\alpha}{\mathrm du} = \phi(1-\alpha)^2 + \phi\,\alpha(1-\alpha)\left(1-\frac1\sigma\right) = \phi(1-\alpha)\left[1-\frac{\alpha}{\sigma}\right] \] At the steady state, \(\phi = n+g+\delta\) and \(G''(0) = (n+g+\delta)(1-\alpha^{\star})\left(1-\alpha^{\star}/\sigma^{\star}\right) = 2\gamma\).
The quadratic term vanishes if and only if \(\sigma^{\star}=\alpha^{\star}\). For a Cobb-Douglas technology, \(\gamma = \frac{\beta}{2}(1-\alpha)>0\); more generally, \(\gamma\) is positive as soon as \(\sigma^{\star}>\alpha^{\star}\), which is the case for all usual calibrations. The approximate equation is a Bernoulli equation with constant coefficients, with \(m=2\), \(R=\beta\) and \(Q=\gamma\), and we know how to solve it.
The solution of the second-order approximation is: \[ u(t) = \frac{u(0)\,e^{-\beta t}}{1 - \frac{\gamma}{\beta}\,u(0)\left(1-e^{-\beta t}\right)} \] and output per efficient worker follows, to the same order, from: \[ \log\frac{\hat y(t)}{\hat y^{\star}} \approx \alpha^{\star}u(t) + \frac12\alpha^{\star}(1-\alpha^{\star})\left(1-\frac{1}{\sigma^{\star}}\right)u(t)^2 \]
We divide the equation by \(u^2\) and set \(z = 1/u\), so that \(\dot z = -\dot u/u^2\). We get \(\dot z = \beta z - \gamma\), a linear equation with constant coefficients whose steady state is \(\gamma/\beta\) and whose solution is \(z(t) = \left(z(0) - \frac{\gamma}{\beta}\right)e^{\beta t} + \frac{\gamma}{\beta}\). Going back to \(u = 1/z\) with \(z(0) = 1/u(0)\), and multiplying numerator and denominator by \(u(0)e^{-\beta t}\), we obtain the stated expression. For output, the second derivative of \(\log f(\hat k^{\star}e^{u})\) with respect to \(u\) is \(\mathrm d\alpha/\mathrm du = \alpha(1-\alpha)(1-1/\sigma)\), which gives the second-order expansion.
One can go one step further and write directly, to second order, the dynamics of the output deviation \(v = \log(\hat y/\hat y^{\star})\). It has the same form as that of capital, and its speed of convergence compares directly with that of the section without approximation.
In a neighbourhood of the steady state, the output deviation \(v = \log(\hat y/\hat y^{\star})\) follows, to second order, the Bernoulli equation: \[ \dot v \approx -\beta\,v + \gamma_y\,v^2 \qquad\text{with}\qquad \gamma_y = \frac{\beta}{2\alpha^{\star}}\left[\alpha^{\star} + \frac{1-2\alpha^{\star}}{\sigma^{\star}}\right] \] whose solution is \(v(t) = v(0)e^{-\beta t}\big/\bigl[1-\frac{\gamma_y}{\beta}v(0)(1-e^{-\beta t})\bigr]\). The speed of convergence of output implied by the approximation is: \[ -\frac{\ddot v}{\dot v} = \beta - 2\gamma_y\,v \]
Let \(c = \frac12\alpha^{\star}(1-\alpha^{\star})(1-1/\sigma^{\star})\), so that \(v \approx \alpha^{\star}u + cu^2\) and \(\dot v \approx (\alpha^{\star} + 2cu)\dot u\). Substituting \(\dot u \approx -\beta u + \gamma u^2\) and keeping only the terms of order at most two, \(\dot v \approx -\alpha^{\star}\beta\,u + (\alpha^{\star}\gamma - 2c\beta)u^2\). It remains to express \(u\) in terms of \(v\) to the same order, by inverting the expansion: \(u \approx v/\alpha^{\star} - (c/\alpha^{\star 3})v^2\). We get \(\dot v \approx -\beta v + \bigl[\gamma/\alpha^{\star} - \beta c/\alpha^{\star 2}\bigr]v^2\) and, replacing \(\gamma\) and \(c\) by their expressions: \[ \frac{\gamma}{\alpha^{\star}} - \frac{\beta c}{\alpha^{\star 2}} = \frac{\beta}{2\alpha^{\star}}\left[\left(1-\frac{\alpha^{\star}}{\sigma^{\star}}\right) - (1-\alpha^{\star})\left(1-\frac{1}{\sigma^{\star}}\right)\right] = \frac{\beta}{2\alpha^{\star}}\left[\alpha^{\star} + \frac{1-2\alpha^{\star}}{\sigma^{\star}}\right] \] The equation obtained is that of capital with \(\gamma_y\) in place of \(\gamma\), hence the solution. Finally \(\ddot v = (-\beta + 2\gamma_y v)\dot v\).
Two consistency checks. First, since \(v \approx \alpha^{\star}u\), the slope of this speed with respect to \(u\) at the steady state is \(-2\gamma_y\alpha^{\star} = -(n+g+\delta)(1-\alpha^{\star})\bigl[\alpha^{\star} + (1-2\alpha^{\star})/\sigma^{\star}\bigr]\): this is exactly the derivative established in the section without approximation. The second-order speed is the tangent to the exact speed \(\beta_{\sigma}\) at the steady state, where the first order only retains the value \(\beta\). Second, in the Cobb-Douglas case, \(\gamma_y = \beta(1-\alpha)/(2\alpha)\), and the exact speed \(\beta_1 = \beta\,e^{-\frac{1-\alpha}{\alpha}v}\) does have \(\beta - 2\gamma_y v\) as its first-order expansion in \(v\).
def gamma_y(sigma):
return betastar/(2*alphastar)*(alphastar + (1 - 2*alphastar)/sigma)
def order2_output(t, v0, sigma):
gy = gamma_y(sigma)
return v0*np.exp(-betastar*t)/(1 - (gy/betastar)*v0*(1 - np.exp(-betastar*t)))
The figure above superimposes the two speeds along the transitions of the section without approximation. Near the steady state, the second order reproduces the direction and the order of magnitude of the deviations from \(\beta^{\star}\), in both directions and for all three technologies, which the first order cannot do. Far from the steady state, the approximation, which is only the tangent to the exact speed, departs from it. For \(\sigma=1\) and \(\sigma=2\) it underestimates the speed in both directions, the exact speed being convex in \(v\) and the tangent lying below it. For \(\sigma=0.5\) it greatly exaggerates the speed from below, where the exact speed flattens out because the transition function changes curvature along the path, as we shall see below; and it cannot reproduce the negative speed observed from above, which is an effect of the variation of the capital share far from its steady-state level.
Three remarks on this solution.
For \(\gamma=0\) we recover the first-order solution, and in general the denominator corrects the first-order solution by a factor which depends on the sign of \(u(0)\). If \(\gamma>0\) and the economy starts below its steady state (\(u(0) < 0\)), the denominator exceeds one and \(|u(t)|\) is smaller than at first order: convergence is faster. If it starts above, the denominator is below one and convergence is slower. This is exactly what the previous figure says for the exact dynamics. It can also be read on the speed of adjustment of capital. Since \(\dot u\) is the growth rate of capital per efficient worker, \(g_{\hat k}\), the ratio \(-\ddot u/\dot u = -\dot g_{\hat k}/g_{\hat k}\) is the counterpart, for capital, of the speed of convergence defined for output in the section without approximation: it measures the speed at which the growth rate of capital dies out, and equals exactly \(\beta\) for the linear dynamics \(\dot u = -\beta u\). Since \(\dot u = G(u)\), we have \(\ddot u = G'(u)\dot u\) and hence \(-\ddot u/\dot u = -G'(u)\): it is the slope of the transition function at the current point, the speed that a linearisation performed at \(u\) rather than at zero would give. For the second-order approximation, this speed is \(\beta - 2\gamma u\), which is no longer constant: above \(\beta\) below the steady state, below it above. For the exact dynamics, the derivative of \(G\) computed above gives: \[ -\frac{\ddot u}{\dot u} = (n+g+\delta)\bigl[1-\alpha(\hat k)\bigr]\frac{\hat y/\hat y^{\star}}{\hat k/\hat k^{\star}} \] of which \(\beta-2\gamma u\) is the first-order expansion in \(u\). This speed of capital is not the speed of output \(\beta(t)\) of the property established in the section without approximation: since \(g_{\hat y} = \alpha(\hat k)\,g_{\hat k}\), the latter contains in addition the term due to the variation of the capital share, which is the origin of the bracket. The two coincide when \(\alpha\) is constant, that is in the Cobb-Douglas case. The previous property gives the counterpart of \(\beta - 2\gamma u\) for output, \(\beta - 2\gamma_y v\), which compares directly with \(\beta_{\sigma}\).
The approximate equation has a second steady state, \(u = \beta/\gamma\), unstable, which has no counterpart in the model: it is an artefact of the approximation, as the figure on the local approximation led one to expect for any polynomial approximation of the transition function. If \(u(0)>\beta/\gamma\), the denominator vanishes in finite time, and the approximate solution blows up exactly like that of the example treated above. For a Cobb-Douglas technology, \(\beta/\gamma = 2/(1-\alpha)\), that is \(3.125\) for \(\alpha=0.36\): one would have to start from more than twenty-two times the steady-state capital, which is very far from the neighbourhood where the approximation makes sense. The second-order approximation can therefore be used without fear, but it cannot be used anywhere.
In the Cobb-Douglas case, the exact model is itself a Bernoulli equation: \(\dot{\hat k} = s\hat k^{\alpha} - (n+g+\delta)\hat k\), with \(m=\alpha\). The change of variable \(z = \hat k^{1-\alpha}\) makes it linear, \(\dot z = (1-\alpha)\left[s - (n+g+\delta)z\right]\), and one obtains the explicit solution of the transition dynamics, used in the note on the simulation of the Solow model: \[ u(t) = \frac{1}{1-\alpha}\log\left[1 + \left(e^{(1-\alpha)u(0)} - 1\right)e^{-\beta t}\right] \] Equivalently, the variable \(w = e^{-(1-\alpha)u} = (\hat k/\hat k^{\star})^{-(1-\alpha)}\) follows the logistic dynamics \(\dot w = \beta w(1-w)\). The second-order approximation therefore replaces a Bernoulli equation in \(\hat k\) by a Bernoulli equation in \(u\), and the first-order approximation by a linear equation in \(u\). This is why this technology allows the approximation errors to be measured exactly.
The figure below compares the exact dynamics of the deviation \(u\), obtained from the previous formula in the Cobb-Douglas case and by numerical integration in the case \(\sigma=0.5\), with the first- and second-order approximations, starting from \(0.25\,\hat k^{\star}\) and from \(4\,\hat k^{\star}\).
def order1(t, u0):
return u0*np.exp(-betastar*t)
def order2(t, u0, sigma):
gamma = betastar/2*(1 - alphastar/sigma)
return u0*np.exp(-betastar*t)/(1 - (gamma/betastar)*u0*(1 - np.exp(-betastar*t)))
The maximum error on the logarithmic deviation, in absolute value, is as follows:
| start | technology | order one | order two |
|---|---|---|---|
| \(0.25\,\hat k^{\star}\) | Cobb-Douglas | \(0.152\) | \(0.027\) |
| \(4\,\hat k^{\star}\) | Cobb-Douglas | \(0.152\) | \(0.050\) |
| \(0.25\,\hat k^{\star}\) | CES, \(\sigma=0.5\) | \(0.029\) | \(0.036\) |
| \(4\,\hat k^{\star}\) | CES, \(\sigma=0.5\) | \(0.101\) | \(0.026\) |
In the Cobb-Douglas case, the second order divides the first-order error by more than five from below and by three from above, even though the starting points retained are far from small: an initial capital four times below or above the steady-state capital. The first-order approximation always errs in the same direction, it underestimates the speed from below and overestimates it from above, which is exactly the content of the property established in the section without approximation; the second order, by restoring the dependence of the speed on the position, corrects this asymmetry. An error remains, larger from above than from below, which would only shrink by pushing the expansion to the next order.
The case \(\sigma=0.5\) holds a surprise: from below, the second order does worse than the first order. This is not a computational error, but a reminder of what a local approximation is. The curvature of the transition function has, by the proof of the property, the sign of \(1-\alpha(\hat k)/\sigma\). With \(\sigma=0.5\), the capital share increases as capital decreases, and exceeds \(\sigma\) as soon as \(\hat k\) falls below half of \(\hat k^{\star}\): the function \(G\) is convex in a neighbourhood of the steady state, where the approximation is built, but concave on the first part of the path, where it is used. The quadratic term, which reproduces the curvature at the steady state, then corrects in the wrong direction. That the first order does well is due to a compensation, the exact speed of capital being sometimes below, sometimes above \(\beta^{\star}\) along this path, as the figure on the speed of convergence suggested. From above, where the function remains convex, the second order divides the error by four.
One should not conclude that the second-order approximation is always preferable. It requires knowing the curvature of the transition function at the steady state, here the elasticity of substitution, where the first order makes do with the capital share; and its explicit solution is a privilege of dimension one, which disappears as soon as one moves to a system. This is why log-linearisation remains the reference method for dynamic general equilibrium models, and why higher orders are only sought when the question at hand requires them.
Footnotes:
The condition is necessary. It is sufficient on a simply connected domain, which we shall always assume.
A function homogeneous of degree one, increasing and concave in each of its arguments, and satisfying the Inada conditions. See the note on the Solow model.
The other notes on this site denote by \(x\) the growth rate of technical progress.
Except for some production functions. For a Cobb-Douglas or Leontief technology the computations can be carried through; we shall come back to it.