Where am i going wrong here?

Where am i going wrong? I'm trying to find x using the cosine rule from:

http://www.mathhelpforum.com/math-he...ccbeee97-1.gif

so i've got:

$\displaystyle 7^2 = (x+2)^2 + 4^2 - 2\times{(x+2)}\times{4}\times(\frac{\sqrt2}{2})$

$\displaystyle 49 = x^2 + 4x + 4 + 16 - 8(x+2)\times(\frac{\sqrt2}{2})$

$\displaystyle 49 = x^2 + 4x + 20 - 4(x+2)\times(\sqrt2)$

$\displaystyle x^2 + 4x - 29 - 4(\sqrt2)x - 8(\sqrt2)$

Now i know i've already gone wrong somewhere; the answer is:

$\displaystyle x^2 - 4(\sqrt2-1)x - (29+8\sqrt2) = 0$

Thanks,

F,