Answer
At $P(1,3)$, f has the absolute maximum.
Work Step by Step
We determine the critical points using the first derivative test
\[
\begin{array}{l}
f_{x}=0 \Rightarrow y-2=0 \Rightarrow y=2 \\
f_{y}=0 \Rightarrow 0=x
\end{array}
\]
Hence $P(0,2)$ is a critical point. Now we can use the second derivative test
\[
f_{x x}=f_{y y}=0, \quad f_{x y}=1, \text { resulting } D=f_{x x} f_{y y}-f_{x y}^{2}=-1<0
\]
Since $D<0, f$ has a saddle point at $P(0,2)$
Now we evaluate our function over the boundaries of the triangle. The equation of the line that passes through $P_{1}(0,0)$ and $P_{2}(0,4)$ is $x=0$, and when $x=0, f(x, y)=0,(y)-2(0)=0$.
$y=0$ is the horizontal line that passes through $P_{1}(0,0)$ and $P_{3}(4,0)$, resulting in $y=0, f(x, y)=-2 x \leq 0$ for $x \geq 0$
Finally, $y=-x+4$ is the line that passes through $P_{2}(0,4)$ and $P_{3}(4,0)$ Using the equation of this line:
\[
f(x, y)=x y-2 x=x(-x+4)-2 x=-x^{2}+4 x-2 x=x(2-x)
\]
Using the first derivative test:
\[
f_{x}=0 \Rightarrow 2(1-x)=0 \Rightarrow 1=x
\]
Evaluating at $x=1$, $y=3$. Finally at $P(1,3)$, f has the absolute maximum.