Cho biểu thức \(P=\sqrt{x^2-xy+1}\) . Tính giá trị của P khi:

a) x = 3, y = −2;

b) x = 1, y = 4.