I'm trying to differentiate $x!$ but I just can't seem to do it right. I define the function as follows:
$$x! = \prod_{r = 0}^{x}(x-r) \quad,\quad x \in \mathbb N$$
I've tried attempted to try it by the first principle, but that was a dead end. The following is a more fruitful attempt although it provides no conclusive result:
$$\frac{\mathrm d}{\mathrm dx} x! = \frac{\mathrm d}{\mathrm dx}x(x-1)!\\ = x\frac{\mathrm d}{\mathrm dx}(x-1)! + (x-1)!\\ = x( (x-1)\frac{\mathrm d}{\mathrm dx}(x-2)! + (x-2)! ) + (x-1)!\\ = x((x-1)((x-2)\frac{\mathrm d}{\mathrm dx} (x-3)! + (x-3)!) + (x-2)!) + (x-1)!\\ = \dots$$
This pattern just goes on repeating, and I can't even find a good way to express the pattern. I tried opening the brackets and rearranging but even then I don't see any pattern which holds.
Maybe there isn't a derivative? I don't know. Can you help me out?
Edit: Thanks to @Belgi and others, I have realized that it is not possible to differentiate the factorial function by the definition I had given (silly me!) and now, I understand why the digamma function is required.
But, as noted in the comments by @WarrenHill, the computational engine WolframAlpha says the following: $$\frac{\mathrm d}{\mathrm dx} (x!) = \Gamma(x+1)\Psi^{(0)}(x+1) $$
Please justify all aspects of this answer.
Derivatives and Integrals make sense only for non integer functions. If you like a function that "flows". If you want to find the derivative of the factorial function you could consider extending it to the real numbers using the Gamma function. The gamma function acts like the factorial function for all positive integers however it also has values for real numbers.
The gamma function is defined as $\displaystyle \Gamma(x+1)=\int_0^\infty t^{x}e^{-t}\mathrm dt$. The gamma function satisfies $\Gamma(x+1)=x\Gamma(x)$ therefore for integer values of $x$ it can be said that $\Gamma(x+1)=x!$.
The derivative of the gamma function can be expressed in terms of the Digamma function. The Digamma function is defined as $$\psi(x)=\frac{\Gamma'(x)}{\Gamma(x)}$$ So the derivative of the Gamma function is $\psi(x)\Gamma(x)$. Now it may look like we are going round in circle by defining this special function however the digamma function has properties that are useful elsewhere and is an important special function. If you look at the article for the digamma function you will see many ways of computing it and its deep relationship with harmonic numbers and euler-mascheroni constant.
To address what wolfram alpha said:
There is a family of functions called the polygamma functions and they are the derivatives of the digamma function. Hence $\psi^{(0)}(x)=\psi(x)$. Remember that $x!=\Gamma(x+1)$ therefore $(x!)'=\Gamma'(x+1)=\Gamma(x+1)\psi(x+1)$.