Why is the separation constant (used in obtaining the electron's wave function in hydrogen) a constant and not a function of position (and time)? The Schrödinger equation for the hydrogen atom in polar coordinates is:
$$
-\frac{\hbar^2}{2\mu}\left[\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{\partial \psi}{\partial r}\right) + \frac{1}{r^2\sin{\theta}}\frac{\partial}{\partial \theta}\left(\sin{\theta}\frac{\partial\psi}{\partial\theta}\right)+\frac{1}{r^2\sin^2{\theta}}\frac{\partial^2\psi}{\partial \phi^2}\right]-\frac{Ze^2}{4\pi\epsilon_0 r}\psi=E\psi
$$
Which can be written as::
$$\frac{1}{r^2}\frac{\partial}{\partial r}\left(r^2\frac{\partial\psi}{\partial r}\right)+\frac{1}{r^2\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial\psi}{\partial\theta}\right)+\frac{1}{r^2\sin^2\theta}\frac{\partial^2\psi}{\partial\phi^2}+\frac{2\mu}{\hbar^2}\left(E+\frac{Ze^2}{4\pi\epsilon_0r}\right)\psi=0
$$
Using the separation of variables, we assume a product solution of a radial and an angular function:
$$\psi(r,\theta,\phi)=R(r)\cdot Y(\theta,\phi).$$
Since $Y$ does not depend on $r$, we can put it in front of the radial derivative:
$$\frac{\partial\psi}{\partial r}=\frac{\partial}{\partial r}RY=Y\frac{{\rm d}R}{{\rm d}r},$$
and, similarly, $R$ does not depend on the angular variables. Thus replace $\psi$ and the differentials:
$$\frac{Y}{r^2}\frac{\rm d}{{\rm d}r}\left(r^2\frac{{\rm d}R}{{\rm d}r}\right)+\frac{R}{r^2\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial Y}{\partial\theta}\right)+\frac{R}{r^2\sin^2\theta}\frac{\partial^2Y}{\partial\phi^2}+\frac{2\mu}{\hbar^2}\left(E+\frac{Ze^2}{4\pi\epsilon_0r}\right)RY=0.
$$
Multiply by $r^2$ and divide by $RY$ to separate the radial and angular terms:
$$\bbox[pink]{\frac{1}{R}\frac{\rm d}{{\rm d}r}\left(r^2\frac{{\rm d}R}{{\rm d}r}\right)}+\bbox[lightblue]{\frac{1}{Y\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial Y}{\partial\theta}\right)+\frac{1}{Y\sin^2\theta}\frac{\partial^2Y}{\partial\phi^2}}+\bbox[pink]{\frac{2\mu r^2}{\hbar^2}\left(E+\frac{Ze^2}{4\pi\epsilon_0r}\right)}=0$$
The first and fourth terms depend on $r$ only, the middle terms depend on the angles only. They can only balance each other for all points in space if the radial and angular terms are the same constants but with opposite signs.
Therefore, we can separate into a radial equation:
$$\bbox[pink]{\frac{\rm d}{{\rm d}r}\left(r^2\frac{{\rm d}R}{{\rm d}r}\right)+\frac{2\mu r^2}{\hbar^2}\left(E+\frac{Ze^2}{4\pi\epsilon_0r}\right)R}-AR=0$$
and an angular equation:
$$\bbox[lightblue]{\frac{1}{\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial Y}{\partial\theta}\right)+\frac{1}{\sin^2\theta}\frac{\partial^2Y}{\partial\phi^2}}+AY=0,$$
where $A$ is the separation constant.
That's how it's done. Now maybe it's because it's almost two in the night that I don't get it, but why should $A$ be the same everywhere (or any time)? Can't $A$ depend on the three polar variables (and one time coordinate), so it's not a constant but a function of the three (four) variables, $A(\rho,\psi,\theta,(t))$? In that case, the last two equations will still hold and the two terms will still balance each other out in all points of space (and time). I must have overlooked something, but what?? Maybe this is more a math question, but the context is the hydrogen atom.
 A: By rearranging the first highlighted equation to:
$$ 
\bbox[pink]{\frac{1}{R}\frac{\rm d}{{\rm d}r}\left(r^2\frac{{\rm d}R}{{\rm d}r}\right)}+\bbox[pink]{\frac{2\mu r^2}{\hbar^2}\left(E+\frac{Ze^2}{4\pi\epsilon_0r}\right)}= -\,\bbox[lightblue]{\frac{1}{Y\sin\theta}\frac{\partial}{\partial\theta}\left(\sin\theta\frac{\partial Y}{\partial\theta}\right)+\frac{1}{Y\sin^2\theta}\frac{\partial^2Y}{\partial\phi^2}} \quad , $$
you see that while the left-hand side only depends on $r$ (i.e. is a function of $r$ only), the right-hand side only depends on $\theta$ and $\phi$ (i.e. is a function of $\theta$ and $\phi$ only). So changing $r$ cannot lead to a change of the right-hand side and a change of $\theta$ or $\phi$ cannot lead to a change of the left-hand side. Consequently, both terms must be constant - with respect to $\theta$, $\phi$ and $r$. If $A$ would depend on either $r$ or $\theta$ or $\phi$ (or on all variables), then a change in e.g. $r$ would lead to a change of the right-hand side of the equation, which is not possible.
