0

I must use the Newton Raphson method.

Can someone please explain the steps I must take in order to reach the answer. For alot of this im having to self study the material to catch up and without instruction, im quite lost on how to approach the problem. I wasnt given any initial values, so am i to assume that i must use the distance formula or..

  • So let's take some value for $x$, let's say $x=t$. On the graph, this corresponds to the point $(t,\ln t)$. What is the distance of this point from the origin? – Matti P. Dec 18 '20 at 11:03
  • so using the distance formula id get d=sqrt(x^2 + (lnx)^2. but do i now use this as the f(x) function nd then divide it by its derivative? so that i can find x1 x2 and so forth using newton raphson – margiela Dec 18 '20 at 11:06
  • Let's not worry about any iterative methods yet. We don't even know what we're trying to solve yet. So we have the function for the distance, which is $$ d(t) = \sqrt{t^2 + \ln^2 x} $$ The graph of this function looks like this: https://www.desmos.com/calculator/9w4dpwyhsp

    So now what we're interested in is the minimum of this function. As you can see form the graph, there is one quite clear minimum point. Do you know how to find the minimum of a function? Hint: The value that minimises $\sqrt{g(x)}$ is the same as for $g(x)$, without the square root.

    – Matti P. Dec 18 '20 at 11:11
  • to find mins and maximums i must find the critical values right, using the derivative nd second order derivative right? – margiela Dec 18 '20 at 11:14
  • Yes so what you have to know is that if a (continous and smooth) function has a minimum, then the derivative of that function is zero at that point. So with this in mind, in order to find the minimum value of $d(t)$, we have to find the derivative of $d(t)$ first. But we can make the problem significantly easier by getting rid of the square root. So now we're interested in the derivative of $$ f(t) = d^2 (t) = t^2 + \ln^2 t $$ Can you calculate the derivative? – Matti P. Dec 18 '20 at 11:21
  • its gonna be 2t+2ln(t)/t – margiela Dec 18 '20 at 11:25
  • again im really sorry, i feel like im being daft or like slow, please bare with me:) – margiela Dec 18 '20 at 11:27
  • Yes you are correct. So now we are interested in finding the values of $t$ that are the solutions to the equation $$ h(t) = f'(t) = \frac{2t^2 + 2\ln t}{t} = 0 $$ (just a slight re-write of the derivative). Now we have an actual equation to solve and we can use numerical methods. Do you know how to proceed? – Matti P. Dec 18 '20 at 11:28
  • 1
    It's all good - most people don't even reply to efforts in helping them! – Matti P. Dec 18 '20 at 11:29
  • id put the original f(t) function (essentially the distance formula) nd divide it by f'(t) nd ultimately subtract this whole value from tn, or must i still ignore the iterative method – margiela Dec 18 '20 at 11:30
  • Forget about everything else and let's just focus on this: $$ h(t) = \frac{2t^2 + 2 \ln t}{t} = 0 $$ This is the equation that needs an iterative, numerical solution. – Matti P. Dec 18 '20 at 11:31
  • ok, so if i need to find the o's of this funtion i must just find the critical values. so essentially when t = 0 and when the numerator is equal to 0 – margiela Dec 18 '20 at 11:33
  • The critical value is the solution to the equation that I wrote. So now we only want to solve the equation numerically. The graph of $h(x)$ looks like this: https://www.desmos.com/calculator/vbiofbx8bx

    See how it has a pretty clear, single root? That's what we want to find numerically.

    – Matti P. Dec 18 '20 at 11:36
  • Actually, I see another point that we can use to make the equation easier: When we want to solve $$ \frac{2t^2 + 2 \ln t}{t} = 0 $$, it suffices that $2t^2 + 2 \ln t = 0$ . – Matti P. Dec 18 '20 at 11:38
  • I know that there are a lot of equations and functions, but the way to the correct solution is just to advance logically in each step ... – Matti P. Dec 18 '20 at 11:40
  • 2lnt = -2t^2,,,,,,,,, which can be -2t^2/2 = lnt,,,,,,,,,,so e^(ln t) = e^-2t^2/2,,,,,,,, t = e^-t^2 – margiela Dec 18 '20 at 11:41
  • Yes, good that you have looked for algebraic solutions - and noticed that there are none. So now we only have the equation $$ 2t^2 + 2\ln t = 0 $$ to solve. Forget everything else than this equation. Time to take out the Newton-Rhapson method. – Matti P. Dec 18 '20 at 11:43
  • what would i use for the xn value tho – margiela Dec 18 '20 at 11:48
  • What do you refer to, by $x_n$ ? The way the method works is that you pick a starting value for the unknown variable (in this case, $t$ - and in many cases it doesn't matter at all which value you choose) and then you calculate an improved value based on that initial guess. If I were you, I would choose $t_0 = 1$ as the initial guess. – Matti P. Dec 18 '20 at 11:50
  • ohhh, so i can pick the intial value for t. coz isnt the formula xn-f(xn)/f'(xn). either way that makes things alot clearer – margiela Dec 18 '20 at 11:51
  • x(n+1) = 1 - (2(1)^2+ 2 ln(1))/4(1) + 2/1) – margiela Dec 18 '20 at 11:55
  • Looks good, go on. After the first iteration, you really need a calculator because the values will not be rational numbers. – Matti P. Dec 18 '20 at 11:58
  • so 1- (2/6),,,,,, 1-(1/3),,,,,, x(n+1) = 2/3 – margiela Dec 18 '20 at 11:59
  • since we got x1 , i now keep finding iterations right? – margiela Dec 18 '20 at 12:00
  • Yes, essentially the process is infinite and it gets more and more accurate each time. – Matti P. Dec 18 '20 at 12:01
  • 2/3 - (2(2/3)^2+ 2ln(2/3)/4(2/3) + 2/2/3) – margiela Dec 18 '20 at 12:02
  • i know this is prob dumb, but id know to stop when the values start moving awy from the orgin again right? – margiela Dec 18 '20 at 12:02
  • I get the following iteration values: $$ t_0 = 1 $$ $$ t_1 = \frac{2}{3} $$ $$ t_2 \approx 0.652~909 $$ – Matti P. Dec 18 '20 at 12:03
  • What do you mean "moving away from the origin"? Which origin? In this case, if you have calculated everything correctly, the iteration should converge - and quite quickly, too. – Matti P. Dec 18 '20 at 12:04
  • oh i get it now, thank you so much for your help – margiela Dec 18 '20 at 12:06

1 Answers1

1

The closest point of the curve has an $x$-coordinate that is the solution of the equation $$f(x)=x^2+\log x =0$$ as $f\left(\frac12\right)=\frac14-\log 2<0$ and $f(1)=1>0$, for the intermediate values theorem the root is in the interval $(0.5,1)$

So we take $x_0=0.5$ and $x_n=x_{n-1}-\frac{f(x_{n-1})}{f'(x_{n-1})}$

$$ \begin{array}{l|r|r} n & x_n & error\\ \hline 0 & 0.5 &\\ 1 & 0.647716 & 0.147716 \\ 2 & 0.652917 & 0.00520115 \\ 3 & 0.652919 & 1.77\times 10^{-6} \\ 4 & 0.6529186404 & 1.9\times 10^{-13} \\ \end{array} $$

The solution with $6$ exact decimal places is $x^*=0.652919$

Raffaele
  • 26,371