0

Consider the situation with this functions,

 F[mm_, q_] :=  NIntegrate[(q/2) * (x Tanh[π x]) *( ( (Coth[π q Sqrt[x^2 + mm] ]
                            )/Sqrt[ x^2 + mm] - Coth[π x])/x,
                {x, 0, ∞}] + (1/2) Tan[Sqrt[mm] π ]   ;

Plot[ F[mm, 2], {mm, 0, 1}]

Mathematica graphics

Looking at the graph it is clear that the function has roots in the range of $mm \in [0,1]$. But I am unable to use any of the root finding commands to get those numbers! Why are they not working here?


Also what are those vertical lines that the Mathematica is plotting here?

Sjoerd C. de Vries
  • 65,815
  • 14
  • 188
  • 323
user6818
  • 1,171
  • 1
  • 12
  • 27
  • 1
    Try changing the lhs of the function definition to F[mm_?NumericQ, q_], then use something like FindRoot[F[mm, 2], {mm, 0.1}]. See the User-defined functions, numerical approximation, and NumericQ answer on the what-are-the-most-common-pitfalls-awaiting-new-users question. – Sjoerd C. de Vries Mar 27 '14 at 23:12
  • 1
    p.s. just in case, vertical line is a plotting atrtifact and can be fixed by Exclusions or: , RegionFunction -> (Abs[#2] < 5 &) for example. – Kuba Mar 27 '14 at 23:28
  • @Kuba Thanks! So what do those vertical lines indicate? Can you kindly write the full command - as in where in the "Plot" function do I insert that? – user6818 Mar 28 '14 at 04:07
  • Plot[ F[mm, 2], {mm, 0, 1} , RegionFunction -> (Abs[#2] < 5 &)] – Kuba Mar 28 '14 at 09:02
  • @Kuba It removes the vertical line . But what does it really do mathematically? – user6818 Mar 28 '14 at 17:51
  • @user6818 Mathematica does not know if there is a singularity or something so it is assuming there is a continuity, and it joins the points. Try plotting Tan[x]. This option works this way: there are points above 5 and below -5 but our RegionFunction cuts them out (#2 stands for y) in context of plotting and will not try to join the outlayers, it knows there is something above. Am I clear? Because this comment looks like a mess :P – Kuba Mar 28 '14 at 18:05
  • @Kuba But is there a way to ask Mathematica is there is a singularity there? Like is there a way in which Mathematica can be asked to find out divergences in a function in a given interval? – user6818 Mar 29 '14 at 02:36
  • On example of Tan: NSolve[1/Tan[x] == 0 && .1 < x < 2, x], or FindRoot. – Kuba Mar 29 '14 at 07:58

0 Answers0