Solving $3^x = 4-x$ in terms of Lambert W function

74 Views Asked by At

I want to solve $3^x = 4-x$ in terms of the function W of Lambert.

Wolfram gave me this answer:

$x = \dfrac{4\ln3 - \operatorname{W}(81\ln3)}{\ln3}$, so I tried to find a solution working backwards.

Here is my attempt:

$x\ln3 -4\ln3 = -\operatorname{W}(81\ln3)$

$\ln3(x -4) = -\operatorname{W}(81\ln3)$

$\ln3(4-x) = \operatorname{W}(81\ln3)$

$\ln3(4-x)e^{\ln3(4-x)} = 81\ln3$

$(4-x)e^{\ln3(4-x)} = 81$

$\ln((4-x)e^{\ln3(4-x)}) = \ln81$

$\ln(4-x)+\ln3(4-x) = \ln81$

$\ln(3(4-x)^2) = \ln81$

$3(4-x)^2 = 81$

$(4-x)^2 = 27$

$|4-x| = \sqrt{27}$

$x = 4 \pm \sqrt{27}$, then clearly I made a mistake. Where?

I want to get to the equation $3^x = 4 - x$ from Wolfram´s answer, how can I do that?

A solution starting from $3^x = 4-x$ will also be accepted.

1

There are 1 best solutions below

2
On BEST ANSWER

$$3^x=4-x$$ $$1=(4-x)3^{-x}$$ $$3^4=(4-x)3^{4-x}$$ $$3^4\ln(3)=(4-x)\ln(3)\cdot e^{(4-x)\ln(3)}$$ $$W(3^4\ln(3))=(4-x)\ln(3)$$ $$\therefore x=4-\frac{W(3^4\ln 3)}{\ln 3}$$