Prove $\int_a^b [y_2Ly_1-y_1Ly_2]\ dx = p(y_1'y_2-y_1y_2')|_a^b$ for a second-order differential self-adjoint operator 
For a second-order differential operator $L$ that is self adjoint,
  show that:
$$\int_a^b [y_2Ly_1-y_1Ly_2]\ dx = p(y_1'y_2-y_1y_2')|_a^b$$

I'm studying Sturm-Liouville theory. The only differential operator that I know, and that is also called $L$, is:
$$L = \frac{d}{dx}\left[p(x)\frac{d}{dx}\right] + q(x)$$
So, 
$$Ly_1 = \frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right] + q(x)y_1$$
$$Ly_2 = \frac{d}{dx}\left[p(x)\frac{dy_2}{dx}\right] + q(x)y_2$$
The exercise talks about any second-order differential operator that is self-adjoint, but does not specify what $p$ is, so I'm assuming it must be the sturm-liouville one. So, let's suppose it is. Then I have to calculate:
$$\int_a^b = [y_2Ly_1-y_1Ly_2]\ dx =  \\ \int_a^b \left[y_2\frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right] + q(x)y_1 +  y_1\frac{d}{dx}\left[p(x)\frac{dy_2}{dx}\right] + q(x)y_2 \right] \ dx$$
right?
I'll break in two:
$$\int_a^b = [y_2Ly_1-y_1Ly_2]\ dx =  \\ \int_a^b \left[y_2\frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right] + q(x)y_1 \right] \ dx +  \int_a^b \left[y_1\frac{d}{dx}\left[p(x)\frac{dy_2}{dx}\right] + q(x)y_2 \right] \ dx$$
Let's focus on the first as the second is analogous:
$$\int_a^b \left[y_2\frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right] + q(x)y_1 \right] \ dx =  \int_a^b \left[y_2\frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right]\right] \ dx + \int_a^b q(x)y_1 \ dx$$
but I don't think this is the right way. For example, I'd have to use integration by parts in $\int_a^b q(x)y_1\ dx = q(x)y_1'|_a^b - \int_a^b q'(x)y_1\ dx$ but this doesn't help. The answer doesn't even involves $p$. I think I'm on the wrong track.
 A: I think you should have 
$$\int_a^b = [y_2Ly_1-y_1Ly_2]\ dx =  \\ \int_a^b \left[y_2\left(\frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right] + q(x)y_1\right) -  y_1\left(\frac{d}{dx}\left[p(x)\frac{dy_2}{dx}\right] + q(x)y_2\right) \right] \ dx.
$$
Therefore, the terms $q(x)y_1 y_2$ cancel each other. 
Hence, we get
$$\int_a^b  [y_2Ly_1-y_1Ly_2]\ dx = \int_a^b y_2\frac{d}{dx}\left[p(x)\frac{dy_1}{dx}\right]-y_1\frac{d}{dx}\left[p(x)\frac{dy_2}{dx}\right]dx.$$
Applying integration by parts to the last expression, you will get the result which I will leave it to you.
A: $$
    \int_{a}^{b}(y_2Ly_1 - y_1 Ly_2 )dx \\
   = \int_{a}^{b}y_2\left[\frac{d}{dx}\left(p\frac{dy_1}{dx}\right)+qy_1\right]
    - \left[\frac{d}{dx}\left(p\frac{dy_1}{dx}\right)+qy_1\right]y_2 \;dx \\
   = \int_{a}^{b}\frac{d}{dx}\left(p\frac{dy_1}{dx}\right)y_2-y_1\frac{d}{dx}\left(p\frac{dy_2}{dx}\right) dx \\
   = \int_{a}^{b}\frac{d}{dx}\left[ \left(p\frac{dy_1}{dx}\right)y_2-y1\left(p\frac{dy_2}{dx}\right)\right]dx \\
   = \left. p\frac{dy_1}{dx}y_2-py_1\frac{dy_2}{dx}\right|_{x=a}^{b}
$$
