square root of $1/2 + \sqrt3/2?$ Playing with Maple, I noticed that it gives the square root of $c = 1+\frac{\sqrt3}{2}$ as equal to $a = \frac{1}{2}+\frac{\sqrt3}{2}$.
Indeed it checks out. But I got curious: how can I find that value, or more generally any square root of numbers of the form $x+y\sqrt{k}$?
I was able to do it the following way: the square of $z = x+y\sqrt{k}$ is also of the same form. Therefore, I can suppose there is a number of that form whose square is equal to $z$.
In my case, I want to find $(x,y)$ such that $(x+y\sqrt3)^2 = 1+\frac{\sqrt3}{2}$. I developed, which yields $(x^2+3y^2) + 2xy\sqrt3 = 1+\frac{\sqrt3}{2}$. Then I matched the coefficients of $1$ and of $\sqrt3$ on both sides, to get the system:
$x^2+3y^2 = 1$
$2xy = \frac{1}{2}$
Solving for $x$ and $y$, I got $x = ±\frac{1}{2}$ and $y = ±\frac{1}{2}$ (there is another pair of solutions that compute to the same number). QED.
Is my method correct? Is there any more efficient way? Is it possible to prove that a solution of the form $z = x+y\sqrt{k}$ always exist and if not, when?
Thanks.

For rationals $x,y,a,b,k$ where $k$ is square-free and $y \ne 0$, $(a + b \sqrt{k})^2 = x + y \sqrt{k}$ if and only if $a^2 + k b^2 = x$ and $2 a b = y$, and thus $b = y/(2a)$ and 
$a^2 + k y^2/(4 a^2) = x$, i.e.  $(2 a^2 - x)^2 = x^2 - k y^2$.  Thus $x^2 - k y^2$ must be the square of a rational, and if it is $r^2$ then $(x \pm r)/2$ must be the square of a rational.  
In your example, $x=1, y=1/2, k=3$, $x^2 - k y^2 = 1 - 3/4 = 1/4 = (1/2)^2$ and
$(1 - 1/2)/2 = (1/2)^2$, so $1 + \sqrt{3}/2$ is a square.
On the other hand, for $x=3, y=1, k=5$, $x^2 - k y^2 = 9 - 5 = 2^2$ but $(3 - 2)/2 = 1/2$ and $(3+2)/2 = 5/2$ are not squares, so $3 + \sqrt{5}$ is not the square of an expression of the form $a + b \sqrt{5}$ with $a$ and $b$ rational (on the other hand, it is the square of
$\sqrt{10}/2 + \sqrt{2}/2$).
