So the problem is that I have $D(f)=\{(x,y,z), x^2+y^2+z^2 ≤2 , z≤1\}$ and I have to determine the maximum value for the function $(x−1)^2+ (y−1)^2+ (z−1)^2$ in $D$.
I'm just confused as I don't actually know if $z\le1$ counts as a constraint as well, or is it just for me to sketch the area, which is actually a part of the question. Furthermore, I know that I have to use Lagrange multiplier method, but I honestly don't know how because $\le$ is making the question hard for me. Do I just calculate as usual and count $\le$ the same as $=$?
appreciate all the feedback
Edit: I have calculated the grad f =0 which is = $D(f)=(2(x-1), 2(y-1), 2(z-1))$ where I've got that $x=y=z= 1$ and $f(1, 1, 1)=0$. (I don't know what to do with this though). Then I calculated $L(x, y, x, λ) = (x−1)^2+(y−1)^2+(z−1)^2 +λ(x^2+y^2+z^2-2)$, then the four cases where I got the same value which is $-2λ= 2(x-1)/x = 2(y-1)/y = 2(z-1)/z$. Which means that $x=y=z$, put it in the $D$ function $x^2+ x^2+ x^2$ and ended up with $x=y=z= −+√2/√3$. I took the minus sign for the maximum distance from $(1,1,1)$. which means that the answer is $x=y=z= −√2/√3$. Is it correct?
Hint. Find first the maximum value for the function $(x−1)^2+(y−1)^2+(z−1)^2$, which is the square of the distance of the point $(x,y,z)$ from $P=(1,1,1)$, in the larger set $$D_1=\{(x,y,z): x^2+y^2+z^2 ≤2\}$$ which is the closed ball centered at $(0,0,0)$ of radius $\sqrt{2}$. This should be easy to find by using a geometric approach with very few calculations: the maximum point is on the boundary of $D_1$ along the line which joins the center $(0,0,0)$ and the point $(1,1,1)$.
Does this maximum point satisfy the constrain $z\leq 1$? What may we conclude?