CDF of a gamma distribution ($X \sim \mathcal{G}(n, \lambda)$) looks like

$$F(x) = \frac{\Gamma_x(n)}{\Gamma(n)}$$

Where $\Gamma_x(n) = \int_0^x t^{n-1} e^{-t} \, dt$ the incomplete gamma function. Ok so far?

But how do I differentiate such an expression?

$$\frac{d}{dx} \frac{\int_0^x t^{n-1} e^{-t} \, dt}{\int_0^\infty t^{n-1} e^{-t} \, dt}$$


With help from @MhenniBenghorbal, I have gotten:

$$\frac{d}{dx} \frac{\int_0^x t^{n-1} e^{-t} \, dt}{\int_0^\infty t^{n-1} e^{-t} \, dt} = \frac{1}{\Gamma(n)} x^{n-1}e^{-\lambda t}$$

but then its missing the $\lambda^n$ term of the original PDF of a gamma distribution. How do I get that back? I must have overlooked something? But I can see where ...

  • $\begingroup$ The denominator does not depend on $x$. You can use Leibniz rule. $\endgroup$ Nov 5, 2013 at 1:29
  • $\begingroup$ @MhenniBenghorbal, Ok I havent seem to learn this in school, but looking the the wiki page, I will obtain something like: $\frac{1}{\int_0^\infty t^{n-1} e^{-t}\, dt} \int_0^x \frac{\delta}{\delta x} (t^{n-1}e^{-t}) dt$. But $t^{n-1}e^{-t}$ it self doesn't have an $x$ term and will differenciate to $0$? $\endgroup$
    – Jiew Meng
    Nov 5, 2013 at 1:45

2 Answers 2


Here is how you apply it

$$ \frac{d}{dx}\int_{0}^{x}t^{n-1}e^{-t}dt= x^{n-1}e^{-x}. $$

Note: In your case you the fundamental theorem of calculus is enough

Theorem: Let $f$ be a continuous real-valued function defined on a closed interval $[a, b]$. Let $F$ be the function defined, for all $x$ in $[a, b]$, by $$F(x) = \int_a^x\!f(t)\, dt.$$ Then, $F$ is continuous on $[a, b]$, differentiable on the open interval (a, b), and $$F'(x) = f(x)\,$$ for all $x$ in $(a, b)$.

  • $\begingroup$ Ok, thanks. But now I have a minor hicup, I don't seem to be able to get back the expected PDF of a Gamma distribution. $\frac{1}{\Gamma(n)}x^{n-1} e^{-\lambda x}$ but the PDF of a gamma RV is $\frac{\lambda^n}{\Gamma(n)}x^{n-1}e^{-\lambda x}$. I am missing a $\lambda^n$? $\endgroup$
    – Jiew Meng
    Nov 5, 2013 at 3:00
  • $\begingroup$ Just make sure of your integrals. $\endgroup$ Nov 5, 2013 at 3:17
  • $\begingroup$ By integrals, what are you referring to? $\endgroup$
    – Jiew Meng
    Nov 5, 2013 at 9:55
  • $\begingroup$ There are basically 2 terms the numerator which equals what u gave $x^{n-1}e^{-\lambda t}$ and the denominator which is $\Gamma(n)$. $\endgroup$
    – Jiew Meng
    Nov 5, 2013 at 10:18

This should be a comment but I don't have enough points. You are omitting the $\lambda$ term in your original expression, so it can't appear on his own. Your derivation works for the case where $\lambda$ is 1 (although it shouldn't appear in your final expression). Otherwise the CDF of the standard gamma is actually


In that case you cannot get the derivative wrt to $x$ using the fundamental theorem of calculus since the limit of integration will be $x\lambda$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .