\(B=2x^2+y^2+2xy-2x+2y+1\)
\(=2\left[x^2+x\left(y-1\right)+\dfrac{1}{4}\left(y-1\right)^2\right]+\dfrac{1}{2}\left(y^2+6y+9\right)-4\)
\(=2\left(x+\dfrac{1}{2}y-\dfrac{1}{2}\right)^2+\dfrac{1}{2}\left(y+3\right)^2-4\ge-4\)
\(minB=-4\Leftrightarrow\) \(\left\{{}\begin{matrix}x=2\\y=-3\end{matrix}\right.\)