Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given that $x-2y+3z=1$, find the minimum value of $x^2+y^2+z^2$.

share|cite|improve this question
up vote 3 down vote accepted

The basic idea of constrained optimization is as follows: Usually to find minimal or maximal points, we find the argument where the target function $f$ "doesn't change", that is has vanishing gradient. If we are constrained to a subset of $\mathbb R^3$ (say), this won't work as it doesn't harm us, if $f$ changes orthogonal to our subset (given by a constrained $\{g=0\}$) for then, locally on $\{g=0\}$ $f$ also "doesn't change". Now the orthogonal direction to a level set at a point $(x,y,z)$ is given by $g$'s gradient at this point (look at a curve $\gamma\colon (-\epsilon, \epsilon) \to \{g=0\}$ and compute the derivative of $0 = g \circ \gamma$ using the chain rule to see that $\operatorname{grad} g(\gamma(0)) \perp \gamma'(0)$). So we are interested in points, where $f$'s direction of change is the same as $g$'s direction to change, that is we look for $(x,y,z)$ such that \[ g(x,y,z)=0 \text{ and } \exists \lambda \in \mathbb R: \operatorname{grad} f(x,y,z) = \lambda \cdot \operatorname{grad}g(x,y,z). \] This intuitive argument can be made explicit and our $\lambda$ is called a Lagrangian multiplicator.

Use the Lagrangian multiplicator technique. We set $f(x,y,z) = x^2 + y^2 + z^2$ and $g(x,y,z) = x - 2y + 3z -1$. Then we have to minimize $f$ on $\{g =0\}$. We compute \begin{align*} \partial_x f(x,y,z) = 2x\\ \partial_y f(x,y,z) = 2y\\ \partial_z f(x,y,z) = 2z\\ \partial_x g(x,y,z) = 1\\ \partial_y g(x,y,z) = -2\\ \partial_z g(x,y,z) = 3 \end{align*} So we have to solve the system \begin{align*} x - 2y + 3z &= 1\\ \\ 2x &= \lambda \cdot 1 & \iff x &= \frac 12\lambda\\ 2y &= \lambda \cdot (-2) & \iff y &= -\lambda\\ 2z &= \lambda \cdot 3 & \iff z &= \frac 32 \lambda \end{align*} So \[ \frac 12 \lambda + 2 \lambda + \frac 92 \lambda = 1 \iff \lambda = \frac 17\] That is $x = \frac 1{14}$, $y = -\frac 17$ and $z = \frac 3{14}$. So the minimal value of $f$ on $\{g=0\}$ is (note that the critical point we found has to be a minimum point, as $f$ grows for large arguments) \[ f\left(\frac 1{14}, -\frac 1{7}, \frac 3{14}\right) = \frac{1 + 4 + 9}{196} = \frac 1{14} \]

share|cite|improve this answer
Can you also describe what is happening here geometrically? – Berci Oct 21 '12 at 9:30
@Berci I tried. – martini Oct 21 '12 at 9:41

The constraint equation is that of a plane with normal vector $(1,-2,3)$. From the symmetry of the objective function, which is the squared distance to the origin, it follows that the minimum will be achieved at some point $t(1,-2,3)$ on the normal vector. Since this point is to lie on the constraint plane, we have $t=1/14$, at the optimal point. The value of the objective function is the sum of squares of the coordinates at this point $t(1,-2,3)=(1/14,-2/14,3/14)$, which is $(1^2+2^2+3^2)/14^2=1/14$, as obtained by martini using lagrange multipliers method.

In general this objective function $x^2+y^2+z^2$ is the squared distance from the origin. For a plane $ax+by+cz=p$ the point closest to the origin will lie on the normal vector $(a,b,c)$ to the plane, and the distance to the origin will be the length of that multiple of the normal vector whose tip lies on the plane. Thus when things are squared we get the above answers.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.