Clear[m, M, g]; 
    mat := {{2*g - m*x, -2*Cos[k]}, {-2*Cos[k], 
          2*g - M*x}}

MatrixForm[mat]

sol := Solve[Det[mat] == 0, x]

sol

fig := 
      Plot[{Sqrt[x] /. sol[[1]], 
          Sqrt[x] /. sol[[2]]}, {k, -(Pi/2), Pi/2}, 
        PlotStyle -> {RGBColor[1, 0, 0], RGBColor[0, 0, 1]}]

disp := Display["t.ps", #1, "EPS"] &

g = 1; m = 1;

M = 1;  fig

M = 2;  fig

M =  .5;  fig

plo:=Plot[
        Abs[2  Sin[k/2]],  {k, -2 Pi, 
          2  Pi}]

M = 1;  Show[fig,  plo]