# Why do all the Roots not show up in ContourPlot of an equation?

Roots by Normal Method:

  f[x_] := (Sin[x] + Cos[x] - Sqrt) Sqrt[-11 x - x^2 - 30];
Reduce[(Sin[x] + Cos[x] - Sqrt) Sqrt[-11 x - x^2 - 30] == 0, x]


Which GIVES-

(C \[Element] Integers && x == -2 ArcTan[1 - Sqrt] + 2 \[Pi] C) || x == -6 || x == -5

Roots by Contour Plot:

Suppose we have a function $$f(z)$$, we can write it as following,

$$f(z)\Rightarrow f(x+iy)= g(x,y)+ i h(x,y)$$

Then roots of $$f$$ can be obtained by equating $$g$$ and $$h$$ to zero separately, and Common root(s) of $$g$$ and $$h$$ will be the root(s) of $$f.$$ Here I am doing it-

  funn0[z_] := f[z];
gun0[x_, y_] := funn0[x + I*y];
rgun0[x_, y_] := Re[gun0[x, y]];
igun0[x_, y_] := Im[gun0[x, y]];
p2 = ContourPlot[{rgun0[x, y] == 0, igun0[x, y] == 0}, {x, -9, 0}, {y, -5, 5}, ContourStyle -> {Red, {Dashed, Blue}, Black, Black}, MaxRecursion -> 5] Ques is: Why Both Curves are not intersecting at x=-5, -6 ?, Why Contour plot missed out these two roots ?

• Look at Plot[rgun0[-5, x], {x, -5, 5}, MaxRecursion -> 10] - the problem is that along the imaginary axis, the real part does not cross 0, so it is very hard for ContourPlot to see the contour along the real axis. I tried to increase PlotPoints, but I couldn't find a value that works. You can also look at ContourPlot[rgun0[x, y], {x, -9, 0}, {y, -5, 5}, MaxRecursion -> 5] to see that ContourPlot does indeed have problems along the real axis – Lukas Lang Jul 9 at 8:31
• @LukasLang, Yes!, Thanks, Any Resolution? – math Jul 9 at 8:39