# How is Compound Interest Calculated between 2 Time Intervals?

I am building an application, where I need to understand how Compound Interest is calculated.

I know, how to use the formula if the time is say 1 month, 3 months. If the duration is 42 days, How do we use the Compound Interest formula.

I am calculating interest monthly.

Thanks

-

## 1 Answer

Let the rate of interest per anum is $r$, principal $=p$, and the compound interested is calculated $n$ time per year.

So, in time $\frac 1 n$ year, the interest accrued is $p\cdot \frac 1 n \cdot r$

So, the principal + interest becomes $p(1+\frac r n)$

In the next $\frac 1 n$ year, the interest accrued is $p(1+\frac r n)\cdot \frac 1 n \cdot r$

So, the principal + interest becomes $p(1+\frac r n)+p(1+\frac r n)\cdot \frac 1 n \cdot r=p(1+\frac r n)^2$

If $t=n\cdot s+u$ where $0\le u< n$ , on $n\cdot s$ years the principal + interest will be $p(1+\frac r n)^{ns}$

For $u$ years, the rest interest is $p(1+\frac r n)^{ns}\cdot \frac u n \cdot r$

-