So, do I understand correctly that you want to maximize the function
F(x,y) = \left(\frac{\partial f(x,y)}{\partial x}\right)^2 + \left(\frac{\partial f(x,y)}{\partial y}\right)^2 \; ?
If so, are you given any more information about the function ##f##, because as it stands, the problem is not particularly well-posed: it is possible to give functions ##f## for which your ##F(x,y)## has no maximum---not even any local maxima.
However, assuming the problem is well-posed, you can proceed in two ways: (i) directly, from the formula for ##F##; and (ii) using the conditions ##g_1(x,y,u,v) \equiv u - \partial f /\partial x = 0## and ##g_2(x,y,u,v) \equiv v - \partial f/ \partial y = 0## as constraints in the optimization of ##h(x,y,u,v) = u^2 + v^2## (with ##h## happening to not actually depend on ##x,y## at all!). That is where you could use the Lagrange multiplier method.