4: Denoting the function on the left as f and the one on the right as g one gets

Equality of derivatives on interior of M shows that the two functions differ by a constant on M. To get equality, substitute any point from M into both of them and compare.

Next hint