This is supposed to be a trivial problem but I have a poor background in NLP. Suppose $$f(x,y) = (x-2)(y-1) $$ Then I should find the maximum of $f$ over the convex polygon determined by the vertices $(2,1)$, $(2,4)$, $(4,2)$ and $(3,1)$.
Attempt: Writing out $f(x,y) = xy - x - 2y +2$, the so-called derivative test yields $$ f_x = 0 \Rightarrow y=1 $$ $$ f_y = 0 \Rightarrow x=2 $$ $$ f_{xx} = 0,\quad f_{yy}=0$$ So that $\Delta < 0$ and the critical point $(2,1)$ (which is also a vertex of the region) is unfortunately a saddle point. So what should I do to find the maximum? Could it be any of the other vertices, pretty much like an LP?

HINT
Note that the domain is compact (that is bounded and closed) thus for Weierstrass EV theorem $f(x,y)$ continuos has maximum and minimum.
Since we don't have critical point in the interior of the domain we need to look for the extrema on the boundary.
To find the maximum we can use substitution method for each line which define the boundary. Then we need to evaluate separately also the value for $f(x,y)$ on the vertices.