(a - 1)x² + a²xy + (a + 1)y²
= (a - 1)x² + (a² - 1 + 1)xy + (a + 1)y²
= (a - 1)x² + {(a - 1)(a + 1) + 1}xy + (a + 1)y²
= (a - 1)x² + (a - 1)(a + 1)xy + xy + (a + 1)y²
Taking (a-1)x outside
and y ouside
= (a - 1)x{x + (a + 1)y} + y{x + (a + 1)y}
Taking {x+(a+1)y} outside
= (x + ay + y)(ax - x + y)