Tìm m để phương trình $\displaystyle \text{cos}2x-\left( 2m-1 \right)\text{cosx}-m+1=0$ có đúng 2 nghiệm$x\in \left[ -\frac{\pi }{2};\frac{\pi }{2} \right]$.
A. $\displaystyle -1<m\le 0$
B. $\displaystyle 0\le m<1$
C. $\displaystyle 0\le m\le 1.$
D. $\displaystyle -1<m<1.$