You're using Rolle's theorem. This theorem states that, if a function is continous in
and differentiable in
, and
, then there exists a middle point
such that
![f'(c)=0](https://img.qammunity.org/2019/formulas/mathematics/high-school/a2dmyc6tmse6x7zsfanj0zeks7bz9t3v9s.png)
In other words, if a continous and differentiable function starts and ends at the same height, then it has a maximum or minimum.
In your case, since the function is differentiable in the closed interval, it is also continuous in the closed interval (differentiability implies continuity), and also being differentiable in the closed interval obviously implies that the function is differentiable in the open interval. Also, you're given that the function evaluates to 4 at both extreme points, so the hypothesis of the theorem are granted.