2. The minimum value of the function $f(x)=(\sqrt{1+x}+\sqrt{1-x}-3)\left(\sqrt{1-x^{2}}+1\right)$ is $m$, and the maximum value is $M$, then $\frac{M}{m}=$
$\qquad$ .
Let $x=\sin \theta, \theta \in\left[-\frac{\pi}{2}, \frac{\pi}{2}\right]$, then $f(x)=\left(2 \cos \frac{\theta}{2}-3\right)(\cos \theta+1)=2\left(2 \cos ^{3} \frac{\theta}{2}-3 \cos ^{2} \frac{\theta}{2}\right)$ $\xlongequal{t=\cos \frac{\theta}{2} \in\left[\frac{\sqrt{2}}{2}, 1\right]} 2\left(2 t^{3}-3 t^{2}\right)$, let $u=2 t^{3}-3 t^{2}, u^{\prime}=6 t(t-1) \leqslant 0 \Rightarrow u$ is a monotonically decreasing function in $t \in\left[\frac{\sqrt{2}}{2}, 1\right]$, thus $M=\sqrt{2}-3, m=-2$. Therefore, $\frac{M}{m}=\frac{3-\sqrt{2}}{2}$.