First let us find the equation of each side of the triangle.
It is the equation of the line in the xy plane which connects those two.
Solve, (you are big enough to solve the system thyself).
There exists solutions but not inside the open boundary.
Hence we check the boundary itself.
Find extreme values on (0,2) and you find there are none.
Now check its boundaries x=0 and x=2
f(0,4)=-16 and f(2,4)=8-18-16=-26
Find extreme values on (0,4) and there are none.
Now check its boundaries y=0 and y=4.
f(0,0)=0 and f(0,4)=-16
Find extreme values on (0,2) and there are none.
Now check its boundaries x=0 and x=2.
f(0,0)=0 and f(2,4)=8-64+30=-26
The smallest values was at,
The largest value was at,