$5.39 \sin 2 x+2 \operatorname{ctg} x=3$.

Translate the text above into English, keeping the original text's line breaks and format, and output the translation result directly.

$5.39 \sin 2 x+2 \operatorname{ctg} x=3$.
5.39 Using the formula $\sin 2 x=\frac{2 \operatorname{tg} x}{1+\operatorname{tg}^{2} x}$, we get

$$
\frac{2 \operatorname{tg} x}{1+\operatorname{tg}^{2} x}+\frac{2}{\operatorname{tg} x}=3 ; 4 \operatorname{tg}^{2} x+2=3 \operatorname{tg} x+3 \operatorname{tg}^{3} x
$$

Notice that $\operatorname{tg} x=1$ is a solution to this equation; hence, $x=\frac{\pi}{4}(4 k+1)$.

There are no other solutions. Indeed,

$3 \operatorname{tg}^{3} x-4 \operatorname{tg}^{2} x+3 \operatorname{tg} x-2=3 \operatorname{tg}^{3} x-3 \operatorname{tg}^{2} x-\operatorname{tg}^{2} x+\operatorname{tg} x+$ $+2 \operatorname{tg} x-2=\left(3 \operatorname{tg}^{2} x-\operatorname{tg} x+2\right)(\operatorname{tg} x-1)$

where $3 \operatorname{tg}^{2} x-\operatorname{tg} x+2 \neq 0$ (since $D<0$).

Answer: $\quad x=\frac{\pi}{4}(4 k+1), k \in Z$.