$2^x - a$ touches $\log_2(x)$

I was playing around with the functions $2^x$ and $\log_2(x)$. As they are the inversions of each other, I thought there was a simple number $a$ for which $2^x - a$ touches $\log_2(x)$.

Using trial-and-error, for $a = 2$ looked like the functions just touched each other, but on closer inspection they did cross each other: at $x = 1$ and at approximately $x = 1.04759$.

Zoomed in:

Is there an exact solution to $a$ for which $2^x - a$ touches $\log_2(x)$? With "touches" I mean that they just touch each other, like a tangent does to a function.

-

If the graphs "just touch", then the tangents are parallel. So you want $$(2^x - a)' = (\log_2 x)'$$ This leads to $$(\ln 2)2^x = \frac{1}{(\ln 2)x}$$ or $x2^x = (\ln 2)^{-2}$.

Since $y= x2^x$ is strictly increasing on $(0,\infty)$ (the derivative is $2^x(1+x\ln 2)$), has $\lim\limits_{x\to 0^+}x2^x = 0$ and $\lim\limits_{x\to \infty}x2^x = \infty$, there is one and only one value of $x$ where the equality holds.

So there is one and only one value of $x$ where the tangents of $y=2^x-a$ and $y = \log_2 x$ are parallel. Picking $a$ to equal the value of $\log_2(x)$ at the point $x$ in which this holds, which is the unique solution to $x2^x = (\ln 2)^{-2}$, gives the unique solution.

The solution to $x2^x = (\ln 2)^{-2}$ can be "obtained" by using the Lambert $W$ function.

Since $x2^x = xe^{x\ln 2}$, we can rewrite the equation as $(x\ln 2)e^{x\ln 2} = \frac{1}{\ln 2}$. Since $W(1/\ln 2)$ is the value $k$ such that $ke^k = \ln 2$, we conclude that $x = \frac{1}{\ln 2}W\left(\frac{1}{\ln 2}\right)$ is where $x2^x = (\ln 2)^{-2}$.

So this is the value of $x$ at which $y = 2^x - a$ (for any $a$) and $y=\log_2(x)$ have parallel tangents. We want to pick $a$ so that the two functions have the same value as well, so we want $2^x - a = \log_2(x)$; that is $$a = 2^{\frac{1}{\ln 2}W(\frac{1}{\ln 2})} - \log_2\left(\frac{1}{\ln 2}W\left(\frac{1}{\ln 2}\right)\right) = 2^{\frac{W(1/\ln 2)}{\ln 2}} - \log_2W\left(\frac{1}{\ln 2}\right) + \log_2(\ln 2).$$

The values of $a$ and $x$ are \begin{align*} a&\approx 1.9993335366784208872185237594934841819876651500164506943525\ldots\\\ x&\approx 1.0237165016039817739129111076311195719147116014095574420368\ldots. \end{align*}

-
Thanks very much. Although I don't have any doubt about your correctness, if I plot it, they do not touch each other: wolframalpha.com/input/?i=plot+2^x+-+1%2Fln%282%29+*+W%281%2Fln%282%2‌​9%29%2C+log%28x%29+%2F+log%282%29. What could I be interpreting wrongly? – pimvdb Mar 21 '11 at 20:05
@pimvdb: I don't know much about wolframalpha, so I don't really know what you plotted. But there are a few silly mistakes in my derivation of $a$, which I'm still trying to correct. – Arturo Magidin Mar 21 '11 at 20:10
@pimvdb: Okay, I think that's it as far as figuring out $a$ correctly. – Arturo Magidin Mar 21 '11 at 20:16
Yes I managed to plot it just fine. Thanks extremely much for your response. It's remarkable that it's not that easy (I first thought just $a = 2$). – pimvdb Mar 21 '11 at 20:27
It is amusing that $a$ is very close to, but not equal to, 2. – Michael Lugo Aug 6 '11 at 22:09

...and it's about 2.00971; so, you were pretty close, pimvdb

-
I think this post can be improved. – The Chaz 2.0 Mar 21 '11 at 20:24
Actually, it is 1.999333536678 according to WolframAlpha (tinyurl.com/693fk3k). – pimvdb Mar 21 '11 at 20:28