Necessary Condition for an Extrema(Is a Function Differentiable at Boundaries)