9. Let the line $y=x+\sqrt{2}$ intersect the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$ at points $M, N$, and $O M \perp O N$ (where $O$ is the origin). If $|M N|=\sqrt{6}$, find the equation of the ellipse.
Let $M\left(r_{1} \cos \alpha, r_{1} \sin \alpha\right), N\left(-r_{2} \sin \alpha, r_{2} \cos \alpha\right)$, then we have $\left\{\begin{array}{l}\frac{r_{1}^{2} \cos ^{2} \alpha}{a^{2}}+\frac{r_{1}^{2} \sin ^{2} \alpha}{b^{2}}=1, \\ \frac{r_{2}^{2} \sin ^{2} \alpha}{a^{2}}+\frac{r_{2}^{2} \cos ^{2} \alpha}{b^{2}}=1\end{array}\right.$ $\Rightarrow \frac{1}{a^{2}}+\frac{1}{b^{2}}=\frac{1}{r_{1}^{2}}+\frac{1}{r_{2}^{2}}=\frac{r_{1}^{2}+r_{2}^{2}}{\left(r_{1} r_{2}\right)^{2}}=\frac{1}{d^{2}}$, where $d$ is the altitude of the hypotenuse of the right triangle $\triangle O M N$.

Clearly, $d=1 \Rightarrow \frac{1}{a^{2}}+\frac{1}{b^{2}}=1$. On the other hand, solving $\left\{\begin{array}{l}b^{2} x^{2}+a^{2} y^{2}=a^{2} b^{2}, \\ y=x+\sqrt{2}\end{array}\right.$
$$
\begin{array}{l}
\Rightarrow\left(a^{2}+b^{2}\right) x^{2}+2 \sqrt{2} a^{2} x+2 a^{2}-a^{2} b^{2}=0 \\
\Rightarrow|M N|=2 \sqrt{2} a \cdot \frac{\sqrt{2 a^{2}-\left(2-b^{2}\right)\left(a^{2}+b^{2}\right)}}{a^{2}+b^{2}}=2 \sqrt{2} a b \cdot \frac{\sqrt{a^{2}+b^{2}-2}}{a^{2}+b^{2}}=\sqrt{6} \\
\xrightarrow{a^{2}+b^{2}=a^{2} b^{2}} \xrightarrow{2 \sqrt{a^{2} b^{2}-2}}=\sqrt{3} \Rightarrow a^{2} b^{2}=8 \Rightarrow a^{2}=4+2 \sqrt{2}, b^{2}=4-2 \sqrt{2} .
\end{array}
$$

Therefore, the equation of the ellipse is $\frac{x^{2}}{4+2 \sqrt{2}}+\frac{y^{2}}{4-2 \sqrt{2}}=1$.