This problem is not really suited to the use of Lagrange multiplier techniques. The constraint leads to a family of circles of radius (don't forget the 2), for k = 0,1,2,...

On the first of those circles, when k=0 (actually a degenerate circle consisting of a single point at the origin), the function z takes its global minimum value 0. On the "k"-circle, z takes a local maximum value at the point , and a local minimum value at the point .

Not much of that information comes from the Lagrange method. In fact, at any point where the cosine function is equal to 1, the sine function vanishes. So equations (1) and (2) become x = y = 0, and the only extreme value that you get is the minimum at the origin.

If you want to use the Lagrange method, then I think you need to apply it separately to each constraint of the form .