Example 13 Suppose the equation $\sqrt{a(x-a)}+\sqrt{a(y-a)}$ $=\sqrt{x-a}-\sqrt{a-y}$ holds in the real number range, where $a, x, y$ are distinct real numbers. Then the value of $\frac{3 x^{2}+x y-y^{2}}{x^{2}-x y+y^{2}}$ is ( ).
(A) 3
(B) $\frac{1}{3}$
(C) 2
(I) $\frac{5}{3}$.
Solution: From $x-a \geqslant 0$ and $a(x-a) \geqslant 0$ we know $a \geqslant 0$; from $a-y \geqslant 0$ and $a(y-a) \geqslant 0$ we know $a \leqslant 0$. Therefore, $a=0$,
and $\sqrt{x}-\sqrt{-y}=0$,
which means $x=-y \neq 0$.
Substituting the above equation into the original fraction, we get
the original expression $=\frac{1}{3}$.
Therefore, the answer is (B).