Solve the following equation: $\sin x \cos x = \frac{1}{2}$ I am required to solve the following equation:

$$\sin x \cos x = \frac{1}{2}$$

My attempt:
Rewriting $\cos x$
$$\sin x \sqrt{1 - \sin^2 x} = \frac{1}{2}$$
Squaring both sides
$$\bigl(\sin x \sqrt{1 - \sin^2 x}\bigr)^2 = \bigl(\frac{1}{2}\bigr)^2$$
$$\sin^2 x (1 - \sin^2 x) = \frac{1}{4}$$
Expanding left side and multiplying both sides by 4 
$$\sin^2 x - \sin^4 x = \frac{1}{4}$$
$$4\sin^2 x - 4\sin^4 x = 1$$
$$4\sin^2 x - 4\sin^4 x -1 = 0$$
Reordering left side
$$- 4\sin^4 x + 4\sin^2 x  -1 = 0$$
$$4\sin^4 x - 4\sin^2 x  + 1 = 0$$
Expression above can be factored as
$$(2\sin^2 x - 1)(2\sin^2 x - 1) = 0$$
$$(2\sin^2 x - 1)^2 = 0$$
It follows that
$$2\sin^2 x - 1 = 0 $$
$$\sin^2 x = \frac{1}{2} $$
$$\sin x = ± \frac{1}{\sqrt{2}} $$
So the resulting angles are: $45^{\circ},135^{\circ},225^{\circ},315^{\circ}$
Is my solution correct?

The reason why I am asking is, the author of the book used different method, and the end result he got was:
$$\sin2x = 1$$
So $2x = \sin^{-1}(1) = 90^{\circ},450$, and thus $x = 45^{\circ},225^{\circ}$

There's a useful identity you can use. 
$2\sin(x)\cos(x)=\sin(2x)$
Now, rewrite it as $\frac{\sin(2x)}{2}=\sin{x}\cos{x}$.
Swap $\frac{\sin(2x)}{2}$ with your LHS and you have: 
$\frac{\sin(2x)}{2}=\frac{1}{2}$ as the following.
We are now left with $\sin(2x)=1$.
