Evaluating $\lim_\limits{x\to 3}\left(\frac{\left(x!-2x\right)}{x-3}\right)$

calculusfactoriallimits

$\lim_\limits{x\to 3}\left(\frac{\left(x!-2x\right)}{x-3}\right)$

I tried substituting $x(x-1)$ in place for $x!$ as the limit approaches $3$, giving the limit $3$ by factorization.
But while plotting graph on Desmos calculator, it showed a weird gamma function graph, giving the answer around 5.5 like this
But when I plotted graph substituting $x(x-1)$ in place for $x!$, the graph was a straight line and gave limit $3$. like this
Please help me to get the correct answer.

Best Answer

I believe the first answer is correct. Mathematica gives the answer as $9 - 6\gamma$, where $\gamma$ is the Euler-Mascheroni constant. The reason for this has to do with the fact that the (generalized) factorial can be expressed in terms the Gamma function \begin{align*} \Gamma(z) = \int_0^\infty x^{z-1}e^{-x}dx, \end{align*} when $\Re z > 0$. This function has the property that $\Gamma(n) = (n-1)!$ for all positive integers $n$ and so it is the natural extension of the factorial. Using this, we can replace $x! = \Gamma(x+1) = \int_0^\infty y^{x}e^{-y}dy$. The Wikipedia page for the gamma function presents a nice form for its derivative when $x$ is an integer:

\begin{align*} \Gamma'(x+1) =x!\left(-\gamma+\sum_{k=1}^x\frac{1}{k}\right) \end{align*}

Now applying L'Hopital's rule and use the above formula for the derivative we get: \begin{align*} \lim_{x \rightarrow 3} \frac{x!-2x}{x-3} &= \lim_{x \rightarrow 3} \frac{\Gamma(x+1)-2x}{x-3} = \lim_{x \rightarrow 3} \Gamma'(x+1)-2 = \Gamma'(4) - 2\\ &= 3!\left(-\gamma + 1 + \frac{1}{2} + \frac{1}{3}\right) - 2 = 9-6\gamma \approx 5.5. \end{align*}

Related Question