# Generalized mean value theorem.

I am reading a book on analysis in which using generalized mean value theorem for $g(x)=e^xf(x)$. it is shown that $\displaystyle \frac{g'(c)}{e^c}=\frac{g(x)-g(a)}{e^x-e^a}$ for some $c\in (a,x)$. But I am unable to show how they got it. Could you please show me how this step came?

Edit: Another way using generalized mean value theorem $\displaystyle \frac{e^xf(x)-e^af(a)}{e^x-e^a}={f(c)+f'(c)}$. But I am finding it difficult to get this step.