8

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.

Ali Caglayan
  • 5,726
Nick
  • 6,804
  • 5
  • 8
    If the function is defined only for natural numbers then what do you mean by its derivative? – Belgi Aug 28 '14 at 11:41
  • @Lucian: ... that's too complicated for a highschooler like me. – Nick Aug 28 '14 at 11:42
  • I believe your method will ultimately yield the result: $x!+ (x-1)! + (x-2)!+ \cdots + 2! +1!$ – Diya Aug 28 '14 at 11:43
  • 1
    @Nick True, so complicated that even Daniel Bernoulli couldn't figure it out. You are not alone :-). But its quite interesting, and do you know there are four types of Gamma functions? – Troy Woo Aug 28 '14 at 11:45
  • @Belgi: Why not? – Nick Aug 28 '14 at 11:45
  • @Belgi Try to plot your function in XY plane. Then you can see that you can't differentiate it. – Bumblebee Aug 28 '14 at 11:48
  • 1
    @Nick Belgi's point is that $n!,:n\in{N}$ is just points & not a smooth graph so you can't have a derivative. You can imagine how steep a hill is but can you imagine how steep a line of poles is? To get a meaningful answer, you'd need to fill in the numbers inbetween (with the gamma function) & then use Lucian's answer. – Jam Aug 28 '14 at 11:48
  • 2
    @Nick, your definition lacks some consistency: what does the running index $;r;$ is supposed to do if $;x;$ is not an integer? Say, what does it mean $$\prod_{r=0}^{5.67}...;?$$ You need a continuous variable $;x;$ if you want to differentiate. – Timbuc Aug 28 '14 at 12:07
  • 1
    $\dfrac{d}{dx} (x!) = \Gamma(x+1)\Psi^{(0)}(x+1)$ according to Wolfram Alpha but to be honest I don't see how. – Warren Hill Aug 28 '14 at 12:14
  • @Belgi: I took an actual graph paper and I plotted it. It's not smooth, I get it. :D – Nick Aug 28 '14 at 13:57
  • 1
    @Timbuc: :D I understand. It took me some time to truly realize it but I understand now why we need the digamma function. – Nick Aug 28 '14 at 14:00
  • @TroyWoo: ... I just learnt two today by asking this question, there are two more? – Nick Aug 28 '14 at 14:03
  • 1
    @Nick There are three types of generalized Gamma functions, namely trigonometric/hyperbolic/elliptic Gamma functions. They, together with the rational Gamma function (the original Euler Gamma function) form a hiererarchy of gamma functions, where Euler Gamma function sits at the bottom. These functions are introduced in 1997 by Ruijsenaars in a paper about relativistic quantum integrable systems. These are of course research stuffs and not known to most. It was told to me by a professor which is a descendant of Rolf Nevanlinna. – Troy Woo Aug 28 '14 at 14:34
  • 1
    @EulCan: I didn't at first realize that the function wasn't differentiable because I was plotting it as a curve. My logic was that $x(x-1)(x-2)\dots$ was a curve and I failed to realize that this idea contradicted my initial assumption that $x \in \mathbb N$. So, basically what I'm saying is that after I plotted the points, I joined the points in a curve... Yeah, I'm not the sharpest pin in the haystack.. I'm more like the hay. But, atleast I won't make a blunder like that again :D – Nick Aug 28 '14 at 14:36
  • Relevant: http://math.stackexchange.com/questions/360593/funny-graph-of-x-by-a-graphing-program – Nick Aug 28 '14 at 14:39
  • @Nick At least you generated some interesting discussion :) – Jam Aug 28 '14 at 14:40
  • @EulCan: It's not over. No one has yet explained WA's solution. – Nick Aug 29 '14 at 08:11
  • 1
    @Nick Oh sorry I thought someone had answered that. Wolfram is likely interpreting $x!$ as defined for $\mathbb{R^+}$, not just $\mathbb{N}$, (i.e. $x!=\Gamma(x+1)$). The previously stated derivative of $\Gamma(x)$ applies in this situation to give $\frac{\mathrm{d}}{\mathrm{d}x}x!=\frac{\mathrm{d}}{\mathrm{d}x} \Gamma(x+1)=\Gamma(x+1)\Psi^{(0)}(x+1)$. This is what happens when domains and codomains aren't specified! Technically, a function $f$ should be stated as $f:\mathbb{Z^+_0}\to\mathbb{Z^+},: f:x\to x!$ to be completely defined (it usually doesn't matter though). – Jam Aug 29 '14 at 16:46
  • 2
  • 1
    @Alex M. My question is from 2014. That question you linked is from 2015. My question is Jango Fett, the other one is the Storm Trooper. Link him to me. – Nick Jan 11 '16 at 14:06
  • @Nick: I had that dilemma when I was a beginner here, too. A discussion on Meta MSE clarified that "duplicate" does not refer to the chronological order, but only to the content, and that the "original" that should be kept open is the one with the best answers. – Alex M. Jan 11 '16 at 14:24
  • @Hakim: See my answer to Nick, above. – Alex M. Jan 11 '16 at 14:25
  • @AlexM. I've read those answers.they're better. I get your opinion and allow it. Mark this as duplicate. – Nick Jan 11 '16 at 14:35

4 Answers4

3

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)$.

Ali Caglayan
  • 5,726
2

The function $x!$ of $x$ is defined only for nonnegative integers $x$, so its derivative is defined nowhere. However, one can extend the factorial function in a natural way to a function defined everywhere on $\mathbb{R}$ except the negative odd integers. This function is $\Gamma(x + 1)$, where $\Gamma$ is the Gamma function. One way to define it is via the integral formula

$\Gamma(u) = \int_0^{\infty} t^{u-1} e^{-t} \,dt$;

one can check manually that this agrees with $(u - 1)!$ for positive integers $u$ by integrating by parts $u - 1$ times.

This function is differentiable, but its derivative is simply given in terms of another special function, the digamma function, usually defined by $\psi := \frac{d}{du} \log \Gamma(u)$, so that $\Gamma' = \Gamma \psi$, which can again be given by various integral formulas.

Travis Willse
  • 99,363
1

Factorial is defined only for non-negative integers. As such, $x!$ will be a constant and it's derivative will hence be $0$. Perhaps, $x$ is a variable here taking non-negative integral values?

Diya
  • 2,532
  • 3
  • 29
  • 59
  • You need to help me better understand why $x!$ is constant. – Nick Aug 28 '14 at 11:49
  • That is the part that is confusing me! If you see the Wikipedia article on factorials, you will see that factorials are defined only for non-negative integers, i.e. $0!, 1!, 2!$ etc. Judging by that, $x$ has to be a non-negative integer, and so $x!$ has to be constant. $x!$ as a variable is frankly baffling me and I want to see what others think of this. :) – Diya Aug 28 '14 at 11:52
  • This is misleading. It's not constant, it's just not defined on a large enough set for the notion of derivative to make sense without some form of extension like the digamma. – jxnh Aug 28 '14 at 12:03
  • I am unaware of the digamma function. Sorry :( – Diya Aug 28 '14 at 12:05
  • @Diya: I was too until I asked this question :D – Nick Aug 28 '14 at 14:19
1

Related problem: What is $\int x! $ $ dx$? See my answer there, that is also an answer to this question with changing integral to derivative.

user153012
  • 12,240