Use Newton's Method to solve the equation? lnx+e^x=0lnx+ex=0

2 Answers
Mar 26, 2017

See below.

Explanation:

According to Taylor expansion for f(x)f(x) near x_0x0

f(x)=f(x_0)+((df)/(dx))_(x_0)(x-x_0)+O(abs(x-x_0)^2)f(x)=f(x0)+(dfdx)x0(xx0)+O(|xx0|2)

Now supposing that x_0 approx 0x00 then we can assume

f(x_1)=f(x_0)+((df)/(dx))_(x_0)(x_1-x_0) =0f(x1)=f(x0)+(dfdx)x0(x1x0)=0

This gives rise to an iterative approximation procedure

f(x_k) = ((df)/(dx))_(x_k)(x_(k+1)-x_k) =0f(xk)=(dfdx)xk(xk+1xk)=0 or

x_(k+1) = x_k - ((df)/(dx))_(x_k)^(-1)f(x_k)xk+1=xk(dfdx)1xkf(xk)

In this case we have

((df)/(dx))_(x_k) = 1/x_k+e^(x_k)(dfdx)xk=1xk+exk so

x_(k+1)=x_k-x_k/(1+x_ke^(x_k))(log(x_k)+e^(x_k))xk+1=xkxk1+xkexk(log(xk)+exk)

or

x_(k+1)=(1-(log(x_k)+e^(x_k))/(1+x_ke^(x_k)))x_kxk+1=(1log(xk)+exk1+xkexk)xk

With x_0 = 0.5x0=0.5 the iteration history is

((x_k, f(x_k)),(0.5, 0.955574),(0.238107, -0.166189),(0.268497, -0.00692001),(0.269872, -0.0000118326),(0.269874, -3.4569*10^-11),(0.269874, 0.))

Mar 26, 2017

x=0.2698741376 to 10dp.

Explanation:

We have:

f(x) = lnx+e^x

Our aim is to solve f(x)=0. First let us look at the graph:
graph{ln(x)+e^x [-5, 5, -10, 10]}

We can see that there is one solution in the interval 0 lt x lt 1. Let us start with an initial approximation x=1.

To find the solution numerically, using Newton-Rhapson method we use the following iterative sequence

{ (x_1,=1), ( x_(n+1), = x_n - f(x_n)/(f'(x_n)) ) :}

Therefore we need the derivative:

\ \ \ \ \ \ \f(x) = lnx+e^x
:. f'(x) = 1/x+e^x

Then using excel working to 10dp we can tabulate the iterations as follows:
enter image source here

We could equally use a modern scientific graphing calculator as most new calculators have an " Ans " button that allows the last calculated result to be used as the input of an iterated expression.

And we conclude that we have very rapid convergence, and the solution is x=0.2698741376 to 10dp.