# Use FindRoot to get the root with minimum imaginary part

For example, define

test[z_] := Cosh[0.5132928614530164 z] + 0.5934823341977118 Sinh[0.5132928614530164 z]


And

FindRoot[test[z], {z, 0.3 I}]


The reslut is {z -> -1.33067 + 9.1807 I} .

But if

FindRoot[test[z], {z, 0.5 I}]


The result is {z -> -1.33067 + 3.06023 I}

Why a larger start point in FindRoot gives a smaller root? (larger or smaller are both refer to the imaginary part)

How can I get the root with the minimum positive imaginary part? (Actually there are infinite roots for test[z] with different imaginary part.)

In this example, how can I make sure my result is 3.06023I? What if test[z] takes other forms and parameters?

## 1 Answer

To find an appropriate range we first try:

test[x_, y_] :=  Cosh[0.5132928614530164 (x + I y)] +
0.5934823341977118 Sinh[0.5132928614530164 (x + I y)]

ContourPlot[Abs@test[x, y], {x, -6, 3}, {y, -10, 10}] and we see that the first minima is between I and 5 I

So we try next:

nm = NMinimize[{y, Abs@test[x, y] == 0 && y > 1}, {x, y}]
(* {3.06023, {x -> -1.33067, y -> 3.06023}} *)


Check:

Plot[Abs@test[x /. nm[], y], {y, 2, 10}, AxesOrigin -> {0, 0}] • That's supposed to be test[x + I y], right? (In which case, we replace Norm[] with Abs[].) – J. M.'s torpor Jun 2 '15 at 6:59
• @Guesswhoitis. It was late at night, you know :) – Dr. belisarius Jun 2 '15 at 12:57
• Excused. :D Previously I've also goofed by posting when I should be sleeping, too. – J. M.'s torpor Jun 2 '15 at 13:02