Difference between matrix and linear operator Question 1: Why is it necessary to specify boundary conditions for Laplacian to be a self-adjoint operator, while this is not the case for a matrix? (there is no need to specify boundary conditions for matrices)
Question 2: In finite-difference, discretized Laplacian is not symmetric (self-adjoint), while the actual Laplacian is. Why?
 A: This is subtle. In eigenvalue problems for matrices the vectors are not associated with any shape in space, and there are no boundary conditions to apply. However, if you approximate the Laplacian operator as a matrix on a discrete space, then your matrix will be different for each boundary condition. For example, Lets look at the $1D$ Laplacian
$$\nabla^{2}=\frac{\partial^{2}}{\partial x^{2}}$$
Then you can approximate
$$\nabla^{2}f=\frac{\partial^{2}f}{\partial x^{2}}\approx\frac{f(x+h)-2f(x)+f(x-h)}{h^{2}}$$
with $h$ a small number. Lets now write $x=nh$ for $n\in\{0,1,2,\dots,N\}$, so
$$\frac{\partial^{2}f}{\partial x^{2}}(h)\approx\frac{f(2h)-2f(h)+f(0)}{h^{2}}$$
$$\frac{\partial^{2}f}{\partial x^{2}}(2h)\approx\frac{f(3h)-2f(2h)+f(h)}{h^{2}}$$
$$\vdots$$
$$\frac{\partial^{2}f}{\partial x^{2}}(Nh)\approx\frac{f\Big((N+1)h\Big)-2f(Nh)+f\Big((N-1)h\Big)}{h^{2}}$$
Now you can insert the dependence on boundary conditions. In the case of zero Dirichlet boundary conditions you have $f(0)=f\Big((N+1)h\Big)=0$, and then your Laplacian is
$$\frac{\partial^{2}f}{\partial x^{2}}\approx\begin{pmatrix}-2&1&0&0&\dots&0&0\\1&-2&1&0&\dots&0&0\\0&1&-2&1&\dots&0&0\\\vdots&\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\0&0&0&0&\dots&1&-2\end{pmatrix}\begin{pmatrix}f(h)\\f(2h)\\\vdots\\f(Nh)\end{pmatrix}$$
On the other hand, in the case of zero Neumann boundary conditions you have $f(0)=f(h)$ and $f(Nh)=f\Big((N+1)h\Big)$ so
$$\frac{\partial^{2}f}{\partial x^{2}}\approx\begin{pmatrix}-1&1&0&0&\dots&0&0\\1&-2&1&0&\dots&0&0\\0&1&-2&1&\dots&0&0\\\vdots&\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\0&0&0&0&\dots&1&-1\end{pmatrix}\begin{pmatrix}f(h)\\f(2h)\\\vdots\\f(Nh)\end{pmatrix}$$
