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.$$

-
So you get:<2x, 2y, 2z> + λ<1,1,2> + μ<2x, 2y, -1> = 0 –  Jason Mar 28 '13 at 3:04
Now what do I do? –  Jason Mar 28 '13 at 3:06
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
a thought, four of the equations are linear, might apply some linear algebra to those, I would think that would organize the work some. if my intuition is wrong, let us know what goes wrong please. –  Brady Trainor Mar 28 '13 at 3:13
oops, they're not linear, because the way $\lambda$ and $\mu$ show up. –  Brady Trainor Mar 28 '13 at 3:15