# Generating exercises about extrema of $f(x,y)$

(I have asked this question on math.stackexchange.com and according to a suggestion from comments I am re-asking it here.)

I can generate many examples of functions $$f(x,y)$$ for which finding local extrema is a good exercise for students, for example $$f(x,y)=x^3+y^3−3xy$$, $$f(x,y)=x^3+3xy^2−51x−24y$$, $$f(x,y)=xy+\ln y+x^2$$. The general idea of solving them is to obtain a polynomial of a small degree, for which the roots are easy to obtain, because, e.g., some of them are integer or rational. However, I do not know how to obtain nontrivial, i.e., not of the type $$f(x,y)=(x−a)^2+(y−b)^2$$, examples of functions with previously known extrema.

A long time ago I found a simple rule for memorizing the values of $$\sin x$$ for $$x\in\{π/6,π/4,π/3,π/2\}$$. I did not believe that it is not generally known. Indeed, many years later I found this observation in a written source.

In this case, I also believe that the mathematical society knows the general rules of generating many examples of easy but not trivial exercises, only I do not know them. Are such rules known to you?

• You can try expressions of the kind $f(x)/[(y-g(x))^2+1]$ where $f$ and $g$ are functions such that the curve $y=g(x)$ contains your desired points and $f$ has maxima/minima at their $x$-coordinates. If the maximum of $f$ is positive, it becomes a local maximum and if it is negative, you get a saddle, and the similar story happens with the minima. Actually, it is by itself a good problem for students to design a smooth function with prescribed local maxima, minima, and saddle points. The formula I suggested is one of the easy options but I'm sure that one can get more inventive. Commented Jun 7, 2022 at 22:07
• @fedja Thank you. It seems to be a good answer, not only a comment. Commented Jun 9, 2022 at 3:46