x2 + px + q = (x + a)(x + b)
⇒ x2+ px + q = x2 + ax + bx + ab
⇒ x2+ px + q = x2 + (a + b)x + ab
Comparing the coefficients, we get
a + b = p ...(1)
ab = q ...(2)
∴ x2 + pxy + qy2 = x2 + (a + b)xy + aby2
| Using (1) and (2)
= x2 + axy + bxy + aby2
= x(x + ay) + by(x + ay)
= (x + ay)(x + by).