I have the following linear equation where $X$ and $Y$ are both random variables and $t$ is time. $X$ is normally distributed with $(0, \sigma_x^2)$:
$$Y_t = 5 + 2t + X_t$$
Which could be generalized to
$$Y_t = a + 2t + X_t$$
In demonstrating that $Y_t$ is not a stationary process, we took the expected value of both sides, resulting in:
$$E[Y_t]= a + 2t$$
I understand why $Y_t$ is not stationary, and I understand the expected value of a constant is a constant, accounting for why $a$ is still in this equation. And of course $E[X_t]$ is $0$ given its distribution. However, I do not understand why we leave the term $2t$ as it is. Are we considering the term $2t$ to be a constant as well? If so, why?
In your example, $2t$ is dependent of the time but it's completely deterministic. Thus, when taking expectation (integrating out the random part), it is, indeed, a constant. You could let $Y_t$ be a general deterministic perturbation of $X_t$, i.e. $Y_t=g(t)+X_t$ and you'd get $\mathbb{E}Y_t=g(t)$.