Let $K=\{(x,y):x^2+y^2=1\}, A=\{(x,y,):2x+3y=10)\}$
Find $x \in K, y\in A$ sucht that $d(x,y)=d(A,K)$.
The lagrangian function is
$$H(x_1,x_2,y_1,y_2,\lambda_1,\lambda_2)=(x_1-y_1)^2+(x_2-y_2)^2+\lambda_1(x_1^2+x_2^2-1)+\lambda_2(2y_1+3y_2-10)$$
The distance of the 2 points would normally be $\sqrt{(x_1-y_1)^2+(x_2-y_2)^2}$ so obviously we squared it. Why don't we have to do the same for the conditions $x_1^2+x_2^2-1=0$ and $2y_1+3y_2-10=0$?
For example, here, $\ln$ is applied to the condition as well