4. Solve the equation $\sqrt{2+\cos 2 x-\sqrt{3} \tan x}=\sin x-\sqrt{3} \cos x$. Find all its roots that satisfy the condition $|x-3|<1$.

#
# Solution:

Both sides of the equation $\sqrt{2+\cos 2 x-\sqrt{3} \tan x}=\sin x-\sqrt{3} \cos x$ can be squared under the condition $\sin x-\sqrt{3} \cos x \geq 0$. Since $\sin x-\sqrt{3} \cos x=2 \sin (x-\pi / 3)$, the condition can be written as $\pi / 3+2 \pi n \leq x \leq 4 \pi / 3+2 \pi n, n \in Z$. Under the found constraints, the equation is equivalent to the following: $2+\cos 2 x-\sqrt{3} \tan x=\sin ^{2} x-2 \sqrt{3} \sin x \cos x+3 \cos ^{2} x$, $\tan x-2 \sin x \cos x=0, \frac{\sin x}{\cos x}-2 \sin x \cos x=0, \sin x\left(\frac{1}{\cos x}-2 \cos x\right)=0$. Thus, we arrive at the system of equations: 1) $\sin x=0, x=\pi n, n \in Z, 2)$ $\cos ^{2} x=\frac{1}{2}, \cos x= \pm \frac{\sqrt{2}}{2}, x= \pm \frac{\pi}{4}+\pi n, n \in Z$. Considering the constraints, we obtain the solutions to the original equation: $x=\pi+2 \pi n, \quad x= \pm \frac{3 \pi}{4}+2 \pi n, \quad n \in Z$. Given the condition $|x-3|<1$, we have $x \in(2 ; 4)$, hence $x_{1}=\frac{3 \pi}{4}, x_{2}=\pi, x_{3}=\frac{5 \pi}{4} . \quad$ Answer: solutions to the equation: $\pi+2 \pi n, \quad \pm \frac{3 \pi}{4}+2 \pi n, \quad n \in Z ;$ roots satisfying the condition: $\frac{3 \pi}{4}, \pi, \frac{5 \pi}{4}$.