# Continually Compounded Interest + Addition to Principal

This is essentially the continually compounded version of this question.

I want to know how much money I will have after continually compounding interest, plus continually adding a fixed amount to the principal.

Let t be time in years, S be amount saved per month (added to the principal), R be APR, and x be the current amount of money. I'm going to assume no initial investment.

I started off with this equation:

$$x + dx = 12 S dt + x e^{R dt}$$

Perhaps that is the wrong way to go about it. I don't even know what equations with bare dx's and dt's (instead of dx/dt's) are called, so I had trouble trying to figure this out. Moving things around, I got this equation, which I didn't know what to do with the dt in the denominator of the integral (Cancel out with the dt of the integral?).

$$\frac{dx}{dt} = 12 S - x \frac{1-e^{R dt}}{dt}$$ $$x = 12 S t - \int{x \frac{1 - e^{R dt}}{dt}dt}$$

We focus on the reasoning that leads to the differential equation. Then we look at the solution.

There are variations in the legal definition of APR. For simplicity, I will assume that in one year, $1$ dollar grows to $1+R$. The calculations below are readily modified if another meaning is assigned to $R$.

If there is continuous compounding at instantaneous rate $r$, then in one year $1$ dollar grows to $e^r$. Thus $e^r=1+R$, or equivalently $r=\ln(1+R)$. To repeat, $r$ is the instantaneous rate at which the money grows because of interest. It is not the same as $R$, although the two are numerically close when interest rates are low.

Let $x=x(t)$ be the amount of money in your account at time $t$, where $t$ is measured in years. We find an expression for $\frac{dx}{dt}$, the rate at which your money grows at time $t$.

Money is flowing into your account from two sources. They are (i) the continuous accrual of interest and (ii) the continuous deposits. The rate of accrual of interest, when we have $x$ in the bank, is $rx$. The rate at which money is deposited is $12S$. We arrive at the linear differential equation $$\frac{dx}{dt}=rx+12S.$$ There are various ways to solve the differential equation. The simplest is to fool around until you find something that works. General theory tells us that there is a unique solution for any given initial condition, so "guess and check" can be theoretically justified. Or else we can use a general method for separable equations, or for linear differential equations with constant coefficients. But it is simplest to make the change of variable $w=x+\frac{12S}{r}$. Then $\frac{dw}{dt}=\frac{dx}{dt}$. So our differential equation can be rewritten as $$\frac{dw}{dt}=rw.$$ This is the standard differential equation for exponential growth. It has general solution $$w=Ce^{rt}.$$ You specified the initial condition $x(0)=0$. Thus when $t=0$, we have $w=\frac{12S}{r}$; this is the value of $C$. It follows that $$x(t)= \frac{12S}{r}\left(e^{rt}-1\right).$$

Remark: If you really want an informal argument with "bare" differentials $dt$ and $dx$, imagine that time increases by a tiny amount $dt$. Then $x$ increases by an amount $dx$ made up of two parts. There is the accrual of interest, an amount roughly $r (x\,dt)$. And there is the amount deposited, which is $12S\,dt$. It is more complicated than that, since the part deposited towards the beginning of the short interval accrues interest, but this is exceedingly small even when compared to the two small main terms we have mentioned. We conclude (?) that $$dx\approx (rx+12S)\,dt.$$ Now divide both sides by $dx$, and we get to our differential equation. I do not see any advantage to this approach for our particular problem. It can be very good in an Engineering or Physics setting, once a great deal of physical intuition has been developed, and might be similarly useful in a very complex financial setting.

• You lost me a bit at the step where you arrive at $x(t)=\frac{12S}{r}(e^{rt}-1)$. Any chance you could add another step? I've been trying to calculate a general formula for this and have arrived at $A_0e^{rt}+\frac{k}{r}(e^{rt}-1)$ (where $A_0, r, k$ are the initial amount, interest, and rate money is added, respectively). Is that right, or am I completely misunderstanding this? – Zaz Feb 24 '16 at 20:51
• We go back to the substitution $w=x+12S/r$. Since $x(0)=0$, we have $w(0)=12S/r$. Thus $C=12S/r$ and therefore $x=w-12S/r=12S/r e^{rt}-12S/r=(2S/r)(e^{rt}-1)$. – André Nicolas Feb 24 '16 at 21:01

The equation you have is of the form (where $$\dot x = dx/dt$$):

$$\dot x = rx + s$$

Divide both sides by $$rx + s$$ and integrate:

\begin{align} \int \frac{\dot x}{rx + s} \ dt &= \int 1 \ dt \\\ \\ \frac{1}{r} \cdot \ln(rx+s) &= t + C \end{align}

Rearrange (the $$C$$s in each equation are different constants):

\begin{align} \ln(rx+s) &= rt + C \\\ \\ rx+s &= Ce^{rt} \\\ \\ x &= \frac{Ce^{rt} - s}{r} = Ce^{rt} - \frac{s}{r} \\\ \\ \end{align}

Assuming we start with no money: $$0 = Ce^{r\cdot0}-\frac{s}{r} = C - \frac{s}{r} \implies C = \frac{s}{r}$$:

$$\Large x = \frac{s}{r} \left( e^{rt} - 1 \right)$$

Where $$s$$ is how much you save over 1 year, $$r$$ is the interest rate, e.g. $$0.1$$, and $$t$$ is number of years.