\(-\left(2x^2+y^2+2xy-4x-2y-5\right)\\ \\ =-\left(x^2+2x\left(y-1\right)+\left(y^2-2y+1\right)+\left(x^2-2x+1\right)-7\right)\\ =-\left(x^2+2x\left(y-1\right)+\left(y-1\right)^2+\left(x-1\right)^2-7\right)\\ =-\left(\left(x+y-1\right)^2+\left(x-1\right)^2-7\right)\\ =-\left(x+y-1\right)^2-\left(x-1\right)^2-7\)
\(\left(x+y-1\right)^2\ge0\\ \Rightarrow-\left(x+y-1\right)^2\le0\\ \left(x-1\right)^2\ge0\\ \Rightarrow-\left(x+y-1\right)^2-\left(x-1\right)^2\le0\\ \Rightarrow-\left(x+y-1\right)^2-\left(x-1\right)^2-7\le-7\)
Max A = -7 khi x=1 ; y=0
B) TT