If $f$ is a function that can be differentiated two times on $[a;b]$ I asked this question before, but I quickly deleted it so that I can think about it more. the question was how can I show that:
$\exists c \in [a,b]$ such that $ f(b)=f(a)+(b-a)f'(a)+\frac{(b-a)^2}{2}f''(c)$ knowing that $f$ is a function that can be differentiated two times on $[a,b]$
Here is what I did:
I used the mean value theorem on $f$ in the interval $]a;b[$ then I got:
$$\exists c_0 \in ]a;b[:f(b) - f(a) = f'(c_0)(b-a)$$
rearranging gives:   (1)
$$\exists c_0 \in ]a;b[:f'(c_0) = \frac{f(b)-f(a)}{b-a}$$
Then I used the theorem on $f'$ but in the interval $]a;c_0[$ which gives me
$$\exists c \in ]a;c_0[:f'(c_0) - f'(a) = f''(c)(c_0-a)$$
by replacing $f'(c_0)$ in the last equation with (1) and multiplying by $(b-a)$ I got 
$$\exists c \in ]a;c_0[:f(b)-f(a)-(b-a)f'(a)=f''(c)(c_0-a)(b-a)$$ and rearranging this gets me really close to what I am supposed to get:
$$\exists c \in ]a;c_0[:f(b)=f(a)+(b-a)f'(a)+f''(c)(c_0-a)(b-a)$$
and because $]a;c_0[ \subset]a;b[$ I can write : $$\exists c \in ]a;b[:f(b)=f(a)+(b-a)f'(a)+f''(c)(c_0-a)(b-a)$$
If only that $(c_0-a)$ was $\frac{(b-a)}{2}$ or something like that.
Am I on the right track? I'd appreciate any help on this, I am open to any suggestion.
note: I asked my teacher about this problem and he told me to write I new function in terms of $f(x)$, maybe that will work, but I don't know about that, it seemed to me that he doesn't know the answer either, he could be wrong.
 A: Given $f\in C([a,b])$ twice-differentiable and $x\in(a,b]$, consider
$$
F(t) = f(t)+f'(t)(x-t), \qquad G(t) = (t-x)^2.
$$
By Cauchy's mean value theorem (a simple consequence of Rolle's theorem), we have
$$\tag{1}
\frac{F(x)-F(a)}{G(x)-G(a)} = \frac{F'(c)}{G'(c)}
$$
for some $c\in(a,x)$. But
$$
F'(t)=f'(t)+f''(t)(x-t)-f'(t)=f''(t)(x-t)
$$
and
$$
G'(t) = 2(t-x),
$$
so $(1)$ translates to
$$
\frac{f(x)-f(a)-f'(a)(x-a)}{-(a-x)^2} = \frac{f''(c)(x-c)}{2(c-x)} = -\frac{f''(c)}2.
$$
Rearranging the terms leads to
$$
f(x) = f(a)+f'(a)(x-a)+\frac{f''(c)}2(x-a)^2.
$$
A: You can start with the Taylor-formula
$$f(x) = f(a) + \int_a^x f'(t) \, d x = f(a) + f'(a)(x-a) +\int_a^x (f'(t) -f'(a)) \, dt.$$
Next, we have
\begin{align}
 \int_a^x (f'(t) -f'(a)) \, dt &\ge \min_{t \in [a,x]} \Big(\frac{f'(t)-f'(a)}{t-a}\Big) \int_a^x (t-a) \, dt \\
& = \min_{t \in [a,x]} \Big(\frac{f'(t)-f'(a)}{t-a}\Big) \frac{(x-a)^2}{2}
\end{align}
and similar
$$ \int_a^x (f'(t) -f'(a)) \, dt \le \max_{t \in [a,x]} \Big(\frac{f'(t)-f'(a)}{t-a}\Big) \frac{(x-a)^2}{2}.$$
Note that the function
$$g(t) = \begin{cases} \frac{f'(t)-f'(a)}{t-a} & \text{if} \ t>a \\ f''(a) & \text{if} \  t=a  \end{cases}$$
is continuous. Thus, by the intermediate value theorem there exists a $t \in [a,b]$ with $$g(t) \frac{(x-a)^2}{2} =  \int_a^x (f'(t) -f'(a)) \, dt.$$ 
If $t= a$ we are done. Otherwise we can apply the mean-value theorem in order to get a $c \in (a,t)$ with $$f''(c) = g(t).$$
A: I found this solution that my professor showed me:
let $$\varphi(x)=f(b)-f(x)-(b-x)f'(x)+\frac{(b-a)^2}{2}\lambda$$
notice that $\varphi(b)=0$,
we will choose $\lambda$ so that $\varphi(a)=0=\varphi(b)$
$$\varphi(a)=0\Leftrightarrow\lambda=\frac{-2}{(b-a)^2}\big(f(b)-f(a)-(b-a)f'(a)\big)$$
and because $\varphi$ is continuous on $[a,b]$ and differentiable on $]a,b[$ and $\varphi(a)=\varphi(b)$ we can use Rolle's theorem, we will get:
$$\exists c \in ]a,b[:\varphi'(c)=0$$
we can diffrentiate $\varphi$ so we get
$\varphi'(x)=-f'(x)+f'(x)-(b-x)f''(x)-\frac{2(b-x)}{2}\lambda$
simplifying that and substituting $\lambda$ we get:
$$\varphi'(x)=-(b-x)f''(x)+\frac{2}{(b-a)}\big(f(b)-f(a)-(b-a)f'(a)\big)$$
and then we have:
$$\exists c \in ]a,b[:\varphi'(c)=0 \Leftrightarrow \exists c \in ]a,b[: -(b-c)f''(c)+\frac{2}{(b-a)}\big(f(b)-f(a)-(b-a)f'(a)\big) = 0$$
and by rearranging the terms we can achieve what we want:
$$\exists c \in ]a,b[:f(b)=f(a)+(b-a)f'(a)+\frac{(b-a)^2}{2}f''(c)$$
