# 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 ?

## marked as duplicate by J. M. is away♦ plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Mar 16 at 6:35

• Please try the solutions in the linked thread, after simplifying your equation to $2x\cos x=(6.4x^2-0.1563)\sin x$. – J. M. is away Mar 16 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$. – Roman Mar 16 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.$ – Indrasis Mitra Mar 16 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][] (it's a Root object). To get an explicit formula, use Y[n_] = Normal[Series[X[n], {n, ∞, 3}]]. – Roman Mar 16 at 9:09
• For general $K$, $L$, $h$ this recipe is c[x_] = Normal[Series[2 Cot[x], {x, 0, 1}]] (or higher-order if desired) followed by the approximate root definition X[{k_, L_, h_}, n_] = Assuming[k > 0 && L > 0 && h > 0, x /. Solve[c[x - n π] == (k x)/(h L) - (h L)/(k x), x, Reals][] // Refine]. This gives Y[{k_, L_, h_}, n_] = Normal[Series[X[n], {n,∞, 1}]] the result n π + (2 h L)/(k n π). If you're patient you can get higher-order approximations with this prescription. – Roman Mar 16 at 9:34

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 – Indrasis Mitra Mar 16 at 9:44
• @IndrasisMitra, my pleasure. Thank you for the accept. – kglr Mar 16 at 9:47