### Annual Compounding

In part one a formula for compound interest based on monthly deposits was discussed. The equations are based on monthly compounding which, as already stated in the previous post, is rather uncommon for the area I live in (at least as far as standard saving accounts are concerned).

To overcome this shortcoming we will develop a closed-form solution based on annual compounding. Here’s the question: given an initial balance, , a monthly deposit, , an annual interest rate, , what is the compound future value in months from now if interest is paid **once a year**?

Note that the same assumptions and symbols as in part one apply. One notable exception is the change of semantics for the symbol which now represents the number of years (was number of months before).

As in part one, we start our journey by observing the resulting balance after the first year , , is given by

where the first term describes the initial balance plus interest and represents the monthly deposits plus interest. Since the formula is essentially equal to the formula for in the first post (except that periods are now years and we use the annual interest rate), we can use all the results from the previous part once we determine the value for .

When interest is paid at the end of the interest period the bank usually differentiates between deposits made during the course of the interest period and such balances that already existed at the beginning of the last interest period.

Those amounts that existed for the entire interest period, for example in the calculation of , are paid full interest. The remaining contributions are paid interest proportional to the number of days it contributed to the interest period (consult your terms of service for details).

isto the sum of monthly deposits plus partial interest which is calculated by

which simplifies to

for which the summation can be written as (using properties of an arithmetic sequence)

or

Now that we’ve arrived at a closed-form equation for the value of we can use the results of part one to arrive at

as the solution to our problem. In Ruby

# input $k0 = 2000.0 # initial balance $m = 500.0 # monthly deposit $i = 0.05 # interest rate $n = 36 # number of periods (months) # yearly compounded, closed-form years = ($n / 12).floor y = 12 * $m + 6.5 * $m * $i fv = $k0 * (1 + $i)**years + y * (((1 + $i)**years - 1)/((1 + $i) - 1)) puts "Future value equals #{fv}" #=> 21742.53