# Finding all positive roots of a transcendental equation [duplicate]

I need to find all positive roots of the following transcendental equation

2*cot(x) = 6.4*x-0.1563/x

I know that the roots can be visualised as the intersecting point of the y=LHS and y=RHS curves

Is there any way, I can obtain say the first 20 roots of this equation and obtain their values ?

• Please try the solutions in the linked thread, after simplifying your equation to $2x\cos x=(6.4x^2-0.1563)\sin x$. Commented Mar 16, 2019 at 6:37
• Not quite a duplicate as in this case the roots are distributed very regularly, $x_n\approx (n - 1)\pi + 5/(16 \pi n)$, and a simple FindRoot can be used with this approximation as a starting point. In this way we're not missing any roots, even for very large $n$. Commented Mar 16, 2019 at 7:16
• @Roman Your comment where you write an approximate relation for occurence of the roots ,makes me wonder if some sort of approximate $x_n$ can be written if the actual equation is of the form $2\cot(x) = \frac{Kx}{hL} - \frac{hL}{Kx}$ . I wrote the equation in the original question for the parameter values $K=16,L=0.25,h=10.$ Commented Mar 16, 2019 at 8:56
• Yes, you can do the following with any $K$, $L$, $h$. Define a series expansion c[x_] = Normal[Series[2 Cot[x], {x, 0, 3}]] (or any desired polynomial order), then a good approximation to the $n$th root (counting from $n=0$) is X[n_] = x /. Solve[c[x - n π] == 32 x/5 - 1563/(10000 x), x, Reals][[3]] (it's a Root object). To get an explicit formula, use Y[n_] = Normal[Series[X[n], {n, ∞, 3}]]. Commented Mar 16, 2019 at 9:09
• That's almost four years old; probably things have changed. Commented May 24, 2020 at 14:59

roots = Sort[x /.
NSolve[{2*Cot[x] == Rationalize[6.4] x - Rationalize[0.1563]/x, 60 > x > 0}, x, Reals]];


{0.551848, 3.23803, 6.33252, 9.45782, 12.5912, 15.7278, 18.8661, 22.0053, 25.1452, 28.2854, 31.4259, 34.5666, 37.7074, 40.8484, 43.9894, 47.1305, 50.2717, 53.4129, 56.5542, 59.6955}

Plot[{2*Cot[x], 6.4 x - 0.1563/x}, {x, 0, Last[roots] + 1},
PlotPoints -> 100, MaxRecursion -> 7,
Epilog -> {PointSize[Large], Red, Point[{#, 6.4 # - 0.1563/#} & /@ roots]}]


• Thanks for the detailed answer Commented Mar 16, 2019 at 9:44
• @IndrasisMitra, my pleasure. Thank you for the accept.
– kglr
Commented Mar 16, 2019 at 9:47