Finding a weight function for Bessell Sturm-Liouville problem with some boundary conditions I have a Bessel differential equation 
$$r^2R'' + rR' + k^2r^2R=0$$
on $r = (R_1, R_2)$ with boundary conditions 
$$R'(r=R_1) = A$$
$$R'(r=R_2) = 0$$
where $A$ is some constant I can determine through a physical background of the problem. The solution is $$R(r) = J_0(kr) + B Y_0(kr)$$where $B=-\frac{J_1(kR_2)}{Y_1(kR2)}$.
How would you go about finding a weight function, that would give orthogonality to the solutions of the problem?
Also is there a way to find a weight function for any given boundary conditions? 
 A: The weight function $w$ is the coefficient of $\lambda u$ when the differential equation is put in Sturm–Liouville form,
$$ -(pu')' + qu = \lambda w u. \tag{1} $$
It is the same for any Sturm–Liouville problem that uses this equation (i.e. with appropriate boundary conditions; the actual location of the boundary is irrelevant).

For this equation, the Sturm–Liouville form is
$$ -(rR')' = k^2rR, $$
so $p(r)=r$, $q(r)=0$, $\lambda=k^2$, and $w(r)=r$.

This isn't quite enough, however: as my colleague in the comments notes, the boundary conditions here are not Sturm–Liouville boundary conditions. Your asserted solution is missing a vital component: an overall constant. We can then see that the problem has a continuous variety of solutions: if we let $R_k(r)$ be your solution, then $AR_k(r)/R'_k(R_1)$ satisfies both boundary conditions for any $k$ provided that $R'_k(R_1) \neq 0$. It is not possible to impose orthogonality conditions on these functions: there are simply too many of them.

If we impose the condition $R_k(R_1)=0$, the problem becomes a proper Sturm–Liouville problem, and we can impose the extra boundary condition at $R_1$ to obtain the correct scaling for the functions (given above). We can then check orthogonality using the following:
If we take $u,v$ any solutions to (1) with respective eigenvalues $\lambda$ and $\mu$, we also have the formula
$$ \int w(x)u(x)v(x) \, dx = \frac{-p(x)}{\lambda-\mu}(u'(x)v(x)-v'(x)u(x)) $$
(differentiate the right-hand side and use (1) to see why).
It is clear that this is zero when $r=R_2$, and if $r=R_1$, the new boundary condition $R_k(R_1)=0$ makes the other boundary term zero.
