3.4: Applications
Compound Interest
The equation for the growth of an investment with continuous compounding of interest is a first-order differential equation. Let \(S(t)\) be the value of the investment at time \(t\), and let \(r\) be the annual interest rate compounded after every time interval \(∆t\). We can also include deposits (or withdrawals). Let \(k\) be the annual deposit amount, and suppose that an installment is deposited after every time interval \(∆t\). The value of the investment at the time \(t + ∆t\) is then given by \[\label{eq:1}S(t+\Delta t)=S(t)+(r\Delta t)S(t)+k\Delta t,\] where at the end of the time interval \(∆t\), \(r\Delta tS(t)\) is the amount of interest credited and \(k∆t\) is the amount of money deposited \((k > 0)\) or withdrawn \((k < 0)\). As a numerical example, if the account held \($10,000\) at time \(t\), and \(r = 6\%\) per year and \(k = $12,000\) per year, say, and the compounding and deposit period is \(∆t = 1\text{ month} = 1/12\text{ year}\), then the interest awarded after one month is \(r\Delta tS = (0.06/12) × $10,000 = $50\), and the amount deposited is \(k∆t = $1000\).
Rearranging the terms of \(\eqref{eq:1}\) to exhibit what will soon become a derivative, we have \[\frac{S(t+\Delta t)-S(t)}{\Delta t}=rS(t)+k.\nonumber\]
The equation for continuous compounding of interest and continuous deposits is obtained by taking the limit \(\Delta t\to 0\). The resulting differential equation is \[\label{eq:2}\frac{dS}{dt}=rS+k,\] which can solved with the initial condition \(S(0) = S_0\), where \(S_0\) is the initial capital. We can solve either by separating variables or by using an integrating factor; I solve here by separating variables. Integrating from \(t = 0\) to a final time \(t\), \[\begin{align} \int_{S_0}^S \frac{dS}{rS+k}&=\int_0^tdt,\nonumber \\ \frac{1}{r}\ln\left(\frac{rS+k}{rS_0+k}\right)&=t,\nonumber \\ rS+k&=(rS_0+k)e^{rt},\nonumber \\ S&=\frac{rS_0e^{rt}+ke^{rt}-k}{r},\nonumber \\ S&=S_0e^{rt}+\frac{k}{r}e^{rt}(1-e^{-rt}),\label{eq:3} \end{align}\] where the first term on the right-hand side of \(\eqref{eq:3}\) comes from the initial invested capital, and the second term comes from the deposits (or withdrawals). Evidently, compounding results in the exponential growth of an investment.
As a practical example, we can analyze a simple retirement plan. It is easiest to assume that all amounts and returns are in real dollars (adjusted for inflation). Suppose a \(25\) year-old plans to set aside a fixed amount every year of his/her working life, invests at a real return of \(6\%\), and retires at age \(65\). How much must he/she invest each year to have \(\text{HK }$8,000,000\) at retirement? (Note: \(\text{US }$1\approx\text{ HK }$8\).) We need to solve \(\eqref{eq:3}\) for \(k\) using \(t = 40\text{ years}\), \(S(t) = $8,000,000\), \(S_0 = 0\), and \(r = 0.06\) per year. We have \[\begin{aligned}k&=\frac{rS(t)}{e^{rt}-1}, \\ k&=\frac{0.06\times 8,000,000}{e^{0.06\times 40}-1}, \\ &=$47,889\text{ year}^{-1}.\end{aligned}\]
To have saved approximately one million \(\text{US}$\) at retirement, the worker would need to save about \(\text{HK }$50,000\) per year over his/her working life. Note that the amount saved over the worker’s life is approximately \(40 × $50,000 = $2,000,000\), while the amount earned on the investment (at the assumed \(6\%\) real return) is approximately \($8,000,000 − $2,000,000 = $6,000,000\). The amount earned from the investment is about \(3×\) the amount saved, even with the modest real return of \(6\%\). Sound investment planning is well worth the effort.
Chemical Reactions
Suppose that two chemicals \(A\) and \(B\) react to form a product \(C\), which we write a \[A+B\overset{k}{\to}C,\nonumber\] where \(k\) is called the rate constant of the reaction. For simplicity, we will use the same symbol \(C\), say, to refer to both the chemical \(C\) and its concentration. The law of mass action says that \(dC/dt\) is proportional to the product of the concentrations \(A\) and \(B\), with proportionality constant \(k\); that is \[\label{eq:4}\frac{dC}{dt}=kAB.\]
Similarly, the law of mass action enables us to write equations for the time-derivatives of the reactant concentrations \(A\) and \(B\):
\[\label{eq:5}\frac{dA}{dt}=-kAB,\quad\frac{dB}{dt}=-kAB.\]
The ode given by \(\eqref{eq:4}\) can be solved analytically using conservation laws. We assume that \(A_0\) and \(B_0\) are the initial concentrations of the reactants, and that no product is initially present. From \(\eqref{eq:4}\) and \(\eqref{eq:5}\), \[\begin{array}{lll} \frac{d}{dt}(A+C)=0&\Longrightarrow &A+C=A_0, \\ \frac{d}{dt}(B+C)=0&\Longrightarrow &B+C=B_0.\end{array}\nonumber\]
Using these conservation laws, \(\eqref{eq:4}\) becomes \[\frac{dC}{dt}=k(A_0-C)(B_0-C),\quad C(0)=0,\nonumber\] which is a nonlinear equation that may be integrated by separating variables. Separating and integrating, we obtain \[\begin{align}\int_0^C\frac{dC}{(A_0-C)(B_0-C)}&=k\int_0^t dt\nonumber \\ &=kt.\label{eq:6}\end{align}\]
The remaining integral can be done using the method of partial fractions. We write \[\label{eq:7}\frac{1}{(A_0-C)(B_0-C)}=\frac{a}{A_0-C}+\frac{b}{B_0-C}.\]
The cover-up method is the simplest method to determine the unknown coefficients \(a\) and \(b\). To determine \(a\), we multiply both sides of \(\eqref{eq:7}\) by \(A_0 − C\) and set \(C = A_0\) to find \[a=\frac{1}{B_0-A_0}.\nonumber\]
Similarly, to determine \(b\), we multiply both sides of \(\eqref{eq:7}\) by \(B_0 − C\) and set \(C = B_0\) to find \[b=\frac{1}{A_0-B_0}.\nonumber\]
Therefore, \[\frac{1}{(A_0-C)(B_0-C)}=\frac{1}{B_0-A_0}\left(\frac{1}{A_0-C}-\frac{1}{B_0-C}\right),\nonumber\] and the remaining integral of \(\eqref{eq:6}\) becomes (using \(C < A_0,\: B_0\)) \[\begin{aligned} \int_0^C\frac{dC}{(A_0-C)(B_0-C)}&=\frac{1}{B_0-A_0}\left(\int_0^C\frac{dC}{A_0-C}-\int_0^C\frac{dC}{B_0-C}\right) \\ &=\frac{1}{B_0-A_0}\left(-\ln\left(\frac{A_0-C}{A_0}\right)+\ln\left(\frac{B_0-C}{B_0}\right)\right) \\ &=\frac{1}{B_0-A_0}\ln\left(\frac{A_0(B_0-C)}{B_0(A_0-C)}\right).\end{aligned}\]
Using this integral in \(\eqref{eq:6}\), multiplying by \((B_0 − A_0)\) and exponentiating, we obtain \[\frac{A_0(B_0-C)}{B_0(A_0-C)}=e^{(B_0-A_0)kt}.\nonumber\]
Solving for \(C\), we finally obtain \[C(t)=A_0B_0\frac{e^{(B_0-A_0)kt}-1}{B_0e^{(B_0-A_0)kt}-A_0},\nonumber\] which appears to be a complicated expression, but has the simple limits \[\begin{aligned}\underset{t\to\infty}{\lim}C(t)&=\left\{\begin{array}{ll}A_0,&\text{if }A_0<B_0, \\ B_0,&\text{if }B_0<A_0\end{array}\right. \\ &=\text{min}(A_0,B_0).\end{aligned}\]
As one would expect, the reaction stops after one of the reactants is depleted; and the final concentration of product is equal to the initial concentration of the depleted reactant.
Terminal Velocity
Using Newton’s law, we model a mass \(m\) free falling under gravity but with air resistance. We assume that the force of air resistance is proportional to the speed of the mass and opposes the direction of motion. We define the \(x\)-axis to point in the upward direction, opposite the force of gravity. Near the surface of the Earth, the force of gravity is approximately constant and is given by \(−mg\), with \(g = 9.8\text{m/s}^2\) the usual gravitational acceleration. The force of air resistance is modeled by \(−kv\), where \(v\) is the vertical velocity of the mass and \(k\) is a positive constant. When the mass is falling, \(v < 0\) and the force of air resistance is positive, pointing upward and opposing the motion. The total force on the mass is therefore given by \(F = −mg − kv\). With \(F = ma\) and \(a = dv/dt\), we obtain the differential equation \[\label{eq:8}m\frac{dv}{dt}=-mg-kv.\]
The terminal velocity \(v_∞\) of the mass is defined as the asymptotic velocity after air resistance balances the gravitational force. When the mass is at terminal velocity, \(dv/dt = 0\) so that \[\label{eq:9}v_{\infty}=-\frac{mg}{k}.\]
The approach to the terminal velocity of a mass initially at rest is obtained by solving \(\eqref{eq:8}\) with initial condition \(v(0) = 0\). The equation is both linear and separable, and I solve by separating variables:
\[\begin{aligned}m\int_0^v\frac{dv}{mg+kv}&=-\int_0^t dt,\\ \frac{m}{k}\ln\left(\frac{mg+kv}{mg}\right)&=-t, \\ 1+\frac{kv}{mg}&=e^{-kt/m}, \\ v&=-\frac{mg}{k}\left(1-e^{-kt/m}\right).\end{aligned}\]
Therefore, \(v = v_∞\left( 1 − e^{−kt/m}\right)\), and \(v\) approaches \(v_∞\) as the exponential term decays to zero.
As an example, a skydiver of mass \(m = 100\text{ kg}\) with his parachute closed may have a terminal velocity of \(200\text{ km/hr}\). With \[g=(9.8\text{ m/s}^2)(10^{-3}\text{ km/m})(60\text{ s/min})^2(60\text{ min/hr})^2=127,008\text{ km/hr}^2,\nonumber\] one obtains from \(\eqref{eq:9}\), \(k = 63, 504\text{ kg/hr}\). One-half of the terminal velocity for free-fall (\(100\text{ km/hr}\)) is therefore attained when \((1 − e^{−kt/m}) = 1/2\), or \(t = m \ln 2/k\approx 4\text{ sec}\). Approximately \(95\%\) of the terminal velocity (\(190\text{ km/hr}\)) is attained after \(17\text{ sec}\).
Escape Velocity
An interesting physical problem is to find the smallest initial velocity for a mass on the Earth’s surface to escape from the Earth’s gravitational field, the so-called escape velocity. Newton’s law of universal gravitation asserts that the gravitational force between two massive bodies is proportional to the product of the two masses and inversely proportional to the square of the distance between them. For a mass \(m\) a position \(x\) above the surface of the Earth, the force on the mass is given by \[F=-G\frac{Mm}{(R+x)^2},\nonumber\] where \(M\) and \(R\) are the mass and radius of the Earth and \(G\) is the gravitational constant. The minus sign means the force on the mass \(m\) points in the direction of decreasing \(x\). The approximately constant acceleration \(g\) on the Earth’s surface corresponds to the absolute value of \(F/m\) when \(x = 0\):
\[g=\frac{GM}{R^2},\nonumber\] and \(g\approx 9.8\text{ m/s}^2\). Newton’s law \(F = ma\) for the mass \(m\) is thus given by \[\begin{align}\frac{d^2x}{dt^2}&=-\frac{GM}{(R+x)^2}\nonumber \\ &=-\frac{g}{(1+x/R)^2},\label{eq:10}\end{align}\] where the radius of the Earth is known to be \(R\approx 6350\text{ km}\).
A useful trick allows us to solve this second-order differential equation as a first-order equation. First, note that \(d^2x/dt^2 = dv/dt\). If we write \(v(t) = v(x(t))\)— considering the velocity of the mass \(m\) to be a function of its distance above the Earth—we have using the chain rule \[\begin{aligned}\frac{dv}{dt}&=\frac{dv}{dx}\frac{dx}{dt} \\ &=v\frac{dv}{dx},\end{aligned}\] where we have used \(v = dx/dt\). Therefore, \(\eqref{eq:10}\) becomes the first-order ode \[v\frac{dv}{dx}=-\frac{g}{(1+x/R)^2},\nonumber\] which may be solved assuming an initial velocity \(v(x = 0) = v_0\) when the mass is shot vertically from the Earth’s surface. Separating variables and integrating, we obtain \[\int_{v_0}^v vdv=-g\int_0^x\frac{dx}{(1+x/R)^2}.\nonumber\]
The left integral is \(\frac{1}{2}(v^2 − v_0^2)\), and the right integral can be performed using the substitution \(u = 1 + x/R\), \(du = dx/R\):
\[\begin{aligned}\int_0^x\frac{dx}{(1+x/R)^2}&=R\int_1^{1+x/R}\frac{du}{u^2} \\ &=-\left.\frac{R}{u}\right]_1^{1+x/R} \\ &=R-\frac{R^2}{x+R} \\ &=\frac{Rx}{x+R}.\end{aligned}\]
Therefore, \[\frac{1}{2}(v^2-v_0^2)=-\frac{gRx}{x+R},\nonumber\] which when multiplied by \(m\) is an expression of the conservation of energy (the change of the kinetic energy of the mass is equal to the change in the potential energy). Solving for \(v^2\), \[v^2=v_0^2-\frac{2gRx}{x+R}.\nonumber\]
The escape velocity is defined as the minimum initial velocity \(v_0\) such that the mass can escape to infinity. Therefore, \(v_0 = v_{\text{escape}}\) when \(v → 0\) as \(x → ∞\). Taking this limit, we have \[\begin{aligned}v_{\text{escape}}^2&=\underset{x\to\infty}{\lim}\frac{2gRx}{x+R} \\ &=2gR.\end{aligned}\]
With \(R\approx 6350\text{ km}\) and \(g = 127 008\text{ km/hr}^2\), we determine \(v_{\text{escape}} = \sqrt{2gR}\approx 40 000\text{ km/hr}\). In comparison, the muzzle velocity of a modern high-performance rifle is \(4300\text{ km/hr}\), almost an order of magnitude too slow for a bullet, shot into the sky, to escape the Earth’s gravity.
RC Circuit
Consider a resister \(R\) and a capacitor \(C\) connected in series as shown in Fig. \(\PageIndex{1}\). A battery providing an electromotive force, or emf \(\mathcal{E}\), connects to this circuit by a switch. Initially, there is no charge on the capacitor. When the switch is thrown to a, the battery connects and the capacitor charges. When the switch is thrown to \(b\), the battery disconnects and the capacitor discharges, with energy dissipated in the resister. Here, we determine the voltage drop across the capacitor during charging and discharging.
The equations for the voltage drops across a capacitor and a resister are given by \[\label{eq:11} V_C=q/C,\quad V_R=iR,\] where \(C\) is the capacitance and \(R\) is the resistance. The charge \(q\) and the current \(i\) are related by \[\label{eq:12}i=\frac{dq}{dt}.\]
Kirchhoff’s voltage law states that the emf \(\mathcal{E}\) in any closed loop is equal to the sum of the voltage drops in that loop. Applying Kirchhoff’s voltage law when the switch is thrown to \(a\) results in \[\label{eq:13}V_R+V_C=\mathcal{E}.\]
Using \(\eqref{eq:11}\) and \(\eqref{eq:12}\), the voltage drop across the resister can be written in terms of the voltage drop across the capacitor as \[V_R=RC\frac{dV_C}{dt},\nonumber\] and \(\eqref{eq:13}\) can be rewritten to yield the linear first-order differential equation for VC given by \[\label{eq:14}\frac{dV_C}{dt}+V_C/RC=\mathcal{E}/RC,\] with initial condition \(V_C(0)=0.\)
The integrating factor for this equation is \[\mu(t)=e^{t/RC},\nonumber\] and \(\eqref{eq:14}\) integrates to \[V_C(t)=e^{-t/RC}\int_0^t(\mathcal{E}/RC)e^{t/RC}dt,\nonumber\] with solution \[V_C(t)=\mathcal{E}\left(1-e^{-t/RC}\right).\nonumber\]
The voltage starts at zero and rises exponentially to \(\mathcal{E}\), with characteristic time scale given by \(RC\).
When the switch is thrown to \(b\), application of Kirchhoff’s voltage law results in \[V_R+V_C=0,\nonumber\] with corresponding differential equation \[\frac{dV_C}{dt}+V_C/RC=0.\nonumber\]
Here, we assume that the capacitance is initially fully charged so that \(V_C(0) =\mathcal{E}\). The solution, then, during the discharge phase is given by \[V_C(t)=\mathcal{E}e^{-t/RC}.\nonumber\]
The voltage starts at \(\mathcal{E}\) and decays exponentially to zero, again with characteristic time scale given by \(RC\).
The Logistic Equation
Let \(N(t)\) be the number of individuals in a population at time \(t\), and let \(b\) and \(d\) be the average per capita birth rate and death rate, respectively. In a short time \(∆t\), the number of births in the population is \(b\Delta tN\), and the number of deaths is \(d\Delta tN\). An equation for \(N\) at time \(t + ∆t\) is then determined to be \[N(t+\Delta t)=N(t)+b\Delta tN(t)-d\Delta tN(t),\nonumber\] which can be rearranged to \[\frac{N(t+\Delta t)-N(t)}{\Delta t}=(b-d)N(t);\nonumber\] and as \(\Delta t\to 0\), and with \(r=b-d\), we have \[\frac{dN}{dt}=rN.\nonumber\]
This is the Malthusian growth model (Thomas Malthus, 1766-1834), and is the same equation as our compound interest model.
Under a Malthusian growth model, the population size grows exponentially like \[N(t)=N_0e^{rt},\nonumber\] where \(N_0\) is the initial population size. However, when the population growth is constrained by limited resources, a heuristic modification to the Malthusian growth model results in the Verhulst equation, \[\label{eq:15}\frac{dN}{dt}=rN\left(1-\frac{N}{K}\right),\] where \(K\) is called the carrying capacity of the environment. Making \(\eqref{eq:15}\) dimensionless using \(\tau = rt\) and \(x = N/K\) leads to the logistic equation, \[\frac{dx}{d\tau}=x(1-x),\nonumber\] where we may assume the initial condition \(x(0) = x_0 > 0\). Separating variables and integrating \[\int_{x_0}^x\frac{dx}{x(1-x)}=\int_0^{\tau}d\tau .\nonumber\]
The integral on the left-hand-side can be done using the method of partial fractions:
\[\frac{1}{x(1-x)}=\frac{a}{x}+\frac{b}{1-x},\nonumber\] and the cover-up method yields \(a = b = 1\). Therefore, \[\begin{aligned}\int_{x_0}^x\frac{dx}{x(1-x)}&=\int_{x_0}^x\frac{dx}{x}+\int_{x_0}^x\frac{dx}{(1-x)} \\ &=\ln\frac{x}{x_0}-\ln\frac{1-x}{1-x_0} \\ &=\ln\frac{x(1-x_0)}{x_0(1-x)} \\ &=\tau .\end{aligned}\]
Solving for \(x\), we first exponentiate both sides and then isolate \(x\):
\[\begin{align}\frac{x(1-x_0)}{x_0(1-x)}&=e^{\tau},\nonumber \\ x(1-x_0)&=x_0e^{\tau}-xx_0e^{\tau},\nonumber \\ x(1-x_0+x_0e^{\tau})&=x_0e^{\tau},\nonumber \\ x&=\frac{x_0}{x_0+(1-x_0)e^{-\tau}}.\label{eq:16}\end{align}\]
We observe that for \(x_0 > 0\), we have \(\lim_{\tau\to\infty} x(\tau ) = 1\), corresponding to \[\underset{t\to\infty}{\lim}N(t)=K.\nonumber\]
The population, therefore, grows in size until it reaches the carrying capacity of its environment.