Compound interest with added salary - expanding on other user's question

68 Views Asked by At

Not too long ago I saw a question posted by the user Rick Joker regarding calculating ROI here - Calculating ROI - where is my mistake

The question was rather basic (although well formulated). and I'd like to expand on it for the sake of mathematical understanding and enlightenment.

Rick reached the correct conclusion that if he invested $x(0)$ and $x(t) = x(t-1)(1+\alpha)$ then $x(t) = x(0)(1+\alpha)^t$ given his circumstances.

I'd like to take this question further. Suppose that apart from investing his ROI each day, every $\beta$ days he invests a further $\gamma$ dollars. From his salary or other dividends or what not.

How would we calculate $x(t)$?

If $t < \beta$ then $x(t) = x(0)(1+\alpha)^t$, but $x(\beta) = x(0)(1+\alpha)^\beta+\gamma$, and $x(\beta+1) = x(0)(1+\alpha)^{\beta+1}+\gamma(1+\alpha)$ and so on, and $x(2\beta) = x(0)(1+\alpha)^{2\beta}+\gamma(1+\alpha)^\beta+\gamma$ etc...

It seems to me like $$x(k\beta) = x(0)(1+\alpha)^{k\beta}+\gamma(1+\alpha)^{\beta(k-1)}+\gamma(1+\alpha)^{\beta(k-2)}+...+\gamma = x(0)(1+\alpha)^{k\beta}+\gamma\sum_{i=0}^{k-1}(1+\alpha)^{i\beta}$$

The sum is the sum of geometric sequence starting at $1$ with ratio $(1+\alpha)^\beta$ with $k$ elements. This is equal to $\frac{1-(1+\alpha)^{k\beta}}{1-(1+\alpha)^\beta}$

So overall, $$x(k\beta) = x(0)(1+\alpha)^{k\beta} + \gamma \frac{1-(1+\alpha)^{k\beta}}{1-(1+\alpha)^\beta}$$

That's fine, but how do we calculate $x(t)$ for some arbitrary $t$ which is not necessarily a multiple of $\beta$?

1

There are 1 best solutions below

0
On BEST ANSWER

If $t< \beta$,

$$x(t)=x(0)(1+\alpha)^t$$

Now, we will focus on the case where $t \geq \beta$,

At time $t$, there would be additional $\lfloor t/\beta \rfloor$ deposits besides the initial investment.

An investment at period $i\beta$ will go through increment of interest for $t-i\beta$ time, resulting in the following:

\begin{align} x(t) &= x(0)(1+\alpha)^t + \sum_{i=1}^{\lfloor t/\beta\rfloor} \gamma (1+\alpha)^{t-i\beta} \\ &= x(0)(1+\alpha)^t + \gamma (1+\alpha)^t\sum_{i=1}^{\lfloor t/\beta\rfloor} (1+\alpha)^{-i\beta} \\ &=x(0)(1+\alpha)^t + \gamma (1+\alpha)^t(1+\alpha)^{-\beta}\frac{1-(1+\alpha)^{-\beta \lfloor t/\beta\rfloor}}{1-(1+\alpha)^{-\beta}} \\ &=x(0)(1+\alpha)^t + \gamma (1+\alpha)^{t-\beta}\frac{1-(1+\alpha)^{-\beta \lfloor t/\beta\rfloor}}{1-(1+\alpha)^{-\beta}} \\ \end{align}

Sanity check:

Our formula agree when $t=k\beta$, in particular, let $r=(1+\alpha)^\beta$, my formula become

\begin{align} x(k\beta) &=x(0)(1+\alpha)^t+\gamma (1+\alpha)^{(k-1)\beta}\frac{1-r^{-k}}{1-r^{-1}} \\ &= x(0)(1+\alpha)^t+\gamma r^{k-1}\frac{1-r^{-k}}{1-r^{-1}} \\ &=x(0)(1+\alpha)^t+\gamma\frac{r^k}{r}\frac{1-r^{-k}}{1-r^{-1}} \\ &=x(0)(1+\alpha)^t+\gamma\frac{r^k-1}{r-1} \\ &=x(0)(1+\alpha)^t+\gamma\frac{1-r^k}{1-r} \\ \end{align}

where you can verify that the last line is exactly your formula.

It can also be shown that an alternative formulation is

$$x(t)=(1+\alpha)^t \left( x(0) + \gamma(1+\alpha)^{-\beta\lfloor t/\beta \rfloor} \frac{(1+\alpha)^{\beta \lfloor t/\beta\rfloor}-1}{(1+\alpha)^{\beta}-1} \right)$$