\(x^2+3y^2-4xy+10x-12y+9\)
\(=\left(x^2-xy+x\right)+9x-3xy+3y^2-12y+9\)
\(=\left(x^2-xy+x\right)+\left(9x-9y+9\right)-3xy+3y^2-3y\)
\(=\left(x^2-xy+x\right)+\left(9x-9y+9\right)-\left(3xy-3y^2+3y\right)\)
\(=x\left(x-y+1\right)+9\left(x-y+1\right)-3y\left(x-y+1\right)\\ =\left(x-y+1\right)\left(x+9-3y\right)\)