# Solution of $a^x=\Gamma(x)$ for $a \geq 1$

I stumbled across the equation,

$$a^x=\Gamma(x) \quad \mathrm{for} \quad a \geq 1$$

while trying to prove that $a^{n!}$ eventually becomes larger than $(a^n)!$ for sufficiently large $n$. Specifically for $n$ such that $a^n < (n-1)!, \quad a^{n!}>(a^n)!$. While that particular $n$ isn't tight (i.e., the inequality reverses before that value of $n$), the solution to the above equation is sufficiently large to guarantee the inequality.

The function $f(x,a)=a^x-\Gamma(x)$, with $a \geq 1$, has exactly two roots, and I'm interested in the one larger than $1$. I'm having difficulty in finding the solution numerically since the function cuts the x-axis in an almost perpendicular fashion, making the root-finding heavily dependent on the initial value (and slope of the intersection becomes steeper with increasing $a$). For instance, here is $f(x,4)$:

The roots of $f(x,4)$ are (approximately): $x=0.46488, \, 11.1489$

Also, could the functional equation, $\Gamma(x)\Gamma(1-x)=\frac{\pi}{\sin{\pi x}}$, help? Or maybe some sort of inverse-gamma function?

-
A numerical method that works badly can become pretty good if you use the appropriate trick. For example, you might try to tame the equation by taking the logarithm of both sides. – André Nicolas Apr 18 '11 at 13:47
In addition to the suggestion given to you, you could probably use the Stirling approximation to give a starting value that can be refined by the secant or some other method (if you do Newton-Raphson, you'll need the digamma function). – J. M. Apr 18 '11 at 14:36
@user6312: Ouch, lesson learnt. Solving $x = \frac{\text{LogGamma}(x)}{\log_e a}$ is vastly simpler. Thanks a bunch! – quantumelixir Apr 18 '11 at 14:38
@J.M. Using Stirling's approximation is a great idea too. I should have thought about this! Solving $x \approx \sqrt{\frac{2\pi}{x}} \left(\frac{x}{e}\right)^x$ gives a good initial estimate. – quantumelixir Apr 18 '11 at 14:45
I would like to amplify on the important comment by J.M. The ever popular Newton Method is often practically much less efficient than the Secant Method. True, Secant Method usually needs more iterations, but the iterations are often much cheaper, particularly if the derivative has to be evaluated numericallly. – André Nicolas Apr 18 '11 at 16:35