39 Suppose in the range $0 \leqslant x \leqslant \pi$, the equation $\cos 2x + 4a \sin x + a - 2 = 0$ has exactly two distinct solutions. Try to find the range of values for $a$.
39 Let $\sin x=t$ then we get
$$
2 t^{2}-4 a t-a+1=0(0 \leqslant t \leqslant 1)
$$

For each $0 \leqslant t0,
\end{array}\right.
$$

or
$$
\left\{\begin{array}{l}
0 \leqslant a<1, \\
f(a)=0 .
\end{array}\right.
$$

Solving this, we get $\frac{3}{5}<a \leqslant 1$ or $a=\frac{1}{2}$. This is the range of values for $a$.