Oh , I remember that if the refractive index only varies with y ,
there is a relation :
therefore , It is very easy to get it !
But if N is a fucntion of and ,
i think using this calculus of variations is better and i want to ask one more question : How can we generalize it in polar coordinates ???