a)
\(\begin{array}{l}\left( {{x^2} - xy + 1} \right)\left( {xy + 3} \right)\\ = {x^2}.xy + {x^2}.3 - xy.xy - xy.3 + 1.xy + 1.3\\ = {x^3}y + 3{x^2} - {x^2}{y^2} - 3xy + xy + 3\\ = {x^3}y + 3{x^2} - {x^2}{y^2} + \left( { - 3xy + xy} \right) + 3\\ = {x^3}y + 3{x^2} - {x^2}{y^2} - 2xy + 3\end{array}\)
b)
\(\begin{array}{l}\left( {{x^2}{y^2} - \dfrac{1}{2}xy + 2} \right)\left( {x - 2y} \right)\\ = {x^2}{y^2}.x - {x^2}{y^2}.2y - \dfrac{1}{2}xy.x + \dfrac{1}{2}xy.2y + 2.x - 2.2y\\ = {x^3}{y^2} - 2{x^2}{y^3} - \dfrac{1}{2}{x^2}y + x{y^2} + 2x - 4y\end{array}\)