Tom K. answered 04/21/21
Knowledgeable and Friendly Math and Statistics Tutor
You can use Lagrange multipliers. Alternatively, you can make this a function of one variable. I shall show you this solution.
4x - y = 0, so y = 4x
y+z = 0, so z = -y = -4x
maximize x^2 + 2(4x) - (-4x)^2 =
x^2 + 8x - 16x^2 = 8x - 15x^2
Taking the derivative, 8 - 30x = 0
x = 4/15
y = 4x = 16/15
z = -y = -16/15
x^2 + 2y - z^2 = (4/15)^2 + 2(16/15) - (16/15)^2 =
16/225 + 32/15 - 256/225 =
-240/225 + 32/15 =
-16/15 + 32/15 =
16/15
Incidentally, the second derivative is -30, so this is a maximum.