Finding all positive real roots of $e^x - x -2 = 0$ using Newton Raphson's method.

2.2k Views Asked by At

How should I go approach this problem if I need to solve this problem by hand? Is there a general formula that I can use?

2

There are 2 best solutions below

4
On BEST ANSWER

How should I go approach this problem if I need to solve this problem by hand?

There is no closed-form solution of $$e^x=2+x$$

Thus, if you want to do it by hand, you'll have to use numerical methods – by hand. There are many methods to chose from, however Newton-Raphson is still a good approach when you are forced to do it by hand because it has quadratic convergence here, i.e. the number of found digits will double with each step of $$ x\mapsto x-\frac{e^x-x-2}{e^x-1}$$

The initial guess $x=1$ should be quite good as $e\approx 3$.

Moreover you could adjust the precision for calculation with each step, i.e. in the 1st step it makes no sense to use 100 digits of precision. You'd rather double the precision with each step because that matches the convergence of this method for zeroes of 1st order.

As the computation is by hand, we want it as convenient as possible. The 1st thing to note is that we can write the iteration as $$ x\mapsto x-1+\frac{x+1}{e^x-1}$$ The 2nd thing to note is that for $f(x)=e^x-x-2$ we have $$f(1)<0<f(2)$$ and hence $1<x_0<2$ for the zero $x_0$. We can use that to speed up the computation of $e^x$. If we use the power series $$e^x=\sum \frac{x^n}{n!}$$ for computation for $1<x<2$, then the convergence is solely due to the denominators $n!$. Using $e^x=e\cdot e^{x-1}$ (or using that $\exp^{(n)}(1)=e$) we can use the better suited series $$e^x=e\sum \frac{(x-1)^n}{n!}$$ where the numerators do contribute to the convergence instead of being counter-productive. As it turns out, $x_0\approx1.1$ which means the numerators are roughly $0.1^n$, and with each term of the series we gain an additional decimal figure compared to using expansion around 0.

The 3rd thing to note is that $f'(x)<0\Leftrightarrow x<0$, thus $f$ must have exactly 2 order-1 zeros of opposite sign because it has $x_0\neq0$.

The 4th thing to note is that obviously $x_1<0$, and rough estimate $e^{x_1}\approx0$ yields $x_1\approx-2$. To approximate that zero, we better expand $e^x$ around −2. Next rough estimate $e^{-2} \approx1/7$ gives $x_1\approx -3+7/6=-1.8\bar3$. Actually, $x_1\approx-1.8414$.

0
On

Without Lambert function.

Consider that you look for the zero's of function $$f(x)=e^x - x -2$$ for which $$f'(x)=e^x-1 \qquad \text{and} \qquad f''(x)=e^x \,\, >0 \,\,\forall x$$ To start Newton method, you need a guess for each possible root.

In this problem, the first derivative cancels at $x_*=0$ where $f(x_*)=-1$ and the second derivative test confirms that this point is a minimum; so two roots.

Expand $f(x)$ as a Taylor series around $x=0$; this gives $$f(x)=-1+\frac{x^2}{2}+O\left(x^3\right)$$ and as estimates $\pm \sqrt 2$.

Now, just run.