Ta có
\(B=x^2+2x+y^2-2y-2xy+38\)
\(\Rightarrow B=\left(x^2-2xy+y^2\right)+\left(2x-2y\right)+37\)
\(\Rightarrow B=\left(x-y\right)^2-2\left(x-y\right)+37\)
\(\Rightarrow B=7^2-2.7+37\)
\(\Rightarrow B=49-14+37\)
\(\Rightarrow B=72\)
\(B=x\left(x+2\right)+y\left(y-2\right)-2xy+37\)
\(=x^2+2x+y^2-2y-2xy+37\)
\(=\left(x^2+y^2-2xy+1+2x-2y\right)+36\)
\(=\left(x-y+1\right)^2+36\)
\(=\left(7+1\right)^2+36\)
\(=64+36\)
\(=100\)