The differential equation book I was reading briefly mentions about the generalization S-L form and it says if we consider the BVP
$L(y)=\lambda r(x)y$
where $L(y)=\displaystyle P_n(x)\frac{d^ny}{dx^n}+\dots +P_1(x)\frac{dy}{dx}+P_0(x)y$, then the problem is said to be self-adjoint if $(L(u),v)=(u,L(v))$ and this requires $L$ to be of even order.
I'm not sure why the last condition requires $L$ to be of even order, I tried to google and found some documentations saying $L$ is self-adjoint if it's of even order and anti self-adjoint(i.e. $(L(u),v)=-(u,L(v)))$ if it's of odd order but couldn't find any explanation. Can anyone explain this to me?
The formal adjoint is obtained by ignoring endpoint evaluation information and using integration by parts against a test function: $$ Ly = a_n\frac{d^ny}{dx^n}+a_{n-1}\frac{d^{n-1}y}{dx^{n-1}}+\cdots+a_1\frac{dy}{dx}+a_0y $$ That is, $$ \int (Lf)g dx = \cdots + \int f \left[(-1)^n\frac{d^{n}}{dx^{n}}(a_n g)+\cdots-\frac{d}{dx}(a_1 g)+(a_0 g) \right]dx $$ So the formal adjoint is $$ L^{\dagger}f = \sum_{k=0}^{n}(-1)^n\frac{d^n}{dx^n}(a_nf) $$ $L$ is formally selfadjoint if $L^{\dagger}=L$. The highest order derivative appears in $L^{\dagger}$ with a $(-1)^n$ factor. That's why $n$ needs to be even for real spaces. However, for complex spaces, $L$ can be odd. For example $L=i\frac{d}{dx}$ is formally selfadjoint when using the complex inner product.