1. Nearest and farthest point

The plane $\displaystyle x+y+2z=2$ intersects the paraboloid $\displaystyle z=x^2+y^2$ in an ellipse. Find the points on this ellipse that are nearest to and farthest from the origin.

What I did:

Let $\displaystyle f(x,y)=x+y+2z-2$ and $\displaystyle g(x,y)=z-x^2-y^2$
$\displaystyle f_x=1,f_y=1,f_z=2$ and $\displaystyle g_x=-2x, g_y=-2y,g_z=1$

then:

$\displaystyle 1=-2x\lambda$
$\displaystyle 1=-2y\lambda$
$\displaystyle 2=\lambda$
$\displaystyle z=x^2+y^2$

$\displaystyle x=-1/4,y=-1/4,z=1/8$

But this is none of the answer. The answers are $\displaystyle (1/2,1/2,1/2) and (-1,-1,2)$

Can someone point out my mistake?

2. Here you have 2 constraints

x + y + 2z = 2 call it f

z-x^2 -y^2 = 0 call it g

You want to maxmimize the distance to the origin
(maximize the square of the distance)

Call it D = x^2 + y^2 + z^2

1) 2x = L1 -2xL2
2) 2y = L1 -2yL2
3) 2z= 2L1 + L2
4) x + y + 2z =2
5) z = x^2 + y^2

Now
i Eliminate L2 between eqns 1) and 2) and you obtain x = y

ii Use this in 4) to get z = 1 - x

iii Use this in 5 to get x = 1/2 or -1

Use this to finish