I need to solve a function for $x$
$k+\frac{1}{2}=-\log{x}+\frac{x^2}{2}$
I know the solution(s) should be expressed using Lambert W function because the above function can also be expressed as
$2^{k+1/2}=\frac{1}{x}e^{(\ln{\sqrt{2}})x^2}$
however, I cannot proceed any further.