Correlation between two stochastic processes Let 
$$dX_t = k_1 X_t \, dt + \sigma_1 \, dW_t$$
and
$$dY_t = k_2 Y_t \, dt + \sigma_2 \left( \rho \, dW_t + \sqrt{1-\rho^{2}} \, dW_t^1\right)$$
where $W_t$ and $W_t^1$ are independent. 
What is the covariance and correlation between $X$ and $Y$?
 A: First of all, we note that for
$$b(x,y) := \begin{pmatrix} k_1 \cdot x \\ k_2 \cdot y \end{pmatrix} \qquad \sigma(x,y) := \begin{pmatrix} \sigma_1 & 0 \\ \sigma_2 \varrho &  \sigma_2\sqrt{1-\varrho^2} \end{pmatrix} \qquad B_t := \begin{pmatrix} W_t \\ W_t^1 \end{pmatrix}$$
we have
$$\begin{pmatrix} X_t \\ Y_t \end{pmatrix} = \int_0^t b(X_s,Y_s) \, ds + \int_0^t \sigma(X_s,Y_s) \, dB_s,$$
i.e. $(X_t,Y_t)_{t \geq 0}$ is an Itô process. Applying Itô's formula (for Itô processes), we see that
$$\begin{align*} X_t \cdot Y_t -X_0 Y_0 &= \int_0^t Y_s \, dX_s + \int_0^t X_s dY_s + \int_0^t 1 \, d\langle X,Y\rangle_s \\ &= \underbrace{\sigma_1 \int_0^t Y_s \, dW_s +\sigma_2 \int_0^t X_s \, d(\varrho W_t+\sqrt{1-\varrho^2} W_t^1)}_{=:I_t} \\ &\quad + \int_0^t (k_1+k_2) X_s Y_s \,ds + \int_0^t d\langle X,Y \rangle_s \end{align*}$$
where we used that stochastic differential $dX_t$ and $dY_t$ are given. The quadratic covariation $\langle X,Y\rangle$ equals, as $W_t$ and $W_t^1$ are independent Brownian motions,
$$\langle X,Y \rangle_s = \langle \sigma_1 W_t, \sigma_2 \varrho W_t + \sigma_2\sqrt{1-\varrho^2} W_t^1 \rangle = \sigma_1 \sigma_2 \varrho t.$$
Hence,
$$X_t \cdot Y_t - X_0 Y_0 = I_t + \int_0^t (k_1+k_2) X_s Y_s \, ds + t \varrho \sigma_1 \sigma_2.$$
Note that $(I_t)_{t \geq 0}$ is a martingale (as a stochastic integral with respect to Brownian motion). Taking expectation we therefore find that $f(t) := \mathbb{E}(X_t \cdot Y_t)$ is the (unique) solution of the ordinary differential equation
$$f'(t) = (k_1+k_2) f(t)+\varrho \sigma_1 \sigma_2.$$
This ODE can be solved explicitely and, we obtain an expression for the correlation. A very similar - actually, even simpler - calculation yields the expectation $\mathbb{E}X_t$. Combining these two, we also get the covariance.
