(1) We have f(x)=sin2x+asinx+a−a3. Let t=sinx (−1≤t≤1). Then
g(t)=t2+at+a−a3.
The sufficient and necessary condition for f(x)≤0,∀x∈R is
{g(−1)=1−a3≤0,g(1)=1+2a−a3≤0.
Therefore, we obtain the range of a is (0,1].
(2)
As a≥2, then −2a≤−1. We have
g(t)min=g(−1)=1−a3.
Then f(x)min=1−a3. Therefore, the sufficient and necessary condition for f(x)≤0,∃x∈R is 1−a3≤0, or 0<a≤3.
Finally, we obtain that the range of a is [2,3].