Please also explain how you got the answer if you know it. Thanks. :

Solve for x.
x2-4x+2 = -2x+5

A) (-1,7)
B) (3,-1)
C) {-1,7}
D. {3,-1}

To solve for x, let's first simplify the equation:

x^2 - 4x + 2 = -2x + 5

Next, we can move all the terms to one side of the equation:

x^2 - 4x + 2 + 2x - 5 = 0

Which simplifies to:

x^2 - 2x - 3 = 0

Now, we can try to factorize the quadratic expression. However, in this case, it doesn't factor nicely. Therefore, we can use the quadratic formula to find the solutions for x.

The quadratic formula is given by:

x = (-b ± √(b^2 - 4ac)) / (2a)

For our equation: a = 1, b = -2, and c = -3.

Plugging in the values, we have:

x = (-(-2) ± √((-2)^2 - 4 * 1 * (-3))) / (2 * 1)

Simplifying further, we get:

x = (2 ± √(4 + 12)) / 2

x = (2 ± √16) / 2

x = (2 ± 4) / 2

Now, we have two possible solutions:

x = (2 + 4) / 2 = 6 / 2 = 3

x = (2 - 4) / 2 = -2 / 2 = -1

So, the solutions for x are 3 and -1.

Thus, the correct answer is D) {3, -1}.