I wonder if someone can help me on what is, probably, a simple question but is baffling me at the moment!
In standard texts on functional analysis, something like the following is written Let $L\colon X \to Y$ where $X$ and $Y$ are both Hilbert spaces. Then the adjoint operator $L^\dagger$ exists and is unique, where $L^\dagger \colon Y \to X$ and $ (Lf,g)= (f,L^\dagger g)$ for all $f \in X$ and $g \in Y$.
However, I am having some trouble with this definition in practice. When dealing with differential operators, boundary conditions have to be taken into account and invariably instead of (e.g.) $L\colon L^2 \to L^2$, we have something like $L\colon A \to L^2$ where $A$ is the subset of $L^2$ that satisfies a certain linear boundary condition like $f(1) = 0$. Since $A$ is not a closed subset, it is not a Hilbert space in its own right and I can't see that it is immediate that we can apply the standard theorem as given above. Perhaps we can extend $A$ to $L^2$ somehow - or have I completely missed the point?