Suppose that \begin{align*} L &= p(x) \frac{d^2}{dx^2} + r(x) \frac{d}{dx} + q(x) \\ \end{align*} Consider \begin{align*} \int_a^b vL(u) \, dx \\ \end{align*} By repeated integration by parts, determine the adjoint operator $L^*$ such that \begin{align*} \int_a^b \left[ uL^*(v) - vL(u) \right] &= \left. H(x) \right|_a^b \\ \end{align*} What is $H(x)$? Under what conditions does $L=L^*$, the self-adjoint case?
Hint: Show that \begin{align*} L^* &= p \frac{d^2}{dx^2} + \left( 2 \frac{dp}{dx} - r \right) \frac{d}{dx} + \left(\frac{d^2p}{dx^2} - \frac{dr}{dx} + q \right) \\ \end{align*} The given answer that I must find is: \begin{align*} H(x) &= p \left( u \frac{dv}{dx} - v \frac{du}{dx} \right) + uv \left( \frac{dp}{dx} - r \right) \\ \end{align*}
I'm not sure how to calculate the $L^*$ given in the hint, I obviously know integration by parts, but I don't see how that would be used here, I don't see how to calculate $H(x)$ when we have $L^*$.
Once we have $L^*$, I can identify the self-adjoint conditions where $L = L^*$:
\begin{align*} p \frac{d^2}{dx^2} + r \frac{d}{dx} + q &= p \frac{d^2}{dx^2} + \left( 2 \frac{dp}{dx} - r \right) \frac{d}{dx} + \left(\frac{d^2p}{dx^2} - \frac{dr}{dx} + q \right) \\ r \frac{d}{dx} + q &= \left( 2 \frac{dp}{dx} - r \right) \frac{d}{dx} + \left(\frac{d^2p}{dx^2} - \frac{dr}{dx} + q \right) \\ \end{align*}
which would mean that
\begin{align*} r(x) &= 2 \frac{dp}{dx} - r(x) \\ \frac{dp}{dx} &= r(x) \\ p(x) &= \int r(x) \, dx \\ \end{align*}
and
\begin{align*} q &= \frac{d^2p}{dx^2} - \frac{dr}{dx}(x) + q \\ \frac{d^2p}{dx^2} &= \frac{dr}{dx}(x) \\ \frac{dp}{dx} &= r(x) + c \\ p(x) &= \int \left( r(x) + c \right) \, dx \\ \end{align*}
Since both expressions must be true, the constant in the second expression can be eliminated. We can conclude that $L = L^*$ if and only if $p(x) = \int r(x) \, dx$
I try to calculate $u L^*(v) - v L(u)$ but this doesn't seem useful:
\begin{align*} u L^*(v) &= u p \frac{d^2v}{dx^2} + u \left( 2 \frac{dp}{dx} - r \right) \frac{dv}{dx} + u \left(\frac{d^2p}{dx^2} - \frac{dr}{dx} + q \right) v \\ v L(u) &= v p \frac{d^2u}{dx^2} + v r \frac{du}{dx} + v q u \\ u L^*(v) - v L(u) &= p \left( u \frac{d^2v}{dx^2} - v \frac{d^2u}{dx^2} \right) + u \left( 2 \frac{dp}{dx} - r \right) \frac{dv}{dx} + u \left(\frac{d^2p}{dx^2} - \frac{dr}{dx} \right) v - v r \frac{du}{dx} \\ &= p \left( u \frac{d^2v}{dx^2} - v \frac{d^2u}{dx^2} \right) + 2 u \frac{dp}{dx} \frac{dv}{dx} + u \left(\frac{d^2p}{dx^2} - \frac{dr}{dx} \right) v - r \left( u \frac{dv}{dx} + v \frac{du}{dx} \right) \\ \end{align*}