Necessary and Sufficient Condition for Boundary Conditions to be Self-adjoint

Theorem
Let $\mathbf p$ be continuously differentiable.

The boundary conditions


 * $\mathbf y \left({a}\right) \Big \vert_{x \mathop = a} = \boldsymbol \psi \left({\mathbf y}\right) \Big \vert_{x \mathop = a}$

are self-adjoint :


 * $\forall i, k \in \N: 1 \le i, k \le N: \left.{\dfrac {\partial p_i \left[{x, \mathbf y, \boldsymbol \psi \left({\mathbf y}\right)}\right]} {\partial y_k} }\right\vert_{x \mathop = a} = \left.{\dfrac {\partial p_k \left[{x, \mathbf y, \boldsymbol \psi \left({\mathbf y}\right)}\right]} {\partial y_i} }\right\vert_{x \mathop = a}$

Necessary Condition
By assumption the boundary conditions are self-adjoint.

Then exists $g \left({x, \mathbf y}\right)$ such that:


 * $p_i \left({x, \mathbf y, \boldsymbol \psi \left({\mathbf y}\right)}\right) = \dfrac {\partial g \left({x, \mathbf y}\right)} {\partial y_i}$

Since $\mathbf p \in C^1$, $g \in C^2$.

Differentiate both sides $y_k$:


 * $\dfrac {\partial p_i \left({x, \mathbf y, \boldsymbol \psi \left({\mathbf y}\right)}\right)} {\partial y_k} = \dfrac {\partial^2 g \left({x, \mathbf y}\right)} {\partial y_k \partial y_i}$

By the Schwarz-Clairaut Theorem, partial derivatives commute, hence indices can be mutually replaced:


 * $\dfrac {\partial p_i \left({x, \mathbf y, \boldsymbol \psi \left({\mathbf y}\right)}\right)} {\partial y_k} = \dfrac {\partial p_k \left({x, \mathbf y, \boldsymbol \psi \left({\mathbf y}\right)}\right)} {\partial y_i}$

Fixing $x = a$ provides the result.

Sufficient condition
By assumption:


 * $\left.{\dfrac{\partial p_i} {\partial y_j} }\right \vert_{x \mathop = a} = \left.{\dfrac {\partial p_j} {\partial y_i} }\right \vert_{x \mathop = a}$

Then


 * $\exists g \left({x, \mathbf y}\right) \in C^2: \left.{\dfrac {\partial p_i} {\partial y_j} }\right\vert_{x \mathop = a} = \left.{\dfrac {\partial p_j} {\partial y_i} }\right\vert_{x \mathop = a} = \left.{\dfrac {\partial^2 g} {\partial y_i \partial y_j} }\right\vert_{x \mathop = a}$

In other words:
 * $p_i \Big \vert_{x \mathop = a} = \left.{\dfrac {\partial g} {\partial y_i} }\right\vert_{x \mathop = a}$

Hence, the boundary conditions are self-adjoint.