What's wrong with this transformation? I have the equation $\tan(x) = 2\sin(x)$ and I'd like to transform it in this way:
$$\tan(x) = 2\sin(x)
\Longleftrightarrow
\frac{\sin(x)}{\cos(x)} = 2\sin(x)
\Longleftrightarrow
\sin(x) = 2\sin(x)\cos(x)
\Longleftrightarrow
\sin(x) = \sin(2x)$$
But I'm getting a wrong result so I suppose that I can't do it in this way. Why?
EDIT: 
This is my solution:
$$\tan(x) = 2\sin(x)
\Longleftrightarrow
\frac{\sin(x)}{\cos(x)} = 2\sin(x)
\Longleftrightarrow
\sin(x) = 2\sin(x)\cos(x)
\Longleftrightarrow
\sin(x) = \sin(2x)
\Longleftrightarrow
\sin(2x) - \sin(x) = 0
\Longleftrightarrow
2\cos(\frac{3x}{2})\sin(\frac{x}{2}) = 0
\Longleftrightarrow
\cos(\frac{3x}{2}) = 0 \vee \sin(\frac{x}{2}) = 0$$
Proper solution is $\cos(x) = \frac{1}{2} \vee \sin(x) = 0$

There are two errors in your solution.
First, the transformation $$ 
\frac{\sin x}{\cos x} = 2\sin x \iff \sin x = 2\sin x \cos x
$$ is false.  The correct inference is $$ 
\left( \frac{\sin x}{\cos x} = 2\sin x \text{ and } \cos x \neq 0 \right) \text{ or } \cos x = 0  \iff (\sin x = 2\sin x \cos x \text{ and } \cos x \neq 0) \text{ or } \cos x = 0 
$$ otherwise, going to the left, you divide by zero, and going to the right, you (might) delete the content of your equation by multiplying both sides by zero.  (The hazards are $0 = 0 \implies 0 x = 0 y \not\Rightarrow x = y$ and $x \neq y \not\Rightarrow 0x \neq 0y \implies 0 \neq 0$.)  Starting with either of your equations, you infer the entire other side of the more complicated bi-implication.  Since this can introduce spurious solutions, all solutions must be checked in the original equation at the end of the process.
This suggests a general rule:  Do not cancel.  Instead subtract and factor.  This highlights your second error.  From $$
\sin x = 2 \sin x \cos x \text{,}
$$ subtract and factor to get $$
(1-2\cos x)\sin x = 0 \text{.}
$$  The first factor gives your $\cos x = \frac{1}{2}$.  The second factor gives $\sin x = 0$.  (This is because the product of several things being zero means at least one of them is.)
By proper inference, you should have \begin{align*}
    &      &  \tan x &= 2 \sin x \\
    &\iff  &  \frac{\sin x}{\cos x} &= 2 \sin x \\
    &\iff  &  \sin x &= 2 \sin x \cos x \text{ or } \cos x = 0 \\
    &\iff  &  (1-2\cos x)\sin x &= 0 \text{ or } \cos x = 0 \\ 
    &\iff  &  \cos x &= \frac{1}{2} \text{ or } \sin x = 0 \text{ or } \cos x = 0 \text{.}
\end{align*}  Checking for spurious solutions, all solutions of $\cos x = \frac{1}{2}$ and all solutions of $\sin x = 0$ are solutions of the given equation, but none of the solutions of $\cos x = 0$ are, so the final solution is $\cos x = \frac{1}{2} \text{ or } \sin x = 0$.
Somewhat shorter uses subtract and factor earlier, avoiding the complicated bi-implication altogether: \begin{align*}
    &      &  \tan x &= 2 \sin x \\
    &\iff  &  \frac{\sin x}{\cos x} &= 2 \sin x \\
    &\iff  &  \left( \frac{1}{\cos x} - 2 \right) \sin x &= 0 \\
    &\iff  &  \frac{1}{\cos x} - 2 &= 0 \text{ or } \sin x = 0 \\
    &\iff  &  \frac{1}{\cos x} &= 2 \text{ or } \sin x = 0 \\
    &\iff  &  \cos x &= \frac{1}{2} \text{ or } \sin x = 0 \text{.}
\end{align*} 
