Let's determine the exact values in the given interval. We will plug in value for K=0,1,2,3,4,...etc until we have values of x out of the given interval.
Thus you have the extremes at `x_0,x_1,x_2,x_3`
If you plug in the values of x in the original function, you will find that the maximum values are 5 and they are at points `x_0,x_2`
You can repeat the same work for x2
the minimum values are 1 and they are at points `x_1, x_3`