find the distance of point $P(0,0,1)$ from the level surface $f(x,y,z)=0$ of $f(x, y, z)=\left(z-x^{2}\right)(z+3 y)$ given $$f(x, y, z)=\left(z-x^{2}\right)(z+3 y)$$
I am asking to find the distance of point $p=(0,0,1)$ from the level surface $f(x, y, z)= 0$.
The idea of what I am asked is pretty simple but How should I execute that?

Consider:
Objective function $x^2+y^2+(z-1)^2$, which is the square of
the distance from the position $p$, and constrained to
$(z-x^2)(z+3y)=0$.
So, your auxiliary function is $F=x^2+y^2+(z-1)^2+\lambda(z-x^2)(z+3y)$.
Then the equations
$$\frac{\partial F}{\partial x}=0,$$
$$\frac{\partial F}{\partial y}=0,$$
$$\frac{\partial F}{\partial z}=0,$$
together with $(z-x^2)(z+3y)=0$,
going to give you where the distance to the square distance function:
$$x^2+y^2+(z-1)^2,$$
reaches an extremum.
