can anyone know code for maxima and minima of function of two variables

Could you be a little more specific about your question? Here is a guide about properly making R related questions.