So I have this question on a homework and I just can't seem to figure it out.
Let $f \in C^4 [0,1]$ and let $p$ be a polynomial of degree $\le 3$ such that $p(0) = f(0)$, $p(1) = f(1)$, p'(0) = f'(0) and p'(1) = f'(1). Show that for all $x \in [0,1]$ there exists $c \in [0,1]$ such that the following holds : $ f(x) = p(x) + \frac 1{24} x^2(x-1)^2 f^{(4)}(c). $
Now what I've tried up to now is considering the function $g_x : [0,1] \to \mathbb R$ defined by $ g_x(t) = f(t) - p(t) - \frac{f(x) - p(x)}{x^2(x-1)^2} (t^2(t-1)^2). $ Since g_x(0) = g_x(1) = g'_x(0) = g'_x(1) = 0, I have a $c \in [0,1]$ such that $g_x^{(3)}(c) = 0$ by applying Rolle's Theorem repeatedly, but to solve my problem I need a zero of $g_x^{(4)}(c)$ and I can't seem to get my way around this thing.
(Note that since $p$ has degree $\le 3$, $p^{(4)}(t)$ is identically zero so rearranging the terms for $g^{(4)}(c)$ gives me what I want.)
Any hints?