It's a question from a past calculus exam in my University which I can't formulate a proof to. Will be happy for a help!
Let $h:[a,b] \to \mathbb{R} $ a monotonic function, so there exists $\xi\in[a,b]$ such that:
$\int_{a}^{b}h(t)dt = h(a)(\xi-a)+h(b)(b-\xi)$
I tried defining a function $g(x) = \int_{a}^{x}h(t)dt+\int_{x}^{b}h(t)dt$ and trying to apply mean value theorem to it but that doesn't seems to take me nowhere. Also, besides the fact that if $h$ is monotonic on $[a,b]$ it's integrable there I didn't use that fact.
I know I should probably use integral mean value thm but I think I'm missing intuition as per how to use it.
Thanks for your help.