Use Newton's method to approximate a root of the equation $e^{−x}=4+x$ correct to eight decimal places.

2.6k Views Asked by At

I am having trouble with this question. They usually give us something to start with but they didn't on this one. I tried just starting from one but got the wrong answer and then tried with two, three, etc. Does anyone know how to do this?

2

There are 2 best solutions below

0
On

If you start from 1 you will get there eventually. But a good first guess will get you there faster.

My thought process for a good first guess.

$\ln(e) = 1\\ 3>e\\ \ln 3 > 1\\ e^{\ln 3}$

Is slightly greater than $-\ln 3 + 4$

As for the rest of it.

$f(x) = e^{-x} - x - 4 = 0$

$x_{n+1} = x_n - \frac {f(x_n)}{f'(x_n)}\\ x_{n+1} = x_n - \frac {e^{-x} - x + 4}{-e^{-x} - 1}$

$x_0 = -\ln 3\\ f(-\ln 3)\approx 0.099\\ f'(-\ln 3)=-4$

$x_1 = -\ln 3 + \frac{0.099}{4} \approx -1.074\\ f(x_1)\approx 0.000904\\ f'(x_1)\approx -3.9\\ x_2 = -1.073728957\\ x_3 = -1.073728938$

and that is accurate to within $10^{-8}$

0
On

As said in comments and answers, a "good" guess (obtained by graphing the function or inspection) is always better for fewer iterations and a nicer path to the solution.

For illustration, let us start with a bad guess $x_0=1$. The iterates would then be $$\left( \begin{array}{cc} n & x_n \\ 0 & +1.000000000 \\ 1 & -2.386351472 \\ 2 & -1.606471392 \\ 3 & -1.173459067 \\ 4 & -1.077404021 \\ 5 & -1.073733969 \end{array} \right)\tag 1$$ while starting from $x_0=-1$, they would be $$\left( \begin{array}{cc} n & x_n \\ 0 & -1.000000000 \\ 1 & -1.075765685 \\ 2 & -1.073730483 \\ 3 & -1.073728938 \end{array} \right)$$ But you can compensate the bad guess changing the equation to make it mode linear (at least in the region of the solution.

So, instead of looking for the zero of $$f(x)=e^{-x}-4-x$$ consider $$g(x)=\log(e^{-x})-\log(4+x)=-x-\log(4+x)$$ and let us use the "bad" guess $x_0=1$. The iterates would be $$\left( \begin{array}{cc} 0 & +1.000000000 \\ 1 & -1.174531594 \\ 2 & -1.074188093 \\ 3 & -1.073728947 \\ 4 & -1.073728938 \end{array} \right)\tag 2$$ Do you see the differences between $(1)$ and $(2)$ ?