# How do you solve by completing the square: x^2 - 4x + 2 = 0?

We know that ${\left(x + a\right)}^{2} = {x}^{2} + 2 a x + {a}^{2}$. Since your equation starts with ${x}^{2} - 4 x$, it means that we must find a value of $a$ such that $2 a x = - 4 x$, which means $a = - 2$.
If $a = - 2$, then we have ${\left(x - 2\right)}^{2} = {x}^{2} - 4 x + 4$. You can see that your equation ${x}^{2} - 4 x + 2$ is very close: we only need to add $2$.
So, adding $2$ to both sides, we get ${x}^{2} - 4 x + 4 = 2$, which means
${\left(x - 2\right)}^{2} = 2$. Extracting square roots at both sides, we get $x - 2 = \setminus \pm \setminus \sqrt{2}$, which leads us to the solutions
${x}_{1 , 2} = 2 \setminus \pm \setminus \sqrt{2}$