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

Solution 1:

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*}$$