# Finding Real root with Library functions

HW[m_] = m ( EllipticK[ 1/m^2] - EllipticE [1/m^2]) ;
Rad[m_] = m - Sqrt[m^2 - 1] ;
Plot[{HW[m], Rad[m], 0}, {m, 1.01, 6},
PlotLabel -> "HW > Rad_ immer" , GridLines -> Automatic,
PlotStyle -> Thick]
FindRoot[HW[m] == 1.5 Rad[m] , {m, 3 - .05 I}]


The functions plot real values alright.However they do not together iterate well enough as above. What accuracy and initial value is to be supplied/perturbed?

If you start with another inital value for m, it works flawlessly:

FindRoot[HW[m] == 1.5 Rad[m], {m, -1.1}]
(* {m -> -1.02646} *)


For some ms, e.g. -1.3, you might get miniscule imaginary parts due to the floating point operations involved, which can be cut off like so:

FindRoot[HW[m] == 1.5 Rad[m], {m, -1.3}] // Chop
(* {m -> -1.02646} *)


Besides: I would suggest using SetDelayed instead of Set for your functions like so:

HW[m_] := m (EllipticK[1/m^2] - EllipticE[1/m^2]);
Rad[m_] := m - Sqrt[m^2 - 1];


and maybe change your Plot command to

Plot[{HW[m], Rad[m]}, {m, 1.01, 6}, PlotLabel -> "HW > Rad_ immer",
PlotStyle -> Thick, AxesOrigin -> {1, 0}]


sparing you the hassle of having to add the constant 0 into the diagram.

• Thanks. I wanted positive $m$ only. However,just after posting I plotted ratio HW[m]/Rad[m] to find that it tends asymptotically to $\pi/2$, which could not be readily judged looking at separate graphs :) Mar 21 '15 at 16:01
• @Narasimham: You're welcome! Mar 21 '15 at 16:11