For the first one, you can easily check your answer by using the distance from a point to a plane formula. But first....the long way.

Subject to the constraint

So,

Which leads to the equation:

So, we have:

From the first two equations we get:

where

From the first and third we get:

where

Sub these into the constraint and get:

Solving for x we get

Which leads to

Sub these into g(x,y,z):

We get

Check it with the distance formula:

Check....