$$(a-1) { x }^{ 2 } + { a }^{ 2 } xy+(a+1) { y }^{ 2 }$$
$\left(ax-x+y\right)\left(x+ay+y\right)$
$ax^{2}-x^{2}+xya^{2}+ay^{2}+y^{2}$