In a one-dimensional space, the potential $V(x)\neq 0$ if $0<x<a$ and $V=0$ if $x <0$ or $x>a$. If we set the wave function in $x<0$ as $\phi_1 = Ae^{ikx}+Be^{-ikx}$, and the wave function in $x>a$ as $\phi_2 = Ce^{ikx}+De^{-ikx}$.
Now I want to know if there is a general relation between $\phi_1$ and $\phi_2$, or a relation between $A,B,C,D$.
Here is my solution: Since $\phi_1$ satisfies the stationary Schroedinger's equation, $$ \frac{d^2\phi_i}{dx^2} + \frac{2m}{\hbar^2}E\phi_i =0, i=1,2 (x<0). $$ Therefore,
$$
(\frac{2m}{\hbar^2}E-k^2) (Ae^{ikx}+ Be^{-ikx}) = 0,
$$
and
$$
(\frac{2m}{\hbar^2}E-k^2) (Ce^{ikx} + De^{-ikx}) = 0.
$$
Since the energy at both regions should be the same, I just obtain
$$
E=\frac{\hbar^2k^2}{2m}
$$
for both $x<0$ and $x>a$. But this expression does not include the constants $A,B,C$ or $D$.
Since both $Ae^{ikx}$ and $Ce^{ikx}$ describe a plane wave propagates from left to right, in stationary states, they should be the same, therefore, $$A=C.$$ Similarly, I obtain $$B=D.$$
Since $\phi^*_1$ is also the solution in $x<0$, I can obtain $$ (\frac{2m}{\hbar^2}E-k^2) (B^*e^{ikx} + A^*e^{-ikx})= 0. $$ Therefore, $$ A^* = D; B^* = C. $$
I am not sure this result. Could someone give some suggestion about this problem?