[Math] Lagrange Multiplier Problem – Distance from point With a Circle Constraint

lagrange multiplieroptimization

Given a point $P:(x_0,y_0)$ in $\mathbb{R}^2$, and a constraint function
$$x^2+y^2=R^2$$where $R$ is the radius of the circle. The distance from $P$ to any point on the circle is to be minimized using the method of Lagrange Multiplier. The distance $d$ is given by
$$d(x,y)=\sqrt{(x-x_0)^2+(y-y_0)^2}.$$
Then the Lagrange function becomes
$$\mathcal{L}(x,y,\lambda)=d(x,y)+\lambda\ (x^2+y^2-R^2)$$
with the optimality conditions $\partial_x\mathcal{L}=0$, $\partial_y\mathcal{L}=0$ and $\partial_\lambda\mathcal{L}=0$. These conditions yield:
$$\left[(x-x_0)^2+(y-y_0)^2\right]^{-\frac{1}{2}}(x-x_0)+2\ \lambda\ x=0$$
$$\left[(x-x_0)^2+(y-y_0)^2\right]^{-\frac{1}{2}}(y-y_0)+2\ \lambda\ y=0$$
$$x^2+y^2-R^2=0$$
How should I continue from this point?

Best Answer

Accepting @lab's hint, the Lagrange function can be rewritten as $$\mathcal{L}(x,y,\lambda)=d^2(x,y)+\lambda\ (x^2+y^2-R^2)=(x-x_0)^2+(y-y_0)^2+\lambda\ (x^2+y^2-R^2)$$ Then the optimality conditions would become $$\partial_x\mathcal{L}=2(x-x_0)+2x\lambda=0,\ \partial_y\mathcal{L}=2(y-y_0)+2y\lambda=0$$ $$\partial_\lambda\mathcal{L}=x^2+y^2-R^2=0$$ The first two conditions yield $$x=\cfrac{x_0}{1+\lambda},\ y=\cfrac{y_0}{1+\lambda}\tag{1}$$ These can be substituted in the third condition to obtain $$\cfrac{x_0^2+y_0^2}{(1+\lambda)^2}=R^2$$ Solving for $\lambda$ yields $$\lambda=\left[\cfrac{x_0^2+y_0^2}{R^2}\right]^{\frac{1}{2}}-1$$ $\lambda$ can be substituted in Equation 1 to obtain $$(x,y)=\left(x_0 \left[\cfrac{x_0^2+y_0^2}{R^2}\right]^{\frac{-1}{2}},\, y_0 \left[\cfrac{x_0^2+y_0^2}{R^2}\right]^{\frac{-1}{2}}\right)$$ This point represents the point closest to $P$ and the minimum distance can be found by using the original function $$d(x,y)=\sqrt{(x-x_0)^2+(y-y_0)^2}.$$

Related Question