How do you find the values of x and y given [(x^2+1, 5-y), (x+y, y-4)]=[(2, x), (5, 2)]?

$x = - 1$ and $y = 6$
After equating column of matrices, ${x}^{2} + 1 = 2$, $5 - y = x$ and $y - 4 = 2$. From these equations, $x = - 1$ and $y = 6$