Need a computer application that solves a complicated single variable equation.

83 Views Asked by At

I have to solve the following equation for $r$:

$$298082 = 250000 (1 + r) + 25000 (1 + r)^{\frac{365 - 258}{365}}$$

... which simplifies to:

$$298082 = 250000 (1 + r) + 25000 (1 + r)^{0.293150685}$$

Back in my high school days I would solve this on a TI-89 calculator. Is there an application I can use to solve this on a computer? I tried Desmos and it said "We don't solve complicated single variable equations yet."

1

There are 1 best solutions below

0
On

You are looking for the zero fo funtion $$f(r)=250000 (1+r)+25000 (1+r)^{107/365}-298082$$ Suppose that you define $x=(1+r)^{1/365}$, it would reduce to $$g(x)=250000 x^{365}+25000 x^{107}-298082$$ which cannot be solved analytically.

So, you need numerical methods and the simplest would be Newton method which, starting from a reasonable guess $x_0$, will update it according to $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ So, consider $$f(x)=250000\, x+25000\, x^{107/365}-298082$$ $$f'(x)=250000+\frac{535000}{73\, x^{258/365}}$$ which would the give $$x_{n+1}=\frac{10879993\,x_n^{258/365}-645000\, x_n}{9125000 \,x_n^{258/365}+267500}$$ The derivative being always positive (assuming $r>0$), let us be lazy and start using $x_0=1$. Then, Newton mehod will generate the following iterates $$\left( \begin{array}{cc} n & x_n \\ 0 & 1.000000000 \\ 1 & 1.089698483 \\ 2 & 1.089775701 \end{array} \right)$$ We also could have expanded $f(x)$ as a truncated Taylor series around $x=1$. This would give $$f(x)=-23082+\frac{18785000 }{73}(x-1)-\frac{13803000 }{5329}(x-1)^2+O\left((x-1)^3\right)$$ $$f(r)=-23082+\frac{18785000 }{73}r-\frac{13803000 }{5329}r^2+O\left(r^3\right)$$ and solving the quadratic (ignoring higher order terms) the root would be $r\approx 0.089779615$.

You can easily do this using any calculator.