Time integral of an Ornstein-Uhlenbeck process Let $X_t$ be an Ornstein-Uhlenbeck process solving $dx_t = \theta (\mu-x_t)dt + \sigma dW_t$.
The solution is known and given by: 
$$    x_t = x_0 e^{-\theta t} + \mu(1-e^{-\theta t}) + \int_0^t \sigma e^{\theta (s-t)} dW_s$$
Is there a closed-form formula (both SDE and actual solution) for time integral $\int_0^t X_t dt$? 
(I know there is a lot of literature on interest theory that analyzes the expectation of this kind of integral, but this is not something I am after)
 A: Let us denote $A_t = \int_0^t X_s ds$. $A_t$ is a Gaussian random variable, so it is enough to calculate its mean and variance. This goes by using Fubini's theorem.
For simplicity let us assume that $x_0 = 0, \mu=0$. Then $\mathbb{E} X_t =0$ and 
$\mathbb{E} A_t = \mathbb{E} \int_0^t X_s ds = \int_0^t \mathbb{E} X_s ds  = 0$.
$Var(A_t) = \mathbb{E} A_t^2 = \mathbb{E} \int_0^t \int_0^t X_s X_u ds du =  \int_0^t \int_0^t Cov(X_s, X_u) ds du = 2 \int_0^t \int_0^u Cov(X_s, X_u) ds du.$
Now it is enough to use $Cov(X_s, X_u) =  \frac{\sigma^2}{2\theta}\left( e^{-\theta(u-s)} - e^{-\theta(u+s)} \right)$ valid for $s\leq u$.
This solution is more or less what The Bridge suggest. One can go a step further and calculate $Cov(A_t, A_s)$ and $\mathbb{E}A_t$ which is enough to fully characterise that process. 
A: Hi Grzenio, 
Using Stochastic Fubini's theorem I think you can re-express this integral in an Itô form and more precisely in a Wiener integral form whih are known to be gaussian. 
So you can derive the law of this random variable, is it what you meant by "closed-form" formula ? 
Regards
A: I'm pretty sure the actual solution is given in Ornstein and Uhlenbeck 1930.
Since the O-U process is the velocity of a free particle undergoing Brownian motion, then you are asking for the the distribution of its displacement.  In the limit, the displacement process is a Brownian motion process having variance $\frac{2\sigma}{\theta}$.
I came to this question looking to confirm my understanding, but you should definitely take a look at the original 1930 paper.
