The differential operator $$L=a(x)\frac{d^2}{dx^2}+b(x)\frac{d}{dx}+c(x)$$ is not self adjoint. How would you find r(x) such that r(x)L is self adjoint. I know that this is self adjoint when $L=L^*$ where;
$$L^*=a(x)\frac{d^2}{dx^2}+(2a'(x)-b(x))\frac{d}{dx}+(a''(x)-b'(x)+c)$$
The expression for $r$ is $$r=exp \{\int\frac{b-a'}{a} dx \}.$$
I will assume you are asking us to derive the above expression for $r$. Actually, a self-adjoint form for a second-order differential operator is the Sturm-Liouville form:
$$\frac{d}{dx}\left [ p(x) \frac{d}{dx} \right ] + q(x)$$
The idea is to expand the above operator to bring it into the same form as the general differential operator, multiplied by $r(x)$ to make it self-adjoint:
$$r(x) a(x) \frac{d^2}{dx^2} + r(x) b(x) \frac{d}{dx} + r(x) c(x)$$
Equating powers of $d/dx$, we see that
$$p(x) = r(x) a(x)$$ $$p'(x) = r(x) b(x)$$
which means that
$$\frac{p'(x)}{p(x)} = \frac{b(x)}{a(x)}$$
which you should be able to solve. This gives $p(x)$; you may then easily determine $r(x)$. You should note that
$$\exp{\left[- \int dx \frac{a'(x)}{a(x)}\right]} = \frac{1}{a(x)}$$
in reference with the solution you seek in your post.