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 in the equation x^2 - 4x + 2 = -2x + 5, we'll follow these steps:

Step 1: Move all terms to one side of the equation.
x^2 - 4x + 2 + 2x - 5 = 0
Rearranging the terms, we get:
x^2 - 4x + 2x + 2 - 5 = 0
Simplifying further:
x^2 - 2x - 3 = 0

Step 2: Factor the equation, if possible.
In this case, the quadratic equation does not factor easily. Therefore, we'll use the quadratic formula to solve for x.

The quadratic formula is given by: x = (-b ± √(b^2 - 4ac)) / (2a)

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

Step 3: Substitute the values into the quadratic formula and simplify.
x = (-(-2) ± √((-2)^2 - 4(1)(-3))) / (2(1))
Simplifying further:
x = (2 ± √(4 + 12)) / 2
x = (2 ± √16) / 2
x = (2 ± 4) / 2

Step 4: Simplify the fractions.
x = (2 + 4) / 2 = 6 / 2 = 3
x = (2 - 4) / 2 = -2 / 2 = -1

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

Looking at the options provided, we can see that the correct answer is D) {3, -1}.