2
$\begingroup$

I am trying to calculate the area under the curve for the function:

Formula 1: $$\frac{\mu^xe^{-\mu}}{Γ(x+1)}$$

Where:

  1. $x = 0$ and $x = 1$
  2. $μ = 0.5$

The Indefinite Integral equation WolframAlpha gives me is:

Formula 2:

$$\int \frac{μ^xe^{-μ}}{Γ(x+1)}\,dx = \frac{e^{-μ} \operatorname{Ei}((x+1)\ln(μ))}{Γ(μ)}$$

(see this link )

When I solve this equation for $x = 1$ and $x = 0$, and subtract the latter from the former, I end up with $0.088975$ area units.

Having an area value so small between $x = 0$, and $x = 1$ makes no sense to me.

Just by looking at the curve in excel, I can see that when $x = 0$, $y = 0.606$. And when $x = 1$, $y = 0.303$. The area should be approximately $75\%$ of a rectangle with dimensions $0.606 \cdot 1 = 0.606$ area units.

Any help/insight would be appreciated!

$\endgroup$
5
  • 2
    $\begingroup$ I think you misread $\Gamma(x+1)$ as $\Gamma \cdot (x+1)$ where $\Gamma$ is some constant. Here, $\Gamma()$ is the Gamma function. You have to use Gamma[] in WolframAlpha. Anyway, when $x$ is an integer, the usual way to compute this is integration by parts and with the knowledge that $\Gamma(x) = (x-1)!$. $\endgroup$ – angryavian Aug 26 '20 at 0:30
  • $\begingroup$ You were right, turns out that there is no Indefinite Integral generated by WolframAlpha for Formula 1. Unfortunately, I started out with the Poisson Distribution formula and intentionally replaced the factorial denominator, x! with the Gamma function so that I could solve the equation for instances where x >= 0 and continuous. What would be your recommendation for calculating the area under the curve for Formula 1 where x >= 0? $\endgroup$ – the_rubicon Aug 26 '20 at 1:52
  • $\begingroup$ There is really nothing to compute here, since $\int_0^\infty \mu^x e^{-\mu} \, d\mu$ is the definition of $\Gamma(x+1)$. So the integral (with the normalizing factor $1/\Gamma(x+1)$ )is just $1$. (Also, saying $\mu=0.5$ makes no sense if your integral is with respect to $\mu$.) $\endgroup$ – angryavian Aug 26 '20 at 2:25
  • $\begingroup$ The Wolfram alpha web site integrated with respect to $x$. But I suspect you want to integrate with respect to $\mu$. Then it is called the incomplete Gamma function. $\endgroup$ – Stephen Montgomery-Smith Aug 26 '20 at 3:46
  • $\begingroup$ I'm sorry, it seems I have a disconnect. I have plotted Formula 1 in excel with increments of of x increasing by 0.1 from 0 to 4. I have a fixed μ = 0.5 value. Perhaps I should label this something else? I'm really just using μ as a fixed numerical constant I adjust to get the desired graph shape (increasing shifts y_max right and simultaneously reduces amplitude). All I want to know is if it's possible to calculate the area under my graph between 0 and any given decimal value of x, say x = 0.7, given a fixed value of 'μ'. And if this is possible, how... Many thanks in advance, J $\endgroup$ – the_rubicon Aug 26 '20 at 6:07
3
$\begingroup$

I am quite skeptical about a possible closed form of the antiderivative $$I=e^{-μ}\int \frac{μ^x}{\Gamma(x+1)}\,dx$$

However, assuming that we should always stay in the range $0 \leq x \leq 1$, we could make some approximations representing $\Gamma(x+1)$ as a more or less constrained polynomial in $x$

$$\Gamma(x+1) \sim \sum_{n=0}^p a_n x^n=a_p \prod_{n=1}^p (x-r_n)$$ Then partial fraction decomposition would lead to $$I=\frac {e^{-μ}}{a_p} \sum_{n=1}^p b_n\int \frac{\mu^x}{x-r_n}\,dx$$ $$J_n=\int \frac{\mu^x}{x-r_n}\,dx=\mu ^{r_n}\, \log (\mu)\,\text{Ei}\big[x-r_n\big] $$

Trying for $\mu=0.5$ and a few values of $p$ for the integral between $0$ and $1$, the following results were obtained (no constraint for the curve fit) $$\left( \begin{array}{cc} p & \text{approximation} \\ 2 & 0.47485397 \\ 3 & 0.47487261 \\ 4 & 0.47487351 \\ 5 & 0.47487387 \\ 6 & 0.47487409 \end{array} \right)$$ while the exact value is $0.47487382$.

Edit

Another possibility is to use $$\frac{1}{\Gamma(x+1)}=\sum_{n=0}^p \frac{c_n}{n!}\,x^n +O(x^{p+1})$$ where the very first coefficients are (have a look here) $$\left( \begin{array}{cc} 0 & 1 \\ 1 & \gamma \\ 2 & \gamma ^2-\frac{\pi ^2}{6} \\ 3 & \gamma ^3-\frac{\gamma \pi ^2}{2}+2 \zeta (3) \\ 4 & \gamma ^4-\gamma ^2 \pi ^2+\frac{\pi ^4}{60}+8 \gamma \zeta (3) \\ 5 & \gamma ^5-\frac{5 \gamma ^3 \pi ^2}{3}+\frac{\gamma \pi ^4}{12}-\frac{10}{3} \left(-6 \gamma ^2+\pi ^2\right) \zeta (3)+24 \zeta (5) \\ 6 & \gamma ^6-\frac{5 \gamma ^4 \pi ^2}{2}+\frac{\gamma ^2 \pi ^4}{4}-\frac{5 \pi ^6}{168}-20 \gamma \left(-2 \gamma ^2+\pi ^2\right) \zeta (3)+40 \zeta (3)^2+144 \gamma \zeta (5) \end{array} \right)$$

$$K_n=\int \mu^x \,x^n \,dx=-x^{n+1} E_{-n}\big[-x \log (\mu )\big]$$

Using the terms given in the link, the results is $0.47487437$.

Update

Another possibility is based on the fact that$$\frac{1}{\Gamma(x+1)}-1$$ looks like a Gibbs enxcess energy model.

So, let use write $$\frac{1}{\Gamma(x+1)}=1+x(x-1) \sum_{k=0}^p d_k\, x^k$$ This would make

$$I=e^{-μ}\Big[\frac{\mu ^x}{L} +\sum_{k=0}^p (-1)^k d_k L^{-k}\,\left(\frac{\Gamma (k+3,-x L)}{L^3}+\frac{\Gamma (k+2,-xL ))}{L^2} \right)\Big]$$ where $L=\log(\mu)$.

For $p=3$, we should have $$d_0=-\gamma\qquad d_1=-\gamma -\frac{\gamma ^2}{2}+\frac{\pi ^2}{12}$$ $$d_2==48+16 \gamma +2 \gamma ^2-\frac{\pi ^2}{3}+\frac{16 (-8+\gamma +2\log (2))}{\sqrt{\pi }}$$ $$d_3=\frac{384-6 (32+\gamma (10+\gamma )) \sqrt{\pi }+\pi ^{5/2}+96 (2-\gamma -2\log (2))}{3 \sqrt{\pi }}$$ which reproduce the function and first derivative values at $x=0$, $x=\frac 12$ and $x=1$.

For the test example, the result would be $0.47487809$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.