[proofplan]
We first identify the adjoint of the compactly supported interval Laplacian as the maximal second-derivative operator on $H^2(0,L)$ and compute its boundary form by [integration by parts](/theorems/210). The trace map sends $H^2(0,L)$ onto $\mathbb C^2\oplus\mathbb C^2$, so self-adjoint restrictions of the maximal operator are exactly maximal subspaces of boundary data on which the boundary form vanishes. A Cayley transform converts those maximal isotropic boundary subspaces into graphs of unitary maps on $\mathbb C^2$. Pulling the graph condition back through the trace map gives precisely the stated boundary condition.
[/proofplan]
[step:Identify the maximal adjoint operator and its boundary form]
Define the maximal operator
\begin{align*}
S_{\max}:H^2(0,L)\subset L^2(0,L)\to L^2(0,L),\qquad u\mapsto -u''.
\end{align*}
Let $\mathcal L^1$ denote one-dimensional [Lebesgue measure](/page/Lebesgue%20Measure) on $(0,L)$. We first show that $S_0^*=S_{\max}$. If $u\in H^2(0,L)$ and $\varphi\in C_c^\infty(0,L)$, then [integration by parts](/theorems/2098) twice gives
\begin{align*}
\int_0^L (-u'')\overline{\varphi}\,d\mathcal L^1=\int_0^L u\overline{(-\varphi'')}\,d\mathcal L^1.
\end{align*}
Thus $H^2(0,L)\subset \mathcal D(S_0^*)$ and $S_0^*u=-u''$.
Conversely, let $u\in\mathcal D(S_0^*)$. Then there exists $f\in L^2(0,L)$ such that
\begin{align*}
\int_0^L u\overline{(-\varphi'')}\,d\mathcal L^1=\int_0^L f\overline{\varphi}\,d\mathcal L^1
\end{align*}
for every $\varphi\in C_c^\infty(0,L)$. Hence the distributional second derivative of $u$ is $u''=-f\in L^2(0,L)$. Define
\begin{align*}
g:(0,L)\to\mathbb C,\qquad x\mapsto \int_0^x -f(t)\,d\mathcal L^1(t).
\end{align*}
Then $g\in H^1(0,L)$ and the [distributional derivative](/page/Distributional%20Derivative) of $u'-g$ is zero. A distribution on an interval with zero distributional derivative is constant, so there is $c\in\mathbb C$ such that $u'=g+c$ in the sense of distributions. Since $g+c\in H^1(0,L)$, we have $u'\in H^1(0,L)$ and therefore $u\in H^2(0,L)$. Therefore $\mathcal D(S_0^*)=H^2(0,L)$ and $S_0^*=S_{\max}$.
For $u,v\in H^2(0,L)$, integration by parts gives Green's identity
\begin{align*}
(S_{\max}u,v)_{L^2}-(u,S_{\max}v)_{L^2}=(\Gamma_1u,\Gamma_2v)_{\mathbb C^2}-(\Gamma_2u,\Gamma_1v)_{\mathbb C^2}.
\end{align*}
[guided]
The adjoint is the largest operator against which compactly supported test functions cannot detect boundary conditions. Define
\begin{align*}
S_{\max}:H^2(0,L)\subset L^2(0,L)\to L^2(0,L),\qquad u\mapsto -u''.
\end{align*}
If $u\in H^2(0,L)$ and $\varphi\in C_c^\infty(0,L)$, then $\varphi$ and $\varphi'$ vanish near both endpoints. Therefore the two integrations by parts have no boundary contributions:
\begin{align*}
\int_0^L (-u'')\overline{\varphi}\,d\mathcal L^1=\int_0^L u\overline{(-\varphi'')}\,d\mathcal L^1.
\end{align*}
This proves $u\in\mathcal D(S_0^*)$ and $S_0^*u=-u''$.
Now suppose $u\in\mathcal D(S_0^*)$. By definition of the adjoint, there is an element $f\in L^2(0,L)$ such that
\begin{align*}
\int_0^L u\overline{(-\varphi'')}\,d\mathcal L^1=\int_0^L f\overline{\varphi}\,d\mathcal L^1
\end{align*}
for all $\varphi\in C_c^\infty(0,L)$. This says exactly that the distributional second derivative of $u$ is $u''=-f$, hence belongs to $L^2(0,L)$. We now prove the needed interval regularity directly. Define
\begin{align*}
g:(0,L)\to\mathbb C,\qquad x\mapsto \int_0^x -f(t)\,d\mathcal L^1(t).
\end{align*}
Because $f\in L^2(0,L)$, the function $g$ belongs to $H^1(0,L)$ and has distributional derivative $g'=-f$. Therefore the distributional derivative of $u'-g$ is $u''-g'=0$. A distribution on an interval whose distributional derivative is zero is constant, so there is $c\in\mathbb C$ such that $u'=g+c$ in the sense of distributions. Since $g+c\in H^1(0,L)$, this gives $u'\in H^1(0,L)$, and hence $u\in H^2(0,L)$. Thus $\mathcal D(S_0^*)=H^2(0,L)$.
It remains to compute the boundary pairing on this maximal domain. For $u,v\in H^2(0,L)$, integration by parts is valid because the traces $u(0),u(L),u'(0),u'(L)$ and the analogous traces of $v$ are well-defined. We obtain
\begin{align*}
(S_{\max}u,v)_{L^2}-(u,S_{\max}v)_{L^2}=-u'(L)\overline{v(L)}+u'(0)\overline{v(0)}+u(L)\overline{v'(L)}-u(0)\overline{v'(0)}.
\end{align*}
Using
\begin{align*}
\Gamma_1u=(u(0),u(L)),\qquad \Gamma_2u=(-u'(0),u'(L)),
\end{align*}
the right-hand side is exactly
\begin{align*}
(\Gamma_1u,\Gamma_2v)_{\mathbb C^2}-(\Gamma_2u,\Gamma_1v)_{\mathbb C^2}.
\end{align*}
This identity is the bridge between self-adjointness of differential operators and linear algebra of boundary values.
[/guided]
[/step]
[step:Reduce self-adjoint restrictions to maximal isotropic boundary subspaces]
Let $\mathcal B:=\mathbb C^2\oplus\mathbb C^2$. Define the skew-Hermitian boundary form
\begin{align*}
\omega:\mathcal B\times\mathcal B\to\mathbb C,\qquad ((x,y),(x',y'))\mapsto (x,y')_{\mathbb C^2}-(y,x')_{\mathbb C^2}.
\end{align*}
Define the trace map
\begin{align*}
\Gamma:H^2(0,L)\to\mathcal B,\qquad u\mapsto(\Gamma_1u,\Gamma_2u).
\end{align*}
The map $\Gamma$ is surjective: for any $a_0,a_L,b_0,b_L\in\mathbb C$, the Hermite interpolation polynomial $p\in C^\infty([0,L])$ satisfying $p(0)=a_0$, $p(L)=a_L$, $p'(0)=-b_0$, and $p'(L)=b_L$ belongs to $H^2(0,L)$ and has $\Gamma p=((a_0,a_L),(b_0,b_L))$.
If $T$ is a closed extension of $S_0$ with $T\subset S_{\max}$, then $T$ contains the closure of $S_0$. The closure has domain
\begin{align*}
H^2_0(0,L)=\{u\in H^2(0,L):u(0)=u(L)=u'(0)=u'(L)=0\}=\ker\Gamma.
\end{align*}
Here the equality with $\ker\Gamma$ follows from the definitions of $\Gamma_1$ and $\Gamma_2$, and the closure statement uses the standard endpoint trace characterization of $H^2_0(0,L)$: functions in $C_c^\infty(0,L)$ are dense in the $H^2(0,L)$ norm exactly in the subspace with vanishing endpoint values and vanishing endpoint first derivatives. Set
\begin{align*}
M_T:=\Gamma(\mathcal D(T))\subset\mathcal B.
\end{align*}
Since $\ker\Gamma\subset\mathcal D(T)$, the domain is exactly the pullback of its boundary data:
\begin{align*}
\mathcal D(T)=\Gamma^{-1}(M_T).
\end{align*}
Indeed, if $u\in\Gamma^{-1}(M_T)$, choose $v\in\mathcal D(T)$ with $\Gamma v=\Gamma u$; then $u-v\in\ker\Gamma\subset\mathcal D(T)$, so $u\in\mathcal D(T)$.
By Green's identity, $T$ is symmetric exactly when $\omega$ vanishes on $M_T\times M_T$. Its adjoint is the restriction of $S_{\max}$ whose boundary values lie in
\begin{align*}
M_T^{\perp_\omega}:=\{z\in\mathcal B:\omega(z,m)=0\text{ for every }m\in M_T\}.
\end{align*}
Surjectivity of $\Gamma$ gives this equality of domains, not merely one inclusion. Therefore $T=T^*$ exactly when $M_T=M_T^{\perp_\omega}$, which is equivalent to $M_T$ being maximal among subspaces of $\mathcal B$ on which $\omega$ vanishes.
[claim:Maximal isotropic boundary subspaces have dimension two]
If $M\subset\mathcal B$ satisfies $M=M^{\perp_\omega}$, then $\dim_{\mathbb C}M=2$.
[/claim]
[proof]
The form $\omega$ is nondegenerate: if $z=(x,y)\in\mathcal B$ and $\omega(z,(x',y'))=0$ for every $(x',y')\in\mathcal B$, then testing first against $(0,y')$ gives $(x,y')_{\mathbb C^2}=0$ for every $y'\in\mathbb C^2$, so $x=0$; testing against $(x',0)$ gives $-(y,x')_{\mathbb C^2}=0$ for every $x'\in\mathbb C^2$, so $y=0$. Thus the [linear map](/page/Linear%20Map) $\mathcal B\to\mathcal B^*$ induced by $\omega$ is an isomorphism. For any subspace $M\subset\mathcal B$, rank-nullity applied to the restriction map $\mathcal B\to M^*$, $z\mapsto \omega(z,\cdot)|_M$, gives
\begin{align*}
\dim_{\mathbb C}M^{\perp_\omega}=4-\dim_{\mathbb C}M.
\end{align*}
If $M=M^{\perp_\omega}$, then $2\dim_{\mathbb C}M=4$, hence $\dim_{\mathbb C}M=2$.
[/proof]
[guided]
The point of this step is to justify that no hidden interior condition is being lost when we pass from operator domains to boundary values. Let $T$ be a closed extension of $S_0$ satisfying $T\subset S_{\max}$. Since $T$ is closed and contains $S_0$, it contains the closure of $S_0$. The closure has domain
\begin{align*}
H^2_0(0,L)=\{u\in H^2(0,L):u(0)=u(L)=u'(0)=u'(L)=0\}=\ker\Gamma.
\end{align*}
The equality with $\ker\Gamma$ follows from the definitions of $\Gamma_1$ and $\Gamma_2$. The closure statement uses the standard endpoint trace characterization of $H^2_0(0,L)$: functions in $C_c^\infty(0,L)$ are dense in the $H^2(0,L)$ norm exactly in the subspace with vanishing endpoint values and vanishing endpoint first derivatives.
Define
\begin{align*}
M_T:=\Gamma(\mathcal D(T))\subset\mathcal B.
\end{align*}
We claim that $\mathcal D(T)=\Gamma^{-1}(M_T)$. The inclusion $\mathcal D(T)\subset\Gamma^{-1}(M_T)$ follows from the definition of $M_T$. Conversely, take $u\in\Gamma^{-1}(M_T)$. Then there is $v\in\mathcal D(T)$ such that $\Gamma u=\Gamma v$. Hence $\Gamma(u-v)=0$, so $u-v\in\ker\Gamma=H^2_0(0,L)\subset\mathcal D(T)$. Since $v\in\mathcal D(T)$ and $\mathcal D(T)$ is a linear subspace, $u=(u-v)+v\in\mathcal D(T)$. This proves the pullback identity.
Now Green's identity says that for $u,v\in\mathcal D(T)$,
\begin{align*}
(Tu,v)_{L^2}-(u,Tv)_{L^2}=\omega(\Gamma u,\Gamma v).
\end{align*}
Thus $T$ is symmetric precisely when $\omega$ vanishes on $M_T\times M_T$. To compute the adjoint, take $w\in H^2(0,L)$. The condition $w\in\mathcal D(T^*)$ is that
\begin{align*}
(S_{\max}w,v)_{L^2}-(w,Tv)_{L^2}=0
\end{align*}
for every $v\in\mathcal D(T)$. By Green's identity, this is equivalent to
\begin{align*}
\omega(\Gamma w,m)=0
\end{align*}
for every $m\in M_T$. Hence
\begin{align*}
\mathcal D(T^*)=\Gamma^{-1}(M_T^{\perp_\omega}),
\end{align*}
where
\begin{align*}
M_T^{\perp_\omega}:=\{z\in\mathcal B:\omega(z,m)=0\text{ for every }m\in M_T\}.
\end{align*}
Therefore $T=T^*$ exactly when $M_T=M_T^{\perp_\omega}$, which is the same as maximal isotropy for the nondegenerate boundary form $\omega$. We will also need the dimension of such a subspace. The form $\omega$ is nondegenerate: if $z=(x,y)\in\mathcal B$ and $\omega(z,(x',y'))=0$ for every $(x',y')\in\mathcal B$, then testing against $(0,y')$ gives $x=0$, and testing against $(x',0)$ gives $y=0$. Hence the map $\mathcal B\to\mathcal B^*$ induced by $\omega$ is an isomorphism. For a subspace $M\subset\mathcal B$, rank-nullity applied to $z\mapsto \omega(z,\cdot)|_M$ gives
\begin{align*}
\dim_{\mathbb C}M^{\perp_\omega}=4-\dim_{\mathbb C}M.
\end{align*}
Thus $M=M^{\perp_\omega}$ implies $\dim_{\mathbb C}M=2$.
[/guided]
[/step]
[step:Classify maximal isotropic boundary subspaces by a Cayley transform]
For $(x,y)\in\mathbb C^2\oplus\mathbb C^2$, define the Cayley boundary variables
\begin{align*}
a:=x+iy,\qquad b:=x-iy.
\end{align*}
The linear map
\begin{align*}
C:\mathbb C^2\oplus\mathbb C^2\to\mathbb C^2\oplus\mathbb C^2,\qquad (x,y)\mapsto(a,b)
\end{align*}
is invertible, with inverse $x=(a+b)/2$ and $y=(a-b)/(2i)$. A direct calculation gives, for $z=(x,y)$ and $z'=(x',y')$,
\begin{align*}
\omega(z,z')=-\frac{i}{2}\bigl((a,a')_{\mathbb C^2}-(b,b')_{\mathbb C^2}\bigr).
\end{align*}
Let $M\subset\mathbb C^2\oplus\mathbb C^2$ be maximal $\omega$-isotropic, and let $N:=C(M)\subset\mathbb C^2\oplus\mathbb C^2$. If $(a,0)\in N$, isotropy gives $(a,a)_{\mathbb C^2}=0$, hence $a=0$; similarly $(0,b)\in N$ implies $b=0$. Therefore both coordinate projections are injective on $N$. Since $M$ is maximal isotropic and $C$ is invertible, the dimension result proved in the previous step gives $\dim_{\mathbb C}N=\dim_{\mathbb C}M=2$. Hence each injective projection from $N$ to $\mathbb C^2$ is also surjective. Hence $N$ is the graph of a unique linear map $U:\mathbb C^2\to\mathbb C^2$:
\begin{align*}
N=\{(Ub,b):b\in\mathbb C^2\}.
\end{align*}
The isotropy identity applied to $(Ub,b)$ and $(Ub',b')$ gives
\begin{align*}
(Ub,Ub')_{\mathbb C^2}=(b,b')_{\mathbb C^2}
\end{align*}
for all $b,b'\in\mathbb C^2$, so $U$ is an isometry. Since $\mathbb C^2$ is finite-dimensional, this isometry is surjective and hence unitary. Conversely, the graph of any unitary map has dimension $2$ and satisfies the displayed isotropy identity, so it is maximal isotropic. Thus a subspace $M\subset\mathbb C^2\oplus\mathbb C^2$ is maximal $\omega$-isotropic exactly when $C(M)$ is the graph of a unitary map $U:\mathbb C^2\to\mathbb C^2$.
Equivalently, $(x,y)\in M$ exactly when
\begin{align*}
x+iy=U(x-iy).
\end{align*}
Rearranging gives
\begin{align*}
(I-U)x+i(I+U)y=0.
\end{align*}
[guided]
The Cayley variables separate the positive and negative parts of the boundary form. For $(x,y)\in\mathbb C^2\oplus\mathbb C^2$, define
\begin{align*}
a:=x+iy,\qquad b:=x-iy.
\end{align*}
The map $C:(x,y)\mapsto(a,b)$ is invertible because $x=(a+b)/2$ and $y=(a-b)/(2i)$. Substituting these formulas into the boundary form gives
\begin{align*}
\omega((x,y),(x',y'))=-\frac{i}{2}\bigl((a,a')_{\mathbb C^2}-(b,b')_{\mathbb C^2}\bigr).
\end{align*}
Thus isotropy of $M$ becomes equality of the two inner products on $C(M)$.
Let $N:=C(M)$. If $(a,0)\in N$, applying isotropy to this vector with itself gives $(a,a)_{\mathbb C^2}=0$, so $a=0$. The same argument shows that $(0,b)\in N$ implies $b=0$. Hence both coordinate projections are injective on $N$. A maximal isotropic subspace for this nondegenerate form has complex dimension $2$, so each injective projection from $N$ to $\mathbb C^2$ is also surjective. Therefore $N$ is the graph of a unique linear map $U:\mathbb C^2\to\mathbb C^2$, written
\begin{align*}
N=\{(Ub,b):b\in\mathbb C^2\}.
\end{align*}
The isotropy condition for two graph vectors gives
\begin{align*}
(Ub,Ub')_{\mathbb C^2}=(b,b')_{\mathbb C^2}
\end{align*}
for all $b,b'\in\mathbb C^2$. Hence $U$ preserves the Hermitian [inner product](/page/Inner%20Product). Since the domain and codomain are both finite-dimensional and have dimension $2$, this isometry is onto, so $U$ is unitary. Conversely, the graph of a unitary map has dimension $2$ and satisfies the displayed equality, so it is maximal isotropic.
Returning to the original variables, $N$ is the graph of $U$ exactly when
\begin{align*}
x+iy=U(x-iy).
\end{align*}
Moving all terms to one side gives
\begin{align*}
(I-U)x+i(I+U)y=0.
\end{align*}
[/guided]
[/step]
[step:Pull the unitary boundary subspace back to the operator domain]
Let $U\in U(2)$ and define
\begin{align*}
\mathcal D(S_U)=\{u\in H^2(0,L):(I-U)\Gamma_1u+i(I+U)\Gamma_2u=0\}.
\end{align*}
For every $u\in\mathcal D(S_U)$, the boundary pair $(\Gamma_1u,\Gamma_2u)$ lies in the maximal isotropic subspace corresponding to $U$. Hence Green's identity gives
\begin{align*}
(S_Uu,v)_{L^2}=(u,S_Uv)_{L^2}
\end{align*}
for all $u,v\in\mathcal D(S_U)$, so $S_U$ is symmetric.
Since the boundary subspace is maximal isotropic and $\Gamma$ is surjective, the adjoint boundary condition of $S_U$ is the same boundary condition. Therefore $\mathcal D(S_U^*)=\mathcal D(S_U)$ and $S_U^*=S_U$. Thus $S_U$ is self-adjoint.
[guided]
Let $U\in U(2)$ and define
\begin{align*}
\mathcal D(S_U)=\{u\in H^2(0,L):(I-U)\Gamma_1u+i(I+U)\Gamma_2u=0\}.
\end{align*}
The preceding classification says that the set of boundary values satisfying this equation is a maximal $\omega$-isotropic subspace of $\mathcal B$. Hence, if $u,v\in\mathcal D(S_U)$, then $\omega(\Gamma u,\Gamma v)=0$. Green's identity therefore gives
\begin{align*}
(S_Uu,v)_{L^2}-(u,S_Uv)_{L^2}=0,
\end{align*}
so $S_U$ is symmetric.
To see self-adjointness, compute the adjoint boundary condition. If $w\in\mathcal D(S_U^*)$, then Green's identity forces $\omega(\Gamma w,m)=0$ for every boundary vector $m$ satisfying the displayed condition. Since that boundary subspace is maximal isotropic, its $\omega$-orthogonal complement is itself. Thus $\Gamma w$ satisfies the same boundary condition, so $w\in\mathcal D(S_U)$. The reverse inclusion follows from symmetry. Therefore $\mathcal D(S_U^*)=\mathcal D(S_U)$ and $S_U^*=S_U$.
[/guided]
[/step]
[step:Recover the unitary matrix uniquely from an arbitrary self-adjoint extension]
Let $T$ be any self-adjoint extension of $S_0$. Since $S_0\subset T=T^*\subset S_0^*=S_{\max}$, the operator $T$ is a restriction of $S_{\max}$ to some domain $\mathcal D(T)\subset H^2(0,L)$. Its boundary data subspace $M_T=\Gamma(\mathcal D(T))$ is maximal $\omega$-isotropic by the previous reduction. By the Cayley classification, there is a unitary matrix $U\in U(2)$ such that
\begin{align*}
M_T=\{(x,y)\in\mathbb C^2\oplus\mathbb C^2:(I-U)x+i(I+U)y=0\}.
\end{align*}
Pulling this identity back through $\Gamma$ gives $\mathcal D(T)=\mathcal D(S_U)$, and both operators act as $-u''$ on their domains. Hence $T=S_U$.
The unitary matrix is unique because its graph
\begin{align*}
\{(Ub,b):b\in\mathbb C^2\}
\end{align*}
is uniquely determined by the maximal isotropic subspace $C(M_T)$. This proves the claimed bijection between $U(2)$ and the self-adjoint extensions of $S_0$.
[guided]
Let $T$ be a self-adjoint extension of $S_0$. Because $T=T^*$, it is closed, and because $S_0\subset T\subset S_0^*=S_{\max}$, it is a restriction of the maximal operator to a domain contained in $H^2(0,L)$. Define $M_T=\Gamma(\mathcal D(T))$. The reduction above applies to closed extensions containing $S_0$, so $\mathcal D(T)=\Gamma^{-1}(M_T)$ and self-adjointness of $T$ implies that $M_T$ is maximal $\omega$-isotropic.
By the Cayley classification, there is a unitary matrix $U\in U(2)$ such that
\begin{align*}
M_T=\{(x,y)\in\mathbb C^2\oplus\mathbb C^2:(I-U)x+i(I+U)y=0\}.
\end{align*}
Pulling this condition back through $\Gamma$ gives
\begin{align*}
\mathcal D(T)=\{u\in H^2(0,L):(I-U)\Gamma_1u+i(I+U)\Gamma_2u=0\}=\mathcal D(S_U).
\end{align*}
Both $T$ and $S_U$ act by $u\mapsto -u''$ on this common domain, so $T=S_U$.
Finally, the unitary matrix is unique. Under the Cayley transform, the boundary subspace determines the graph
\begin{align*}
\{(Ub,b):b\in\mathbb C^2\}.
\end{align*}
A linear map is uniquely determined by its graph, so no two different unitary matrices give the same extension. This proves the claimed bijection.
[/guided]
[/step]