[Math] Use Newton’s Method to approximate $x$, accurate to within $10^{-4}$ that produces the point on $y=x^2$ closest to $(1,0)$

calculusnumerical methods

Use Newton's Method to approximate $x$, accurate to within $10^{-4}$ that produces the point on $y=x^2$ closest to $(1,0)$.

$\textbf{My approach:}$

I consider the distance between some arbitrary point on $y=x^2$ and $(1,0)$, this is given by:
$$\begin{align}d(x) &= \sqrt{(x-1)^2 + (x^2-0)^2} \\ &= \sqrt{x^4 + x^2 -2x +1} \end{align}$$

Now, if $d$ is to have a minimum at some point $x_0$, it's slope must be $0$ there, so I want to use Newton's Method to approximate $x_0$ such that $d'(x_0)=0$. In addition, since we require a minimum, we also want $d''(x_0)>0$.

$\textbf{Some questions:}$

Using a program to apply Newton's Method in computing $d'(x)=0$, after 200 iterations with initial value $0.5$, I am nowhere close to the expected root $0.5897$. Is my problem that of finding a good initial value?

I noticed that computing $d''(x)=0$ gives me the result after 3 iterations. Why does finding the root of the second derivative of $d$ give the result when my problem is to minimize $d$?

Best Answer

You can define your objective function as

$h(x) = x^4+x^2-2\,x+1$

$h'(x) = 4\,x^3+2\,x-2$

$h''(x) = 12\,x^2+2$

We can see that $h''$ is strictly positive, so you do not have to worry about it, you only need to find the point where $h'=0$.

So, using Newton's Method:

$x_0=0.5\\ x_1 = x_0-\frac{h'(x_0)}{h''(x_0)} = 0.5 - \frac{0.5+1-2}{3+2} = 0.6\\ x_2 = x_1-\frac{h'(x_1)}{h''(x_1)} = 0.6 - \frac{0.864+1.2-2}{4.32+2} = 0.5899$

Since you are not getting the right result, probably there is an implementation error.