<s>[INST] Finding points of a function's graph that are closest to a given point A question from my calculus book states,

Which points on the graph  $y=4-x^2$ are the closest to the point (0,2)?

Using some of my notes, I have a formula  as follows (not sure what it's actually called):
$$d=\sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}$$
So I plugged in $(0,2)$ as my $x_1/y_1$ values:
$$d=\sqrt{(x_2-0)^2 + (y_2-2)^2}$$
$$d^2 = (x-0)^2 + (y-2)^2$$
I know $y=4-x^2$ so I plug it in:
$$d^2 = (x-0)^2 + ((4-x^2)-2)^2$$ 
$$F(x) = (x-0)^2 + (2-x^2)^2$$
Finding the derivative using the chain rule I get:
$$F'(x) = 2(x-0)(1) + 2(2-x^2)(-1)$$
$$0 = 2(x-0)- 2(2-x^2)$$
$$0 = 2x-0-4+2x^2$$
$$0 = 2x^2+2x-4$$
Thus I have a polynomial, so I tried using the quadratic equation to solve for $[x]$ and ended up with $$x=(-2 + 6)/(4) | x=(-2 - 6)/(4)$$, so $x=1/x=-2$?
Can someone help me out with what I'm missing or doing wrong in trying to find the points of the graph to point $(0,2)$?
 [/INST] This is a classic optimization problem where you are trying to minimize the distance from the point $(0, 2)$. Given the function $$f(x) = 4 - x^2$$, we can represent all of the points on that curve as, $(x, 4 - x^2)$. Now, we can use the distance formula: $$d = \sqrt{(x_2-x_1)^2+(y_2-y_1)^2}$$. When we plug in $(x, 4 - x^2)$ and $(0, 2)$ for $(x_1, y_1)$ and $(x_2, y_2)$, respectively, we obtain, $$d = \sqrt{x^4-3x^2+4}$$ We want to minimize the distance function, so we should find when the derivative is equal to $0$. Since the square root will always increase with the inside function, we can disregard the square root and call $$f(x)=x^4-3x^2+4$$. Taking the derivative yields $$f'(x)=4x^3-6x$$ Which when factored is $$f'(x)=2x(2x^2-3)$$. We can see that the critical numbers of the function $f(x)$ are $x = 0$ and $x = \pm\sqrt{\frac{3}{2}}$ Applying the first derivative test shows that $x = \pm\sqrt{\frac{3}{2}}$ are minimums. Therefore the points that are a minimum distance from $(0, 2)$ and are on $y=4-x^2$ are $(\sqrt{\frac{3}{2}}, \frac{5}{2})$ and $(-\sqrt{\frac{3}{2}}, \frac{5}{2})$.
</s>