Question about the gradient of a function We consider a function of class $C^1(\mathbb{R}^2)$, by searching a max or min between the points of $S=\{(x,y) \in \mathbb{R}^2 \;\; | \;\; x^2+y^2=1\}$, if $(x_0,y_0)$ is one of them, is it true that there exists $\lambda \in \mathbb{R}$ such that $\nabla f(x_0,y_0)=2\lambda (x_0,y_0)?$ Why?

Assuming that you want the extremum of some $f(x,y)$, we can parameterize the locus as $x=\cos t,y=\sin t$.
Then by the chain rule, the stationary points of $f$ are given by
$$\frac{df}{dt}=\nabla f\cdot(-\sin t,\cos t)=0$$ and these are such that $$\nabla f=\lambda(\cos t,\sin t).$$
In other words, the derivative of the function when you remain in the locus is zero when the gradient is normal to the locus, i.e. parallel to a normal to the locus.
This is a quite general property.
