This question already has an answer here:

Roots of fluctuating function (p,q real) needed to evaluate eigenvalues of

$$ y(x) = \dfrac{\sin px }{p} + \dfrac {\sin q x }{q} =0 ...(1*) $$

form a real and complex infinite set. The way to capture/collect them all in a defined interval seems (to me) involved with uncertainties of sequentially ordering them through straight algorithmic procedures.( Referring to the first tangent intersection of Newton-Raphson straying off way too far).

In a proposed workaround since in Rootfinding,its derivatives are anyways involved together ..

Does it in someway shorten/speed up /facilitate/ improve calculation efficiency of the procedure if instead we choose to NDSolve that associates derivatives of the functions?

In this particular case

$$ y^{''} + q^2 y + \sin p x \cdot( p^2- q^2) /p =0 ...(2*) $$ which is same as

$$ y^{''} + p^2 y - \sin q x \cdot( p^2- q^2) /q = 0 $$

Implied advantage is,ready availability of successive derivative algorithms associated with solution of differential equations.


Is it easier/effective to attempt to find all roots for the straight closed form $y(x) $ in (1*), or to try to find solutions for the derived ODE function (2*)?


marked as duplicate by Jens, Community Mar 21 '15 at 16:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ I'm not sure if I'm following you. Could you explain further? $\endgroup$ – Dr. belisarius Mar 17 '15 at 13:46
  • $\begingroup$ I'm sure I'm not following. Do p and q have numerical values? If not, what does it mean to find solutions in an interval? $\endgroup$ – Daniel Lichtblau Mar 21 '15 at 12:52
  • 1
    $\begingroup$ It seems you're saying that this doesn't work satisfactorily: With[{p = 12, q = 5, a = 0, b = 5}, NSolve[{Sin[p x]/p + Sin[q x]/q == 0, a <= Re[x] <= b}, x]] But it seems ok to me. Or perhaps your question is about the mathematics (numerics) of equation solving? Then you should ask on a different site. $\endgroup$ – Michael E2 Mar 21 '15 at 13:32
  • $\begingroup$ @ DanielLichtblau ; p = 0.756 ; q = 1.12; Plot[Sin[ p x]/p + Sin[q x]/q, {x, 0, 70}] There are 16 real roots and complex roots with real part near to 9, 26, 44, 60 . Can we get them all in a table? $\endgroup$ – Narasimham Mar 21 '15 at 14:01
  • 2
    $\begingroup$ @MichaelE2 For real roots one can use event handling in NDSolve (but you probably knew that). For complex roots? Maybe set up as PDE using CR equations, with event handlers involving real and imaginary parts? It would be interesting to know if there is an approach along those or other NDSolve lines. $\endgroup$ – Daniel Lichtblau Mar 21 '15 at 15:31