0
$\begingroup$

Roots by Normal Method:

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

Which GIVES-

(C[1] \[Element] Integers && x == -2 ArcTan[1 - Sqrt[2]] + 2 \[Pi] C[1]) || 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]

enter image description here

Ques is: Why Both Curves are not intersecting at x=-5, -6 ?, Why Contour plot missed out these two roots ?

$\endgroup$
  • 1
    $\begingroup$ 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 $\endgroup$ – Lukas Lang Jul 9 at 8:31
  • $\begingroup$ @LukasLang, Yes!, Thanks, Any Resolution? $\endgroup$ – math Jul 9 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.