We have to make the quadratic equation a perfect square if possible or sum of perfect square with a constant.
(a + b)2 = a2 + 2ab + b2
\(x^2-(\sqrt{2}+1)x+\sqrt{2}=0\)
⇒ x2 – (√2 + 1)x + ((√2 + 1)/2)2 - ((√2 + 1)/2)2 + √2 = 0
⇒ (x - (√2 + 1)/2)2 = (2 + 1 + 2√2)/4 - √2
⇒ (x – (√2 + 1)/2)2 = (2 + 1 – 2√2)/4 = ((√2 – 1)/2)2
⇒ x - (√2 + 1)/2 = (√2 – 1)/2
⇒ x = √2, 1