Differential equation and savings
Part of Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics.
Main Stam4Econ site | View this section in the book | Author: Fan Wang | DOI: 10.5281/zenodo.24696926
Date: 2026-11-30 | HTML | PDF | QMD
1 Differential equation and savings
1.1 First difference
What is a difference equation? When we have something at time \(t+1\) and at \(t\) as well, let’s call this \(x_t\) and \(x_{t+1}\), then a difference equation is an equation that relates \(x_{t+1}\) to \(x_t\). For example:
\[ \Delta x_t = x_{t+1} - x_t \]
We can also write \(t\) not as superscript but write \(x\) as a function of discrete \(t\):
\[ \Delta x(t) = x(t+1) - x(t) \]
Consider the difference in savings between two points in time, savings at time \(t\) is \(S(t)\), between \(t\) and \(t+1\), I have earnings from income, from interest on the savings, and I can decide to save more or withdraw.
\[\begin{align*} \Delta S(t) &= S(t+1) - S(t) \\ &= \underbrace{y(t) + (1+r) S(t) - c(t)}_{=S(t+1)} - S(t)\\ &= y(t) + r S(t) - c(t)\\ \end{align*}\]
Where \(y(t)\) is income, \(r\) is the interest rate, and \(c(t)\) is consumption at time \(t\). The difference equation tells us how savings change over time.
1.2 Definition of derivative with respect to time
Time is continuous, rather than jumping at 1 unit time intervals, we can consider changes over arbitrarily sized intervals. When the interval is small, we can define:
\[ \dot{x} = \frac{d x}{d t} = \lim_{\Delta t \to 0} \frac{x(t + \Delta t) - x(t)}{\Delta t} \]
As a short hand, we can write \(\dot{x}\) instead of \(\frac{d x}{d t}\). The “d” notation we use, \(\frac{d x}{d t}\), is from Leibniz. The dot notation is from Newton. Newton invented calculus partly to analyze time and motion.
1.3 Differential equation and savings
In continuous time, suppose \(y(t)\) and \(c(t)\) are flow rates per unit time and \(r\) is a continuously compounded interest rate. Over a small interval \(\Delta t\), the balance changes approximately by
\[ S(t+\Delta t)-S(t)\approx \left(y(t)+rS(t)-c(t)\right)\Delta t. \]
Dividing by \(\Delta t\) and taking the limit gives the differential equation:
\[ \dot{S}(t) = y(t) + r S(t) - c(t) \]
This is a continuous-time flow equation; it is a limiting counterpart of the discrete-time balance equation, not the same discrete-time equation.
Why is this a differential equation? A differential equation is an equation that relates a function to its derivative. Here we have \(S(t)\) on the right hand side, and \(\dot{S}(t)\) on the left hand side, so it is a differential equation.
1.4 Differential equation, derivative, and integral
Perhaps the simplest differential equation is this below:
\[ \frac{df(x)}{dx} = n\frac{f(x)}{x} \]
This is a differential equation because it relates the function \(f(x)\) to its derivative \(\frac{df}{dx}\). We can solve this differential equation by separating the variables:
\[\begin{align*} \frac{df}{f(x)} &= n \frac{dx}{x} \\ \int \frac{1}{f(x)} df &= \int n \frac{1}{x} dx \\ \ln f(x) &= n \ln x + C \\ f(x) &= A x^n \quad \text{ where } A = e^C \end{align*}\]
We assume above the \(f(x)\) and \(x\) are positive, so that the logarithm is defined. The solution to the differential equation is \(f(x) = A x^n\), where \(A\) is a constant.
In this case the derivative of \(f(x)\) is \(f'(x) = n A x^{n-1}\), which is just our power rule for derivatives. We usually don’t think of this as an ordinary differential equation, but it is one once we transform it to \(\frac{df}{dx} = n \frac{f(x)}{x}\).