Determining Weight function in Sturm Liouville problem By choosing the proper weight function $\sigma (x) $ solve the Sturm-Liouville problem and determine its eigenvalues and eigenfunctions.
$$ \frac{d}{dx}\left[x\frac{dy(x)}{dx}\right] + \frac{2}{x}y(x) +\lambda \sigma (x)y(x)=0,\; y'(1)=y'(2)=0,\; 1 \leq x \leq 2. $$
I don't understand what it means to "choose" the proper weight function. I tried to rewrite the problem in this form.
$$\frac{1}{\sigma(x)}\left[\frac{d}{dx}\left[x\frac{dy(x)}{dx} + \frac{2}{x}y(x)\right] +\lambda\sigma(x)=0\right], $$
then calculate it by setting  $p(x)=A(x)\sigma (x), p'(x)=B(x)\sigma(x)$ and using this formula:
$$\sigma(x)=e^{\int \frac{A-B'}{B}\,dX}, $$ 
but it doesn't get me anywhere; solving this gives you just $1=1.$ 
I tried extracting information about the weight function from the boundary condition but i am failing at that too and i tried solving the differential equation using an infinite series but that won't work either because of the unknown weight function. Any tips?
 A: I think the problem might be a tad easier than you're making it out to be; most of the time, you can simply read off what the weight function should be. See this link for a type-up of some notes I got on SL problems, including a downloadable pdf.
For your problem, you need to massage the equation into the right form, from which you can simply read it off:
\begin{align*}
\frac{d}{dx}\left[x\frac{dy(x)}{dx}\right] + \frac{2}{x}y(x) +\lambda \sigma (x)y(x)&=0\\
\frac{d}{dx}\left[x\frac{dy(x)}{dx}\right] + \frac{2}{x}y(x)&=-\lambda \sigma (x)y(x);
\end{align*}
then you just need a positive weight function. The hope is that some combination of $\sigma(x)$ or $\lambda\sigma(x)$ or $-\lambda\sigma(x)$ or $-\sigma(x)$ is positive. 
Alternatively, you could view $1/x$ as the weighting function by writing as
$$\frac{d}{dx}\left[x\frac{dy(x)}{dx}\right]+\lambda \sigma (x)y(x)=- \frac{2}{x}y(x).$$
Depending on how $\sigma(x)$ behaves, this may be the only option, since $1/x$ does not change sign on your interval.
A: For generic 2nd order (homogeneous) ODE:
$ a(x)y''(x) + b(x)y'(x) +c(x)y(x) = 0 $
To transform it to Sturm Liouville form you need:
$ a(x)>0$ and $a,b,c$ to be on continuous on the interval of definition.
Now the weight function is defined as follows:
$w(x) = \dfrac{1}{a(x)}e^{\int \frac{b(x)}{a(x)}dx}$
We now set:
$ p(x) = w(x)a(x)\\  q(x)=w(x)c(x)$
To do a sanity check find $p'(x)$ which is $b(x)w(x)$
so now you can rewrite the DE to:
$\dfrac{1}{w(x)} \left[ w(x)a(x)y'' + w(x)b(x)y' + w(x)c(x)y \right] =0\\ \dfrac{1}{w(x)} \left[ p(x)y'' + p'(x)y' + q(x) \right] = 0\\ \dfrac{1}{w(x)} \left[ (p(x)y')' + q(x) \right] = 0 $
That's how you reformulate to SL form. Hope this helps and you can work the details for your problem.
A: Your equation may be written as
$$
                 -xy''-y'+\frac{2}{x}y=\lambda\sigma(x)y \\
                 -x^2y''-xy'+2y=\lambda \sigma(x)xy.
$$
If you are allowed to choose $\sigma(x)$, I would choose $\sigma(x)x=1$. Then you have Euler's equation, which you can explicitly solve:
$$
                         x^2y''+xy'+(2-\lambda)y=0,\;\;\; y'(1)=y'(2)=0.
$$
The solutions where $y'(1)=0$ can be normalized by an added condition such as $y(1)=1$, for example. Then you can solve for $\lambda$ for which $y'(2)=0$, and that determines the eigenvalues $\lambda$.
