`~rai~`
\(a)m(\sin x+\cos x-1)=\sin x-\cos x+3\\\Leftrightarrow m\sin x+m\cos x-m=\sin x-\cos x+3\\\Leftrightarrow m\sin x-\sin x+m\cos x+\cos x=m+3\\\Leftrightarrow (m-1)\sin x+(m+1)\cos x=m+3\\\text{Phương trình có nghiệm khi:}\\(m-1)^2+(m+1)^2\ge (m+3)^2\\\Leftrightarrow m^2-2m+1+m^2+2m+1\ge m^2+6m+9\\\Leftrightarrow m^2-6m-7\ge 0\\\Leftrightarrow (m+1)(m-7)\ge 0\\\Leftrightarrow \left[\begin{array}{I}m\le -1\\m\ge 7\end{array}\right.\\\text{Vậy với }m\in(-\infty;-1]\cup[7;+\infty)\text{ thì phương trình có nghiệm.}\\b)3\sin^2x+m\sin2x-4\cos^2x=0\\\Leftrightarrow 3\sin^2x+2m\sin x\cos x-4\cos^2x=0\\\text{Dễ dàng nhận thấy }\cos x=0\text{ không là nghiệm của phương trình }\\\text{nên ta chia cả 2 vế phương trình cho }\cos^2x\text{ được:}\\3\tan^2x+3m\tan x-4=0\\\text{Do ac<0 nên phương trình luôn có nghiệm }\forall m\in\mathbb{R}.\\\text{Vậy phương trình luôn có nghiệm }\forall m\in\mathbb{R}.\)