I think that the method of Lagrange multipliers is the easiest way to
solve my question, but how can I find the Lagrangian function?
As shown by other answers and in note 1 there are easier ways to find the shortest distance, but here is a detailed solution using the method of Lagrange multipliers. You need to find the minimum of the distance function
$$\begin{equation}
d(x,y,z)=\sqrt{x^{2}+y^{2}+(z-1)^{2}} \tag{1a}
\end{equation}$$
subject to the constraint given by the surface equation $z=f(x,y)=\frac32(x^2+y^2)$
$$\begin{equation}
g(x,y,z)=z-\frac{3}{2}\left( x^{2}+y^{2}\right) =0. \tag{2}
\end{equation}$$
Since $\sqrt{x^{2}+y^{2}+(z-1)^{2}}$ increases with $x^{2}+y^{2}+(z-1)^{2}$ you can simplify the
computations if you find the minimum of
$$\begin{equation}
[d(x,y,z)]^2=x^{2}+y^{2}+(z-1)^{2} \tag{1b}
\end{equation}$$
subject to the same constraint $(2)$. The Lagrangian function is then
defined by
$$\begin{eqnarray}
L\left( x,y,z,\lambda \right) &=&[d(x,y,z)]^2+\lambda g(x,y,z) \\
L\left( x,y,z,\lambda \right) &=&x^{2}+y^{2}+(z-1)^{2}+\lambda \left( z-
\frac{3}{2}\left( x^{2}+y^{2}\right) \right), \tag{3}
\end{eqnarray}$$
where $\lambda $ is the Lagrange multiplier. By this method you need to
solve the following system
$$\begin{equation}
\left\{ \frac{\partial L}{\partial x}=0,\frac{\partial L}{\partial y}=0,
\frac{\partial L}{\partial z}=0,\frac{\partial L}{\partial \lambda }
=0,\right. \tag{4}
\end{equation}$$
which results in
$$\begin{eqnarray}
\left\{
\begin{array}{c}
2x+3\lambda x=0 \\
2y+3\lambda y=0 \\
2z-2-\lambda =0 \\
-z+\frac{3}{2}\left( x^{2}+y^{2}\right) =0
\end{array}
\right. &\Leftrightarrow &\left\{
\begin{array}{c}
x=0\vee 2+3\lambda =0 \\
y=0\vee 2+3\lambda =0 \\
2z-2-\lambda =0 \\
-z+\frac{3}{2}\left( x^{2}+y^{2}\right) =0
\end{array}
\right. \\
&\Leftrightarrow &\left\{
\begin{array}{c}
x=0 \\
y=0 \\
\lambda =2 \\
z=0
\end{array}
\right. \vee \left\{
\begin{array}{c}
\lambda =-2/3 \\
z=2/3 \\
x^{2}+y^{2}=4/9
\end{array}
\right. \tag{5}
\end{eqnarray}$$
For $x=y=x=0$ we get $d(0,0,0)=1$. And for $x^2+y^2=4/9,z=2/3$ we get the minimum distance subject to the given conditions
$$\begin{equation}
\underset{g(x,y,z)=0}\min d(x,y,z)=\sqrt{\frac{4}{9}+(\frac{2}{3}-1)^{2}}=\frac{1}{3}\sqrt{5}. \tag{6}
\end{equation}$$
It is attained on the intersection of the surface $z=\frac{3}{2}\left(
x^{2}+y^{2}\right) $ with the vertical cylinder $x^{2}+y^{2}=\frac{4}{9}$ or equivalently with the horizontal plane $z=\frac{2}{3}$.
$$\text{Plane }z=\frac{2}{3} \text{(blue) and surface }z=\frac{3}{2}\left(
x^{2}+y^{2}\right) $$
Notes.
- As the solution depends only on the sum $r^{2}=x^{2}+y^{2}$ we could just find
$$\begin{equation}
\min [d(r)]^2=r^{2}+(\frac{3}{2}r^{2}-1)^{2} \tag{7}
\end{equation}$$
and then find $d(r)=\sqrt{[d(r)]^2}$ at the minimum.
- The surface $z=\frac{3}{2}\left(
x^{2}+y^{2}\right) $ is a surface of revolution around the $z$ axis.
Best Answer
We seek $x\in\Bbb{R}$ to minimize the distance between $(0,b)$ and $(x,x^{2})$. This amounts to minimizing the value of $$\sqrt{(x-0)^{2}+(x^{2}-b)^{2}},$$ and this gives the same value as the problem of minimizing $$x^{2}+(x^{2}-b)^{2}.$$ To do this, we set the derivative equal to zero and solve: \begin{eqnarray*} 2x + 4x(x^{2}-b) & = & 0,\\ \implies 2x[2x^{2}-2b+1]=0,\\ \implies x=0\:\text{ or }\:x^{2}=b-\tfrac{1}{2}. \end{eqnarray*} Of course, the latter is only valid for $b\geq 1/2$.
Therefore if $b<1/2$, then the minimum distance is $\sqrt{0+(0-b)^{2}}=|b|$. If $b\geq 1/2$, then the minimum distance is either $|b|$ or is $\sqrt{b-\tfrac{1}{4}}$, whichever is smaller, which by inspection is the latter.
As a check, note that $\lim_{b\to1/2^{-}}|b| = 1/2 = \lim_{b\to1/2^{+}}\sqrt{b-\frac{1}{4}}$, which satisfies our intuitions.
It is worth asking what the relevance is of the solution $x=0$ in the case $b\geq1/2$. Some thought (and perhaps a good diagram) shows that $x=0$ in fact gives a local maximum for the distance.
In $\mathbb{R}^{3}$, when we have $z=x^{2}+y^{2}$ and $(0,0,b)$, we can reduce the problem to the two dimensional one due to the rotational symmetry of the paraboloid and the fact that the point $(0,0,b)$ lies on the axis of symmetry. The major difference between the two situations is that instead of two points giving the same minimum distance ($x=\pm\sqrt{b-\frac{1}{2}}$ above), we instead have infinitely many (in fact, the points of minimum distance will form a circle, the intersection between some cone with vertex at $(0,0,b)$ and the paraboloid $z=x^{2}+y^{2}$).