# Approximation $\ln \frac{(h+f)!}{(h-g)!}$ using Stirling’s when $f+g=o(h)$

Stirling’s approximation can be extended to a very well known inequality -

$$\sqrt{2\pi n}\left(\frac{n}{e}\right)^n \leq n! \leq e\sqrt{n}\left(\frac{n}{e}\right)^n$$

How can we use this to prove,

$$\ln \frac{(h+f)!}{(h-g)!} = (f+g)\ln h \pm O\left(\frac{(f+g)^2}{h}\right)$$

when $$f+g=o(h)$$

### My Attempt

\begin{align} \ln \frac{(h+f)!}{(h-g)!} &= \ln \frac{\left(h+f\right)^{h+f+1/2}}{\left(h-g\right)^{h-g+1/2}} + \ln \frac{e^{h-g}}{e^{h+f}}\\ &= (h+f+1/2)\ln(h+f) - (h-g+1/2)\ln(h-g) - (f+g) \end{align}

At this point I can use property of logarithms $$\ln(h+f)=\ln h+\ln(1+f/h)$$ and $$\ln(h-g)=\ln h+\ln(1-g/h)$$ to extract $$\ln h$$ terms. But that would leave a lot of other terms with itself which I'm not able to collate.

How should I move ahead from hear? If this is not the right approach then I hope to be pointed towards right direction.

• I never saw the very well known inequality :-) – Yves Daoust Mar 22 at 10:41
• I'm sorry, I should not have presumed too much. But the inequality is there on wiki, and quite straight forward to prove as well. – Prateek Mar 22 at 11:05

To continue, you can use the Taylor expansion of logarithm, just the beginning: $$\ln(1+x) = x + \mathcal{O}(x^2)$$ That gives you $$(h+f+1/2)\ln(1+f/h) = f + \mathcal{O}\left(\frac{f^2}{h}\right)$$ and $$-(h-g+1/2)\ln(1+g/h) = g + \mathcal{O}\left(\frac{g^2}{h}\right)$$
However, note that Stirling's approxiamtion won't give you the exact equality as you're writing it. What you can get from them is $$\ln (n!) = (n+1/2)\ln n - n + \xi(n)$$ where $$\xi(n) \in [\ln\sqrt{2\pi},1]$$. This last term is negligible compared to the leading term, but it doesn't vanish. In the end, the best you can get this with this method is $$\ln\frac{(h+f)!}{(h-g)!} = (f+g)\ln h + \xi + \mathcal{O}\left(\frac{f^2}{h},\frac{g^2}{h}\right)$$ where $$\xi = \xi(h+f)-\xi(h-g)$$, $$|\xi| \le 1-\ln\sqrt{2\pi}$$