Step 1: Critical points in the interior of \( D \): \[ f_x = 4x - 4 = 0 \implies x = 1, \qquad f_y = 2y - 2 = 0 \implies y = 1. \] The interior point \( (1, 1) \) lies inside \( D \) since \( 1 \ge 0, 1 \ge 0 \), and \( 1 + 1 = 2 < 4 \).
Value: \( f(1, 1) = 2(1)^2 + 1^2 - 4(1) - 2(1) + 5 = 2 + 1 - 4 - 2 + 5 = \mathbf{2} \).
Step 2: Boundary Segment 1 (\( y = 0 \) for \( 0 \le x \le 4 \)):
\( u(x) = f(x, 0) = 2x^2 - 4x + 5 \).
\( u'(x) = 4x - 4 = 0 \implies x = 1 \in [0, 4] \). Candidate points: \( (1, 0) \), \( (0, 0) \), \( (4, 0) \).
Values: \( f(1, 0) = 2 - 4 + 5 = \mathbf{3} \); \( f(0, 0) = \mathbf{5} \); \( f(4, 0) = 2(16) - 4(4) + 5 = 32 - 16 + 5 = \mathbf{21} \).
Step 3: Boundary Segment 2 (\( x = 0 \) for \( 0 \le y \le 4 \)):
\( v(y) = f(0, y) = y^2 - 2y + 5 \).
\( v'(y) = 2y - 2 = 0 \implies y = 1 \in [0, 4] \). Candidate points: \( (0, 1) \), \( (0, 4) \).
Values: \( f(0, 1) = 1 - 2 + 5 = \mathbf{4} \); \( f(0, 4) = 16 - 8 + 5 = \mathbf{13} \).
Step 4: Boundary Segment 3 (\( y = 4 - x \) for \( 0 \le x \le 4 \)):
\( w(x) = f(x, 4 - x) = 2x^2 + (4 - x)^2 - 4x - 2(4 - x) + 5 = 2x^2 + 16 - 8x + x^2 - 4x - 8 + 2x + 5 = 3x^2 - 10x + 13 \).
\( w'(x) = 6x - 10 = 0 \implies x = 5/3 \in [0, 4] \implies y = 4 - 5/3 = 7/3 \).
Value: \( f(5/3, 7/3) = 3(25/9) - 10(5/3) + 13 = 25/3 - 50/3 + 39/3 = 14/3 = \mathbf{4.667} \).
Step 5: Global comparison: Comparing all candidate values \( \{ 2, 3, 5, 21, 4, 13, 4.667 \} \): \[ \text{Absolute Minimum} = \mathbf{2} \quad \text{at } (1, 1), \qquad \text{Absolute Maximum} = \mathbf{21} \quad \text{at } (4, 0). \]