# How do I find a minimum of a function satisfying conditions

Given the following function

$y=(x_1-2)^2+(x_2-3)^2+(x_3-5)^2$

and the following conditions

$x_3-x_2\geq2$

$x_2-x_1\geq2$

How do I find $x_1$, $x_2$ and $x_3$ such that the $y$ is minimum.

I need a general idea how to solve such equations not just this specific one. Let me know if I can improve the question (e.g. tags). Thanks!

-

Since $y \ge 0$ potential minimum would be $y = 0$ which can be achieved that the point $x_1 = 2$, $x_2 = 3$, $x_3 = 5$. Since this solution satisfies the inequalities the minimum is $0$ and it is achieved at point $(2, 3, 5)$. For more general idea you might like to have a look at the method of Lagrange multipliers, especially this.