Compound Interest Explained: The Formula and Its Derivation

Compound interest explained step by step: simple vs compound interest, deriving A = P(1 + r/n)^(nt), continuous compounding and e, APY, the future value of regular deposits, solving for time with logarithms, the rule of 72, real returns after inflation, worked examples and practice questions.

Compound interest means you earn interest on your interest. This page builds the formula \(A = P\left(1+\frac{r}{n}\right)^{nt}\) from a single period, then follows it to continuous compounding and the number \(e\), the yearly rate (APY), regular deposits, how long a goal takes, the rule of 72 and inflation. There are worked examples and practice questions at the end. To run your own numbers, use the Compound Interest Calculator.

The letters used on this page

  • \(P\): the principal, the amount you start with.
  • \(r\): the yearly interest rate as a decimal (5% is 0.05).
  • \(n\): how many times a year interest is compounded (added to the balance): 1 yearly, 4 quarterly, 12 monthly, 365 daily.
  • \(t\): the time in years.
  • \(A\): the amount at the end, principal plus interest.

Simple interest vs compound interest

With simple interest you are paid interest only on the money you first put in. Every year adds the same amount, \(Pr\), so after \(t\) years

\(\displaystyle A_{\text{simple}} = P + Prt = P(1 + rt)\)

The balance grows in a straight line. With compound interest each year's interest is added to the balance, and next year's interest is worked out on that bigger balance. The amount added keeps growing, so the balance curves upward.

Take \(P = 1000\) at 5% a year. Simple interest pays 50 every year. Compound interest pays 50 in year 1, 52.50 in year 2 (5% of 1,050) and 55.13 in year 3 (5% of 1,102.50). Step through it yourself:

Deriving the compound interest formula

Step 1: one period. Interest is paid \(n\) times a year, so each time you are paid the yearly rate divided by \(n\). A balance \(B\) earns \(B\cdot\frac{r}{n}\) and becomes

\(\displaystyle B + B\,\frac{r}{n} = B\left(1+\frac{r}{n}\right)\)

So one period multiplies the balance by the same number, the growth factor \(1 + \frac{r}{n}\). That is the whole idea: adding a percentage is the same as multiplying.

Step 2: several periods. Each period multiplies again by the same factor:

\(\displaystyle \begin{aligned} B_1 &= P\left(1+\tfrac{r}{n}\right) \\ B_2 &= B_1\left(1+\tfrac{r}{n}\right) = P\left(1+\tfrac{r}{n}\right)^{2} \\ B_3 &= P\left(1+\tfrac{r}{n}\right)^{3} \\ B_k &= P\left(1+\tfrac{r}{n}\right)^{k} \end{aligned}\)

Step 3: count the periods. In \(t\) years there are \(k = nt\) periods, which gives the compound interest formula:

\(\displaystyle A = P\left(1+\frac{r}{n}\right)^{nt}\)

The interest earned is \(A - P\). With \(n = 1\) (yearly) it is simply \(A = P(1+r)^t\).

More often: continuous compounding and the number e

Compounding more often helps, but less and less. To see the limit, take a rate of 100% (\(r = 1\)) for one year and let \(n\) grow. The growth factor is \(\left(1+\frac{1}{n}\right)^{n}\):

The values climb toward 2.71828... and never pass it. That limit is the number \(e\):

\(\displaystyle e = \lim_{n\to\infty}\left(1+\frac{1}{n}\right)^{n} \approx 2.718281828\)

For any rate \(r\), write \(m = \frac{n}{r}\), so \(\frac{r}{n} = \frac{1}{m}\) and \(nt = m\,rt\):

\(\displaystyle \begin{aligned} P\left(1+\frac{r}{n}\right)^{nt} &= P\left[\left(1+\frac{1}{m}\right)^{m}\right]^{rt} \\ &\longrightarrow P\,e^{rt} \quad (n\to\infty) \end{aligned}\)

