CompoundingIf accumulated intereset is added back to the principal, it is called compounding [1].

Compound InterestCompound interest is related with the word "compound". So we can define compound interest as interest on interest. Compound interest is not resut of paying it out, in contrast, it is the result of investing interest again(reinvesting) [2]. Compound interest is an important topic in finance and economics.

Let

= Principal Amount

= Monthly Payment

= Annual Rate

= Number of Years

= Compounding

= Rate compounded monthly

= Balance at the month i

= Final Balance

= Total Principal

= Interest Amount

= Annual Percentage yield.

First, calculate the rate compounded monthly:

If payments are made at the begining of the period, then

If payments are made at the end of the period, then

Finally,

**Example 1**

*Input*

Principal Amount = 5000

Monthly Payment = 100

Annual Rate = 5%

Number of Years = 10

Compounding = 4 (Quarterly)

Mode = BEG

*Output*

Total Principal = 17000

Interest Amount = 6793.511

Balance = 23793.511

Apy = 5.095%

**Example 2**

*Input*

Principal Amount = 1000

Monthly Payment = 200

Annual Rate = 3%

Number of Years = 6

Compounding = 12 (Monthly)

Mode = END

*Output*

Total Principal = 15400

Interest Amount = 1552.826

Balance = 16952.826

Apy = 3.042%

1. A Basic Course in the Theory of Interest and Derivatives Markets (n.d). http://faculty.atu.edu/ mfinan/actuarieshall/mainf.pdf

2. Compound Interest (n.d.). Retrieved August 18, 2016, from https://en.wikipedia.org/wiki /Compound_interest