I came across this function in algebra ($e$ being its limit as $x$ goes to infinity) while studying compounded interest. Since this function is a little modified from the real interest formula $y=(1+1/n)^{nt}$ where $n$ is # of times compounded per year and $t$ is time. (I just replaced $n$ with $x$ and assumed $t$ is $1$ to get the modified function). And I wondered: is it possible to solve this function for $x$? (or $n$) Is it possible? If it is, how can it be done? If it isn't, why? I tried turning it into a logarithm which quickly became a dead end because it was $\log_{1+1/x}(y) = x$, for obvious reasons. How does one isolate $x$ (if one can)? Essentially I want to know if this function has an inverse. Thank you!
-
$\begingroup$ Don't expact this to have an "inverse". $\endgroup$– Sean RobersonAug 11, 2018 at 3:51
-
$\begingroup$ The formula where the interest is involved would be $y=\left(1+\frac{i}{m}\right)^{n\cdot m}$ You want to solve for $m$ or for $n$? I don´t see a reason to solve the equation for $m$. Usually the value of $m$ is known. Can you give a reason? $\endgroup$– callculus42Aug 11, 2018 at 4:55
-
$\begingroup$ Notice that the annuities problem (finding the interest rate) also leads to an "unsolvable" problem. $\endgroup$– user65203Aug 11, 2018 at 11:40
-
$\begingroup$ To the close voters: I think this problem has enough context to stay open. The OP indicated their background and where the problem came from, which gives motivation to solve it since the problem relates to compound interest rates. They also attempted to take the log of both sides, which is natural, though anyone knowing the solution already knows such attempts would be futile... $\endgroup$– Simply Beautiful ArtAug 11, 2018 at 12:28
2 Answers
One may solve for $x$ in terms of the Lambert W function as follows:
Rearrange the equation a bit:
$$y=\left(1+\frac1x\right)^x\\y^{1/x}=1+\frac1x\\1=\left(1+\frac1x\right)y^{-1/x}\\\frac1y=\left(1+\frac1x\right)y^{-(1+1/x)}\\\frac1y=\left(1+\frac1x\right)e^{-\ln(y)(1+1/x)}\\-\frac{\ln(y)}y=-\ln(y)\left(1+\frac1x\right)e^{-\ln(y)(1+1/x)}\\W_k\left(-\frac{\ln(y)}y\right)=-\ln(y)\left(1+\frac1x\right)\\-\frac{W_k(-\ln(y)/y)}{\ln(y)}=1+\frac1x$$
$$x=-\left(1+\frac{W_k(-\ln(y)/y)}{\ln(y)}\right)^{-1}$$
where $e=\lim\limits_{n\to\infty}\left(1+\frac1n\right)^n,\ln=\log_e,$ and $W_k$ is the $k$th branch of the Lambert W function.
Note that since $-\frac{\ln(y)}y=\ln(1/y)e^{\ln(1/y)}$, there is a choice of branch for each $y$ that would give a simpler solution, though it turns out this solution is extraneous.
There are other solutions here as well, but for actual calculation purposes, it is probably better to tackle the problem numerically:
For quick and lazy work, we can see that
$$x=\log_{1+1/x}(y),\quad x=\left(y^{1/x}-1\right)^{-1}$$
with the initial approximation of $x\approx\frac{2y-e}{2e-2y}$ to get an iterative approximation. Iterate the first equation for $y<e$ and the second for $y>e$. For example, with $y=1.5$, we use the first one, with the initial approximation of
$x\approx\frac{3-e}{2e-3}\approx0.11562$
and by substituting into the first equation,
$x\approx\log_{1+1/0.11562}(1.5)\approx0.17887$
and again,
$x\approx\log_{1+1/0.17887}(1.5)\approx0.21503$
etc.
a few calculator clicks later...
which gives the approximate solution: $x\approx0.253860169$ for $y=1.5$.
(Note that these can be improved, but require more background to understand)
I wondered: is it possible to solve this function for $x$ ? (or $n$) Is it possible? If it is, how can it be done? If it isn't, why?
So we have the equality $$y=\left(1+\frac 1x\right)^x,$$ and you would like to know whether it is possible to express $x$ explicitly in terms of $y,$ or when $x=n$ (by which I assume you mean $x$ is real in general whereas $n$ is a positive integer).
In both cases it is not -- changing $x$ to $n$ doesn't help significantly either, because (if you apply the binomial expansion formula with $x=n$), the last term $1/n^n$ gives an indication why it might be impossible.
I'm curious, though. Why do you need this explicit rearrangement?