First check for the critical points of <em>f</em> by checking where the first-order derivatives vanish.
![\dfrac{\partial f}{\partial x}=4x-4=0\implies x=1](https://tex.z-dn.net/?f=%5Cdfrac%7B%5Cpartial%20f%7D%7B%5Cpartial%20x%7D%3D4x-4%3D0%5Cimplies%20x%3D1)
![\dfrac{\partial f}{\partial y}=2y-4=0\implies y=2](https://tex.z-dn.net/?f=%5Cdfrac%7B%5Cpartial%20f%7D%7B%5Cpartial%20y%7D%3D2y-4%3D0%5Cimplies%20y%3D2)
Notice how the point (1, 2) lies on the line <em>y</em> = 2<em>x</em> ; at this point, we get a value of <em>f</em>(1, 2) = -5 (MIN).
Next, check the points where the boundary lines intersect, which occurs at the points (0, 0), (0, 2), and (1, 2). We already checked the last one. We find <em>f</em>(0, 0) = 1 (MAX) and <em>f</em>(0, 2) = -3.
Now check on the boundary lines themselves. If <em>x</em> = 0, then
![f(0,y)=y^2-4y+1=(y-2)^2-3](https://tex.z-dn.net/?f=f%280%2Cy%29%3Dy%5E2-4y%2B1%3D%28y-2%29%5E2-3)
which has a maximum value of -3 when <em>y</em> = 2 (so we get the same critical point as before).
If <em>y</em> = 2, then
![f(x, 2)=2x^2-4x-3=2(x-1)^2-5](https://tex.z-dn.net/?f=f%28x%2C%202%29%3D2x%5E2-4x-3%3D2%28x-1%29%5E2-5)
with a maximum of -5 when <em>x</em> = 1.
If <em>y</em> = 2<em>x</em>, then
![f(x,2x)=6x^2-12x+1=6(x-1)^2-5](https://tex.z-dn.net/?f=f%28x%2C2x%29%3D6x%5E2-12x%2B1%3D6%28x-1%29%5E2-5)
with the same maximum of -5 when <em>x</em> = 1.