# Creating a For Loop for a equation that has many solutions [duplicate]

I have two equations like these. I want to create a for loop that gives to me all intersection points of the two equations. How can I do that?

 Plot[{x*BesselJ[1, x]*BesselK[0, Sqrt[
22.295^2 - x^2]]/(BesselJ[0, x]*
BesselK[1, Sqrt[22.295^2 - x^2]]), Sqrt[22.295^2 - x^2]}, {x, 0,
23}] • Function findAllRoots described in this answer does the job in OP problem. – Pinti Apr 18 '17 at 8:02
• Also this: mathematica.stackexchange.com/q/5663/12 – Szabolcs Apr 18 '17 at 8:18
• Use BesselJZero to generate starting points for FindRoot . – LouisB Apr 18 '17 at 8:52
• @Pinti It also returns several "fake roots". – Szabolcs Apr 18 '17 at 10:20

try this

NSolve[{x*BesselJ[1, x]*
BesselK[0,
Sqrt[22.295^2 - x^2]]/(BesselJ[0, x]*
BesselK[1, Sqrt[22.295^2 - x^2]]) - Sqrt[22.295^2 - x^2]} ==
0 && 0 < x < 23, x]


{{x -> 2.30141}, {x -> 5.28092}, {x -> 8.27351}, {x -> 14.2381}, {x -> 17.1905}, {x -> 20.0892}}

EDIT

there is one more root x->11,2619

• I meant the root near 11.2619479668904. – Szabolcs Apr 18 '17 at 10:17
• Reduce does seem to work. It gives a warning that it couldn't prove that all roots were returned, but none seem to be missing: Reduce[x*BesselJ[1, x]* BesselK[0, Sqrt[22.295^2 - x^2]]/(BesselJ[0, x]* BesselK[1, Sqrt[22.295^2 - x^2]]) - Sqrt[22.295^2 - x^2] == 0 && 0 < x < 23, x] – Szabolcs Apr 18 '17 at 10:19