# Integrals of poly(|x|)exp(-|x|) probability density functions

I am interested in modifying the Laplace distribution to take the general form $$\textrm{poly}(|x|)\exp(-|x|)$$, where $$\textrm{poly}(\cdot)$$ denotes a function of finite polynomial degree. In particular, I am interested in the class of densities which can be written as

$$\frac{1}{2(\alpha+1)}\sum^{\alpha}_{k=0} \frac{|x|^k}{k!}e^{-|x|},$$

where integer $$\alpha \ge 1$$.

Interestingly, the derivative has the simple form

$$\frac{sign(x)}{2(\alpha+1)}\Big(e^{-|x|}\sum^{\alpha}_{k=0}\frac{k|x|^{k-1}}{k!}-e^{-|x|}\sum^{\alpha}_{k=0}\frac{|x|^k}{k!}\Big) = -\frac{e^{-|x|}}{2(\alpha+1)!}x|x|^{\alpha-1}.$$

However, I am struggling to find the integral for this class of densities. It's straightforward enough to put a particular density, say for $$\alpha=2$$, into WolframAlpha, but I don't know how to obtain the general form for any $$\alpha$$.

• The absolute value $|x|$ makes it hard to integrate, but $\int x^ke^{-x} = -\Gamma(k+1,x)$. Aug 28, 2023 at 3:43

If $$P$$ is a polynomial and let for all $$x \in \mathbb{R}$$, $$f(x) = \int_0^x P(|t|)e^{-|t|}\, dt, \qquad g(x) = \int_0^x P(t)e^{-t} \, dt.$$ Then, by parity, we clearly have $$f(x) = \mathrm{sgn}(x)g(|x|)$$ for all $$x$$ and if $$t \mapsto P(|t|)e^{-|t|}$$ is the distribution of a probability distribution $$\mu$$, then for all $$a < b$$, $$\mu([a,b]) = f(b) - f(a) = \mathrm{sgn}(b)g(|b|) - \mathrm{sgn}(a)g(|a|)$$. Therefore, it is enough to study $$g$$ on $$\mathbb{R}_+$$.
A first method to compute $$g$$, if you know the coefficients of $$P$$ (like in your case), is to use the incomplete Gamma function, as @Ricky suggested it. An other one is to write $$P$$ in an other base of $$\mathbb{R}[x]$$. Indeed, for all $$k$$, $$\partial_x(x^ke^{-x}) = kx^{k - 1}e^{-x} - x^ke^{-x}$$ so if you set $$b_k(x) = -x^k + kx^{k - 1}$$ (so $$b_0 = -1$$), you have, $$\int_0^x b_k(t)e^{-t} \, dt = [t^ke^{-t}]_0^x = x^ke^{-x} - \delta_{0k}.$$ The $$b_k$$ clearly form a base of $$\mathbb{R}[x]$$ (and $$(b_0,\ldots,b_n)$$ is a basis of $$\mathbb{R}_n[x]$$) so you can write $$P(x) = \sum_{k = 0}^n a_kb_k(x)$$ where $$n = \deg(P)$$ and you have, $$g(x) = a_0e^{-x} - a_0 + \sum_{k = 1}^n a_kx^ke^{-x}.$$ In your case, you can use the simple form of the derivative of $$P$$ to get that, \begin{align*} g(x) & = \int_0^x P(t)e^{-t} \, dt\\ & = [tP(t)e^{-t}]_0^x - \int_0^x t\partial_t(P(t)e^{-t}) \, dt \textrm{ by IBP,}\\ & = xP(x)e^{-x} + \frac{1}{2(\alpha + 1)!}\int_0^x t^{\alpha + 1}e^{-t} \, dt\\ & = \frac{1}{2(\alpha + 1)}\sum_{k = 0}^\alpha \frac{x^{k + 1}}{k!}e^{-x} + \frac{\gamma(\alpha + 2,x)}{2(\alpha + 1)!}. \end{align*} Therefore, if $$\mu$$ is the associated measure, for all $$a < b$$, $$\mu([a,b]) = \frac{\mathrm{sgn}(b)}{2(\alpha + 1)}\sum_{k = 0}^\alpha \frac{|b|^{k + 1}}{k!}e^{-|b|} + \frac{\mathrm{sgn}(b)\gamma(\alpha + 2,|b|)}{2(\alpha + 1)!} - \frac{\mathrm{sgn}(a)}{2(\alpha + 1)}\sum_{k = 0}^\alpha \frac{|a|^{k + 1}}{k!}e^{-|a|} - \frac{\mathrm{sgn}(a)\gamma(\alpha + 2,|a|)}{2(\alpha + 1)!}$$
• Just to make sure I understand correctly, the CDF at $t$ is then $g(|t|)-g(|-\infty|) = \lim_{a \rightarrow -\infty} \mu([a, b])$? Aug 28, 2023 at 12:48
• I made a sign error that I corrected in the expression of $f$ so $\mu(]-\infty,b]) = f(b) - \lim_{-\infty} f = \mathrm{sgn}(b)g(|b|) + \lim_{+\infty} g$. Aug 29, 2023 at 8:39