The corner points of the bounded feasible region are (0,0), (4,0), (2,4) and (0,5).
The maximum value of z=ax+by, where a,b>0, occurs at both (2,4) and (4,0).
In linear programming, when the maximum occurs at two corner points, those points must give the same value of z.
At point (2,4):
z=a(2)+b(4)
z=2a+4b
At point (4,0):
z=a(4)+b(0)
z=4a
Since both points give the maximum value:
2a+4b=4a
4b=4a−2a
4b=2a
2b=a
Therefore, a=2b.