# Points nearest and farthest from origin, Lagrange Multipliers

The plane $x + y + 2z = 30$ intersects the paraboloid $z = x^2 + y^2$ in an ellipse.

Find the points on the ellipse that are nearest to and farthest from the origin.

I know you have to find the gradient for $f$, but after that, I have no clue how to proceed. Thank you in advance.

-

let $d^2(x,y,z)=x^2+y^2+z^2$.
you want $\nabla (d^2)$ to be in the plane of $\nabla f$ and $\nabla g$. That is, for some $\lambda$ and $\mu$, you want $$\nabla(d^2)+\lambda\nabla f+\mu\nabla g=0.$$
Let's do a confidence check, that is, let's count unknowns, and pray that we have as many equations. Our unknowns are $x,y,z,\lambda,\mu$, five unknowns. We have the three equations you write in the comment above, plus $f=g=0$, two more, so that's five equations, so there's hope. Let's smash them together and pray. –  Brady Trainor Mar 28 '13 at 3:09
oops, they're not linear, because the way $\lambda$ and $\mu$ show up. –  Brady Trainor Mar 28 '13 at 3:15