def advance_cov12(phi, C12, x):
    """
    Explicit integration of covariance term in the 1/2 axes planes
    phi - density function
    C12 - transition matrices
    x - grid
    """
    for kk in range(len(x)):
        C = C12[kk]
        phi[:, :, (kk)] = (C * phi[:, :, (kk)].reshape(len(x) ** 2)).reshape(
            len(x), len(x))
    return phi
