# ContourPlot, FindRoot

The ContourPlot[] of the below two equations demonstrates that there should be two solutions to them,

ContourPlot[{1 - u Log[Sqrt[(1 + u)^2 + v^2]/Sqrt[u^2 + v^2]] +
v (ArcTan[1 + u, v] - ArcTan[u, v]) ==
0.8371, -v Log[Sqrt[(1 + u)^2 + v^2]/Sqrt[u^2 + v^2]] -
u (ArcTan[1 + u, v] - ArcTan[u, v]) == 0}, {u, -2, 2}, {v, -2, 2}]

However, the FindRoot[] cannot find the solution lies on the left-hand plane,

FindRoot[{1 - u Log[Sqrt[(1 + u)^2 + v^2]/Sqrt[u^2 + v^2]] +
v (ArcTan[1 + u, v] - ArcTan[u, v]) ==
0.8371, -v Log[Sqrt[(1 + u)^2 + v^2]/Sqrt[u^2 + v^2]] -
u (ArcTan[1 + u, v] - ArcTan[u, v]) ==
0}, {u, -1, -0.001}, {v, -0.5, 0.5}]

Why doesn't FindRoot[] find the solution around {u, -0.571}, {v, 0.0001}?

• What is your question? Please always make the question clear and explicit. Commented Nov 2, 2016 at 10:25
• @Szabolcs Thanks for your attention. How can I find the solution which lies on the left-hand plane using the FindRoot? Commented Nov 2, 2016 at 10:29
• It is possible this has to do with ArcTan[] which has a removable continuity. Commented Nov 2, 2016 at 10:40
• @Szabolcs If in my question the number 0.8371 replaced by 1.1584, although the ContourPlot gives a specific diagram (there are one or two solutions), why does the FindRoot give different solutions for different ranges of u and v? What other method can I use instead of the FindRoot? Thanks for your attention. Commented Nov 5, 2016 at 16:53

This ContourPlot is misleading. Your second expression is not zero for $u<0$ and $v=0$. To understand what is going on, try putting in $u=-1/2$ and see how it changes with $v$.

Plot[-v Log[Sqrt[(1 + u)^2 + v^2]/Sqrt[u^2 + v^2]] -
u (ArcTan[1 + u, v] - ArcTan[u, v]) /. u -> -1/2 //
Evaluate, {v, -1, 1}]

As you can see, the expression never becomes zero. There is no solution to your equations for $u < 0$. This is why FindRoot cannot give consistent results.

In version 11, both Plot and ContourPlot got smarter about detecting this sort of thing symbolically and ContourPlot will produce this for the above expression:

• If in my question the number 0.8371 replaced by 1.1584, although the ContourPlot gives a specific diagram (there are one or two solutions), why does the FindRoot give different solutions for different ranges of u and v? What other method can I use instead of the FindRoot? Thanks for your attention. Commented Nov 5, 2016 at 12:12
• @anIdiot The solution from FindRoot is not always good. It uses numerical methods described here (second section). These methods have limitations, and may give fake results. Substitute these back to see how well they satisfy your equation. It turns out: not at all. Mathematica will give warnings about this (it did when I tried). Commented Nov 6, 2016 at 19:54
• Don't you think that the second expression can be zero for $u < 0$ and $v = 0$, but when $u < -1$? Commented Nov 7, 2016 at 10:45
• @anIdiot Clearly, you can analyse the situation for different $u$. I updated this question in response to your comments about why FindRoot gives inconsistent results here, and your comments on your deleted question from yesterday where you wouldn't accept that there is no solution in the point you showed because ContourPlot is showing one. That point was between $-1 < u <0$. Commented Nov 7, 2016 at 11:32