Solution of a differential equation with non constant coefficients I would like to solve the following differential equation in the unknown $v(r)$:
$$\frac{d^2v}{d r^2}+\frac{2}{r}\frac{d v}{d r}+\left(\frac{\omega^2}{c^2}-\frac{2}{r^2}\right)v+f(r)=0$$ 
in the domain $R_1<r<R_2$ ($R_1>0$ and $R_2>0$).
$\omega,c\in\mathbb{R}$, while $f(r)$ is a regular function on r.
How can I find 2 independent solutions of the homogeneous equation? 
Afterward, can I use the variation of constants method to find the general solution of the differential equation?
 A: We have
\begin{align*}
\frac{d^2v}{d r^2}+\frac{2}{r}\frac{d v}{d r}+\left(\frac{\omega^2}{c^2}-\frac{2}{r^2}\right)v+f(r)&=0 \\
r^2\frac{d^2v}{d r^2}+2r\,\frac{d v}{d r}+\left(\frac{\omega^2r^2}{c^2}-2\right)v&=-r^2f(r). \\
\end{align*}
This is exactly the spherical Bessel differential equation, with $n=1$ and $k=\omega/c.$ The solution to the homogeneous equation is therefore
$$v_h(r)=c_1\, j_1\!\left(\frac{\omega r}{c}\right)+c_2\,y_1\!\left(\frac{\omega r}{c}\right). $$
Variation of parameters to get the full general solution is rather difficult. It's going to involve integrals with $f$ inside. Mathematica yields
\begin{align*}
v(r)&= j_1\!\left(\frac{r \omega}{c}\right) \int _1^r\frac{\omega f(s)
   \,s^2 \,y_1\!\left(\frac{\omega
   s}{c}\right)}{c}\,ds\\
&-y_1\!\left(\frac{r \omega}{c}\right)
   \int _1^r\frac{\omega f(t)\, t^2 \,j_1\!\left(\frac{\omega
   t}{c}\right)}{c}\,dt\\
&+c_1 \,j_1\!\left(\frac{r
   \omega}{c}\right)+c_2 \,y_1\!\left(\frac{r \omega}{c}\right). 
\end{align*}
So you can see that it's rather like Fourier analysis - this is the pattern you often get with special functions, if they are orthogonal.