since \(m\) grows without limit when \(n\) does. This is continuous compounding:

\(\displaystyle A = P\,e^{rt}\)

It is the most a given yearly rate can ever give. In practice daily compounding is already within a few cents of it: 5,000 at 4% for 10 years grows to 7,401.22 compounded yearly, 7,454.16 monthly and 7,459.12 continuously.

The yearly rate you really get: APY (effective rate)

A rate of "5% compounded monthly" grows by more than 5% in a year. The real yearly growth, called the APY (annual percentage yield), the effective annual rate or AER, is what one year of the formula gives, minus the 1 you started with:

\(\displaystyle \text{APY} = \left(1+\frac{r}{n}\right)^{n} - 1\)
\(\displaystyle \text{APY}_{\text{continuous}} = e^{r} - 1\)

5% compounded daily is an APY of 5.1267%; continuously 5.1271%. Comparing two savings accounts? Compare their APYs, not their headline rates. (A loan's APR is usually the plain \(r\), before compounding.)

Regular deposits: the future value of a series

Now add a deposit \(D\) at the end of every period, with growth \(i\) per period (\(i = \frac{r}{n}\) when deposits and compounding match, e.g. both monthly) for \(N\) periods. Follow each deposit to the end. The last one has no time to grow, the one before grows for one period, and the first one for \(N-1\) periods:

\(\displaystyle \begin{aligned} S &= D + D(1+i) + D(1+i)^2 \\ &\quad + \dots + D(1+i)^{N-1} \end{aligned}\)

This is a geometric series: each term is the one before times \(x = 1+i\). Multiply the whole sum by \(x\) and subtract the original; everything in the middle cancels:

\(\displaystyle \begin{aligned} xS &= Dx + Dx^2 + \dots + Dx^{N} \\ xS - S &= Dx^{N} - D \\ S &= D\,\frac{x^{N}-1}{x-1} \end{aligned}\)

With \(x - 1 = i\) this is the future value of an ordinary annuity:

\(\displaystyle S = D\,\frac{(1+i)^{N}-1}{i}\)

Deposits at the start of each period (an "annuity due") have one more period to grow, so every term, and the total, is multiplied by \((1+i)\):

\(\displaystyle S_{\text{start}} = D\,\frac{(1+i)^{N}-1}{i}\,(1+i)\)

The starting amount grows on its own as before, so the balance with both is the sum of the two parts:

\(\displaystyle \begin{aligned} A &= P(1+i)^{N} \\ &\quad + D\,\frac{(1+i)^{N}-1}{i} \end{aligned}\)

(If \(i = 0\) the fraction is undefined, but the answer is just \(DN\): no interest, only deposits.)

How long does it take? Solving for t with logarithms

To find when \(P\) grows to a goal \(A\), divide by \(P\) and take the natural log of both sides; the log brings the exponent down:

\(\displaystyle \begin{aligned} \frac{A}{P} &= \left(1+\frac{r}{n}\right)^{nt} \\ \ln\frac{A}{P} &= nt\,\ln\!\left(1+\frac{r}{n}\right) \\ t &= \frac{\ln(A/P)}{n\,\ln(1+r/n)} \end{aligned}\)

With continuous compounding it is simpler: \(t = \frac{\ln(A/P)}{r}\). Any log base works, as long as you use the same one on top and bottom.

The rule of 72, and why it works

For doubling, \(A/P = 2\). With yearly compounding

\(\displaystyle t_2 = \frac{\ln 2}{\ln(1+r)}\)

For small \(r\), \(\ln(1+r) \approx r\), and \(\ln 2 \approx 0.693\). Writing the rate in percent, \(R = 100r\):

\(\displaystyle t_2 \approx \frac{0.693}{r} = \frac{69.3}{R}\)

That "rule of 69.3" is exact for continuous compounding. For yearly compounding, \(\ln(1+r)\) is a bit smaller than \(r\) (\(\ln(1+r) \approx r - \frac{r^2}{2}\)), so the true time is a bit longer. Pushing the top number up to 72 makes up for it near 8%, and 72 is easy to divide by 2, 3, 4, 6, 8, 9 and 12. Another fix keeps 69.3 and adds 0.35 years:

\(\displaystyle t_2 \approx \frac{72}{R} \quad\text{or}\quad t_2 \approx \frac{69.3}{R} + 0.35\)

After inflation: the real rate

If prices rise by \(f\) a year, a balance that grows by \(r\) buys only \(\frac{1+r}{1+f}\) times as much each year. The real rate is

\(\displaystyle r_{\text{real}} = \frac{1+r}{1+f} - 1 \approx r - f\)

6% interest with 3% inflation is a real rate of 2.91% (the quick \(r - f\) says 3%). To see a future balance in today's money, divide it by \((1+f)^t\).

Worked examples

1. A single deposit. 5,000 at 4% compounded monthly for 10 years:

\(\displaystyle \begin{aligned} A &= 5000\left(1+\frac{0.04}{12}\right)^{120} \\ &= 5000 \times 1.490833 \\ &\approx 7454.16 \end{aligned}\)

Interest: 2,454.16. Simple interest would have paid 2,000. Try it in the calculator.

2. Saving every month. 200 at the end of every month for 30 years at 6% compounded monthly, so \(i = 0.005\) and \(N = 360\):

\(\displaystyle S = 200\cdot\frac{1.005^{360}-1}{0.005} \approx 200{,}903.01\)

You put in 72,000; the other 128,903 is interest. Paying at the start of each month instead multiplies that by 1.005, giving about 201,907.52. Try it in the calculator.

3. How long? 10,000 to 25,000 at 7% compounded yearly:

\(\displaystyle t = \frac{\ln 2.5}{\ln 1.07} = \frac{0.91629}{0.06766} \approx 13.54 \text{ years}\)

4. APY. 5% compounded daily:

\(\displaystyle \left(1+\frac{0.05}{365}\right)^{365} - 1 \approx 0.051267\)

an APY of 5.13%.

Practice questions

Try each one, then open it to check your answer.

1. 1,000 at 8% compounded quarterly for 5 years. What is the balance?

\(i = 0.08/4 = 0.02\) and \(N = 20\), so

\(\displaystyle A = 1000 \times 1.02^{20} \approx 1485.95\)
2. What is the APY of 12% compounded monthly?

\(i = 0.01\): \(1.01^{12} - 1 \approx 0.1268\), so 12.68%.

3. At 9% a year (compounded yearly), about how long does money take to double? How close is the rule of 72?

Rule of 72: \(72/9 = 8\) years. Exact: \(\ln 2 / \ln 1.09 \approx 8.04\) years, so the rule is about two weeks short.

4. You save 100 a month for 20 years at 5% compounded monthly. How much more do you have if you pay at the start of each month instead of the end?

End of each month:

\(\displaystyle 100\cdot\frac{(1+0.05/12)^{240}-1}{0.05/12} \approx 41{,}103.37\)

Start of each month: multiply by \(1 + 0.05/12\) to get about 41,274.63, which is 171.26 more.

5. What yearly rate (compounded yearly) doubles money in exactly 8 years?

\((1+r)^8 = 2\), so \(r = 2^{1/8} - 1 \approx 0.0905\): 9.05%. The rule of 72 says 9%.

6. 2,000 at 3% compounded continuously for 15 years?
\(\displaystyle \begin{aligned} A &= 2000\,e^{0.03 \times 15} \\ &= 2000\,e^{0.45} \approx 3136.62 \end{aligned}\)

Try it yourself

The Compound Interest Calculator uses exactly these formulas, with deposits weekly to yearly, raises, tax, inflation, a year-by-year table and a growth chart with sliders. Its Goal tab solves for the deposit, the time or the rate, and the Rule of 72 tab compares the shortcut with the exact doubling time.

Comments
Advertisement