In proving Cauchy's mean value theorem, the first step is to use this function:

$$ h(x)=[f(b)−f(a)]g(x)−[g(b)−g(a)]f(x)$$

I've seen this in many textbooks but none of them actually show how they got this function. I understand every steps in the proof of Cauchy's mean value theorem, except how to derive this equation myself.

Do you guys know how do they get this function? Thanks a lot!