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}$
 A: Your solution is incorrect, as others pointed out. The reason is because you've made two "irreversible" operations, and did not took care of the branches they create.
The first one is:
$$
\sin x \cos x = \frac{1}{2} \Rightarrow \sin x \sqrt{1 - \sin^2 x} = \frac{1}{2}
$$
This is is simply wrong, because if your are working on real numbers, the outcome of the square root must be a non-negative number. The correct statement would actually be:
$$
\sin x |\cos x| = \frac{1}{2} \Rightarrow \sin x \sqrt{1 - \sin^2 x} = \frac{1}{2}
$$
The second one is:
$$
\sin x \sqrt{1 - \sin^2 x} = \frac{1}{2} \Rightarrow \bigl(\sin x \sqrt{1 - \sin^2 x}\bigr)^2 = \bigl(\frac{1}{2}\bigr)^2
$$
This is actually right, but you needed the arrow to go both ways, and it doesn't because:
$$
\sin x \sqrt{1 - \sin^2 x} = -\frac{1}{2} \Rightarrow \bigl(\sin x \sqrt{1 - \sin^2 x}\bigr)^2 = \bigl(-\frac{1}{2}\bigr)^2 = \bigl(\frac{1}{2}\bigr)^2
$$
Because of this step, you've introduced 2 additional solutions.
You could have checked all the answers you've obtained to verify which remained valid, but the advantage of the double-arc method is that you circumvent those irreversible operations, making it easier to reach the final answer.
A: Use that $$\sin(2x)=2\sin(x)\cos(x)$$
A: Your solution is not correct, because it assumes that $\cos x=\sqrt{1-\sin^2x}$. In fact, sometimes you indeed have $\cos x=\sqrt{1-\sin^2x}$, but sometimes you have $\cos x=-\sqrt{1-\sin^2x}$.
Note that\begin{align}\sin(x)\cos(x)=\frac12&\iff2\sin(x)\cos(x)=1\\&\iff\sin(2x)=1\\&\iff2x=\frac\pi2+2k\pi\text{ ($k\in\mathbb Z$)}\\&\iff x=\frac\pi4+k\pi\text{ ($k\in\mathbb Z$)}.\end{align}
A: $$2\sin(x)\cos(x)=1$$
$$\sin(2x)=1$$
$$2x=\arcsin(1)+2k\pi = \dfrac{\pi}{2}+2k\pi$$
therefore $x=\dfrac{\pi}{4}+k\pi,~k\in\mathbb{Z}$.
A: From $$\sin(2x)=2\sin x\cos x$$
$$\sin x\cos x = \frac{1}{2} \Leftrightarrow \sin(2x)=1$$
So the answer is $x=\frac{\pi}{4}$ in $0<x<\pi.$
The general solution is $$x=\frac{(4n\pi+\pi)}{4}, n\in\mathbb{Z}$$.
A: 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$.
A: Your solution is incorrect.  You proved that $\sin x \cos x = \frac{1}{2}\implies\sin x =\pm\dfrac1{\sqrt2},$ 
but the reverse implication does not necessarily hold.  
You need to look at which of your solutions satisfy the original equation.  $135^o$ and $315^o$ do not.  
A: I am now going to add one more for fun and wish you can enjoy it. $$
\begin{aligned}
&(\cos x+\sin x)^{2}=1+2 \sin x \cos x=2 \\
\Rightarrow & \cos x+\sin x=\pm \sqrt{2} \ldots(1) \\
&(\cos x-\sin x)^{2}=1-2 \sin x \cos x=0 \\
\Rightarrow & \cos x-\sin x=0 \quad \cdots(2)
\end{aligned}
$$
(1) $\pm$ (2) yields $$\quad \cos x=\sin x=\pm \frac{1}{\sqrt{2}}$$
$$
x=n \pi+\frac{\pi}{4}
$$
where $n \in \mathbb{Z}.$
