\(A=-\left(x^2-2x\left(y+1\right)+\left(y+1\right)^2\right)-\left(4y^2-10y-5-\left(y+1\right)^2\right)\)
\(=-\left(x-y-1\right)^2-\left(3y^2-12y-6\right)\)
\(=-\left(x-y-1\right)^2-3\left(y-2\right)^2+18\le18\)
Max A=18 khi y=2; x=3
\(B=-\left(x^2+2x\left(y-1\right)+\left(y-1\right)^2\right)-\left(2y^2+2y-\left(y-1\right)^2\right)-15\)
\(=-\left(x+y-1\right)^2-\left(y+2\right)^2-10\le-10\)
Max B=-10 khi y=-2; x= 3