Suppose I have the equation
$$y^{\prime \prime}-\left(\frac{1}{4} + \frac{k}{x}\right)y=0.$$
I understand that an equation of this form would normally be solved using the Frobenius Method to obtain a recurrence relation. But in this case, the $\frac{1}{x}$ dependence causes the coefficient $a_n$ in the recurrence relationship to depend on both $a_{n-1}$ and $a_{n-2}$ after I "shift up" the summation indices, and so I'm not sure how to continue.
I also tried plugging the equation into Mathematica, which gave a solution for $y$ in terms of the hypergeometric function. However, I'll ultimately need to find the value for the constant $k$ which causes the nontrivial solution to vanish for both $x=0$ and $x=\infty$. What method should I use to solve this?
Frobenius Method cannot be applicable directly so tansform the ODE using $y(x)=xe^{x/2} z(x)$ then $$y''-(1/4+k/x)y=0 \implies x z''(x)+(2-x)~z(x)-(1+k)~z(x)=0.$$ Now Frob' method cann be applied. Also the z equation is Confluent Hyper geometric equation: $$zW''+(b-ax)W'-W=0 \implies W=A M(a,b,x)+ B U(a,b,x),$$ $M$ and $W$ are spoecial Kummer functions. See
https://en.wikipedia.org/wiki/Confluent_hypergeometric_function So $$y(x)=x e^{-x/2} A M(1+k,2,x) + B U(1+k,2;x)$$ is the complete solution of the gien ODE. These solutions can also be written in term\ms of Lagurre Polynomials. See
https://en.wikipedia.org/wiki/Laguerre_polynomials