1
$\begingroup$

I can't figure out why Mathematica is returning the incorrect roots. The first five should be 2.9496,5.84113,8.87273,11,9561, and 15.0624 according to my textbook.

Clear[x]
Plot[3 BesselJ[1, x] + x D[BesselJ[1, x]], {x, 0, 15}]

enter image description here

FindInstance[{BesselJ[1, x] + x D[BesselJ[1, x]] == 0, x >= 0, 
  x < 16}, x, 10]

{{x -> Root[{BesselJ[1, #1] + BesselJ[1, #1] #1 &, 3.83170597020751231561443588631}]}, {x -> Root[{BesselJ[1, #1] + BesselJ[1, #1] #1 &, 7.01558666981561875353704998148}]}, {x -> Root[{BesselJ[1, #1] + BesselJ[1, #1] #1 &, 10.17346813506272207718571177678}]}, {x -> Root[{BesselJ[1, #1] + BesselJ[1, #1] #1 &, 13.32369193631422303239368412695}]}}

I tried previous posts 1, 2 with the same problem with the same result, making me think it's not the bug in RootFind of bessel, but something else like the textbook was wrong or I'm not inputting the equation correctly.

Zeros[x_] = BesselJ[1, x] + x D[BesselJ[1, x]];
(zeros = First@
    Last@Reap@
      Quiet@NDSolve[{y'[x] == Zeros'[x], y[0] == Zeros[0], 
         WhenEvent[y[x] == 0, Sow[FindRoot[Zeros[z], {z, x}]]]}, 
        y, {x, 0, 40}, AccuracyGoal -> 1, 
        PrecisionGoal -> 1]) // AbsoluteTiming

{0.0392937, {{z -> 3.83171}, {z -> 7.01559}, {z -> 10.1735}, {z -> 13.3237}, {z -> 16.4706}, {z -> 19.6159}, {z -> 22.7601}, {z -> 25.9037}, {z -> 29.0468}, {z -> 32.1897}, {z -> 35.3323}, {z -> 38.4748}}}

FindRoot has the same result:

FindRoot[{BesselJ[1, x] + x D[BesselJ[1, x]] == 0}, {x, 3}]

{x -> 3.83171}

$\endgroup$

closed as off-topic by gpap, MarcoB, user9660, Yves Klett, Sumit May 3 '16 at 13:12

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – gpap, MarcoB, Community, Yves Klett, Sumit
If this question can be reworded to fit the rules in the help center, please edit the question.

6
$\begingroup$

It will work perfectly once you write it correctly

x /. NSolve[{3 BesselJ[1, x] + x D[BesselJ[1, x], x] == 0, 16 > x >= 0}, x]

{2.9496, 5.84113, 8.87273, 11.9561, 15.0624}

You made a mistake when you write D[BesselJ[1, x]] and also you are missing 3 in first term.

$\endgroup$