To find the extrema of a continuous function on a closed interval, we examine its critical points, that is, points at which the derivative of the function is #0# or does not exist, and the endpoints of the interval.
Using the product rule, the chain rule, and the derivatives #d/dxx^n = nx^(n-1)# and #d/dxcx = c#, we have
#d/dxf(x) = d/dxx^a(2-x)^b#
#=x^a(d/dx(2-x)^b))+(2-x)^b(d/dxx^a)#
#=x^a(b(2-x)^(b-1))(d/dx(2-x))+ax^(a-1)(2-x)^b#
#=-bx^a(2-x)^(b-1)+ax^(a-1)(2-x)^b#
#=x^(a-1)(2-x)^(b-1)(a(2-x)-bx)#
#=x^(a-1)(2-x)^(b-1)(2a-(a+b)x)#
Setting this equal to #0#, we get
#x^(a-1)=0 or (2-x)^(b-1)=0 or 2a-(a+b)x = 0#
Solving for #x#, we get
#x = 0 or x = 2 or x = (2a)/(a+b)#
Checking to see if #(2a)/(a+b) in [0, 2]#, we can start knowing that the quotient of positive numbers is positive, thus
#0 < (2a)/(a+b) < (2(a+b))/(a+b) = 2#
So #(2a)/(a+b) in [0, 2]#, meaning we must include it as a possibility as well.
As these include the endpoints of the interval, we have no further points to examine. Now we can evaluate #f# at each of the above values to see which gives a maximum.
#f(0) = 0^a2^b = 0#
#f(2) = 2^a0^b=0#
#f((2a)/(a+b))=[(2a)/(a+b)]^a[2-(2a)/(a+b)]^b>0#
Thus, as #x=(2a)/(a+b)# provides the greatest value among all critical points, #f((2a)/(a+b))# is the maximum of #f(x)# on #[0, 2]#