The formula for compound interest is actually a little different from how you have written it. It is
where A is the final amount of the investment or debt, P is the principal amount or initial amount, i is the interest rate per time period, and n is the number of time periods.
In order to use this formula, you need to be given three of the four items in the formula, then you can solve for the fourth.
For example, suppose you are investing $100 for 3 years, at 2%/year. What is the final amount in the investment?
The initial amount is $100, so P=100. The investment is for 3 years, so n=3, and the interest rate is 2%/year, so i=0.02. The only thing left is the amount A, so we will solve for that.
So after 3 years, the final amount of the investment is $106.12.
As long as you have been given three of the four variables, you can always solve for the fourth variable.
If you are given P, i, n, then `A=P(1+i)^n` .
If you are given A, i, n, then solve for P
If you are given A, P, n, then solve for i.
Finally, if you are given A, P, and i, then you solve for n.
`A/P=(1+i)^n` take logarithms
`log(A/P)=log(1+i)^n` use power rule
We now have a way of solving for each constant in the original formula: