Solving Equation involving Lambert W function

algebra-precalculuscalculusexponential functionlambert-wlogarithms

I have the following equation that depends on the values $a, q, x$ where $a,q>2$ are positive non-zero real numbers.
$$
y = \log(x\log(2) + a) – \left(2-\frac{1}{2^x}\right) q
$$

Now I was able to find the value $x$ at which $y$ is minimal using the Lambert W function as
$$
x^* = \frac{-1}{\log(2)}\left(a + W_{-1}\left(\frac{-1}{qe^a}\right)\right)
$$

I now want to find the either $q$ as a function of $a$ or vice versa to describe the values $q,a$ (given one) such that $y=0$ at this minima. Clearly we can just plug in
$$
0 = \log(x^*\log(2) + a) – \left(2-\frac{1}{2^{x^*}}\right) q
$$

and simplify to
$$
\log\left(-W_{-1}\left(\frac{-1}{qe^a}\right)\right) = \left(2-e^ae^{W_{-1}\left(\frac{-1}{qe^a}\right)}\right)q
$$

However from here I am completely stuck on how one could solve for either $q,a$ in terms of the other. I am relatively new to $W$ so there may be some properties I am unfamiliar with, so any help would be appreciated!

Edit: I will append on any future work I get to this problem just in case anyone can help from further points. First, I will just define
$$
W = W_{-1}\left(\frac{-1}{qe^a}\right)
$$

So we have
$$
\log(-W) = (2-e^ae^W)q
$$

using an identity $e^W(x) = x/W(x)$ we get
$$
\log(-W) = \left(2 + \frac{e^a}{qe^a}\frac{1}{W}\right)q = 2q + \frac{1}{W}
$$

Now moving terms around and raising to powers we can find
$$
\log(-W) + \frac{1}{W} = 2q
$$

which appears very close to the definition of the identity but I just need a little push from here

Best Answer

I will show $$a=\log{(-W(-e^{-2q}))}-\frac{1}{W(-e^{-2q})}-\log{(q)}$$ where $W$ is Lambert's W.

To begin, start with the work you post in the problem, although you will need to correct a sign error: from $$\log{(-w)}=2q+\frac{1}{w}$$ one has $$2q=\log{(-w)}-\frac{1}{w}$$ instead. (I use lowercase $w$ rather than your $W$ to avoid confusion.) From here, we can solve for $w$ in terms of $q$; then, inverting the $W$ defining $w$, we can solve for $a$.

Let $v=-\frac{1}{w}$; then $$2q=-\log{(v)}+v$$ Negating, exponentiating, and negating again, we have $$-ve^{-v}=-e^{-2q}$$ This equation can be inverted via Lambert's $W$, viz.: $-v=W(-e^{-2q})$. Equivalently, $w=\frac{1}{W(-e^{-2q})}$. (Note that, where defined, this is negative.)

Now we need to solve for $a$. Recall our definition of $w$: $w=W\left(-\frac{1}{qe^a}\right)$. Inverting, we have $$-\frac{1}{qe^a}=we^w=\frac{e^{W(-e^{-2q})^{-1}}}{W(-e^{-2q})}$$ Rearranging, $$e^a=\frac{-W(-e^{-2q})}{qe^{W(-e^{-2q})^{-1}}}$$ Thus, $$a=\log{(-W(-e^{-2q}))}-\frac{1}{W(-e^{-2q})}-\log{(q)}$$

(I'd like to thank g.kov for pointing out an error in the original solution.)

Related Question