0

I'm trying to create three new formulas from a compound interest formula: I'm trying to respectively isolate M, r, and P. The original formula comes from https://www.thecalculatorsite.com/articles/finance/compound-interest-formula.php#regular-contributions, and it's the standard formula for finding future compound interest with an initial investment.

$$ A = P\left(1 + \frac{r}{n}\right)^ {n t} + M\biggl(\frac{\left(1 + \frac{r}{n}\right)^ {n t} - 1}{\frac{r}{n}}\biggr)$$

These are what the variables stand for:

  • A = the future value of the investment/loan, including interest
  • P = the principal investment amount
  • M = the monthly payment
  • r = the annual interest rate
  • n = the number of times that interest is compounded per unit t
  • t = the number of years the money is invested or borrowed for

I contacted the site owner and he wasn't able to help with this, since he's not on the mathematical side of things, he just builds calculators on the back of formulas that already exist. I've also been trying to achieve this in Wolfram Alphra with no luck:

solve P * (1 + r / n) ^ (n * t) + PMT * (((1 + r / n) ^ (n * t) - 1) / (r * n)) = A for r

Any help here would be appreciated! Thanks. It's been too many years since my college math.

2 Answers2

2

There is no problem isolating $P$ or $M$, the equation is linear in these ($a=bP+c\to P=\dfrac{a-c}b$).

On the other hand, there is no analytical solution for $r$ and you have to resort to a numerical approximation approach. Newton's iterations will work fine.


As $(1+\frac rn)^{nt}\approx 1+rt$, a starting approximation is otained by solving

$$ A = P(1+rt) + Mnr$$ for $r$.

0

To make notations simpler, let $\frac r n=x$ and $m=nt$ to make the equation $$A=P (x+1)^m+M\frac{ (x+1)^m-1}{x}$$ and use the first iteration of Newton or higher order iterative methods (let $k$ be the order of the method).

This would give as estimates $$x_{(2)}=\frac 2 m\,\frac{ A-P-m M}{ (m-1) M+2 P}$$ $$x_{(3)}=\frac {6 ((m-1) M+2 P) (A-P-m M) } {\alpha A +\beta (m+1) }$$ $$\alpha=2 (m-1) ((m-2) M+3 P)$$ $$\beta=(m-1) m M^2+4 (m-1) M P+6 P^2$$

Trying with $A=3000$, $P=1000$, $M=10$, $n=1$, $t=20$ these approximations would give $$x_{(2)}=\frac{6}{73}\approx 0.08219 \qquad \qquad x_{(3)}=\frac{146}{3119}\approx 0.04681$$ while the exact solution is $0.05030$.

The next one (the formula is not reported here since a bit too long but available on request) woulf give $$x_{(4)}=\frac{56142}{1119719}\approx 0.05014$$

If you want easier to implement formulae, consider that you look for the zero of function $$f(x)=P (x+1)^m+M\frac{ (x+1)^m-1}{x}-A$$ and use the formulae given here with $$f^{(0)}(0)=nM+P-A$$ $$ f^{(1)}(0)=\frac{1}{2} m ((m-1) M+2 P)$$ $$f^{(2)}(0)=\frac{1}{3} (m-1) m ((m-2) M+3 P)$$ $$f^{(3)}(0)=\frac{1}{4} (m-2) (m-1) m ((m-3) M+4 P)$$ $$f^{(4)}(0)=\frac{1}{5} (m-3) (m-2) (m-1) m ((m-4) M+5 P)$$ $$f^{(5)}(0)=\frac{1}{6} (m-4) (m-3) (m-2) (m-1) m ((m-5) M+6 P)$$ where you can notice the nice patterns.

With this, compute the coefficients $a_k^n$ of the linked paper and you can easily obtain "quintic, sextic, septic, octic ... iterations".