Find all integer values of $m$ such that the equation $\sqrt{9 - x} = \sqrt{3m - x^2 + 9x} - \sqrt{x}$ has exactly four distinct real roots. 
Find all integer values of $m$ such that the equation $$\large \sqrt{9 - x} = \sqrt{3m - x^2 + 9x} - \sqrt{x}$$ has exactly four distinct real roots.

$\left(x \in [0, 9], m \in \left[0, \dfrac{27}{4}\right]\right)$
Let $9 - x = y \ (\iff x + y = 9)$, we have that $$\sqrt{9 - x} = \sqrt{3m - x^2 + 9x} - \sqrt{x} \implies \sqrt{x} + \sqrt{y} = \sqrt{3m + xy}$$
$$\implies x + y + 2\sqrt{xy} = 3m + xy \iff (x - 1)y - 2\sqrt{xy} + (3m - x) = 0$$
For the equation $$\sqrt{9 - x} = \sqrt{3m - x^2 + 9x} - \sqrt{x}$$ to have exactly four distinct real roots, the equation $$(x - 1)y - 2\sqrt{xy} + (3m - x) = 0$$ must have two distinct real roots $x$.
(note that $x_0$ and $9 - x_0$ are both solutions to $\sqrt{9 - x} = \sqrt{3m - x^2 + 9x} - \sqrt{x}$)
$$\implies \Delta' = x - (x - 1)(3m - x) > 0$$, in which case, the solutions are $\begin{cases} m > \dfrac{y^2}{3(y - 1)} &\text{if $x \in [0, 1)$}\\ m \in \mathbb R &\text{if $x = 1$}\\ m < \dfrac{y^2}{3(y - 1)} &\text{if $x \in (1, 9]$} \end{cases}$, (according to WolframAlpha, of course), which lead to suspect that $m \in \{0, 1\}$ are the integer solutions. But I don't really know.
 A: We have $$\sqrt{x}+\sqrt{9-x}=\sqrt{3m-x^2+9x},$$ which is for $0\leq x\leq9$ and $3m-x^2+9x\geq0$ is equivalent to
$$9+2\sqrt{x(9-x)}-x(9-x)=3m$$ or
$$10-\left(1-\sqrt{x(9-x)}\right)^2=3m,$$ which gives $3m\leq10$ and $m\leq3.$
Also, since $$\sqrt{x}+\sqrt{9-x}=\sqrt{9+2\sqrt{x(9-x)}}\geq3,$$ we obtain:
$$3m-x^2+9x\geq9.$$ 
Thus, 
$$3m\geq x^2-9x+9=(x-4.5)^2-11.25\geq-11.25,$$ which gives $$-3\leq m\leq3.$$
Now, consider $f(x)=10-\left(1-\sqrt{x(9-x)}\right)^2.$
We see that $f$ has two maximum points for $\sqrt{x(9-x)}=1$ and the minimum point for $x=4.5$.
Thus, our equation has four distinct roots for $$f(0)\leq3m<f\left(x_\max\right)$$ or
$$9\leq3m<10,$$ which gives $m=3.$
A: $\sqrt{9-x}=\sqrt{3m-x^2+9x}-\sqrt x$
Equations $\sqrt{9-x}=\sqrt x$  has no solution. For the moment we assume that equation  $\sqrt{3m-x^2+9x}=\sqrt x$ has also no solution. Therefore the roots of equation $\sqrt{9-x}=\sqrt{3m-x^2+9x}$ must be satisfied by $\sqrt x$; considering $x∈[0, 9]$, we may write for integer x:
$x=0. 1, 4, 9$
$\sqrt{9-x}=\sqrt{3m-x^2+9x}$
$m= \frac{x^2-10x+9}{3}$
Which gives :
$(x, m)=(0, 3), (1, 0), (4, -5), (9, 0)$
Among these only $(x, m)=(0, 3)$ satisfies the original equation.Moreover for $m=3$ we also get $x=9$ in equation.
If we assume that equation $\sqrt{3m-x^2+9x}=\sqrt x$ has solution then it must satisfy the original equation, I checked; it does not.
