How would you solve $3^x = 2x + 3$ using the Lambert $W$ function

Could someone provide a solution to the equation $$3^x = 2x+3.$$

Our teacher told us to solve it graphically, but I was curious what the exact answers might be and just plugged it into Wolfram Alpha and saw that the two solutions came from the principle and the $$-1$$ branch of the Lambert $$W$$ function.

I am familiar with the "function" and how it is the inverse "function" of the function $$xe^x$$, but whatever transformations I tried I just couldn't obtain the wolfram alpha solution.

Any help, hints or even a solution is greatly appreciated.

\begin{align*} 3^x&=2x+3\\ e^{\log (3) x}&=2(x+\frac{3}{2})\\ -\frac{\log (3)}{2}&=-\log (3)(x+\frac{3}{2})e^{-\log (3) x}\\ -\frac{\log (3)}{2}e^{-\frac{3}{2}\log(3)}&=-\log (3)(x+\frac{3}{2})e^{-\log (3) (x+\frac{3}{2})}\\ \end{align*} Now the RHS is in the form $$ye^y$$. So \begin{align*} -\log (3) (x+\frac{3}{2})&=W\left(-\frac{\log (3)}{2}e^{-\frac{3}{2}\log(3)}\right)\\ x+\frac{3}{2}&=-\frac{1}{\log(3)}W\left(-\frac{\log (3)}{2}e^{-\frac{3}{2}\log(3)}\right)\\ x&=-\frac{1}{\log(3)}W\left(-\frac{\log (3)}{2}e^{-\frac{3}{2}\log(3)}\right)-\frac{3}{2} \end{align*}

• Thank you so much! @Joshua Tilley Oct 11, 2023 at 23:05

Since @Joshua Tilley gave the detailed steps, consider the more general case of $$a^x=bx+c$$The solution is $$x=-\frac c b-\frac {W(t)}{\log(a)}\quad \text{where} \quad t=-\frac{\log (a)}{b}\,a^{\frac{b}{c}}$$

In the real domain, we must have $$t \ge -\frac 1e$$.

You can also consider that you look for the zero of function $$f(x)=a^x-bx-c$$ The first derivative cancels at $$x_*=\frac{\log \left(\frac{b}{\log (a)}\right)}{\log (a)}$$ So, if $$f(x_*)=\frac{b-b \log \left(\frac{b}{\log (a)}\right)-c \log (a)}{\log (a)}$$ is negative, there are two solutions on the left and right sides of $$x_*$$.

You can have a rough idea of where are the solution using Taylor series $$f(x)=f(x_*)+\frac 12 f''(x_*)\,(x-x_*)^2+ O((x-x_*)^3)$$

For your specific case, this would give $$x_1=-0.892$$ and $$x_2=1.983$$ while the solutions are $$-1.392$$ and $$1.686$$.