May 7th, 2011, 12:36 am
Truly, the easiest way is to buy Mathematica, where it is a built-in.If I _had_ to code it myself, I would attempt something like this.First, look up the asymptotic large x expression for J_n(x) inAbramowitz and Stegun; it is proportional to a simple cos(...); the k-th zero of the cos(...) is trivially found at(*) x_k = [(2 k -1)/2 + n/2 + 1/4] pi, (k=1,2,...)For n small, these can be remarkably accurate, even for low order zeros.For example, for J_0(x), the first 5 approximate zeros are at{2.35619, 5.49779, 8.63938, 11.781, 14.9226} Now, the exact first 5 zeros are(**) {2.40483, 5.52008, 8.65373, 11.7915, 14.9309}For n=0, the asymptotic zero is so close to the exact, that a simple Newton's method root finder,started at any element of (*) will rapidly converge to the corresponding exact value of (**). For larger n, the lowest order roots are not so well-approximated, so this may require somefine-tuning to make sure the Newton's method routine picks up all the correct roots.
Last edited by
Alan on May 6th, 2011, 10:00 pm, edited 1 time in total.