Values of $k$ for non-trivial solutions of the differential equation $y''-\left(\frac{1}{4}+\frac{k}{x}\right)y=0$ where $x$ is non-negative I attempted a power series solution of this equation in order to find the values of k that have a non-trivial solution:
$y''-\left(\dfrac{1}{4}+\dfrac{k}{x}\right)y=0$
I am having trouble constructing the final form of the solution. I have found the following relations:
$a_0=8a_2$
$a_{n+2}=\dfrac{\dfrac{a_n}{4}+ka_{n+1}}{(n+2)(n+1)}$
How do I proceed to construct a general solution that will reveal which values of $k$ give a nontrivial solution that will vanish at $x=0$ and $x=\infty$ ?
 A: When $k=0$ , the ODE becomes $y''-\dfrac{y}{4}=0$ and the general solution is obviously $y=C_1e^\frac{x}{2}+C_2e^{-\frac{x}{2}}$
When $k\neq0$ , the ODE becomes $y''-\left(\dfrac{1}{4}+\dfrac{k}{x}\right)y=0$
$4xy''-(x+4k)y=0$
Let $y=\int_Ce^{xs}K(s)~ds$ ,
Then $4x(\int_Ce^{xs}K(s)~ds)''-(x+4k)\int_Ce^{xs}K(s)~ds=0$
$4x\int_Cs^2e^{xs}K(s)~ds-(x+4k)\int_Ce^{xs}K(s)~ds=0$
$\int_C(4s^2-1)e^{xs}K(s)~d(xs)+4k\int_Ce^{xs}K(s)~ds=0$
$\int_C(4s^2-1)K(s)~d(e^{xs})+4k\int_Ce^{xs}K(s)~ds=0$
$\left[(4s^2-1)e^{xs}K(s)\right]_C-\int_Ce^{xs}~d((4s^2-1)K(s))+4k\int_Ce^{xs}K(s)~ds=0$
$\left[(4s^2-1)e^{xs}K(s)\right]_C-\int_Ce^{xs}((4s^2-1)K'(s)+8sK(s))~ds+4k\int_Ce^{xs}K(s)~ds=0$
$\left[(4s^2-1)e^{xs}K(s)\right]_C-\int_Ce^{xs}((4s^2-1)K'(s)+(8s-4k)K(s))~ds=0$
$\therefore(4s^2-1)K'(s)+(8s-4k)K(s)=0$
$(2s+1)(2s-1)K'(s)=(4k-8s)K(s)$
$\dfrac{K'(s)}{K(s)}=\dfrac{4k-8s}{(2s+1)(2s-1)}$
$\dfrac{K'(s)}{K(s)}=\dfrac{2k-2}{2s-1}-\dfrac{2k+2}{2s+1}$
$\int\dfrac{K'(s)}{K(s)}ds=\int\left(\dfrac{2k-2}{2s-1}-\dfrac{2k+2}{2s+1}\right)ds$
$\ln K(s)=(k-1)\ln(2s-1)-(k+1)\ln(2s+1)+c_1$
$K(s)=c(2s-1)^{k-1}(2s+1)^{-k-1}$
$\therefore y=\int_Cc(2s-1)^{k-1}(2s+1)^{-k-1}e^{xs}~ds$
But since the above procedure in fact suitable for any complex number $s$ ,
$\therefore y_n=\int_{a_n}^{b_n}c_n(2k_nt-1)^{k-1}(2k_nt+1)^{-k-1}e^{xk_nt}~d(k_nt)=k_nc_n\int_{a_n}^{b_n}(2k_nt-1)^{k-1}(2k_nt+1)^{-k-1}e^{k_nxt}~dt$
For some $x$-independent real number choices of $a_n$ and $b_n$ and $x$-independent complex number choices of $k_n$ such that:
$\lim\limits_{t\to a_n}(2k_nt-1)^k(2k_nt+1)^{-k}e^{k_nxt}=\lim\limits_{t\to b_n}(2k_nt-1)^k(2k_nt+1)^{-k}e^{k_nxt}$
$\int_{a_n}^{b_n}(2k_nt-1)^{k-1}(2k_nt+1)^{-k-1}e^{k_nxt}~dt$ converges
A: The solution above does not answer the question.  It just laplace transforms the ODE but does not tell you which values of k.  There is a particular range of values, thus we need to solve this problem.
The solution above is correct, but the inversion integral is not easy to worth with for this particular example.  The inversion integral obtained from Laplace transform is one with branch cuts.  Of course you can read off the solutions easily from the inversion integral for integer values of k (no branch cuts), however for example: k=-1/2, -3/7, etc the integral will be more difficult to evaluate.  Of course, laplace transform is just the continuous analog of a power series, but yet's use the series approach.  Now I will provide a solution to
\begin{equation}
 y''(x)-\bigg(\frac{1}{4}+\frac{\kappa}{x}\bigg)y(x)=0 , \ 0 \leq \kappa < \infty.
 \end{equation}
 I will use a power series solution.  We know that $y(0)=0$ and that the solution must vanish in the limit $x\to\infty$.  Thus we will use a power series solution of the form 
 \begin{equation}
 y(x)={e^{-\alpha x}}\sum_{n=1}^{\infty} a_n x^n
 \end{equation}
 where $\alpha$ will be determine from analyzing the power series recurrence relation.  The sum goes to infinity HOWEVER we will truncate it at some upper bound, call it N since we do not want the polynomial $t^n$ growing to infinity. The sum starts at $n=1$ since if it started at $n=0$ the first term of the expansion would be $\sim a_0$, however we want it to be zero.  We now calculate derivatives needed to plug into the ODE.   We obtain
 $$
 y'(x)=-\alpha e^{-\alpha x}\sum_{n=1}^{\infty}a_nx^n+e^{-\alpha x} \sum_{n=1}^{\infty}na_n x^{n-1}=-\alpha y(x) +e^{-\alpha x}\sum_{n=1}^{\infty}n a_n x^{n-1}
 $$
 $$
 y''(x)=\alpha^2 e^{-\alpha x}\sum_{n=1}^{\infty}a_nx^n-2\alpha e^{-\alpha x} \sum_{n=1}^{\infty}na_nx^{n-1}+e^{-\alpha x} \sum_{n=1}^{\infty}n(n+1)a_{n}x^{n-2}.
 $$
Now we use the second derivative to plug into ODE, we obtain
 $$
 \alpha^2e^{-\alpha x}\sum_{n=1}^{\infty} a_n x^n-2\alpha e^{-\alpha x} \sum_{n=0}^{\infty} a_{n+1} (n+1) x^n + e^{-\alpha x }\sum_{n=0}^{\infty} a_{n+2} (n+1)(n+2) x^n-\frac{1}{4}e^{-\alpha x}\sum_{n=1}^{\infty}a_n x^n-\kappa e^{-\alpha x}\sum_{n=1}^{\infty}a_{n+1}x^n=0.
 $$
 Note, I shifted the sums that came from the first and second derivative.
 Now we clean up the terms by canelling out the exponentials and simplifying to obtain
 $$
 \big(\alpha^2-\frac{1}{4}\big)\sum_{n=1}^\infty a_n x^n-2\alpha\sum_{n=0}^{\infty}(n+1)a_{n+1}x^n+\sum_{n=0}^{\infty} a_{n+2} (n+1)(n+2) x^n-\kappa\sum_{n=0}^{\infty}a_{n+1} x^{n}=0.
 $$
 Now we can use the uniqueness of power series that the coefficient of each power of $x$ must vanish, thus we obtain a recurrence relation given by
 \begin{equation}
 (\alpha^2-\frac{1}{4})a_n-(2\alpha(n+1)+\kappa)a_{n+1}+(n+1)(n+2)a_{n+2}=0.
 \end{equation}
 We can easily see that the coefficient in front of $a_n$ vanishes by
 $$
 \alpha^2-\frac{1}{4}=0, \ \to \alpha=\frac{1}{2}.
 $$
 We know $\alpha$ is positive since if it takes the value $-1/2$ than the power series solution diverges for large x, which is exactly what we do not want.   Analyzing the other two terms in recurrence relation above and plugging in $\alpha=1/2$ we obtain the relation
 \begin{equation}
 a_{n+2}=\frac{(n+1)+\kappa}{(n+1)(n+2)}a_{n+1}.
 \end{equation}
Since we know that the power series must terminate to gaurantee that our solutions are normalizable, there must be some highest value of n such that the recurision relation gives $a_{n+2}=0$.  Setting the above relation to zero and obtain
\begin{equation}
 a_{n+2}=\frac{(n+1)+\kappa}{(n+1)(n+2)}a_{n+1}=0, \ \to {\boxed{\kappa = -(n+1),  n=0,1,2,...}}
\end{equation}
Thus this shows that $\kappa$ can only take negative integer values ($\kappa \leq -1$) in order to give a non trivial solution that vanishes at both $x=0$ and in the limit $x\to\infty$.  An alternative method to this problem is using Laplace transforms.  The difficult we run across when using Laplace transforms is that the inversion integral (inverse laplace transform) is a contour integral that is difficult to evaluate for fractional values of $\kappa$, thus I used the power series method instead.  
