The definition of the sine function is just as it is because it is useful in this way in trigonometry. That's why
$$\sin z=\frac{1}{2} [\exp(\mathrm{i} z)-\exp(-\mathrm{i} z)], \quad z \in \mathbb{C}.$$
It's a definition of the sine function in terms of the (complex) exponential function.
Now I'm still puzzled by, what the question concerning the quantum mechanics problem(s) really is.
Let's first take the case of a free particle moving along a line. Then you can represent the Hilbert space in terms of the square Lebesgue-integrable position wave functions ##\psi(x)##, ##x \in \mathbb{R}##, and the position and momentum operators are both self-adjoint being densely defined on the said Hilbert space ##\mathrm{L}^2(\mathbb{R})##:
$$\hat{x} \psi(x)=x \psi(x), \quad \hat{p} \psi(x) = -\mathrm{i} \hbar \partial_x \psi(x).$$
Now you can ask for general eigenfunctions of various operators. For ##\hat{x}## and ##\hat{p}## these are
$$u_{x'}(x)=\delta(x-x'), \quad u_{p}(x)=\frac{1}{\sqrt{2 \pi \hbar}} \exp(\mathrm{i} p x/\hbar),$$
where the norm is chosen such that these generalized functions are "normalized to a ##\delta## distribution". For the position eigenfunction it's obvious. For the momentum eigenfunction you see it as follows
$$\langle p|p' \rangle=\int_{\mathbb{R}} \mathrm{d} x u_{p}^*(x) u_{p'}(x) = \frac{1}{2 \pi \hbar} \int_{\mathbb{R}} \mathrm{d} x \exp[\mathrm{i}(p'-p) x/\hbar=\frac{1}{2 \pi \hbar} 2 \pi \delta[(p-p')/\hbar] = \delta(p-p').$$
Since the Hamiltonian is
$$\hat{H}=\frac{1}{2m} \hat{p}^2,$$
any momentum eigenfunction is also an energy eigenfunction,
$$\hat{H} u_p(x)=\frac{p^2}{2m} u_p(x).$$
Except the ground state with ##E_p=p^/(2m)=0## all the energy eigenstates are degenerate, because for any ##p \neq 0## also for ##-p## you get the same energy eigenvalue ##E_p##. That's, why any linear combination of the two momentum eigenfunctions with eigenvalues ##\pm p## are energy eigenstates to the same eigenvalue ##E_p##.
You can lift this degeneracy by diagonalizing other operators simultaneously. In this case the degeneracy is obviously, because the particle moving to the right or the left with the same magnitude of momentum have the same energy. So to make the energy eigenvectors unique, you can ask for the eigenfunctions, which are at simultaneously eigenfunctions of the parity operator, which represents space reflections,
$$\hat{P}\psi(x)=\psi(-x),$$
and the eigenvalues are ##P \in \{1,-1\}## (even and odd functions under space reflections). The two energy eigenstates for a given ##E_p=p^2/(2m)## obviously are
$$u_E^{(+)}=\frac{1}{\sqrt{2}}[u_p+u_{-p}], \quad u_E^{-}=\frac{1}{\sqrt{2}} [u_p-u_{-p}].$$
For the infinite-square well, there is no momentum operator, because if there were one it should also be given by the same operator ##-\mathrm{i} \hbar \partial_x##, because by definition ##\hat{p}## should generate space translations. For the infinite square well, however, the corresponding eigenfunctions belong not to the Hilbert space, because they do not fulfill the necessary boundary conditions ##\psi(0)=\psi(L)=0##.
The result is that there are energy eigenstates, and they are nondegenerate, i.e., to each energy eigenvalue there's only one linearly independent eigenfunction, which thus are unique up to a factor (the factor doesn't play a role in quantum mechanics anyway, because all you need is to calculate the probability distributions, which are given by normalized wave functions modulus squared).