Integral and limit with geometric factor I would like to calculate the following limit $$\lim_{x \to x_0}{\frac{log\left(\frac{1}{x-x_0}\int_{x_0}^{x}{\frac{\sqrt{f(x)f(x_0)}}{f(u)}du}\right)}{\left(\int_{x_0}^{x}{\frac{1}{f(u)}du}\right)^2}}$$
where $f$ strictly positive and infinitely differentiable.
We can define the functions $$h(x)=\int_{x_0}^{x}{\frac{1}{f(u)}du}$$
and  $$h_1(x)=\sqrt{f(x)f(x_0)}h(x)$$
This the limit can be rewritten as 
$$\lim_{x \to x_0}{\frac{log(\frac{h_1(x)-h_1(x_0)}{x-x_0})}{x-x_0}}\frac{x-x_0}{h_1(x)^2-h_1(x_0)^2}f(x)f(x_0)$$
Finally define $$h_2(x)=log(\frac{h_1(x)-h_1(x_0)}{x-x_0})$$
Thus,
$$\lim_{x \to x_0}{\frac{h_2(x)-h_2(x_0)}{x-x_0}}\frac{x-x_0}{h_1(x)^2-h_1(x_0)^2}f(x)f(x_0)$$
where $h_2(x_0)$ is obtained by extending $h_2$ by continuity around $x_0$, which is $0$
I would like to conclude using the derivative slope definition but something is not adding up as I get and undefined behavior. 
 A: Without loss of generality, we can let $x_0=0$, and let
$$g(x) = \frac{1}{x} \int_0^x \frac{1}{f(u)} \, du.$$
We note that since $f$ is positive, we have $g(0) \neq 0$.
We then have
$$f(x) = \frac{1}{(xg(x))'} = \frac{1}{xg'(x)  + g(x)},$$
and
$$f(0) = \frac{1}{g(0)}.$$
Therefore we can express the limit as
$$\lim_{x \rightarrow 0} \frac{\log\left(\frac{g(x)}{\sqrt{g(0)(xg'(x)  + g(x))}}\right)}{(xg(x))^2}.$$
Now we apply L'Hopital's rule and do some algebraic manipulation to get:
$$\frac{g'(0)^2 - \frac12 g''(0)g(0)}{2g(0)^4}.$$
I've done a few example calculations so it should check out.
A: Let
$$
f(x)=\frac{f(x_0)}{g(x-x_0)}
$$
Then we have
$$
\begin{align}
g(x)&=\frac{f(x_0)}{f(x+x_0)}\\
g'(x)&=-\frac{f(x_0)\,f'(x+x_0)}{f(x+x_0)^2}\\
g''(x)&=f(x_0)\frac{2f'(x+x_0)^2-f(x+x_0)\,f''(x+x_0)}{f(x+x_0)^3}
\end{align}
$$
Furthermore,
$$
\begin{align}
&\lim_{x\to x_0}\frac{\log\left(\frac1{x-x_0}\int_{x_0}^x\frac{\sqrt{f(x)f(x_0)}}{f(u)}\,\mathrm{d}u\right)}{\left(\int_{x_0}^x\frac1{f(u)}\,\mathrm{d}u\right)^2}\\
&=f(x_0)^2\lim_{x\to0}\frac{\log\left(\frac1{\sqrt{g(x)}}\frac1x\int_0^xg(u)\,\mathrm{d}u\right)}{\left(\int_0^xg(u)\,\mathrm{d}u\right)^2}\\
&=f(x_0)^2\lim_{x\to0}\frac{\log\left(\frac1{\sqrt{g(x)}}\frac1x\int_0^x\left(1+g'(0)u+\frac{g''(0)}2u^2+O\!\left(u^3\right)\right)\,\mathrm{d}u\right)}{\left(\int_0^x\left(1+O\!\left(u\right)\right)\,\mathrm{d}u\right)^2}\\
&=f(x_0)^2\lim_{x\to0}\frac{\log\left(\frac{1+\frac{g'(0)}2x+\frac{g''(0)}6x^2+O\left(x^3\right)}{1+\frac{g'(0)}2x+\left(\frac{g''(0)}4-\frac{g'(0)^2}8\right)x^2+O\left(x^3\right)}\right)}{\left(x+O\!\left(x^2\right)\right)^2}\\
&=f(x_0)^2\lim_{x\to0}\frac{\left(\frac{g'(0)^2}8-\frac{g''(0)}{12}\right)x^2+O\!\left(x^3\right)}{x^2+O\!\left(x^3\right)}\\[6pt]
&=f(x_0)^2\left(\color{#C00}{\frac{g'(0)^2}8}\color{#090}{-\frac{g''(0)}{12}}\right)\\[6pt]
&=f(x_0)^2\left(\color{#C00}{\frac{f'(x_0)^2}{8\,f(x_0)^2}}\color{#090}{-\frac{2f'(x_0)^2}{12\,f(x_0)^2}+\frac{f''(x_0)}{12\,f(x_0)}}\right)\\[6pt]
&=\frac{-f'(x_0)^2+2f''(x_0)\,f(x_0)}{24}
\end{align}
$$
