I am trying to solve the following equation for x in terms of $y$ and $c$ (with $x,y \in [0,1]$)
\begin{equation}
\log\left(\frac{x}{1-x-y}\right) + \frac{x}{1-x-y} + \frac{y}{1-x-y} = c
\end{equation}
I can solve this easier equation
\begin{equation}
\log\left(\frac{x}{1-x-y}\right) + \frac{x}{1-x-y} = c
\end{equation}
Let
\begin{equation}
z = \frac{x}{1-x-y}
\end{equation}
Then I can solve for $x$ using Lambert's W function
\begin{align}
\log(z) + z &= c \notag \\
z &= \exp(c)\exp(-z) \notag \\
z \exp(z) &= \exp(c) \notag \\
z &= W(\exp(c)) \notag \\
x &= \frac{(1-y)W(\exp(c))}{1+W(\exp(c))} \notag
\end{align}
Can anyone help me solve the harder equation? Is Lambert's W function helpful here?
Thanks!
Answer
\begin{align}
\ln\left(\frac{x}{1-x-y}\right)
+\frac{x}{1-x-y} + \frac{y}{1-x-y}
&= c
\tag{1}\label{1}
\end{align}
\begin{align}
\ln\left(\frac{x}{1-x-y}\right)
&= c+\frac{1-x-y-1}{1-x-y}
,\\
\ln\left(\frac{1-y}{1-x-y}-1\right)
&= c+1-\frac{1}{1-x-y}
,\\
\ln\left(\frac{1-y}{1-x-y}-1\right)
&= c-\left(\frac{1}{1-x-y}-1\right)
,\\
\ln\left(\frac{1-y}{1-x-y}-1\right)
&= c-\frac{1}{1-y}\left(\frac{1-y}{1-x-y}-(1-y)\right)
,\\
\ln\left(\frac{1-y}{1-x-y}-1\right)
&= c-\frac{1}{1-y}\left(\frac{1-y}{1-x-y}-(1-y)\right)
,\\
\ln\left(\frac{1-y}{1-x-y}-1\right)
&= c-\frac{y}{1-y}-\frac{1}{1-y}\left(\frac{1-y}{1-x-y}-1\right)
.
\end{align}
Let
\begin{align}
\frac{1-y}{1-x-y}-1&=z
,\\
c-\frac{y}{1-y}&=u
,\\
-\frac{1}{1-y}&=v
\end{align}
and we have an equation
\begin{align}
\ln z&=u+vz
,
\end{align}
which has a standard solution for $z$ in terms Lambert W function
\begin{align}
z&=-\frac{\operatorname{W}(-v\exp(u))}{v}
,\\
x&=(1-y)\left(1-\frac1{1+z}\right)
.
\end{align}
No comments:
Post a Comment