Let $f$ be continuous on $ [a,b]$, differentiable on $ (a,b) $ and $ f(x) \neq 0 \forall x \in (a,b) $ Prove $ \exists c \in (a,b) $ such that

To Prove : $$ \frac{f'(c)}{f(c)} = \frac{1}{a-c} + \frac{1}{b-c} $$ I think I should proceed in following way :
Define $g(x) = \ln|f(x)| + \ln|x-a| + \ln|b-x|$
such that
$$g'(x) = \frac{f'(x)}{f(x)} - \frac{1}{a-x} - \frac{1}{b-x} $$ Then, using Rolle's Theorem , I have to prove that :
$\exists c \in (a,b)$ such that $g'(c) = 0$
But I am not able to solve it any further .


Solution 1:

Let $$g(x) = f(x) (x-a) (b - x) $$ then $g(a) =g(b) = 0$ and hence there is a $c\in (a, b) $ for which $g'(c) =0$. Clearly this means that $$ f'(c) (c-a) (b - c) + f(c) (b-c) - f(c) (c-a) =0$$ Dividing by $f(c)(c-a) (b-c) $ we are done.