I want to find out the values of x where the $f(x) = e^x-x-4$ will equal zero.
My problem by solving this myself is that I cannot use logarithm natural (ln) because I have a normal x:
$f(x) = e^x - x - 4$
$f(x) = 0 $
$\Rightarrow e^x - x -4 = 0 (| +x | +4)$
$\Rightarrow e^x = x + 4$
Failed solution one: $ e^x = x + 4 | ^{(-x)}$
$ e^0 = (x + 4)^{(-x)}$
$1 = (x + 4)^{(-x)}$ ?
Failed solution two:
$e^x = x + 4 | \ln$
$\Rightarrow x = \ln(x) + \ln(4)$ ?
What is the solution?
Cheers bodo
This kind of equations generally have no closed-form solution.
It is often possible to manipulate the equation into a form that allows a solution to be written in terms of Lambert's W function, but that's usually not a major improvement from a practical point of view.
You will need to approximate the solution numerically.
Solution with $W$: Set $y = -e^x$. Then $x-e^x = -4$ becomes $$ \log(-y)+y = -4 $$ Exponentiating both sides get $$ -ye^y = e^{-4} $$ so by definition of the $W$ function we have $y=W(-e^{-4})$. Plug into the definition of $y$ and we get $$ x = \log(-W(-e^{-4}))$$ which produces one solution for each of the two branches of $W$. Enlightening, right?