# How to solve or plot roots of the equation involves Bessel function of first and second kind?

Here is my equation

x^2 + BesselJ[m,k*x^2]*x + k*BesselK[m,k]==0.


I would like to solve this equation for different initial guesses of x_0 like x_0 = 1,2 etc, where m is a constant, and is 2, (m =2) and k is a variable in the range of 1 to 5.

Here I want to plot the roots of x over a range of k (from 1 to 5).

• Check out FindRoot Nov 5 '15 at 7:16
• The answers below both note the lack of real roots. There may be complex roots, but you'll need to do some more work... but, how exactly did you encounter this function? Nov 5 '15 at 8:18

If you plot the left-hand part of your equation for m=2 and play with the kvalues:

 Manipulate[
Plot[x^2 + BesselJ[m, k*x^2]*x + k*BesselK[m, k], {x, -5, 5},
PlotRange -> {0, pr}],
{k, 0.1, 5}, {pr, 0.1, 5}]


you will see something like this

and playing with the PlotRange fixed by pryou will see that the equation is likely to have no solutions, at least in the range of parameters I have chosen. So the question to answer here is, if this equation has any solution at all.

Have fun!

• It is an equation which we arrived after solving few equations and we are looking for its solutions. I am not interested in using manipulating solution plot, I just want to find a root by giving an initial guess to x. Nov 5 '15 at 8:49
• @Vemula Ramakrishna Reddy You probably did not understand me. It is not manipulation that I demonstrate, but manipulation helps one to make sure that your equation likely has no solutions. Or at least I would make a special search for conditions at which such a solution might exist. Nov 5 '15 at 10:12
• Dear Alexei Boulbitch, thank you for your valuable help. I just want to ask you one thing can I collect roots of this equation, hope it has roots. Can you tell me how to solve this one using NSolve numerically Nov 6 '15 at 7:34
• @Vemula Ramakrishna Reddy NSolve  has nothing to do with your equation. You may use FindRoot  to look for numerical solutions. The latter, however, requires an initial guess as an input. To give such, it would be useful to know, where approximately lies the root. For that you typically plot the left-hand part of the equation and see where does it cross the x axis. That's what I did above. As I see at k<=5 it does not. I would check for larger k at your place. Further, I see that the point of minimum of the left-hand part is at r=0. See the continuation Nov 6 '15 at 8:14
• Continuation: Then I would check at which k this point touches the Ox axis. This yields the following equation: D[x^2 + BesselJ[m, k*x^2]*x + k*BesselK[m, k], x] == 0 // FullSimplify . It should be solved together with your original one. Usually, this is easier than to solve the original one. Judging by eye, the minimum point is at x=0. If so, you do not need to use the second equation, but simply substitute x=0 into the first one. This yields k BesselK[2, k]  which is positive at any k. So this also tells me that there is likely to be no solution. Nov 6 '15 at 8:23

By varying the controls, from the Plot you can see that there are no real roots in the interval.

Manipulate[
f[m_, k_, x_] = x^2 + BesselJ[m, k*x^2] x + k BesselK[m, k];
Column[{
NMinimize[{f[m, k, x], 0 <= x <= 5}, x],
Plot[f[m, k, x], {x, 0, 5}]}],
{{m, 2}, Range[0, 5]},
{{k, 5}, 1, 5, Appearance -> "Labeled"}]