# Closed-form solution for integral

I am interested in knowing under which conditions the following integral has a closed-form solution:

$$I_1 = \int_0^T{f(x)e^{-\left(F(x)+\alpha x\right)}dx}$$

where:

$$\frac{dF}{dx}(x) = f(x)$$

Assume that both $F(x)$ and $f(x)$ are well defined over the interval $[0,\infty[$.

I have solved it when the function $f$ is constant $-$ $f(x) = \beta$ $-$ but for other functional forms $-$ e.g. $f(x) = x$, $f(x)=\sqrt{x}$, etc. $-$ I have been unable to find a solution $-$ I have tried integration by parts and change of variable.

Could anyone describe how this problem should be approached? Is there a general solution to this integral and, if so, under which conditions does that solution hold? I am looking for a closed-form solution.

FYI, the integral $I_1$ comes from the following integral:

$$I_2 = \int_0^T{f(x)e^{-\int_0^x{(f(y)+\alpha) dy}}dx}$$

So I am really trying to solve $I_2$. Up to now I have only considered functions for which $F(0) = 0$, but if there is a general solution to $I_2$ I will be more than happy to hear it!

$$I_1 = \int_0^T{xe^{-\left(\frac{1}{2}x^2+\alpha x\right)}dx}$$

$$I_1' = \int_0^T{\sqrt{x}e^{-\left(\frac{2}{3}x^{3/2}+\alpha x\right)}dx}$$

$$I_1'' = \int_1^T{\frac{1}{x}e^{-\left(\ln{x}+\alpha x\right)}dx}$$

Edit 2: as pointed out by @Nox, the integral $I_1$ has a solution involving the error function:

$$e(T) = \frac{2}{\sqrt{\pi}}\int_0^Te^{-x^2}dx$$

To obtain it, it is necessary to add and subtract $\int_0^T\alpha e^{-(\frac{x^2}{2}+\alpha x)}dx$ to $I_1$ and make the following change of variable to this integral:

$$u = \frac{\alpha+x}{\sqrt{2}}$$

Edit 3: for information, these integrals arise as the expectation of the following random variable:

$$\mathbb{E} \left[e^{-\alpha \ \tau} \, \mathbb{I}_{\{\tau \ \leq \ T \, \}}\right]$$

The random variable $\tau$ is a stopping time defined as follows: let $N(t)$ be an inhomogeneous Poisson point process parameterised by the intensity function $f(x)$ such that for any $t>0$ and assuming $F(0)=0$:

$$F(t) = \int_0^t f(x)dx < \infty$$

$$\mathbb{P}(N(t) = n) = \frac{F(t)^n}{n!}e^{-F(t)}$$

It comes:

$$\mathbb{P}(N(t) = 0) = e^{-F(t)}$$

The stopping time $\tau$ is then defined as:

$$\tau = \min \{t>0 : N(t)>0\}$$

The distribution of $\tau$ is given by:

\begin{align} & \mathbb{P}(\tau > t) = \mathbb{P}(N(t) = 0) = e^{-F(t)} \\[12pt] & \Rightarrow \mathbb{P}(\tau \leq t) = 1-e^{-F(t)} \\[12pt] & \Rightarrow \frac{d\mathbb{P}}{dt} = f(t)e^{-F(t)} \end{align}

Hence we have:

\begin{align} \mathbb{E} \left[e^{-\alpha \ \tau} \, \mathbb{I}_{\{\tau \ \leq \ T \, \}}\right] & = \int_0^{\infty} e^{-\alpha \ t} \, \mathbb{I}_{\{t \ \leq \ T \, \}} f(t)e^{-F(t)} dt \\[12pt] & = \int_0^T f(t)e^{-(F(t)+\alpha t)} dt \end{align}

• Can't give you a solution ad hoc, but have you tried $\alpha=0$, because then the whole simplifies a bit, with $\int F'(x) \cdot e^{-F(x)}$ – Nox Mar 13 '17 at 16:04
• Unfortunately, I need to have $\alpha > 0$ otherwise the underlying problem for which I need to solve this integral does not make sense. – Morris Fletcher Mar 13 '17 at 16:06
• My quick calculation using fundamental thm of calculus: $\frac{d}{dx}e^{-\int_0^xf(y)+\alpha dy} = e^{-\int_0^xf(y)+\alpha dy}\cdot(-1)\cdot(f(x))$ Which means that your $I_2$ integral is basically an integral of the derivative – Nox Mar 13 '17 at 16:09
• I doubt there is a general formula because you are trying to evaluate $$\int^T_0 \exp(-F(x)-ax)\,dx$$ for arbitrary $F$. – Zaid Alyafeai Mar 13 '17 at 16:41
• As mentioned above. If you use $f(x)=x$ you'll end up with an expression involving the error function, namely you'll get $e^{-(\frac{1}{2}T^2+\alpha T)} - 1 +\alpha e^{\frac{\alpha^2}{2}}\sqrt{\frac{\pi}{2}}\left( Erf(\frac{\alpha-T}{\sqrt{2}}) - Erf(\frac{\alpha}{\sqrt{2}})\right)$. As for the others, Mathematica at least does not yield anything useful. – Nox Mar 13 '17 at 22:02

The question can't be answered for definite integrals because for some of them can have closed-form solutions for specific values of $T$ (such as $\infty$) and there is no general theory about this.

Now, by parts,

$$\int F'(x)e^{-F(x)}e^{-ax}dx=-e^{-F(x)}e^{-ax}+a\int e^{F(x)+ax}dx.$$

In general, the last integral has no closed-form, except for a constant, a multiple of $x$, or the logarithm of a function, which can make it tractable by pulling out of the exponential:

$$\int e^{\log g(x)+ax}dx=\int g(x)e^{ax}dx,$$ for example when $g$ is a polynomial or a trigonometric polynomial, or a combination of these.

• Thank you @Yves. So if I understand you correctly, your point is that the 2nd integral is solvable $-$ i.e. a closed-form solution exists $-$ if $F(x) = \beta_0 + \beta_1x$ or if $F(x) = \log(\sum_{i} \beta_i x^i)$ $-$ I ignore the trigonometric case $-$ ? – Morris Fletcher Mar 15 '17 at 12:07
• @DaneelOlivaw: the first case is obvious, isn't it ? In the second case, by repeated integration by parts you can decrease the degree of the polynomial. This is by no means an exhaustive list. Looking at the last integral and WLOG $a=1$, integration by parts yields $(g-g'+g''-g'''+g''''\cdots)e^x$ and the series may sometimes have a closed-form. – Yves Daoust Mar 15 '17 at 12:09
• Yes the 1st case is obvious, I just wanted to clarify your answer. Thank you that helps. – Morris Fletcher Mar 15 '17 at 12:12