Why can $\psi(x,t)$ be written as a product of a time dependent function and a position dependent function? This is the Schrodinger's equation in 1 dimension:

Our professor said that since $U(x)$ is not dependent on time, solutions of $\psi(x,t)$ can be separated as product of two functions $\phi(x)\chi(t)$. I can't understand why this should be true. Can someone explain it to me?
 A: Here I'm allowing for more than one spatial dimension, hence the introduction of $\nabla^2$ for $\partial^2/\partial x^2$
Separating the variables--it can't always be done, but it can be done often enough to make a useful difference, to wit:
Suppose some $\psi(x, t)$ solving
$i \hbar \dfrac{\partial \psi(x, t)}{\partial t} = -\dfrac{\hbar^2}{2m}\nabla^2 \psi(x, t) + U(x)\psi(x, t) \tag 1$
could be written in the form
$\psi(x, t) = \phi(x) \theta(t); \tag 2$
then
$\dfrac{\partial \psi(x, t)}{\partial t} =  \phi(x) \dfrac{d\theta(t)}{dt} \tag 3$
and
$\nabla^2 \psi(x, t) = (\nabla^2 \phi(x))\theta(t); \tag 4$ 
inserting (3) and (4) into (1) we find
$i \hbar \dfrac{d\theta(t)}{dt} \phi(x) = -\dfrac{\hbar^2}{2m}(\nabla^2 \phi(x))\theta(t) + U(x)\phi(x) \theta(t); \tag 5$
if we now divide through by $\phi(x) \theta(t)$--assuming we can divide through by $\phi(x) \theta(t)$ (this is tricky since $\phi$ or $\theta$ may have zeroes, but if we assume we stay away from such points, the technique flies)--we get
$i\hbar \dfrac{1}{\theta(t)}  \dfrac{d\theta(t)}{dt} = -\dfrac{\hbar^2}{2m}\dfrac{1}{\phi(x)}\nabla^2 \phi(x) + U(x); \tag 6$
we now observe in the typical manner that, since the left-hand side depends only on $t$ whereas the right-hand side depends only on $x$, there must be some constant $E$ such that
$i\hbar \dfrac{1}{\theta(t)}  \dfrac{d\theta(t)}{dt} = E \tag 7$
and
$-\dfrac{\hbar^2}{2m}\dfrac{1}{\phi(x)}\nabla^2 \phi(x) + U(x) = E; \tag 8$
(7) and (8) yield
$i\hbar \dfrac{d\theta(t)}{dt} = E\theta(t), \tag 9$
and
$-\dfrac{\hbar^2}{2m}\nabla^2 \phi(x) + U(x)\phi(x) = E\phi(x).  \tag {10}$
The usual policy is now to solve (10), assuming boundary conditions appropriate to whatever system is under investigation, to derive spatial eigenfunctions $\phi_j(x)$ and eigenvalues $E_j$ such that
$-\dfrac{\hbar^2}{2m}\nabla^2 \phi_j(x) + U(x)\phi_j(x) = E_j\phi_j(x); \tag {11}$
then for each $E_j$ we have
$i\hbar \dfrac{d\theta_j(t)}{dt} = E_j\theta_j(t), \tag {12}$
which is readily solved, assuming $\theta_j(0) = 1$:
$\theta_j(t) = e^{-iE_jt/\hbar}; \tag{13}$
then these special variables-separable solutions may be written
$\psi_j(x, t) = e^{-iE_jt/\hbar} \phi_j(x). \tag{14}$
It is important here to observe that the variables-separable solutions give rise to eigenfunctions and eigenvalues of the spatial operator
$H = -\dfrac{\hbar^2}{2m}\nabla^2  + U(x), \tag {15}$
and that a general solution to (1) is given by a linear combination of these "eigen" solutions:
$\psi(x, t) = \sum_j c_j \psi_j(x, t) = \sum_j c_j e^{-iE_jt/\hbar}\phi_j(x). \tag{16}$
The set of indices $j$ may not in fact be countable or discrete, so sometimes the sum (16) must be understood as an integral of some appropriate kind.
And that's how the variables-separable case relates to the general solution of (1).
A: $$i\hbar\frac{\partial \psi(x,t)}{\partial t}= -\frac{\hbar^2}{2m}\frac{\partial^2 \psi(x,t)}{\partial x^2}+U(x)\psi(x,t) \tag 1$$
We look for particular solutions on the form $\psi(x,t)=\phi(x)\chi(t)$, without knowing if some exist or not à this stage.
$$i\hbar\phi(x)\chi'(t)= -\frac{\hbar^2}{2m}\phi''(x)\chi(t)+U(x)\phi(x)\chi(t)\tag 2$$
$$i\hbar\frac{\chi'(t)}{\chi(t)}= -\frac{\hbar^2}{2m}\frac{\phi''(x)}{\phi(x)}+U(x)\tag 3$$
The term on the left is function of $t$ only. The term on the right is function of $x$ only. This is possible only if both are equal to a constant.
$$i\hbar\frac{\chi'(t)}{\chi(t)}= -\frac{\hbar^2}{2m}\frac{\phi''(x)}{\phi(x)}+U(x)=\lambda$$
The equation splits into two equations $\quad\begin{cases}i\hbar\frac{\chi'(t)}{\chi(t)} =\lambda \\-\frac{\hbar^2}{2m}\frac{\phi''(x)}{\phi(x)}+U(x)=\lambda \end{cases} $ 
The two equations can be solved separately, the first for $\chi(t)$ and the second for $\phi(x)$.
Now, the answer to the question :
Our professor said that since $U(x)$ is not dependent on time, solutions of $\psi(x,t)$ can be separated as product of two functions $\phi(x)\chi(t)$. I can't understand why this should be true. Can someone explain it to me? 
Suppose that $U$ also depends on $t$, say $U(x,t)$ , the equation $(3)$ becomes :
$$i\hbar\frac{\chi'(t)}{\chi(t)}= -\frac{\hbar^2}{2m}\frac{\phi''(x)}{\phi(x)}+U(x,t)$$
Then, the term on the right in not function of $x$ only. It becomes impossible to separate the equation into one term function of $t$ and one term function of $x$. The method of separation of variables fails.
This shows why $U$ must be function of $x$ only to allow the separation of variables and to split the whole equation into two independent equations.
NOTE : The separation of variables works also if $U$ is not function of $x$ and is function of $t$. In this case, put $-U(t)$ on the left side.
