I've been trying to solve this problem by using the Lagrangian multiplier method, but I get lost somewhere. My reasoning is the following:
There must be a point $(a,a^2)$ somewhere in the parabola which is as close as you can get to some point $(b,b-4)$ (a point in the line). The distance between those two generic points is the module of the vector $(a-b,a^2-b+4)$. So let there $f(a,b)$ be the function that I'll call distance squared (to simplify the calculations):
$$f(a,b)=(a-b)^2+(a^2-b+4)^2$$
Now, my question is: what are the constrictions we should use to find the shortest distance? I solved this problem without using this method, but the process involved a third grade polynomial that I couldn't solve without using a computer/calculator, so I don't want to rely on that.
How should one proceed? I don't want anyone to solve my problem, of course, I just need a guideline on what to do now. Thanks in advance :)
First, write the line in standard form:
$$y=x-2\implies x-y-2=0$$
Now, take a generic point on the parabola: $\;(a,a^2)\;$ , and now evaluate the distance from this point to the line:
$$d(a):=\frac{|a-a^2-2|}{\sqrt{1^2+(-1)^2}}=\frac{|a-a^2-2|}{\sqrt2}$$
(Observe that by geometric considerations (i.e. looking at the graphs), we could already assume $\;a\ge0\;$), and then do some differential calculus:
$$d'(a)=\pm\frac{1-2a}{\sqrt2}=0\iff a=\frac12$$
and the minimal distance is thus
$$d\left(\frac12\right)=\frac{\left|\frac12-\frac14-2\right|}{\sqrt2}=\frac7{4\sqrt2}$$
Another way: we want to minimize the (square of the) distance $\;D(x,y):+(a-x)^2+(a^2-y)^2\;$ from a generic point $\;(a,a^2)\;$ on the parabola, under the restriction that $\;y=x-2\iff x-y-2=0\;$ , so
$$H_\lambda=(a-x)^2+(a^2-y)^2+\lambda(x-y-2)\implies$$$${}$$
$$\begin{cases}&I\;\;&H'_x=-2(a-x)+\lambda=0\iff\lambda=2(a-x)\\{}\\ &II\;\;&H'_y=-2(a^2-y)-\lambda=0\iff\lambda=-2(a^2-y)\\{}\\ &III\;\;&H'_\lambda=x-y-2=0\iff y=x-2\end{cases}$$
From I - II - III above, we get
$$\begin{cases}&I\;\;&x=a-\frac\lambda2\\{}\\ &II\;\;&y=a^2+\frac\lambda2\\{}\\&III\;\;&a^2+\frac\lambda2=a-\frac\lambda2-2\end{cases}\;\;\;\;\;\;\stackrel{III}\implies\;\;\lambda=a-a^2-2$$
and from here:
$$I\;\;x=a-\frac{a-a^2-2}2=\frac{a+a^2}2+1\;,\;\;II\;\;y=a^2+\frac{a-a^2-2}2=\frac{a+a^2}2-1$$
and
$$D\left(\frac{a+a^2}2+1\,,\,\,\frac{a+a^2}2-1\right)=\left(\frac{a-a^2}2-1\right)^2+\left(\frac{a^2-a}2+1\right)^2\implies$$
$$D'(a)=(1-2a)\left(\frac{a-a^2}2-1\right)+(2a-1)\left(\frac{a-a^2}2+1\right)\stackrel ?=0\implies$$
$$(2a-1)\cdot2=0\implies a=\frac12$$
and we get again the same as before.