a: \(=\left(x^2+2xy+y^2\right)+7\left(x+y\right)+10\)
\(=\left(x+y\right)^2+7\left(x+y\right)+10\)
\(=\left(x+y+5\right)\left(x+y+2\right)\)
b: \(x^2y+xy^2+x+y=2010\)
\(\Leftrightarrow xy\left(x+y\right)+x+y=2010\)
\(\Leftrightarrow\left(x+y\right)\left(xy+1\right)=2010\)
\(\Leftrightarrow x+y=167.5\)
\(x^2+y^2=\left(x+y\right)^2-2xy=167.5^2-22=28034.25\)