This Lagrange multiplier does go to infinity to keep
$\lambda \cdot \cos(x \cdot y) = 1/2$. What I mean is that this procedure of
$\alpha \rightarrow 1$ is always going to give two solutions from your problem, no matter how close
$\alpha$ to
$1$. In particular, the following two statements are identical (
$\epsilon$ and
$\zeta$ are positive and we confine
$x \cdot y \in \{0, 2 \pi \}$ here):
- find min
$x^2 + y^2 $ s.t.
$\sin(x \cdot y ) = 1 -\epsilon, \epsilon \rightarrow 0$
- find min
$x^2 + y^2 $ s.t.
$x \cdot y = \pi/2 \pm \zeta, \zeta \rightarrow 0$
while in the second statement we have two constraint surfaces, though they may be very close. The two points found by the Lagrange multiplier are not on a simply connected path on the constraint surface, I believe that this makes this problem special.
I prefer to use NMinimize
to deal with this case. It seems that this function has an option, SimulateAnnealing
, that handles this discrete domain very well. You can give it a shot (the solver starts from the red point and it end at the blue point in the contour plot):
res2 = Reap@
NMinimize[{x^2 + y^2, Sin[xy] == 1}, {x, y},
EvaluationMonitor :> Sow[{x, y}], Method -> "SimulatedAnnealing"];
start = res2[[2, 1, 1]]
end = res2[[2, 1, -1]]
