We have the compound interest formula:

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

where A(t) is the account value, t is measured in years, P is the starting amount of the account, often called the principal, or more generally present value, r is the annual percentage rate (APR) expressed as a decimal, and n is the number of compounding periods in one year.

Multiply both sides by the power of \(\displaystyle\frac{1}{{{n}{t}}},\) we get

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

Divide both sides by P

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

Substract 1 from both sides

\(\displaystyle\frac{{{A}^{{\frac{1}{{{n}{t}}}}}}}{{P}}-{1}=\frac{r}{{n}}\)

Multiply both sides by n, we get

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

Hence, \(\displaystyle{r}={n}{\left(\frac{{{A}^{{\frac{1}{{{n}{t}}}}}}}{{P}}-{1}\right)}\)