How to find the exact solution of a Sturm Liouville form, 2nd order ODE? I have a second order ordinary differential equation reducible to Sturm Liovelle form. The equation is given by 
$\frac{f(x)}{x^2} - (\frac{1}{x}+x)f'(x) + f''(x) =0$
and boundary conditions are :
$f(0) =f_0; f(\pm \infty) = 0$
The equation can be reduced to the Sturm Liouville form as 
$\frac{d}{dx} (x e^{\frac{x^2}{2}}f'(x))=\frac{e^{\frac{x^2}{2}}}{x}f(x) $ 
(Mathematica gives solution in terms of Meijer functions). Now for a boundary condition $f(0)=0$ alone, we get a closed form analytical solution given by
$f(x) = c_1 x e^{\frac{-x^2}{4}}\left(I_0(\frac{x^2}{4})+I_1(\frac{x^2}{4})\right)$ where $I_1$ and $I_2$ are modified Bessel functions. 
This solution can be obtained by Frobenius method. My queries are as follows:


*

*Can the equation be solved analytically for any (or all) given sets of BC's?

*If a second order ODE can be reduced to a Strum Liouville form, is there a method for finding analytical solutions, perhaps limited to a certain class of problems?

*Mathematica gives the complete solution, with unspecified boundary conditions as a combination of the solution for boundary condition $f(0)=0$, and another involving Meijer function. I know that is possible to find a representation of the second solution of a second order linear ODE if one solution is available. But is it possible to find solutions of such equations in terms of Meijer functions directly?

 A: Sorry, I will not answer to so broad questions. My answer is limited to solve the ODE :
$$\frac{f(x)}{x^2} - (\frac{1}{x}+x)f'(x) + f''(x) =0$$
The Sturm Liouville form : 
$$\frac{d}{dx} (x e^{\frac{x^2}{2}}f'(x))=\frac{e^{\frac{x^2}{2}}}{x}f(x) $$
draw us to try a change of function on the form :
$$f(x)=x^ae^{b\,x^2}y(x)$$
Of course, this is not a general method. It is a guess, hoping that the ODE will be transformed to a simpler form.
The transformation is an easy but boring calculus. Editing all the steps would be even more boring. So, going straightaway to the result :
$$ x^2y''+\left((4b-1)x^3+(2a-1)x\right)y'+\left(2b(2b-1)x^4+a(4b-1)x^2+(a-1)^2 \right)y=0$$
By inspection, one see that the equation can be reduced to a Bessel form with particular values of $a$ and $b$.
$$b=\frac14\quad\text{and}\quad a=1$$
leading to the ODE of Bessel kind :
$$y''+\frac{1}{x}y'-\frac{x^2}{4}y=0$$
$$y=c_1I_0\left(\frac{x^2}{4}\right)+c_2K_0\left(\frac{x^2}{4}\right)$$
Modified Bessel functions of first and second kind and order $0$.
$$f(x)=xe^{x^2/4}\left(c_1I_0\left(\frac{x^2}{4}\right)+c_2K_0\left(\frac{x^2}{4}\right) \right)$$
Condition $f(0)=f_0$ :
Using the series expansion of the Bessel functions around $0$ :
$$xe^{x^2/4}I_0\left(x^2/4\right)=x-\frac{x^3}{4}+O(x^5) $$
$$xe^{x^2/4}K_0\left(x^2/4\right)=-2x\ln(x)+O(x) $$
Both tend to $0$ for $x\to 0$. As a consequence, 
$$\text{the problem has no real solution if } f_0\neq 0$$
If $f_0=0$ the above general solution satisfies the condition any $c1,c_2$.
\
Condition $f(\pm\infty)=0$ : $\qquad\color{red}{\text{Mistake corrected.}}$ 
Using the asymptotic expansion of the Bessel functions :
$$xe^{x^2/4}I_0\left(x^2/4\right)\sim \sqrt{\frac{2}{\pi}}e^{x^2/2}$$
$$xe^{x^2/4}K_0\left(x^2/4\right)\sim  \sqrt{2\pi}+O\left(x^{-2}\right)$$
The first tends to $\infty$ for $x\to\pm\infty$ which implies $c_1=0$
The second tends to $\sqrt{2\pi}$ for $x\to\pm\infty$ which implies $c_2=0$
\
Final result according to the specified conditions :
If $f_0\neq0$ no solution. 
If $f_0=0$ the solution is trivial : $f(x)=0$.
Ref. :
http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/06/01/04/01/01/
http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/06/02/01/01/01/
http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/06/01/04/01/02/
http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/06/02/01/01/
