I am trying to solve the equation below with DSolve. The equation is that of a wave, expected to fall off exponentially as r approaches infinity. The solution is a combination of Spherical Bessel functions, which is great! However, I am unable to obtain a plot of the solution after multiple tries with various ranges of r. Any suggestions will be appreciated.
sol = DSolve[{-w^2 f[r] + f''[r] + 2/r f'[r] - 2/r^2 f[r] == 0,
f[10^5] == 0, f'[10^5] == 1}, f, {r, 10^3, 10^5}]
test = Plot[{Evaluate[f[r] /. sol /. w -> 0.05 ]}, {r, 1*10^3,
1*10^5}, PlotRange -> {-10, 10}]
FunctionExpand
, which rewrites the spherical Bessel functions:DSolve[{-w^2 f[r] + f''[r] + 2/r f'[r] - 2/r^2 f[r] == 0, f[10^5] == 0, f'[10^5] == 1}, f[r], r] // FunctionExpand // TrigToExp // FullSimplify
. More generally,DSolve[-w^2 f[r] + f''[r] + 2/r f'[r] - 2/r^2 f[r] == 0, f[r], r] // FunctionExpand
gives you the solution for arbitrary boundary conditions. $\endgroup$ – Roman Jan 9 '19 at 22:31