Here is a proof of mean value theorem:
Consider a line passing through the points $(a, f(a))$ and $(b, f(b))$. The equation of the line is
$y-f(a) = \displaystyle\frac{f(b)-f(a)}{(b-a)} (x-a)$
or $y = f(a)+ \displaystyle\frac{f(b)-f(a)}{(b-a)} (x - a)$
Let h be a function that defines the difference between any function f and the above line.
$h(x) = f(x) – f(a) – \displaystyle\frac{f(b)-f(a)}{(b-a)} (x - a)$
Using “Rolle’s theorem”, we have
$h'(x) = f'(x) – \displaystyle\frac{f(b)-f(a)}{(b-a)}$
Or $f(b) - f(a) = f'(x) (b - a)$. Hence, proved.
The source of this proof is this. It is clear why they used $h(x) = f(x) – f(a) – \displaystyle\frac{f(b)-f(a)}{(b-a)} (x - a)$ and how it arrives.
Now here is a proof of Taylor's theorem:
Consider the function $p(x)$ defined in $(a, b)$ by $p(x) = q(x) - \displaystyle\frac{(b-a)^n}{(b-x)^n} q(a)$ where $q(x) = f(b) - f(x) - (b - x)f'(x) - \displaystyle\frac{(b-x)}{2!}f''(x) -... \displaystyle\frac{(b-x)^{n-1}}{(n-1)!}) f^{n-1}(x)$
Then they show that, $p(a) = p(b)=0$ and apply roll's theorem and proves Taylor's theorem.
I don't understand why they use, $p(x) = q(x) - \displaystyle\frac{(b-a)^n}{(b-x)^n} q(a)$. They apply Rolls theorem on $h(x) = f(x) – f(a) – \displaystyle\frac{f(b)-f(a)}{(b-a)} (x - a)$ because it has something to do with a line passing through the points $(a, f(a))$ and $(b, f(b))$. What is the relation of this function, $p(x) = q(x) - \displaystyle\frac{(b-a)^n}{(b-x)^n} q(a)$, with the points? How do we come with this function? Can you show any proof as it was shown how we come with the function, $h(x) = f(x) – f(a) – \displaystyle\frac{f(b)-f(a)}{(b-a)} (x - a)$ from the difference between any function f and the above line? The book I used was as if it took for granted that $p(x) = q(x) - \displaystyle\frac{(b-a)^n}{(b-x)^n} q(a)$
Hope I've clarified my problem.